diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/expected-panels.json b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..d4672bd2a64db340d877ed8d8a224ddd4d8cd2b7 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/expected-panels.json @@ -0,0 +1,951 @@ +{ + "fail-to-pass": [ + "tests/test_commonmark.py::TestCommonMark::test_links_539", + "tests/test_commonmark.py::TestCommonMark::test_tabs_001", + "tests/test_commonmark.py::TestCommonMark::test_tabs_002", + "tests/test_commonmark.py::TestCommonMark::test_tabs_004", + "tests/test_commonmark.py::TestCommonMark::test_tabs_005", + "tests/test_commonmark.py::TestCommonMark::test_tabs_006", + "tests/test_commonmark.py::TestCommonMark::test_tabs_007", + "tests/test_commonmark.py::TestCommonMark::test_tabs_008", + "tests/test_commonmark.py::TestCommonMark::test_tabs_009", + "tests/test_renderers.py::TestRendererRst::test_code_001", + "tests/test_renderers.py::TestRendererRst::test_code_002", + "tests/test_renderers.py::TestRendererRst::test_heading_001", + "tests/test_renderers.py::TestRendererRst::test_html_001", + "tests/test_renderers.py::TestRendererRst::test_images_002", + "tests/test_renderers.py::TestRendererRst::test_images_003", + "tests/test_renderers.py::TestRendererRst::test_inline_001", + "tests/test_renderers.py::TestRendererRst::test_inline_002", + "tests/test_renderers.py::TestRendererRst::test_line_break_001", + "tests/test_renderers.py::TestRendererRst::test_links_001", + "tests/test_renderers.py::TestRendererRst::test_list_001", + "tests/test_renderers.py::TestRendererRst::test_list_002", + "tests/test_renderers.py::TestRendererRst::test_list_003", + "tests/test_renderers.py::TestRendererRst::test_list_004", + "tests/test_renderers.py::TestRendererRst::test_list_005", + "tests/test_renderers.py::TestRendererRst::test_quote_001", + "tests/test_renderers.py::TestRendererRst::test_quote_002", + "tests/test_renderers.py::TestRendererRst::test_quote_003", + "tests/test_renderers.py::TestRendererRst::test_thematic_break_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_002", + "tests/test_renderers.py::TestRendererMarkdown::test_code_003", + "tests/test_renderers.py::TestRendererMarkdown::test_code_004", + "tests/test_renderers.py::TestRendererMarkdown::test_code_005", + "tests/test_renderers.py::TestRendererMarkdown::test_heading_001", + "tests/test_renderers.py::TestRendererMarkdown::test_html_001", + "tests/test_renderers.py::TestRendererMarkdown::test_inline_001", + "tests/test_renderers.py::TestRendererMarkdown::test_linebreak_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_003", + "tests/test_renderers.py::TestRendererMarkdown::test_list_001", + "tests/test_renderers.py::TestRendererMarkdown::test_list_002", + "tests/test_renderers.py::TestRendererMarkdown::test_list_003", + "tests/test_renderers.py::TestRendererMarkdown::test_list_004", + "tests/test_renderers.py::TestRendererMarkdown::test_list_005", + "tests/test_renderers.py::TestRendererMarkdown::test_list_006", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_001", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_002", + "tests/test_renderers.py::TestRendererMarkdown::test_thematic_break_001" + ], + "pass-to-pass": [ + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_062", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_063", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_064", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_065", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_066", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_067", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_068", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_069", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_070", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_071", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_072", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_073", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_074", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_075", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_076", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_077", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_078", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_079", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_593", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_594", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_595", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_596", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_597", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_598", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_599", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_600", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_601", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_602", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_603", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_604", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_605", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_606", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_607", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_608", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_609", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_610", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_611", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_012", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_013", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_014", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_015", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_016", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_017", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_018", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_019", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_020", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_021", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_022", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_023", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_024", + "tests/test_commonmark.py::TestCommonMark::test_blank_lines_227", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_228", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_229", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_230", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_231", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_232", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_233", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_234", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_235", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_236", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_237", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_238", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_239", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_240", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_241", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_242", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_243", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_244", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_245", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_246", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_247", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_248", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_249", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_250", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_251", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_252", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_328", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_329", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_330", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_331", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_332", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_333", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_334", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_335", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_336", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_337", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_338", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_339", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_340", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_341", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_342", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_343", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_344", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_345", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_346", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_347", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_348", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_349", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_350", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_351", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_353", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_354", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_355", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_356", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_357", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_358", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_359", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_360", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_361", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_362", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_363", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_364", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_365", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_366", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_369", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_370", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_371", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_373", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_374", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_375", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_376", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_377", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_378", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_380", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_381", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_382", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_383", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_384", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_385", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_386", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_387", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_389", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_390", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_392", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_393", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_394", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_395", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_396", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_397", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_398", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_399", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_400", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_401", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_402", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_403", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_404", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_405", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_409", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_410", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_411", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_415", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_419", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_420", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_421", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_422", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_423", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_427", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_428", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_432", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_433", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_434", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_435", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_436", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_437", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_438", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_439", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_440", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_447", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_448", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_449", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_450", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_451", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_452", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_459", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_461", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_466", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_468", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_469", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_472", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_473", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_474", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_475", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_476", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_479", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_480", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_025", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_026", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_027", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_028", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_029", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_030", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_031", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_032", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_033", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_034", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_035", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_036", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_037", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_038", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_039", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_040", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_041", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_119", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_120", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_121", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_122", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_123", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_124", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_125", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_126", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_127", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_128", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_129", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_130", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_131", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_132", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_133", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_134", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_135", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_136", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_137", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_138", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_139", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_140", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_141", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_142", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_143", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_144", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_145", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_146", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_147", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_633", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_634", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_635", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_636", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_637", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_638", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_639", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_640", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_641", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_642", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_643", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_644", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_645", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_646", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_647", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_148", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_149", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_150", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_151", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_152", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_153", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_154", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_155", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_156", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_157", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_158", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_159", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_160", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_161", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_162", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_163", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_164", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_165", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_166", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_167", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_168", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_169", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_170", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_171", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_172", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_173", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_174", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_175", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_176", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_177", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_178", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_179", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_180", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_181", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_182", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_183", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_184", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_185", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_186", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_187", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_188", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_189", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_190", + "tests/test_commonmark.py::TestCommonMark::test_images_571", + "tests/test_commonmark.py::TestCommonMark::test_images_572", + "tests/test_commonmark.py::TestCommonMark::test_images_574", + "tests/test_commonmark.py::TestCommonMark::test_images_575", + "tests/test_commonmark.py::TestCommonMark::test_images_576", + "tests/test_commonmark.py::TestCommonMark::test_images_577", + "tests/test_commonmark.py::TestCommonMark::test_images_578", + "tests/test_commonmark.py::TestCommonMark::test_images_579", + "tests/test_commonmark.py::TestCommonMark::test_images_580", + "tests/test_commonmark.py::TestCommonMark::test_images_581", + "tests/test_commonmark.py::TestCommonMark::test_images_582", + "tests/test_commonmark.py::TestCommonMark::test_images_583", + "tests/test_commonmark.py::TestCommonMark::test_images_584", + "tests/test_commonmark.py::TestCommonMark::test_images_585", + "tests/test_commonmark.py::TestCommonMark::test_images_586", + "tests/test_commonmark.py::TestCommonMark::test_images_587", + "tests/test_commonmark.py::TestCommonMark::test_images_588", + "tests/test_commonmark.py::TestCommonMark::test_images_589", + "tests/test_commonmark.py::TestCommonMark::test_images_590", + "tests/test_commonmark.py::TestCommonMark::test_images_591", + "tests/test_commonmark.py::TestCommonMark::test_images_592", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_107", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_108", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_109", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_110", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_111", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_112", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_113", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_114", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_115", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_116", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_117", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_118", + "tests/test_commonmark.py::TestCommonMark::test_inlines_327", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_192", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_193", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_194", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_195", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_196", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_197", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_198", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_199", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_200", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_201", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_202", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_203", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_204", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_205", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_206", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_207", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_208", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_209", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_210", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_211", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_212", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_213", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_214", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_215", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_216", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_217", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_218", + "tests/test_commonmark.py::TestCommonMark::test_links_481", + "tests/test_commonmark.py::TestCommonMark::test_links_482", + "tests/test_commonmark.py::TestCommonMark::test_links_483", + "tests/test_commonmark.py::TestCommonMark::test_links_484", + "tests/test_commonmark.py::TestCommonMark::test_links_485", + "tests/test_commonmark.py::TestCommonMark::test_links_486", + "tests/test_commonmark.py::TestCommonMark::test_links_487", + "tests/test_commonmark.py::TestCommonMark::test_links_488", + "tests/test_commonmark.py::TestCommonMark::test_links_489", + "tests/test_commonmark.py::TestCommonMark::test_links_490", + "tests/test_commonmark.py::TestCommonMark::test_links_491", + "tests/test_commonmark.py::TestCommonMark::test_links_492", + "tests/test_commonmark.py::TestCommonMark::test_links_493", + "tests/test_commonmark.py::TestCommonMark::test_links_494", + "tests/test_commonmark.py::TestCommonMark::test_links_497", + "tests/test_commonmark.py::TestCommonMark::test_links_498", + "tests/test_commonmark.py::TestCommonMark::test_links_499", + "tests/test_commonmark.py::TestCommonMark::test_links_500", + "tests/test_commonmark.py::TestCommonMark::test_links_501", + "tests/test_commonmark.py::TestCommonMark::test_links_502", + "tests/test_commonmark.py::TestCommonMark::test_links_503", + "tests/test_commonmark.py::TestCommonMark::test_links_505", + "tests/test_commonmark.py::TestCommonMark::test_links_506", + "tests/test_commonmark.py::TestCommonMark::test_links_507", + "tests/test_commonmark.py::TestCommonMark::test_links_508", + "tests/test_commonmark.py::TestCommonMark::test_links_509", + "tests/test_commonmark.py::TestCommonMark::test_links_510", + "tests/test_commonmark.py::TestCommonMark::test_links_511", + "tests/test_commonmark.py::TestCommonMark::test_links_512", + "tests/test_commonmark.py::TestCommonMark::test_links_513", + "tests/test_commonmark.py::TestCommonMark::test_links_514", + "tests/test_commonmark.py::TestCommonMark::test_links_515", + "tests/test_commonmark.py::TestCommonMark::test_links_516", + "tests/test_commonmark.py::TestCommonMark::test_links_520", + "tests/test_commonmark.py::TestCommonMark::test_links_521", + "tests/test_commonmark.py::TestCommonMark::test_links_522", + "tests/test_commonmark.py::TestCommonMark::test_links_523", + "tests/test_commonmark.py::TestCommonMark::test_links_524", + "tests/test_commonmark.py::TestCommonMark::test_links_525", + "tests/test_commonmark.py::TestCommonMark::test_links_526", + "tests/test_commonmark.py::TestCommonMark::test_links_527", + "tests/test_commonmark.py::TestCommonMark::test_links_528", + "tests/test_commonmark.py::TestCommonMark::test_links_529", + "tests/test_commonmark.py::TestCommonMark::test_links_530", + "tests/test_commonmark.py::TestCommonMark::test_links_533", + "tests/test_commonmark.py::TestCommonMark::test_links_534", + "tests/test_commonmark.py::TestCommonMark::test_links_535", + "tests/test_commonmark.py::TestCommonMark::test_links_536", + "tests/test_commonmark.py::TestCommonMark::test_links_537", + "tests/test_commonmark.py::TestCommonMark::test_links_538", + "tests/test_commonmark.py::TestCommonMark::test_links_540", + "tests/test_commonmark.py::TestCommonMark::test_links_541", + "tests/test_commonmark.py::TestCommonMark::test_links_542", + "tests/test_commonmark.py::TestCommonMark::test_links_543", + "tests/test_commonmark.py::TestCommonMark::test_links_544", + "tests/test_commonmark.py::TestCommonMark::test_links_545", + "tests/test_commonmark.py::TestCommonMark::test_links_546", + "tests/test_commonmark.py::TestCommonMark::test_links_547", + "tests/test_commonmark.py::TestCommonMark::test_links_548", + "tests/test_commonmark.py::TestCommonMark::test_links_549", + "tests/test_commonmark.py::TestCommonMark::test_links_550", + "tests/test_commonmark.py::TestCommonMark::test_links_551", + "tests/test_commonmark.py::TestCommonMark::test_links_552", + "tests/test_commonmark.py::TestCommonMark::test_links_553", + "tests/test_commonmark.py::TestCommonMark::test_links_554", + "tests/test_commonmark.py::TestCommonMark::test_links_555", + "tests/test_commonmark.py::TestCommonMark::test_links_556", + "tests/test_commonmark.py::TestCommonMark::test_links_557", + "tests/test_commonmark.py::TestCommonMark::test_links_558", + "tests/test_commonmark.py::TestCommonMark::test_links_559", + "tests/test_commonmark.py::TestCommonMark::test_links_560", + "tests/test_commonmark.py::TestCommonMark::test_links_561", + "tests/test_commonmark.py::TestCommonMark::test_links_562", + "tests/test_commonmark.py::TestCommonMark::test_links_563", + "tests/test_commonmark.py::TestCommonMark::test_links_564", + "tests/test_commonmark.py::TestCommonMark::test_links_565", + "tests/test_commonmark.py::TestCommonMark::test_links_566", + "tests/test_commonmark.py::TestCommonMark::test_links_567", + "tests/test_commonmark.py::TestCommonMark::test_links_568", + "tests/test_commonmark.py::TestCommonMark::test_links_569", + "tests/test_commonmark.py::TestCommonMark::test_links_570", + "tests/test_commonmark.py::TestCommonMark::test_list_items_253", + "tests/test_commonmark.py::TestCommonMark::test_list_items_254", + "tests/test_commonmark.py::TestCommonMark::test_list_items_255", + "tests/test_commonmark.py::TestCommonMark::test_list_items_256", + "tests/test_commonmark.py::TestCommonMark::test_list_items_257", + "tests/test_commonmark.py::TestCommonMark::test_list_items_258", + "tests/test_commonmark.py::TestCommonMark::test_list_items_259", + "tests/test_commonmark.py::TestCommonMark::test_list_items_260", + "tests/test_commonmark.py::TestCommonMark::test_list_items_261", + "tests/test_commonmark.py::TestCommonMark::test_list_items_262", + "tests/test_commonmark.py::TestCommonMark::test_list_items_263", + "tests/test_commonmark.py::TestCommonMark::test_list_items_264", + "tests/test_commonmark.py::TestCommonMark::test_list_items_265", + "tests/test_commonmark.py::TestCommonMark::test_list_items_266", + "tests/test_commonmark.py::TestCommonMark::test_list_items_267", + "tests/test_commonmark.py::TestCommonMark::test_list_items_268", + "tests/test_commonmark.py::TestCommonMark::test_list_items_269", + "tests/test_commonmark.py::TestCommonMark::test_list_items_270", + "tests/test_commonmark.py::TestCommonMark::test_list_items_271", + "tests/test_commonmark.py::TestCommonMark::test_list_items_272", + "tests/test_commonmark.py::TestCommonMark::test_list_items_273", + "tests/test_commonmark.py::TestCommonMark::test_list_items_274", + "tests/test_commonmark.py::TestCommonMark::test_list_items_275", + "tests/test_commonmark.py::TestCommonMark::test_list_items_276", + "tests/test_commonmark.py::TestCommonMark::test_list_items_277", + "tests/test_commonmark.py::TestCommonMark::test_list_items_278", + "tests/test_commonmark.py::TestCommonMark::test_list_items_279", + "tests/test_commonmark.py::TestCommonMark::test_list_items_280", + "tests/test_commonmark.py::TestCommonMark::test_list_items_281", + "tests/test_commonmark.py::TestCommonMark::test_list_items_282", + "tests/test_commonmark.py::TestCommonMark::test_list_items_283", + "tests/test_commonmark.py::TestCommonMark::test_list_items_284", + "tests/test_commonmark.py::TestCommonMark::test_list_items_285", + "tests/test_commonmark.py::TestCommonMark::test_list_items_286", + "tests/test_commonmark.py::TestCommonMark::test_list_items_287", + "tests/test_commonmark.py::TestCommonMark::test_list_items_288", + "tests/test_commonmark.py::TestCommonMark::test_list_items_289", + "tests/test_commonmark.py::TestCommonMark::test_list_items_290", + "tests/test_commonmark.py::TestCommonMark::test_list_items_291", + "tests/test_commonmark.py::TestCommonMark::test_list_items_292", + "tests/test_commonmark.py::TestCommonMark::test_list_items_293", + "tests/test_commonmark.py::TestCommonMark::test_list_items_294", + "tests/test_commonmark.py::TestCommonMark::test_list_items_295", + "tests/test_commonmark.py::TestCommonMark::test_list_items_296", + "tests/test_commonmark.py::TestCommonMark::test_list_items_297", + "tests/test_commonmark.py::TestCommonMark::test_list_items_298", + "tests/test_commonmark.py::TestCommonMark::test_list_items_299", + "tests/test_commonmark.py::TestCommonMark::test_list_items_300", + "tests/test_commonmark.py::TestCommonMark::test_lists_301", + "tests/test_commonmark.py::TestCommonMark::test_lists_302", + "tests/test_commonmark.py::TestCommonMark::test_lists_303", + "tests/test_commonmark.py::TestCommonMark::test_lists_304", + "tests/test_commonmark.py::TestCommonMark::test_lists_305", + "tests/test_commonmark.py::TestCommonMark::test_lists_306", + "tests/test_commonmark.py::TestCommonMark::test_lists_307", + "tests/test_commonmark.py::TestCommonMark::test_lists_308", + "tests/test_commonmark.py::TestCommonMark::test_lists_309", + "tests/test_commonmark.py::TestCommonMark::test_lists_310", + "tests/test_commonmark.py::TestCommonMark::test_lists_311", + "tests/test_commonmark.py::TestCommonMark::test_lists_312", + "tests/test_commonmark.py::TestCommonMark::test_lists_313", + "tests/test_commonmark.py::TestCommonMark::test_lists_314", + "tests/test_commonmark.py::TestCommonMark::test_lists_315", + "tests/test_commonmark.py::TestCommonMark::test_lists_316", + "tests/test_commonmark.py::TestCommonMark::test_lists_317", + "tests/test_commonmark.py::TestCommonMark::test_lists_318", + "tests/test_commonmark.py::TestCommonMark::test_lists_319", + "tests/test_commonmark.py::TestCommonMark::test_lists_320", + "tests/test_commonmark.py::TestCommonMark::test_lists_321", + "tests/test_commonmark.py::TestCommonMark::test_lists_322", + "tests/test_commonmark.py::TestCommonMark::test_lists_323", + "tests/test_commonmark.py::TestCommonMark::test_lists_324", + "tests/test_commonmark.py::TestCommonMark::test_lists_325", + "tests/test_commonmark.py::TestCommonMark::test_lists_326", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_219", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_220", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_221", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_222", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_223", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_224", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_225", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_226", + "tests/test_commonmark.py::TestCommonMark::test_precedence_042", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_612", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_613", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_614", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_615", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_616", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_617", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_618", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_619", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_620", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_621", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_622", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_623", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_624", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_625", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_626", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_627", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_628", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_629", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_630", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_631", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_632", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_080", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_081", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_082", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_083", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_084", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_085", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_086", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_087", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_088", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_089", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_090", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_091", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_092", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_094", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_095", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_096", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_097", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_098", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_099", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_100", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_101", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_102", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_103", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_104", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_105", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_106", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_648", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_649", + "tests/test_commonmark.py::TestCommonMark::test_tabs_003", + "tests/test_commonmark.py::TestCommonMark::test_tabs_010", + "tests/test_commonmark.py::TestCommonMark::test_tabs_011", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_650", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_651", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_652", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_043", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_044", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_045", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_046", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_047", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_048", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_049", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_050", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_051", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_052", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_053", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_054", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_055", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_056", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_057", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_058", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_059", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_060", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_061", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_rst_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_complex_001", + "tests/test_directives.py::TestDirective_rst_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_rst_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_rst_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_005", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_006", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_007", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_008", + "tests/test_directives.py::TestDirective_fenced_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_complex_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_fenced_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_image::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_source_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_target_001", + "tests/test_directives.py::TestDirective_fenced_image::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_target_option_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_caption_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_target_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_003", + "tests/test_directives.py::TestCustomizeToc::test_colon_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_rst_toc", + "tests/test_directives.py::TestDirectiveInclude::test_html_include", + "tests/test_directives.py::TestDirectiveInclude::test_include_missing_source", + "tests/test_hooks.py::TestTocHook::test_complex_toc_001", + "tests/test_hooks.py::TestTocHook::test_customize_heading_id_func", + "tests/test_hooks.py::TestTocHook::test_html_in_heading_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_002", + "tests/test_hooks.py::TestTocHook::test_link_in_heading_001", + "tests/test_hooks.py::TestTocHook::test_simple_toc_001", + "tests/test_misc.py::TestMiscCases::test_allow_data_protocols", + "tests/test_misc.py::TestMiscCases::test_allow_harmful_protocols", + "tests/test_misc.py::TestMiscCases::test_ast_output", + "tests/test_misc.py::TestMiscCases::test_ast_url", + "tests/test_misc.py::TestMiscCases::test_before_parse_hooks", + "tests/test_misc.py::TestMiscCases::test_emsp", + "tests/test_misc.py::TestMiscCases::test_escape_html", + "tests/test_misc.py::TestMiscCases::test_hard_wrap", + "tests/test_misc.py::TestMiscCases::test_harmful_links", + "tests/test_misc.py::TestMiscCases::test_html_tag_text_following_list", + "tests/test_misc.py::TestMiscCases::test_markdown_func", + "tests/test_misc.py::TestMiscCases::test_none", + "tests/test_misc.py::TestMiscCases::test_ref_link", + "tests/test_misc.py::TestMiscCases::test_use_plugin", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin1_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin2_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin1_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin2_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_003", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_quote", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_quote", + "tests/test_renderers.py::TestRendererRst::test_images_001", + "tests/test_renderers.py::TestRendererMarkdown::test_images_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_002", + "tests/test_syntax.py::TestSyntax::test_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_image_001", + "tests/test_syntax.py::TestSyntax::test_link_001", + "tests/test_syntax.py::TestSyntax::test_link_002", + "tests/test_syntax.py::TestSyntax::test_link_003", + "tests/test_syntax.py::TestSyntax::test_links_001", + "tests/test_syntax.py::TestSyntax::test_links_002", + "tests/test_syntax.py::TestSyntax::test_max_depth_001", + "tests/test_syntax.py::TestSyntax::test_max_depth_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_003", + "tests/test_syntax.py::TestSyntax::test_setext_headings_001", + "tests/test_syntax.py::TestSyntax::test_setext_headings_002" + ] +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/grade.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/panel-config.json b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..fcf9afd120808ef57ca8e15a2ff5adfbb1b9b425 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/panel-config.json @@ -0,0 +1,24 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "python -m pip install -e ." + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "pyproject.toml": "b2922e3ef89e2918935d38fb3a777bdbc741619942276a75fd21a8dd9faf6b42" + } +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/test.sh b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted-inventory.json b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..aa70e1f5d5d129ced763ef7db40f73f94595e1e2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted-inventory.json @@ -0,0 +1,212 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 1781, + "mode": 420, + "sha256": "b2922e3ef89e2918935d38fb3a777bdbc741619942276a75fd21a8dd9faf6b42" + }, + "setup.py": { + "bytes": 52, + "mode": 420, + "sha256": "504f5c8cbb3b966b1f3f838da0a0cdc77b312f0c5935951357d17328e5324e21" + }, + "tests/__init__.py": { + "bytes": 1149, + "mode": 420, + "sha256": "229cc35ee9a5f5a9fb37e036683e2276f940b80df2dc6203102c0f36f960e467" + }, + "tests/fixtures/__init__.py": { + "bytes": 1502, + "mode": 420, + "sha256": "960fa58f01c3a473a956cc2d5430314d10f070bff18b35c9707c52c1c42a57e2" + }, + "tests/fixtures/abbr.txt": { + "bytes": 2703, + "mode": 420, + "sha256": "18c7e06359486daeaafa88c7404f4ca8248cd47bf38a7ed475ddd35353e68bea" + }, + "tests/fixtures/commonmark.json": { + "bytes": 140423, + "mode": 420, + "sha256": "ae6129f3ce3caf4f99cf4f9a5ad3558a309652b5b887171013e2bf0797289b98" + }, + "tests/fixtures/def_list.txt": { + "bytes": 2834, + "mode": 420, + "sha256": "909b7156a5ba1f005ea3d8a203946e7ab3576149ec5af73ecad657bb046f386d" + }, + "tests/fixtures/diff-commonmark.txt": { + "bytes": 1176, + "mode": 420, + "sha256": "920df6e3c9c8e3d4627842d5a7aeb172bdd23229acfbbb9a9b728a9f6ce2c1f0" + }, + "tests/fixtures/fenced_admonition.txt": { + "bytes": 2344, + "mode": 420, + "sha256": "0f231afd472bc2c742170798e619d1baa5dd34e9e4a6cb18906dabd1aa37a1d0" + }, + "tests/fixtures/fenced_figure.txt": { + "bytes": 3481, + "mode": 420, + "sha256": "83c3d636e8d4f0dd5a767045cf38877fd3c6c03a20c351f06c50e30ae7f30cda" + }, + "tests/fixtures/fenced_image.txt": { + "bytes": 2343, + "mode": 420, + "sha256": "fa7ede5a90b718aaeb46af7f5a4d98a0e17cec0411355f460a166356020e6780" + }, + "tests/fixtures/fenced_toc.txt": { + "bytes": 3656, + "mode": 420, + "sha256": "019a12ca2e293699d88241460bdea48ee6a65981b36b6bae4c0bbf78f020a296" + }, + "tests/fixtures/fix-commonmark.txt": { + "bytes": 1905, + "mode": 420, + "sha256": "1f2777b457f4da70e02983bbcb2104fa3b442dbb8a5bcac1621499b0b796292f" + }, + "tests/fixtures/footnotes.txt": { + "bytes": 847, + "mode": 420, + "sha256": "55227ab43a3986fd07ecbf0742903a977f04cd9ed403086d7c76f23b1967aab1" + }, + "tests/fixtures/hook_toc.txt": { + "bytes": 1896, + "mode": 420, + "sha256": "bdb1a5c90f08cb29c4eed3c892e9c694f92855507b6cd5809eac3b8eb4fc7dc5" + }, + "tests/fixtures/include/hello.md": { + "bytes": 8, + "mode": 420, + "sha256": "389aaf8f17da55ef35fedf530bc70cd1287042f6410ec94c2b44c1b22c36e60a" + }, + "tests/fixtures/include/hello.txt": { + "bytes": 6, + "mode": 420, + "sha256": "5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03" + }, + "tests/fixtures/include/text.html": { + "bytes": 24, + "mode": 420, + "sha256": "bac2f8a2e3937f8923da8e560248d2a52867b502fbda531ba73f1d066b35d2ba" + }, + "tests/fixtures/include/text.md": { + "bytes": 163, + "mode": 420, + "sha256": "3ffb497b2829ca6333bc6eb4e7d2959aa7baeaa44180225a4820e0051ae7ef75" + }, + "tests/fixtures/insert.txt": { + "bytes": 1165, + "mode": 420, + "sha256": "de7b89a58c2cbd2d4948c10b8c599fd7500b3ae6734d271a35ff2cf2854b1572" + }, + "tests/fixtures/mark.txt": { + "bytes": 1138, + "mode": 420, + "sha256": "6b5c232cf89f61097ae6d032865a99bdcd9f65e3ef99517d9423b2da0aa983d0" + }, + "tests/fixtures/math.txt": { + "bytes": 1174, + "mode": 420, + "sha256": "eadc29b04cc85928e50003b2908b002a778447ef028c4b773ca1753b907fd898" + }, + "tests/fixtures/renderer_markdown.txt": { + "bytes": 3569, + "mode": 420, + "sha256": "2ba5fc55634d7dbaabd91aedea9e04b34882e67abc3020034bd809a408cac2a7" + }, + "tests/fixtures/renderer_rst.txt": { + "bytes": 2915, + "mode": 420, + "sha256": "47007bc353f230e9b73d8604548539bb16374a4b837bf7ba8d2f478444fff84e" + }, + "tests/fixtures/rst_admonition.txt": { + "bytes": 848, + "mode": 420, + "sha256": "821676f07a4e595c51c84da87edc592e22e8bbed6241e070040d87a4de7c5d7e" + }, + "tests/fixtures/rst_toc.txt": { + "bytes": 3643, + "mode": 420, + "sha256": "f9ae334cef85d776c37d7ad029e1e38d9e1b035423ab624dab8499aff28f7e98" + }, + "tests/fixtures/ruby.txt": { + "bytes": 1773, + "mode": 420, + "sha256": "1302542447ac0befc2618d9c2da1657581fcc1d90c332896e6dc086b698e30ed" + }, + "tests/fixtures/spoiler.txt": { + "bytes": 1154, + "mode": 420, + "sha256": "21446f2e88b70cc3c50e606c36fbcdf567993581ccf8397ace5948973c251985" + }, + "tests/fixtures/strikethrough.txt": { + "bytes": 886, + "mode": 420, + "sha256": "fee85a2207da74bdcf437c2c58804b009b657b4dfd505989fdbee46f78feac07" + }, + "tests/fixtures/subscript.txt": { + "bytes": 521, + "mode": 420, + "sha256": "61fd94b4718edbbfaa782533f659f4f193585fb09e61761a662cd313906932b8" + }, + "tests/fixtures/superscript.txt": { + "bytes": 523, + "mode": 420, + "sha256": "658ac752d95d74e6e97e7daceba6f48ef279dc6f1389a878610bc608e82f34b3" + }, + "tests/fixtures/table.txt": { + "bytes": 4134, + "mode": 420, + "sha256": "f92d66b63d00f95f7a9938cb6e0e42ea4968d6e9f1f62e902b63bc1be69f51b6" + }, + "tests/fixtures/task_lists.txt": { + "bytes": 3104, + "mode": 420, + "sha256": "d17a07a9cb077dd25c3b4c4dd7301bc9f508ab75ec83c2293b0ebaca954be76c" + }, + "tests/fixtures/url.txt": { + "bytes": 530, + "mode": 420, + "sha256": "441ea5e1e27f6edcd52b51f8c20ca1eee8b76d4adcc3b2fcdd419448c528ef21" + }, + "tests/test_commonmark.py": { + "bytes": 2199, + "mode": 420, + "sha256": "77396377672a8419ecab283aebf55a5e206b1aa413626975dc8b2a006c796973" + }, + "tests/test_directives.py": { + "bytes": 2954, + "mode": 420, + "sha256": "3d46db4f9e52d3067954ab7fcaba80ef855008a516a86ee3baf07b2a9c730817" + }, + "tests/test_hooks.py": { + "bytes": 729, + "mode": 420, + "sha256": "9d6f177c6dd52223ac44e31508ed66bbc2b6fc7a4725ed7121fb39842b0a6a61" + }, + "tests/test_misc.py": { + "bytes": 4830, + "mode": 420, + "sha256": "a1bba411b7b74f1b9d43bf88459db1d9fa2c13e7db32dfee707c93cd8ccb5575" + }, + "tests/test_plugins.py": { + "bytes": 2280, + "mode": 420, + "sha256": "56a6731c5e5667870122edfb3d49925a34dc394ae00ce3282dc3e89cbe2fd6b8" + }, + "tests/test_renderers.py": { + "bytes": 500, + "mode": 420, + "sha256": "efc0fa48c74f8ee1b84c961e4ca034eb5f0246b69b4663428c93cc77d471e7b8" + }, + "tests/test_syntax.py": { + "bytes": 342, + "mode": 420, + "sha256": "88f99c6afc5f39f088c0cd1cdf4fab8a69b60b208a1b28924eeb8fbd0d7bef2e" + } + } +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/pyproject.toml b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..2d95f9b3bd4ee9817157eab051c5277fb0a3846f --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/pyproject.toml @@ -0,0 +1,69 @@ +[project] +name = "mistune" +description = "A sane and fast Markdown parser with useful plugins and renderers" +authors = [{name = "Hsiaoming Yang", email="me@lepture.com"}] +dependencies = [ + "typing-extensions; python_version<'3.11'", +] +license = {text = "BSD-3-Clause"} +dynamic = ["version"] +requires-python = ">=3.8" +readme = "README.rst" +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Text Processing :: Markup", +] + +[project.urls] +Documentation = "https://mistune.lepture.com/" +Source = "https://github.com/lepture/mistune" +Donate = "https://github.com/sponsors/lepture" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +version = {attr = "mistune.__version__"} + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +mistune = ["py.typed"] + +[tool.ruff] +line-length = 120 + +[tool.pytest.ini_options] +pythonpath = ["src", "."] +testpaths = ["tests"] +filterwarnings = ["error"] + +[tool.coverage.run] +branch = true +source = ["mistune"] + +[tool.coverage.paths] +source = ["src"] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "raise NotImplementedError", + "@(abc\\.)?abstractmethod", +] diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/setup.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..af8a0fc50e9db1a27585118393965a8c87e19129 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup(name="mistune") diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/__init__.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b715104d1f96221038f7c9060d66b4bc6a5bdda2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/__init__.py @@ -0,0 +1,40 @@ +import re +from abc import abstractmethod +from unittest import TestCase + +from tests import fixtures + + +class BaseTestCase(TestCase): + @classmethod + def load_fixtures(cls, case_file: str) -> None: + def attach_case(n: str, text: str, html: str) -> None: + def method(self: 'BaseTestCase') -> None: + self.assert_case(n, text, html) + + name = 'test_{}'.format(n) + method.__name__ = name + method.__doc__ = 'Run fixture {} - {}'.format(case_file, n) + setattr(cls, name, method) + + for n, text, html in fixtures.load_examples(case_file): + if cls.ignore_case(n): + continue + attach_case(n, text, html) + + @classmethod + def ignore_case(cls, name: str) -> bool: + return False + + @abstractmethod + def parse(self, text: str) -> str: ... + + def assert_case(self, name: str, text: str, html: str) -> None: + result = self.parse(text) + self.assertEqual(result, html) + + +def normalize_html(html: str) -> str: + html = re.sub(r'>\n+', '>', html) + html = re.sub(r'\n+<', '<', html) + return html.strip() diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/__init__.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a1abe299918fbbac039621a46f85061a7f0c31e --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/__init__.py @@ -0,0 +1,56 @@ +import os +import re +import json +from typing import Any, Iterable, Tuple + +ROOT = os.path.join(os.path.dirname(__file__)) + +EXAMPLE_PATTERN = re.compile( + r'^`{32} example\n([\s\S]*?)' + r'^\.\n([\s\S]*?)' + r'^`{32}$|^#{1,6} *(.*)$', + flags=re.M +) + + +def load_ast(filename: str) -> Any: + with open(os.path.join(ROOT, 'ast', filename)) as f: + return json.load(f) + + +def load_json(filename: str) -> Any: + with open(os.path.join(ROOT, filename)) as f: + return json.load(f) + + +def load_examples(filename: str) -> Iterable[Tuple[str, str, str]]: + if filename.endswith('.json'): + data = load_json(filename) + for item in data: + section = item['section'].lower().replace(' ', '_') + n = '%s_%03d' % (section, item['example']) + yield n, item['markdown'], item['html'] + else: + with open(os.path.join(ROOT, filename), 'rb') as f: + content = f.read() + s = content.decode('utf-8') + yield from parse_examples(s) + + + +def parse_examples(text: str) -> Iterable[Tuple[str, str, str]]: + data = EXAMPLE_PATTERN.findall(text) + + section = None + count = 0 + for md, html, title in data: + if title: + count = 0 + section = title.lower().replace(' ', '_') + + if md and html: + count += 1 + n = '%s_%03d' % (section, count) + md = md.replace(u'\u2192', '\t') + html = html.replace(u'\u2192', '\t') + yield n, md, html diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/abbr.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/abbr.txt new file mode 100644 index 0000000000000000000000000000000000000000..a87b4f1521511a9071a901311c07372340bb958c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/abbr.txt @@ -0,0 +1,79 @@ +# Abbreviation + +## abbreviation + +```````````````````````````````` example +HTML +. +

HTML

+```````````````````````````````` + +```````````````````````````````` example +HTML +*[HTML]: Hyper Text Markup Language +. +

HTML

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: Hyper Text Markup Language +*[W3C]: World Wide Web Consortium +. +

The HTML specification is maintained by the W3C.

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: + Hyper Text Markup Language +*[W3C]: + World Wide Web Consortium +. +

The HTML specification is maintained by the W3C.

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: Hyper Text Markup Language +*[W3C]: World Wide Web Consortium +There is more text below this one. +. +

The HTML specification is maintained by the W3C.

+

There is more text below this one.

+```````````````````````````````` + +```````````````````````````````` example +The latest spec of HTML is HTML5. +*[HTML]: Hyper Text Markup Language +. +

The latest spec of HTML is HTML5.

+```````````````````````````````` + +```````````````````````````````` example +HTML should always be spelt with capital letters and not spelt html. +*[HTML]: Hyper Text Markup Language +. +

HTML should always be spelt with capital letters and not spelt html.

+```````````````````````````````` + +```````````````````````````````` example +HTML is an abbreviation but nobody knows what it stands for. +*[HTML]: +. +

HTML is an abbreviation but nobody knows what it stands for.

+```````````````````````````````` + +```````````````````````````````` example +Foo.* looks like a regular expression. +*[Foo.*]: Just foo +. +

Foo.* looks like a regular expression.

+```````````````````````````````` + +```````````````````````````````` example +Untrusted HTML should be escaped. +*[HTML]:

This is some HTML

+. +

Untrusted HTML should be escaped.

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/commonmark.json b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/commonmark.json new file mode 100644 index 0000000000000000000000000000000000000000..d742f941312421f89a3491b7e1d5edd0e44d2207 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/commonmark.json @@ -0,0 +1,5218 @@ +[ + { + "markdown": "\tfoo\tbaz\t\tbim\n", + "html": "
foo\tbaz\t\tbim\n
\n", + "example": 1, + "start_line": 356, + "end_line": 361, + "section": "Tabs" + }, + { + "markdown": " \tfoo\tbaz\t\tbim\n", + "html": "
foo\tbaz\t\tbim\n
\n", + "example": 2, + "start_line": 363, + "end_line": 368, + "section": "Tabs" + }, + { + "markdown": " a\ta\n ὐ\ta\n", + "html": "
a\ta\nὐ\ta\n
\n", + "example": 3, + "start_line": 370, + "end_line": 377, + "section": "Tabs" + }, + { + "markdown": " - foo\n\n\tbar\n", + "html": "\n", + "example": 4, + "start_line": 383, + "end_line": 394, + "section": "Tabs" + }, + { + "markdown": "- foo\n\n\t\tbar\n", + "html": "\n", + "example": 5, + "start_line": 396, + "end_line": 408, + "section": "Tabs" + }, + { + "markdown": ">\t\tfoo\n", + "html": "
\n
  foo\n
\n
\n", + "example": 6, + "start_line": 419, + "end_line": 426, + "section": "Tabs" + }, + { + "markdown": "-\t\tfoo\n", + "html": "\n", + "example": 7, + "start_line": 428, + "end_line": 437, + "section": "Tabs" + }, + { + "markdown": " foo\n\tbar\n", + "html": "
foo\nbar\n
\n", + "example": 8, + "start_line": 440, + "end_line": 447, + "section": "Tabs" + }, + { + "markdown": " - foo\n - bar\n\t - baz\n", + "html": "\n", + "example": 9, + "start_line": 449, + "end_line": 465, + "section": "Tabs" + }, + { + "markdown": "#\tFoo\n", + "html": "

Foo

\n", + "example": 10, + "start_line": 467, + "end_line": 471, + "section": "Tabs" + }, + { + "markdown": "*\t*\t*\t\n", + "html": "
\n", + "example": 11, + "start_line": 473, + "end_line": 477, + "section": "Tabs" + }, + { + "markdown": "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\n", + "html": "

!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~

\n", + "example": 12, + "start_line": 490, + "end_line": 494, + "section": "Backslash escapes" + }, + { + "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", + "html": "

\\\t\\A\\a\\ \\3\\φ\\«

\n", + "example": 13, + "start_line": 500, + "end_line": 504, + "section": "Backslash escapes" + }, + { + "markdown": "\\*not emphasized*\n\\
not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\ö not a character entity\n", + "html": "

*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\n&ouml; not a character entity

\n", + "example": 14, + "start_line": 510, + "end_line": 530, + "section": "Backslash escapes" + }, + { + "markdown": "\\\\*emphasis*\n", + "html": "

\\emphasis

\n", + "example": 15, + "start_line": 535, + "end_line": 539, + "section": "Backslash escapes" + }, + { + "markdown": "foo\\\nbar\n", + "html": "

foo
\nbar

\n", + "example": 16, + "start_line": 544, + "end_line": 550, + "section": "Backslash escapes" + }, + { + "markdown": "`` \\[\\` ``\n", + "html": "

\\[\\`

\n", + "example": 17, + "start_line": 556, + "end_line": 560, + "section": "Backslash escapes" + }, + { + "markdown": " \\[\\]\n", + "html": "
\\[\\]\n
\n", + "example": 18, + "start_line": 563, + "end_line": 568, + "section": "Backslash escapes" + }, + { + "markdown": "~~~\n\\[\\]\n~~~\n", + "html": "
\\[\\]\n
\n", + "example": 19, + "start_line": 571, + "end_line": 578, + "section": "Backslash escapes" + }, + { + "markdown": "\n", + "html": "

http://example.com?find=\\*

\n", + "example": 20, + "start_line": 581, + "end_line": 585, + "section": "Backslash escapes" + }, + { + "markdown": "\n", + "html": "\n", + "example": 21, + "start_line": 588, + "end_line": 592, + "section": "Backslash escapes" + }, + { + "markdown": "[foo](/bar\\* \"ti\\*tle\")\n", + "html": "

foo

\n", + "example": 22, + "start_line": 598, + "end_line": 602, + "section": "Backslash escapes" + }, + { + "markdown": "[foo]\n\n[foo]: /bar\\* \"ti\\*tle\"\n", + "html": "

foo

\n", + "example": 23, + "start_line": 605, + "end_line": 611, + "section": "Backslash escapes" + }, + { + "markdown": "``` foo\\+bar\nfoo\n```\n", + "html": "
foo\n
\n", + "example": 24, + "start_line": 614, + "end_line": 621, + "section": "Backslash escapes" + }, + { + "markdown": "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n", + "html": "

  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

\n", + "example": 25, + "start_line": 650, + "end_line": 658, + "section": "Entity and numeric character references" + }, + { + "markdown": "# Ӓ Ϡ �\n", + "html": "

# Ӓ Ϡ �

\n", + "example": 26, + "start_line": 669, + "end_line": 673, + "section": "Entity and numeric character references" + }, + { + "markdown": "" ആ ಫ\n", + "html": "

" ആ ಫ

\n", + "example": 27, + "start_line": 682, + "end_line": 686, + "section": "Entity and numeric character references" + }, + { + "markdown": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;\n", + "html": "

&nbsp &x; &#; &#x;\n&#87654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;

\n", + "example": 28, + "start_line": 691, + "end_line": 701, + "section": "Entity and numeric character references" + }, + { + "markdown": "©\n", + "html": "

&copy

\n", + "example": 29, + "start_line": 708, + "end_line": 712, + "section": "Entity and numeric character references" + }, + { + "markdown": "&MadeUpEntity;\n", + "html": "

&MadeUpEntity;

\n", + "example": 30, + "start_line": 718, + "end_line": 722, + "section": "Entity and numeric character references" + }, + { + "markdown": "\n", + "html": "\n", + "example": 31, + "start_line": 729, + "end_line": 733, + "section": "Entity and numeric character references" + }, + { + "markdown": "[foo](/föö \"föö\")\n", + "html": "

foo

\n", + "example": 32, + "start_line": 736, + "end_line": 740, + "section": "Entity and numeric character references" + }, + { + "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", + "html": "

foo

\n", + "example": 33, + "start_line": 743, + "end_line": 749, + "section": "Entity and numeric character references" + }, + { + "markdown": "``` föö\nfoo\n```\n", + "html": "
foo\n
\n", + "example": 34, + "start_line": 752, + "end_line": 759, + "section": "Entity and numeric character references" + }, + { + "markdown": "`föö`\n", + "html": "

f&ouml;&ouml;

\n", + "example": 35, + "start_line": 765, + "end_line": 769, + "section": "Entity and numeric character references" + }, + { + "markdown": " föfö\n", + "html": "
f&ouml;f&ouml;\n
\n", + "example": 36, + "start_line": 772, + "end_line": 777, + "section": "Entity and numeric character references" + }, + { + "markdown": "*foo*\n*foo*\n", + "html": "

*foo*\nfoo

\n", + "example": 37, + "start_line": 784, + "end_line": 790, + "section": "Entity and numeric character references" + }, + { + "markdown": "* foo\n\n* foo\n", + "html": "

* foo

\n\n", + "example": 38, + "start_line": 792, + "end_line": 801, + "section": "Entity and numeric character references" + }, + { + "markdown": "foo bar\n", + "html": "

foo\n\nbar

\n", + "example": 39, + "start_line": 803, + "end_line": 809, + "section": "Entity and numeric character references" + }, + { + "markdown": " foo\n", + "html": "

\tfoo

\n", + "example": 40, + "start_line": 811, + "end_line": 815, + "section": "Entity and numeric character references" + }, + { + "markdown": "[a](url "tit")\n", + "html": "

[a](url "tit")

\n", + "example": 41, + "start_line": 818, + "end_line": 822, + "section": "Entity and numeric character references" + }, + { + "markdown": "- `one\n- two`\n", + "html": "\n", + "example": 42, + "start_line": 841, + "end_line": 849, + "section": "Precedence" + }, + { + "markdown": "***\n---\n___\n", + "html": "
\n
\n
\n", + "example": 43, + "start_line": 880, + "end_line": 888, + "section": "Thematic breaks" + }, + { + "markdown": "+++\n", + "html": "

+++

\n", + "example": 44, + "start_line": 893, + "end_line": 897, + "section": "Thematic breaks" + }, + { + "markdown": "===\n", + "html": "

===

\n", + "example": 45, + "start_line": 900, + "end_line": 904, + "section": "Thematic breaks" + }, + { + "markdown": "--\n**\n__\n", + "html": "

--\n**\n__

\n", + "example": 46, + "start_line": 909, + "end_line": 917, + "section": "Thematic breaks" + }, + { + "markdown": " ***\n ***\n ***\n", + "html": "
\n
\n
\n", + "example": 47, + "start_line": 922, + "end_line": 930, + "section": "Thematic breaks" + }, + { + "markdown": " ***\n", + "html": "
***\n
\n", + "example": 48, + "start_line": 935, + "end_line": 940, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n ***\n", + "html": "

Foo\n***

\n", + "example": 49, + "start_line": 943, + "end_line": 949, + "section": "Thematic breaks" + }, + { + "markdown": "_____________________________________\n", + "html": "
\n", + "example": 50, + "start_line": 954, + "end_line": 958, + "section": "Thematic breaks" + }, + { + "markdown": " - - -\n", + "html": "
\n", + "example": 51, + "start_line": 963, + "end_line": 967, + "section": "Thematic breaks" + }, + { + "markdown": " ** * ** * ** * **\n", + "html": "
\n", + "example": 52, + "start_line": 970, + "end_line": 974, + "section": "Thematic breaks" + }, + { + "markdown": "- - - -\n", + "html": "
\n", + "example": 53, + "start_line": 977, + "end_line": 981, + "section": "Thematic breaks" + }, + { + "markdown": "- - - - \n", + "html": "
\n", + "example": 54, + "start_line": 986, + "end_line": 990, + "section": "Thematic breaks" + }, + { + "markdown": "_ _ _ _ a\n\na------\n\n---a---\n", + "html": "

_ _ _ _ a

\n

a------

\n

---a---

\n", + "example": 55, + "start_line": 995, + "end_line": 1005, + "section": "Thematic breaks" + }, + { + "markdown": " *-*\n", + "html": "

-

\n", + "example": 56, + "start_line": 1011, + "end_line": 1015, + "section": "Thematic breaks" + }, + { + "markdown": "- foo\n***\n- bar\n", + "html": "\n
\n\n", + "example": 57, + "start_line": 1020, + "end_line": 1032, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n***\nbar\n", + "html": "

Foo

\n
\n

bar

\n", + "example": 58, + "start_line": 1037, + "end_line": 1045, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n---\nbar\n", + "html": "

Foo

\n

bar

\n", + "example": 59, + "start_line": 1054, + "end_line": 1061, + "section": "Thematic breaks" + }, + { + "markdown": "* Foo\n* * *\n* Bar\n", + "html": "\n
\n\n", + "example": 60, + "start_line": 1067, + "end_line": 1079, + "section": "Thematic breaks" + }, + { + "markdown": "- Foo\n- * * *\n", + "html": "\n", + "example": 61, + "start_line": 1084, + "end_line": 1094, + "section": "Thematic breaks" + }, + { + "markdown": "# foo\n## foo\n### foo\n#### foo\n##### foo\n###### foo\n", + "html": "

foo

\n

foo

\n

foo

\n

foo

\n
foo
\n
foo
\n", + "example": 62, + "start_line": 1113, + "end_line": 1127, + "section": "ATX headings" + }, + { + "markdown": "####### foo\n", + "html": "

####### foo

\n", + "example": 63, + "start_line": 1132, + "end_line": 1136, + "section": "ATX headings" + }, + { + "markdown": "#5 bolt\n\n#hashtag\n", + "html": "

#5 bolt

\n

#hashtag

\n", + "example": 64, + "start_line": 1147, + "end_line": 1154, + "section": "ATX headings" + }, + { + "markdown": "\\## foo\n", + "html": "

## foo

\n", + "example": 65, + "start_line": 1159, + "end_line": 1163, + "section": "ATX headings" + }, + { + "markdown": "# foo *bar* \\*baz\\*\n", + "html": "

foo bar *baz*

\n", + "example": 66, + "start_line": 1168, + "end_line": 1172, + "section": "ATX headings" + }, + { + "markdown": "# foo \n", + "html": "

foo

\n", + "example": 67, + "start_line": 1177, + "end_line": 1181, + "section": "ATX headings" + }, + { + "markdown": " ### foo\n ## foo\n # foo\n", + "html": "

foo

\n

foo

\n

foo

\n", + "example": 68, + "start_line": 1186, + "end_line": 1194, + "section": "ATX headings" + }, + { + "markdown": " # foo\n", + "html": "
# foo\n
\n", + "example": 69, + "start_line": 1199, + "end_line": 1204, + "section": "ATX headings" + }, + { + "markdown": "foo\n # bar\n", + "html": "

foo\n# bar

\n", + "example": 70, + "start_line": 1207, + "end_line": 1213, + "section": "ATX headings" + }, + { + "markdown": "## foo ##\n ### bar ###\n", + "html": "

foo

\n

bar

\n", + "example": 71, + "start_line": 1218, + "end_line": 1224, + "section": "ATX headings" + }, + { + "markdown": "# foo ##################################\n##### foo ##\n", + "html": "

foo

\n
foo
\n", + "example": 72, + "start_line": 1229, + "end_line": 1235, + "section": "ATX headings" + }, + { + "markdown": "### foo ### \n", + "html": "

foo

\n", + "example": 73, + "start_line": 1240, + "end_line": 1244, + "section": "ATX headings" + }, + { + "markdown": "### foo ### b\n", + "html": "

foo ### b

\n", + "example": 74, + "start_line": 1251, + "end_line": 1255, + "section": "ATX headings" + }, + { + "markdown": "# foo#\n", + "html": "

foo#

\n", + "example": 75, + "start_line": 1260, + "end_line": 1264, + "section": "ATX headings" + }, + { + "markdown": "### foo \\###\n## foo #\\##\n# foo \\#\n", + "html": "

foo ###

\n

foo ###

\n

foo #

\n", + "example": 76, + "start_line": 1270, + "end_line": 1278, + "section": "ATX headings" + }, + { + "markdown": "****\n## foo\n****\n", + "html": "
\n

foo

\n
\n", + "example": 77, + "start_line": 1284, + "end_line": 1292, + "section": "ATX headings" + }, + { + "markdown": "Foo bar\n# baz\nBar foo\n", + "html": "

Foo bar

\n

baz

\n

Bar foo

\n", + "example": 78, + "start_line": 1295, + "end_line": 1303, + "section": "ATX headings" + }, + { + "markdown": "## \n#\n### ###\n", + "html": "

\n

\n

\n", + "example": 79, + "start_line": 1308, + "end_line": 1316, + "section": "ATX headings" + }, + { + "markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n", + "html": "

Foo bar

\n

Foo bar

\n", + "example": 80, + "start_line": 1351, + "end_line": 1360, + "section": "Setext headings" + }, + { + "markdown": "Foo *bar\nbaz*\n====\n", + "html": "

Foo bar\nbaz

\n", + "example": 81, + "start_line": 1365, + "end_line": 1372, + "section": "Setext headings" + }, + { + "markdown": " Foo *bar\nbaz*\t\n====\n", + "html": "

Foo bar\nbaz

\n", + "example": 82, + "start_line": 1379, + "end_line": 1386, + "section": "Setext headings" + }, + { + "markdown": "Foo\n-------------------------\n\nFoo\n=\n", + "html": "

Foo

\n

Foo

\n", + "example": 83, + "start_line": 1391, + "end_line": 1400, + "section": "Setext headings" + }, + { + "markdown": " Foo\n---\n\n Foo\n-----\n\n Foo\n ===\n", + "html": "

Foo

\n

Foo

\n

Foo

\n", + "example": 84, + "start_line": 1406, + "end_line": 1419, + "section": "Setext headings" + }, + { + "markdown": " Foo\n ---\n\n Foo\n---\n", + "html": "
Foo\n---\n\nFoo\n
\n
\n", + "example": 85, + "start_line": 1424, + "end_line": 1437, + "section": "Setext headings" + }, + { + "markdown": "Foo\n ---- \n", + "html": "

Foo

\n", + "example": 86, + "start_line": 1443, + "end_line": 1448, + "section": "Setext headings" + }, + { + "markdown": "Foo\n ---\n", + "html": "

Foo\n---

\n", + "example": 87, + "start_line": 1453, + "end_line": 1459, + "section": "Setext headings" + }, + { + "markdown": "Foo\n= =\n\nFoo\n--- -\n", + "html": "

Foo\n= =

\n

Foo

\n
\n", + "example": 88, + "start_line": 1464, + "end_line": 1475, + "section": "Setext headings" + }, + { + "markdown": "Foo \n-----\n", + "html": "

Foo

\n", + "example": 89, + "start_line": 1480, + "end_line": 1485, + "section": "Setext headings" + }, + { + "markdown": "Foo\\\n----\n", + "html": "

Foo\\

\n", + "example": 90, + "start_line": 1490, + "end_line": 1495, + "section": "Setext headings" + }, + { + "markdown": "`Foo\n----\n`\n\n\n", + "html": "

`Foo

\n

`

\n

<a title="a lot

\n

of dashes"/>

\n", + "example": 91, + "start_line": 1501, + "end_line": 1514, + "section": "Setext headings" + }, + { + "markdown": "> Foo\n---\n", + "html": "
\n

Foo

\n
\n
\n", + "example": 92, + "start_line": 1520, + "end_line": 1528, + "section": "Setext headings" + }, + { + "markdown": "> foo\nbar\n===\n", + "html": "
\n

foo\nbar\n===

\n
\n", + "example": 93, + "start_line": 1531, + "end_line": 1541, + "section": "Setext headings" + }, + { + "markdown": "- Foo\n---\n", + "html": "\n
\n", + "example": 94, + "start_line": 1544, + "end_line": 1552, + "section": "Setext headings" + }, + { + "markdown": "Foo\nBar\n---\n", + "html": "

Foo\nBar

\n", + "example": 95, + "start_line": 1559, + "end_line": 1566, + "section": "Setext headings" + }, + { + "markdown": "---\nFoo\n---\nBar\n---\nBaz\n", + "html": "
\n

Foo

\n

Bar

\n

Baz

\n", + "example": 96, + "start_line": 1572, + "end_line": 1584, + "section": "Setext headings" + }, + { + "markdown": "\n====\n", + "html": "

====

\n", + "example": 97, + "start_line": 1589, + "end_line": 1594, + "section": "Setext headings" + }, + { + "markdown": "---\n---\n", + "html": "
\n
\n", + "example": 98, + "start_line": 1601, + "end_line": 1607, + "section": "Setext headings" + }, + { + "markdown": "- foo\n-----\n", + "html": "\n
\n", + "example": 99, + "start_line": 1610, + "end_line": 1618, + "section": "Setext headings" + }, + { + "markdown": " foo\n---\n", + "html": "
foo\n
\n
\n", + "example": 100, + "start_line": 1621, + "end_line": 1628, + "section": "Setext headings" + }, + { + "markdown": "> foo\n-----\n", + "html": "
\n

foo

\n
\n
\n", + "example": 101, + "start_line": 1631, + "end_line": 1639, + "section": "Setext headings" + }, + { + "markdown": "\\> foo\n------\n", + "html": "

> foo

\n", + "example": 102, + "start_line": 1645, + "end_line": 1650, + "section": "Setext headings" + }, + { + "markdown": "Foo\n\nbar\n---\nbaz\n", + "html": "

Foo

\n

bar

\n

baz

\n", + "example": 103, + "start_line": 1676, + "end_line": 1686, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n\n---\n\nbaz\n", + "html": "

Foo\nbar

\n
\n

baz

\n", + "example": 104, + "start_line": 1692, + "end_line": 1704, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n* * *\nbaz\n", + "html": "

Foo\nbar

\n
\n

baz

\n", + "example": 105, + "start_line": 1710, + "end_line": 1720, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n\\---\nbaz\n", + "html": "

Foo\nbar\n---\nbaz

\n", + "example": 106, + "start_line": 1725, + "end_line": 1735, + "section": "Setext headings" + }, + { + "markdown": " a simple\n indented code block\n", + "html": "
a simple\n  indented code block\n
\n", + "example": 107, + "start_line": 1753, + "end_line": 1760, + "section": "Indented code blocks" + }, + { + "markdown": " - foo\n\n bar\n", + "html": "\n", + "example": 108, + "start_line": 1767, + "end_line": 1778, + "section": "Indented code blocks" + }, + { + "markdown": "1. foo\n\n - bar\n", + "html": "
    \n
  1. \n

    foo

    \n
      \n
    • bar
    • \n
    \n
  2. \n
\n", + "example": 109, + "start_line": 1781, + "end_line": 1794, + "section": "Indented code blocks" + }, + { + "markdown": "
\n *hi*\n\n - one\n", + "html": "
<a/>\n*hi*\n\n- one\n
\n", + "example": 110, + "start_line": 1801, + "end_line": 1812, + "section": "Indented code blocks" + }, + { + "markdown": " chunk1\n\n chunk2\n \n \n \n chunk3\n", + "html": "
chunk1\n\nchunk2\n\n\n\nchunk3\n
\n", + "example": 111, + "start_line": 1817, + "end_line": 1834, + "section": "Indented code blocks" + }, + { + "markdown": " chunk1\n \n chunk2\n", + "html": "
chunk1\n  \n  chunk2\n
\n", + "example": 112, + "start_line": 1840, + "end_line": 1849, + "section": "Indented code blocks" + }, + { + "markdown": "Foo\n bar\n\n", + "html": "

Foo\nbar

\n", + "example": 113, + "start_line": 1855, + "end_line": 1862, + "section": "Indented code blocks" + }, + { + "markdown": " foo\nbar\n", + "html": "
foo\n
\n

bar

\n", + "example": 114, + "start_line": 1869, + "end_line": 1876, + "section": "Indented code blocks" + }, + { + "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", + "html": "

Heading

\n
foo\n
\n

Heading

\n
foo\n
\n
\n", + "example": 115, + "start_line": 1882, + "end_line": 1897, + "section": "Indented code blocks" + }, + { + "markdown": " foo\n bar\n", + "html": "
    foo\nbar\n
\n", + "example": 116, + "start_line": 1902, + "end_line": 1909, + "section": "Indented code blocks" + }, + { + "markdown": "\n \n foo\n \n\n", + "html": "
foo\n
\n", + "example": 117, + "start_line": 1915, + "end_line": 1924, + "section": "Indented code blocks" + }, + { + "markdown": " foo \n", + "html": "
foo  \n
\n", + "example": 118, + "start_line": 1929, + "end_line": 1934, + "section": "Indented code blocks" + }, + { + "markdown": "```\n<\n >\n```\n", + "html": "
<\n >\n
\n", + "example": 119, + "start_line": 1984, + "end_line": 1993, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~\n<\n >\n~~~\n", + "html": "
<\n >\n
\n", + "example": 120, + "start_line": 1998, + "end_line": 2007, + "section": "Fenced code blocks" + }, + { + "markdown": "``\nfoo\n``\n", + "html": "

foo

\n", + "example": 121, + "start_line": 2011, + "end_line": 2017, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n~~~\n```\n", + "html": "
aaa\n~~~\n
\n", + "example": 122, + "start_line": 2022, + "end_line": 2031, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~\naaa\n```\n~~~\n", + "html": "
aaa\n```\n
\n", + "example": 123, + "start_line": 2034, + "end_line": 2043, + "section": "Fenced code blocks" + }, + { + "markdown": "````\naaa\n```\n``````\n", + "html": "
aaa\n```\n
\n", + "example": 124, + "start_line": 2048, + "end_line": 2057, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~\naaa\n~~~\n~~~~\n", + "html": "
aaa\n~~~\n
\n", + "example": 125, + "start_line": 2060, + "end_line": 2069, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n", + "html": "
\n", + "example": 126, + "start_line": 2075, + "end_line": 2079, + "section": "Fenced code blocks" + }, + { + "markdown": "`````\n\n```\naaa\n", + "html": "
\n```\naaa\n
\n", + "example": 127, + "start_line": 2082, + "end_line": 2092, + "section": "Fenced code blocks" + }, + { + "markdown": "> ```\n> aaa\n\nbbb\n", + "html": "
\n
aaa\n
\n
\n

bbb

\n", + "example": 128, + "start_line": 2095, + "end_line": 2106, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n\n \n```\n", + "html": "
\n  \n
\n", + "example": 129, + "start_line": 2111, + "end_line": 2120, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n```\n", + "html": "
\n", + "example": 130, + "start_line": 2125, + "end_line": 2130, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\naaa\n```\n", + "html": "
aaa\naaa\n
\n", + "example": 131, + "start_line": 2137, + "end_line": 2146, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\naaa\n aaa\naaa\n ```\n", + "html": "
aaa\naaa\naaa\n
\n", + "example": 132, + "start_line": 2149, + "end_line": 2160, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\n aaa\n aaa\n ```\n", + "html": "
aaa\n aaa\naaa\n
\n", + "example": 133, + "start_line": 2163, + "end_line": 2174, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\n ```\n", + "html": "
```\naaa\n```\n
\n", + "example": 134, + "start_line": 2179, + "end_line": 2188, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n ```\n", + "html": "
aaa\n
\n", + "example": 135, + "start_line": 2194, + "end_line": 2201, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\naaa\n ```\n", + "html": "
aaa\n
\n", + "example": 136, + "start_line": 2204, + "end_line": 2211, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n ```\n", + "html": "
aaa\n    ```\n
\n", + "example": 137, + "start_line": 2216, + "end_line": 2224, + "section": "Fenced code blocks" + }, + { + "markdown": "``` ```\naaa\n", + "html": "

\naaa

\n", + "example": 138, + "start_line": 2230, + "end_line": 2236, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~~~\naaa\n~~~ ~~\n", + "html": "
aaa\n~~~ ~~\n
\n", + "example": 139, + "start_line": 2239, + "end_line": 2247, + "section": "Fenced code blocks" + }, + { + "markdown": "foo\n```\nbar\n```\nbaz\n", + "html": "

foo

\n
bar\n
\n

baz

\n", + "example": 140, + "start_line": 2253, + "end_line": 2264, + "section": "Fenced code blocks" + }, + { + "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", + "html": "

foo

\n
bar\n
\n

baz

\n", + "example": 141, + "start_line": 2270, + "end_line": 2282, + "section": "Fenced code blocks" + }, + { + "markdown": "```ruby\ndef foo(x)\n return 3\nend\n```\n", + "html": "
def foo(x)\n  return 3\nend\n
\n", + "example": 142, + "start_line": 2292, + "end_line": 2303, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n", + "html": "
def foo(x)\n  return 3\nend\n
\n", + "example": 143, + "start_line": 2306, + "end_line": 2317, + "section": "Fenced code blocks" + }, + { + "markdown": "````;\n````\n", + "html": "
\n", + "example": 144, + "start_line": 2320, + "end_line": 2325, + "section": "Fenced code blocks" + }, + { + "markdown": "``` aa ```\nfoo\n", + "html": "

aa\nfoo

\n", + "example": 145, + "start_line": 2330, + "end_line": 2336, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~ aa ``` ~~~\nfoo\n~~~\n", + "html": "
foo\n
\n", + "example": 146, + "start_line": 2341, + "end_line": 2348, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n``` aaa\n```\n", + "html": "
``` aaa\n
\n", + "example": 147, + "start_line": 2353, + "end_line": 2360, + "section": "Fenced code blocks" + }, + { + "markdown": "
\n
\n**Hello**,\n\n_world_.\n
\n
\n", + "html": "
\n
\n**Hello**,\n

world.\n

\n
\n", + "example": 148, + "start_line": 2432, + "end_line": 2447, + "section": "HTML blocks" + }, + { + "markdown": "\n \n \n \n
\n hi\n
\n\nokay.\n", + "html": "\n \n \n \n
\n hi\n
\n

okay.

\n", + "example": 149, + "start_line": 2461, + "end_line": 2480, + "section": "HTML blocks" + }, + { + "markdown": "
\n *hello*\n \n", + "html": "
\n *hello*\n \n", + "example": 150, + "start_line": 2483, + "end_line": 2491, + "section": "HTML blocks" + }, + { + "markdown": "
\n*foo*\n", + "html": "
\n*foo*\n", + "example": 151, + "start_line": 2496, + "end_line": 2502, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n*Markdown*\n\n
\n", + "html": "
\n

Markdown

\n
\n", + "example": 152, + "start_line": 2507, + "end_line": 2517, + "section": "HTML blocks" + }, + { + "markdown": "
\n
\n", + "html": "
\n
\n", + "example": 153, + "start_line": 2523, + "end_line": 2531, + "section": "HTML blocks" + }, + { + "markdown": "
\n
\n", + "html": "
\n
\n", + "example": 154, + "start_line": 2534, + "end_line": 2542, + "section": "HTML blocks" + }, + { + "markdown": "
\n*foo*\n\n*bar*\n", + "html": "
\n*foo*\n

bar

\n", + "example": 155, + "start_line": 2546, + "end_line": 2555, + "section": "HTML blocks" + }, + { + "markdown": "
\n", + "html": "
*foo*
\n", + "example": 159, + "start_line": 2595, + "end_line": 2599, + "section": "HTML blocks" + }, + { + "markdown": "
\nfoo\n
\n", + "html": "
\nfoo\n
\n", + "example": 160, + "start_line": 2602, + "end_line": 2610, + "section": "HTML blocks" + }, + { + "markdown": "
\n``` c\nint x = 33;\n```\n", + "html": "
\n``` c\nint x = 33;\n```\n", + "example": 161, + "start_line": 2619, + "end_line": 2629, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 162, + "start_line": 2636, + "end_line": 2644, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 163, + "start_line": 2649, + "end_line": 2657, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 164, + "start_line": 2660, + "end_line": 2668, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n", + "html": "\n*bar*\n", + "example": 165, + "start_line": 2671, + "end_line": 2677, + "section": "HTML blocks" + }, + { + "markdown": "\n*foo*\n\n", + "html": "\n*foo*\n\n", + "example": 166, + "start_line": 2686, + "end_line": 2694, + "section": "HTML blocks" + }, + { + "markdown": "\n\n*foo*\n\n\n", + "html": "\n

foo

\n
\n", + "example": 167, + "start_line": 2701, + "end_line": 2711, + "section": "HTML blocks" + }, + { + "markdown": "*foo*\n", + "html": "

foo

\n", + "example": 168, + "start_line": 2719, + "end_line": 2723, + "section": "HTML blocks" + }, + { + "markdown": "
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay\n", + "html": "
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\n

okay

\n", + "example": 169, + "start_line": 2735, + "end_line": 2751, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 170, + "start_line": 2756, + "end_line": 2770, + "section": "HTML blocks" + }, + { + "markdown": "\n", + "html": "\n", + "example": 171, + "start_line": 2775, + "end_line": 2791, + "section": "HTML blocks" + }, + { + "markdown": "\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n", + "html": "\nh1 {color:red;}\n\np {color:blue;}\n\n

okay

\n", + "example": 172, + "start_line": 2795, + "end_line": 2811, + "section": "HTML blocks" + }, + { + "markdown": "\n\nfoo\n", + "html": "\n\nfoo\n", + "example": 173, + "start_line": 2818, + "end_line": 2828, + "section": "HTML blocks" + }, + { + "markdown": ">
\n> foo\n\nbar\n", + "html": "
\n
\nfoo\n
\n

bar

\n", + "example": 174, + "start_line": 2831, + "end_line": 2842, + "section": "HTML blocks" + }, + { + "markdown": "-
\n- foo\n", + "html": "
    \n
  • \n
    \n
  • \n
  • foo
  • \n
\n", + "example": 175, + "start_line": 2845, + "end_line": 2855, + "section": "HTML blocks" + }, + { + "markdown": "\n*foo*\n", + "html": "\n

foo

\n", + "example": 176, + "start_line": 2860, + "end_line": 2866, + "section": "HTML blocks" + }, + { + "markdown": "*bar*\n*baz*\n", + "html": "*bar*\n

baz

\n", + "example": 177, + "start_line": 2869, + "end_line": 2875, + "section": "HTML blocks" + }, + { + "markdown": "1. *bar*\n", + "html": "1. *bar*\n", + "example": 178, + "start_line": 2881, + "end_line": 2889, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 179, + "start_line": 2894, + "end_line": 2906, + "section": "HTML blocks" + }, + { + "markdown": "';\n\n?>\nokay\n", + "html": "';\n\n?>\n

okay

\n", + "example": 180, + "start_line": 2912, + "end_line": 2926, + "section": "HTML blocks" + }, + { + "markdown": "\n", + "html": "\n", + "example": 181, + "start_line": 2931, + "end_line": 2935, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 182, + "start_line": 2940, + "end_line": 2968, + "section": "HTML blocks" + }, + { + "markdown": " \n\n \n", + "html": " \n
<!-- foo -->\n
\n", + "example": 183, + "start_line": 2974, + "end_line": 2982, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n
\n", + "html": "
\n
<div>\n
\n", + "example": 184, + "start_line": 2985, + "end_line": 2993, + "section": "HTML blocks" + }, + { + "markdown": "Foo\n
\nbar\n
\n", + "html": "

Foo

\n
\nbar\n
\n", + "example": 185, + "start_line": 2999, + "end_line": 3009, + "section": "HTML blocks" + }, + { + "markdown": "
\nbar\n
\n*foo*\n", + "html": "
\nbar\n
\n*foo*\n", + "example": 186, + "start_line": 3016, + "end_line": 3026, + "section": "HTML blocks" + }, + { + "markdown": "Foo\n\nbaz\n", + "html": "

Foo\n\nbaz

\n", + "example": 187, + "start_line": 3031, + "end_line": 3039, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n*Emphasized* text.\n\n
\n", + "html": "
\n

Emphasized text.

\n
\n", + "example": 188, + "start_line": 3072, + "end_line": 3082, + "section": "HTML blocks" + }, + { + "markdown": "
\n*Emphasized* text.\n
\n", + "html": "
\n*Emphasized* text.\n
\n", + "example": 189, + "start_line": 3085, + "end_line": 3093, + "section": "HTML blocks" + }, + { + "markdown": "\n\n\n\n\n\n\n\n
\nHi\n
\n", + "html": "\n\n\n\n
\nHi\n
\n", + "example": 190, + "start_line": 3107, + "end_line": 3127, + "section": "HTML blocks" + }, + { + "markdown": "\n\n \n\n \n\n \n\n
\n Hi\n
\n", + "html": "\n \n
<td>\n  Hi\n</td>\n
\n \n
\n", + "example": 191, + "start_line": 3134, + "end_line": 3155, + "section": "HTML blocks" + }, + { + "markdown": "[foo]: /url \"title\"\n\n[foo]\n", + "html": "

foo

\n", + "example": 192, + "start_line": 3183, + "end_line": 3189, + "section": "Link reference definitions" + }, + { + "markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n", + "html": "

foo

\n", + "example": 193, + "start_line": 3192, + "end_line": 3200, + "section": "Link reference definitions" + }, + { + "markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n", + "html": "

Foo*bar]

\n", + "example": 194, + "start_line": 3203, + "end_line": 3209, + "section": "Link reference definitions" + }, + { + "markdown": "[Foo bar]:\n\n'title'\n\n[Foo bar]\n", + "html": "

Foo bar

\n", + "example": 195, + "start_line": 3212, + "end_line": 3220, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n", + "html": "

foo

\n", + "example": 196, + "start_line": 3225, + "end_line": 3239, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n", + "html": "

[foo]: /url 'title

\n

with blank line'

\n

[foo]

\n", + "example": 197, + "start_line": 3244, + "end_line": 3254, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]:\n/url\n\n[foo]\n", + "html": "

foo

\n", + "example": 198, + "start_line": 3259, + "end_line": 3266, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]:\n\n[foo]\n", + "html": "

[foo]:

\n

[foo]

\n", + "example": 199, + "start_line": 3271, + "end_line": 3278, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: <>\n\n[foo]\n", + "html": "

foo

\n", + "example": 200, + "start_line": 3283, + "end_line": 3289, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: (baz)\n\n[foo]\n", + "html": "

[foo]: (baz)

\n

[foo]

\n", + "example": 201, + "start_line": 3294, + "end_line": 3301, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", + "html": "

foo

\n", + "example": 202, + "start_line": 3307, + "end_line": 3313, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n[foo]: url\n", + "html": "

foo

\n", + "example": 203, + "start_line": 3318, + "end_line": 3324, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", + "html": "

foo

\n", + "example": 204, + "start_line": 3330, + "end_line": 3337, + "section": "Link reference definitions" + }, + { + "markdown": "[FOO]: /url\n\n[Foo]\n", + "html": "

Foo

\n", + "example": 205, + "start_line": 3343, + "end_line": 3349, + "section": "Link reference definitions" + }, + { + "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", + "html": "

αγω

\n", + "example": 206, + "start_line": 3352, + "end_line": 3358, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n", + "html": "", + "example": 207, + "start_line": 3367, + "end_line": 3370, + "section": "Link reference definitions" + }, + { + "markdown": "[\nfoo\n]: /url\nbar\n", + "html": "

bar

\n", + "example": 208, + "start_line": 3375, + "end_line": 3382, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url \"title\" ok\n", + "html": "

[foo]: /url "title" ok

\n", + "example": 209, + "start_line": 3388, + "end_line": 3392, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n\"title\" ok\n", + "html": "

"title" ok

\n", + "example": 210, + "start_line": 3397, + "end_line": 3402, + "section": "Link reference definitions" + }, + { + "markdown": " [foo]: /url \"title\"\n\n[foo]\n", + "html": "
[foo]: /url "title"\n
\n

[foo]

\n", + "example": 211, + "start_line": 3408, + "end_line": 3416, + "section": "Link reference definitions" + }, + { + "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", + "html": "
[foo]: /url\n
\n

[foo]

\n", + "example": 212, + "start_line": 3422, + "end_line": 3432, + "section": "Link reference definitions" + }, + { + "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", + "html": "

Foo\n[bar]: /baz

\n

[bar]

\n", + "example": 213, + "start_line": 3437, + "end_line": 3446, + "section": "Link reference definitions" + }, + { + "markdown": "# [Foo]\n[foo]: /url\n> bar\n", + "html": "

Foo

\n
\n

bar

\n
\n", + "example": 214, + "start_line": 3452, + "end_line": 3461, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\nbar\n===\n[foo]\n", + "html": "

bar

\n

foo

\n", + "example": 215, + "start_line": 3463, + "end_line": 3471, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n===\n[foo]\n", + "html": "

===\nfoo

\n", + "example": 216, + "start_line": 3473, + "end_line": 3480, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", + "html": "

foo,\nbar,\nbaz

\n", + "example": 217, + "start_line": 3486, + "end_line": 3499, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n> [foo]: /url\n", + "html": "

foo

\n
\n
\n", + "example": 218, + "start_line": 3507, + "end_line": 3515, + "section": "Link reference definitions" + }, + { + "markdown": "aaa\n\nbbb\n", + "html": "

aaa

\n

bbb

\n", + "example": 219, + "start_line": 3529, + "end_line": 3536, + "section": "Paragraphs" + }, + { + "markdown": "aaa\nbbb\n\nccc\nddd\n", + "html": "

aaa\nbbb

\n

ccc\nddd

\n", + "example": 220, + "start_line": 3541, + "end_line": 3552, + "section": "Paragraphs" + }, + { + "markdown": "aaa\n\n\nbbb\n", + "html": "

aaa

\n

bbb

\n", + "example": 221, + "start_line": 3557, + "end_line": 3565, + "section": "Paragraphs" + }, + { + "markdown": " aaa\n bbb\n", + "html": "

aaa\nbbb

\n", + "example": 222, + "start_line": 3570, + "end_line": 3576, + "section": "Paragraphs" + }, + { + "markdown": "aaa\n bbb\n ccc\n", + "html": "

aaa\nbbb\nccc

\n", + "example": 223, + "start_line": 3582, + "end_line": 3590, + "section": "Paragraphs" + }, + { + "markdown": " aaa\nbbb\n", + "html": "

aaa\nbbb

\n", + "example": 224, + "start_line": 3596, + "end_line": 3602, + "section": "Paragraphs" + }, + { + "markdown": " aaa\nbbb\n", + "html": "
aaa\n
\n

bbb

\n", + "example": 225, + "start_line": 3605, + "end_line": 3612, + "section": "Paragraphs" + }, + { + "markdown": "aaa \nbbb \n", + "html": "

aaa
\nbbb

\n", + "example": 226, + "start_line": 3619, + "end_line": 3625, + "section": "Paragraphs" + }, + { + "markdown": " \n\naaa\n \n\n# aaa\n\n \n", + "html": "

aaa

\n

aaa

\n", + "example": 227, + "start_line": 3636, + "end_line": 3648, + "section": "Blank lines" + }, + { + "markdown": "> # Foo\n> bar\n> baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 228, + "start_line": 3704, + "end_line": 3714, + "section": "Block quotes" + }, + { + "markdown": "># Foo\n>bar\n> baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 229, + "start_line": 3719, + "end_line": 3729, + "section": "Block quotes" + }, + { + "markdown": " > # Foo\n > bar\n > baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 230, + "start_line": 3734, + "end_line": 3744, + "section": "Block quotes" + }, + { + "markdown": " > # Foo\n > bar\n > baz\n", + "html": "
> # Foo\n> bar\n> baz\n
\n", + "example": 231, + "start_line": 3749, + "end_line": 3758, + "section": "Block quotes" + }, + { + "markdown": "> # Foo\n> bar\nbaz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 232, + "start_line": 3764, + "end_line": 3774, + "section": "Block quotes" + }, + { + "markdown": "> bar\nbaz\n> foo\n", + "html": "
\n

bar\nbaz\nfoo

\n
\n", + "example": 233, + "start_line": 3780, + "end_line": 3790, + "section": "Block quotes" + }, + { + "markdown": "> foo\n---\n", + "html": "
\n

foo

\n
\n
\n", + "example": 234, + "start_line": 3804, + "end_line": 3812, + "section": "Block quotes" + }, + { + "markdown": "> - foo\n- bar\n", + "html": "
\n
    \n
  • foo
  • \n
\n
\n
    \n
  • bar
  • \n
\n", + "example": 235, + "start_line": 3824, + "end_line": 3836, + "section": "Block quotes" + }, + { + "markdown": "> foo\n bar\n", + "html": "
\n
foo\n
\n
\n
bar\n
\n", + "example": 236, + "start_line": 3842, + "end_line": 3852, + "section": "Block quotes" + }, + { + "markdown": "> ```\nfoo\n```\n", + "html": "
\n
\n
\n

foo

\n
\n", + "example": 237, + "start_line": 3855, + "end_line": 3865, + "section": "Block quotes" + }, + { + "markdown": "> foo\n - bar\n", + "html": "
\n

foo\n- bar

\n
\n", + "example": 238, + "start_line": 3871, + "end_line": 3879, + "section": "Block quotes" + }, + { + "markdown": ">\n", + "html": "
\n
\n", + "example": 239, + "start_line": 3895, + "end_line": 3900, + "section": "Block quotes" + }, + { + "markdown": ">\n> \n> \n", + "html": "
\n
\n", + "example": 240, + "start_line": 3903, + "end_line": 3910, + "section": "Block quotes" + }, + { + "markdown": ">\n> foo\n> \n", + "html": "
\n

foo

\n
\n", + "example": 241, + "start_line": 3915, + "end_line": 3923, + "section": "Block quotes" + }, + { + "markdown": "> foo\n\n> bar\n", + "html": "
\n

foo

\n
\n
\n

bar

\n
\n", + "example": 242, + "start_line": 3928, + "end_line": 3939, + "section": "Block quotes" + }, + { + "markdown": "> foo\n> bar\n", + "html": "
\n

foo\nbar

\n
\n", + "example": 243, + "start_line": 3950, + "end_line": 3958, + "section": "Block quotes" + }, + { + "markdown": "> foo\n>\n> bar\n", + "html": "
\n

foo

\n

bar

\n
\n", + "example": 244, + "start_line": 3963, + "end_line": 3972, + "section": "Block quotes" + }, + { + "markdown": "foo\n> bar\n", + "html": "

foo

\n
\n

bar

\n
\n", + "example": 245, + "start_line": 3977, + "end_line": 3985, + "section": "Block quotes" + }, + { + "markdown": "> aaa\n***\n> bbb\n", + "html": "
\n

aaa

\n
\n
\n
\n

bbb

\n
\n", + "example": 246, + "start_line": 3991, + "end_line": 4003, + "section": "Block quotes" + }, + { + "markdown": "> bar\nbaz\n", + "html": "
\n

bar\nbaz

\n
\n", + "example": 247, + "start_line": 4009, + "end_line": 4017, + "section": "Block quotes" + }, + { + "markdown": "> bar\n\nbaz\n", + "html": "
\n

bar

\n
\n

baz

\n", + "example": 248, + "start_line": 4020, + "end_line": 4029, + "section": "Block quotes" + }, + { + "markdown": "> bar\n>\nbaz\n", + "html": "
\n

bar

\n
\n

baz

\n", + "example": 249, + "start_line": 4032, + "end_line": 4041, + "section": "Block quotes" + }, + { + "markdown": "> > > foo\nbar\n", + "html": "
\n
\n
\n

foo\nbar

\n
\n
\n
\n", + "example": 250, + "start_line": 4048, + "end_line": 4060, + "section": "Block quotes" + }, + { + "markdown": ">>> foo\n> bar\n>>baz\n", + "html": "
\n
\n
\n

foo\nbar\nbaz

\n
\n
\n
\n", + "example": 251, + "start_line": 4063, + "end_line": 4077, + "section": "Block quotes" + }, + { + "markdown": "> code\n\n> not code\n", + "html": "
\n
code\n
\n
\n
\n

not code

\n
\n", + "example": 252, + "start_line": 4085, + "end_line": 4097, + "section": "Block quotes" + }, + { + "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", + "html": "

A paragraph\nwith two lines.

\n
indented code\n
\n
\n

A block quote.

\n
\n", + "example": 253, + "start_line": 4139, + "end_line": 4154, + "section": "List items" + }, + { + "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 254, + "start_line": 4161, + "end_line": 4180, + "section": "List items" + }, + { + "markdown": "- one\n\n two\n", + "html": "
    \n
  • one
  • \n
\n

two

\n", + "example": 255, + "start_line": 4194, + "end_line": 4203, + "section": "List items" + }, + { + "markdown": "- one\n\n two\n", + "html": "
    \n
  • \n

    one

    \n

    two

    \n
  • \n
\n", + "example": 256, + "start_line": 4206, + "end_line": 4217, + "section": "List items" + }, + { + "markdown": " - one\n\n two\n", + "html": "
    \n
  • one
  • \n
\n
 two\n
\n", + "example": 257, + "start_line": 4220, + "end_line": 4230, + "section": "List items" + }, + { + "markdown": " - one\n\n two\n", + "html": "
    \n
  • \n

    one

    \n

    two

    \n
  • \n
\n", + "example": 258, + "start_line": 4233, + "end_line": 4244, + "section": "List items" + }, + { + "markdown": " > > 1. one\n>>\n>> two\n", + "html": "
\n
\n
    \n
  1. \n

    one

    \n

    two

    \n
  2. \n
\n
\n
\n", + "example": 259, + "start_line": 4255, + "end_line": 4270, + "section": "List items" + }, + { + "markdown": ">>- one\n>>\n > > two\n", + "html": "
\n
\n
    \n
  • one
  • \n
\n

two

\n
\n
\n", + "example": 260, + "start_line": 4282, + "end_line": 4295, + "section": "List items" + }, + { + "markdown": "-one\n\n2.two\n", + "html": "

-one

\n

2.two

\n", + "example": 261, + "start_line": 4301, + "end_line": 4308, + "section": "List items" + }, + { + "markdown": "- foo\n\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 262, + "start_line": 4314, + "end_line": 4326, + "section": "List items" + }, + { + "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", + "html": "
    \n
  1. \n

    foo

    \n
    bar\n
    \n

    baz

    \n
    \n

    bam

    \n
    \n
  2. \n
\n", + "example": 263, + "start_line": 4331, + "end_line": 4353, + "section": "List items" + }, + { + "markdown": "- Foo\n\n bar\n\n\n baz\n", + "html": "
    \n
  • \n

    Foo

    \n
    bar\n\n\nbaz\n
    \n
  • \n
\n", + "example": 264, + "start_line": 4359, + "end_line": 4377, + "section": "List items" + }, + { + "markdown": "123456789. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 265, + "start_line": 4381, + "end_line": 4387, + "section": "List items" + }, + { + "markdown": "1234567890. not ok\n", + "html": "

1234567890. not ok

\n", + "example": 266, + "start_line": 4390, + "end_line": 4394, + "section": "List items" + }, + { + "markdown": "0. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 267, + "start_line": 4399, + "end_line": 4405, + "section": "List items" + }, + { + "markdown": "003. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 268, + "start_line": 4408, + "end_line": 4414, + "section": "List items" + }, + { + "markdown": "-1. not ok\n", + "html": "

-1. not ok

\n", + "example": 269, + "start_line": 4419, + "end_line": 4423, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n
    bar\n
    \n
  • \n
\n", + "example": 270, + "start_line": 4442, + "end_line": 4454, + "section": "List items" + }, + { + "markdown": " 10. foo\n\n bar\n", + "html": "
    \n
  1. \n

    foo

    \n
    bar\n
    \n
  2. \n
\n", + "example": 271, + "start_line": 4459, + "end_line": 4471, + "section": "List items" + }, + { + "markdown": " indented code\n\nparagraph\n\n more code\n", + "html": "
indented code\n
\n

paragraph

\n
more code\n
\n", + "example": 272, + "start_line": 4478, + "end_line": 4490, + "section": "List items" + }, + { + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "html": "
    \n
  1. \n
    indented code\n
    \n

    paragraph

    \n
    more code\n
    \n
  2. \n
\n", + "example": 273, + "start_line": 4493, + "end_line": 4509, + "section": "List items" + }, + { + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "html": "
    \n
  1. \n
     indented code\n
    \n

    paragraph

    \n
    more code\n
    \n
  2. \n
\n", + "example": 274, + "start_line": 4515, + "end_line": 4531, + "section": "List items" + }, + { + "markdown": " foo\n\nbar\n", + "html": "

foo

\n

bar

\n", + "example": 275, + "start_line": 4542, + "end_line": 4549, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • foo
  • \n
\n

bar

\n", + "example": 276, + "start_line": 4552, + "end_line": 4561, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 277, + "start_line": 4569, + "end_line": 4580, + "section": "List items" + }, + { + "markdown": "-\n foo\n-\n ```\n bar\n ```\n-\n baz\n", + "html": "
    \n
  • foo
  • \n
  • \n
    bar\n
    \n
  • \n
  • \n
    baz\n
    \n
  • \n
\n", + "example": 278, + "start_line": 4596, + "end_line": 4617, + "section": "List items" + }, + { + "markdown": "- \n foo\n", + "html": "
    \n
  • foo
  • \n
\n", + "example": 279, + "start_line": 4622, + "end_line": 4629, + "section": "List items" + }, + { + "markdown": "-\n\n foo\n", + "html": "
    \n
  • \n
\n

foo

\n", + "example": 280, + "start_line": 4636, + "end_line": 4645, + "section": "List items" + }, + { + "markdown": "- foo\n-\n- bar\n", + "html": "
    \n
  • foo
  • \n
  • \n
  • bar
  • \n
\n", + "example": 281, + "start_line": 4650, + "end_line": 4660, + "section": "List items" + }, + { + "markdown": "- foo\n- \n- bar\n", + "html": "
    \n
  • foo
  • \n
  • \n
  • bar
  • \n
\n", + "example": 282, + "start_line": 4665, + "end_line": 4675, + "section": "List items" + }, + { + "markdown": "1. foo\n2.\n3. bar\n", + "html": "
    \n
  1. foo
  2. \n
  3. \n
  4. bar
  5. \n
\n", + "example": 283, + "start_line": 4680, + "end_line": 4690, + "section": "List items" + }, + { + "markdown": "*\n", + "html": "
    \n
  • \n
\n", + "example": 284, + "start_line": 4695, + "end_line": 4701, + "section": "List items" + }, + { + "markdown": "foo\n*\n\nfoo\n1.\n", + "html": "

foo\n*

\n

foo\n1.

\n", + "example": 285, + "start_line": 4705, + "end_line": 4716, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 286, + "start_line": 4727, + "end_line": 4746, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 287, + "start_line": 4751, + "end_line": 4770, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 288, + "start_line": 4775, + "end_line": 4794, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
\n", + "example": 289, + "start_line": 4799, + "end_line": 4814, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 290, + "start_line": 4829, + "end_line": 4848, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n", + "html": "
    \n
  1. A paragraph\nwith two lines.
  2. \n
\n", + "example": 291, + "start_line": 4853, + "end_line": 4861, + "section": "List items" + }, + { + "markdown": "> 1. > Blockquote\ncontinued here.\n", + "html": "
\n
    \n
  1. \n
    \n

    Blockquote\ncontinued here.

    \n
    \n
  2. \n
\n
\n", + "example": 292, + "start_line": 4866, + "end_line": 4880, + "section": "List items" + }, + { + "markdown": "> 1. > Blockquote\n> continued here.\n", + "html": "
\n
    \n
  1. \n
    \n

    Blockquote\ncontinued here.

    \n
    \n
  2. \n
\n
\n", + "example": 293, + "start_line": 4883, + "end_line": 4897, + "section": "List items" + }, + { + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "html": "
    \n
  • foo\n
      \n
    • bar\n
        \n
      • baz\n
          \n
        • boo
        • \n
        \n
      • \n
      \n
    • \n
    \n
  • \n
\n", + "example": 294, + "start_line": 4911, + "end_line": 4932, + "section": "List items" + }, + { + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
  • baz
  • \n
  • boo
  • \n
\n", + "example": 295, + "start_line": 4937, + "end_line": 4949, + "section": "List items" + }, + { + "markdown": "10) foo\n - bar\n", + "html": "
    \n
  1. foo\n
      \n
    • bar
    • \n
    \n
  2. \n
\n", + "example": 296, + "start_line": 4954, + "end_line": 4965, + "section": "List items" + }, + { + "markdown": "10) foo\n - bar\n", + "html": "
    \n
  1. foo
  2. \n
\n
    \n
  • bar
  • \n
\n", + "example": 297, + "start_line": 4970, + "end_line": 4980, + "section": "List items" + }, + { + "markdown": "- - foo\n", + "html": "
    \n
  • \n
      \n
    • foo
    • \n
    \n
  • \n
\n", + "example": 298, + "start_line": 4985, + "end_line": 4995, + "section": "List items" + }, + { + "markdown": "1. - 2. foo\n", + "html": "
    \n
  1. \n
      \n
    • \n
        \n
      1. foo
      2. \n
      \n
    • \n
    \n
  2. \n
\n", + "example": 299, + "start_line": 4998, + "end_line": 5012, + "section": "List items" + }, + { + "markdown": "- # Foo\n- Bar\n ---\n baz\n", + "html": "
    \n
  • \n

    Foo

    \n
  • \n
  • \n

    Bar

    \nbaz
  • \n
\n", + "example": 300, + "start_line": 5017, + "end_line": 5031, + "section": "List items" + }, + { + "markdown": "- foo\n- bar\n+ baz\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
\n
    \n
  • baz
  • \n
\n", + "example": 301, + "start_line": 5253, + "end_line": 5265, + "section": "Lists" + }, + { + "markdown": "1. foo\n2. bar\n3) baz\n", + "html": "
    \n
  1. foo
  2. \n
  3. bar
  4. \n
\n
    \n
  1. baz
  2. \n
\n", + "example": 302, + "start_line": 5268, + "end_line": 5280, + "section": "Lists" + }, + { + "markdown": "Foo\n- bar\n- baz\n", + "html": "

Foo

\n
    \n
  • bar
  • \n
  • baz
  • \n
\n", + "example": 303, + "start_line": 5287, + "end_line": 5297, + "section": "Lists" + }, + { + "markdown": "The number of windows in my house is\n14. The number of doors is 6.\n", + "html": "

The number of windows in my house is\n14. The number of doors is 6.

\n", + "example": 304, + "start_line": 5364, + "end_line": 5370, + "section": "Lists" + }, + { + "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", + "html": "

The number of windows in my house is

\n
    \n
  1. The number of doors is 6.
  2. \n
\n", + "example": 305, + "start_line": 5374, + "end_line": 5382, + "section": "Lists" + }, + { + "markdown": "- foo\n\n- bar\n\n\n- baz\n", + "html": "
    \n
  • \n

    foo

    \n
  • \n
  • \n

    bar

    \n
  • \n
  • \n

    baz

    \n
  • \n
\n", + "example": 306, + "start_line": 5388, + "end_line": 5407, + "section": "Lists" + }, + { + "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", + "html": "
    \n
  • foo\n
      \n
    • bar\n
        \n
      • \n

        baz

        \n

        bim

        \n
      • \n
      \n
    • \n
    \n
  • \n
\n", + "example": 307, + "start_line": 5409, + "end_line": 5431, + "section": "Lists" + }, + { + "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
\n\n
    \n
  • baz
  • \n
  • bim
  • \n
\n", + "example": 308, + "start_line": 5439, + "end_line": 5457, + "section": "Lists" + }, + { + "markdown": "- foo\n\n notcode\n\n- foo\n\n\n\n code\n", + "html": "
    \n
  • \n

    foo

    \n

    notcode

    \n
  • \n
  • \n

    foo

    \n
  • \n
\n\n
code\n
\n", + "example": 309, + "start_line": 5460, + "end_line": 5483, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n - d\n - e\n - f\n- g\n", + "html": "
    \n
  • a
  • \n
  • b
  • \n
  • c
  • \n
  • d
  • \n
  • e
  • \n
  • f
  • \n
  • g
  • \n
\n", + "example": 310, + "start_line": 5491, + "end_line": 5509, + "section": "Lists" + }, + { + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "html": "
    \n
  1. \n

    a

    \n
  2. \n
  3. \n

    b

    \n
  4. \n
  5. \n

    c

    \n
  6. \n
\n", + "example": 311, + "start_line": 5512, + "end_line": 5530, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n - d\n - e\n", + "html": "
    \n
  • a
  • \n
  • b
  • \n
  • c
  • \n
  • d\n- e
  • \n
\n", + "example": 312, + "start_line": 5536, + "end_line": 5550, + "section": "Lists" + }, + { + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "html": "
    \n
  1. \n

    a

    \n
  2. \n
  3. \n

    b

    \n
  4. \n
\n
3. c\n
\n", + "example": 313, + "start_line": 5556, + "end_line": 5573, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n- c\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n
  • \n
  • \n

    c

    \n
  • \n
\n", + "example": 314, + "start_line": 5579, + "end_line": 5596, + "section": "Lists" + }, + { + "markdown": "* a\n*\n\n* c\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n
  • \n

    c

    \n
  • \n
\n", + "example": 315, + "start_line": 5601, + "end_line": 5616, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n c\n- d\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n

    c

    \n
  • \n
  • \n

    d

    \n
  • \n
\n", + "example": 316, + "start_line": 5623, + "end_line": 5642, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n [ref]: /url\n- d\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n
  • \n
  • \n

    d

    \n
  • \n
\n", + "example": 317, + "start_line": 5645, + "end_line": 5663, + "section": "Lists" + }, + { + "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", + "html": "
    \n
  • a
  • \n
  • \n
    b\n\n\n
    \n
  • \n
  • c
  • \n
\n", + "example": 318, + "start_line": 5668, + "end_line": 5687, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n\n c\n- d\n", + "html": "
    \n
  • a\n
      \n
    • \n

      b

      \n

      c

      \n
    • \n
    \n
  • \n
  • d
  • \n
\n", + "example": 319, + "start_line": 5694, + "end_line": 5712, + "section": "Lists" + }, + { + "markdown": "* a\n > b\n >\n* c\n", + "html": "
    \n
  • a\n
    \n

    b

    \n
    \n
  • \n
  • c
  • \n
\n", + "example": 320, + "start_line": 5718, + "end_line": 5732, + "section": "Lists" + }, + { + "markdown": "- a\n > b\n ```\n c\n ```\n- d\n", + "html": "
    \n
  • a\n
    \n

    b

    \n
    \n
    c\n
    \n
  • \n
  • d
  • \n
\n", + "example": 321, + "start_line": 5738, + "end_line": 5756, + "section": "Lists" + }, + { + "markdown": "- a\n", + "html": "
    \n
  • a
  • \n
\n", + "example": 322, + "start_line": 5761, + "end_line": 5767, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n", + "html": "
    \n
  • a\n
      \n
    • b
    • \n
    \n
  • \n
\n", + "example": 323, + "start_line": 5770, + "end_line": 5781, + "section": "Lists" + }, + { + "markdown": "1. ```\n foo\n ```\n\n bar\n", + "html": "
    \n
  1. \n
    foo\n
    \n

    bar

    \n
  2. \n
\n", + "example": 324, + "start_line": 5787, + "end_line": 5801, + "section": "Lists" + }, + { + "markdown": "* foo\n * bar\n\n baz\n", + "html": "
    \n
  • \n

    foo

    \n
      \n
    • bar
    • \n
    \n

    baz

    \n
  • \n
\n", + "example": 325, + "start_line": 5806, + "end_line": 5821, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", + "html": "
    \n
  • \n

    a

    \n
      \n
    • b
    • \n
    • c
    • \n
    \n
  • \n
  • \n

    d

    \n
      \n
    • e
    • \n
    • f
    • \n
    \n
  • \n
\n", + "example": 326, + "start_line": 5824, + "end_line": 5849, + "section": "Lists" + }, + { + "markdown": "`hi`lo`\n", + "html": "

hilo`

\n", + "example": 327, + "start_line": 5858, + "end_line": 5862, + "section": "Inlines" + }, + { + "markdown": "`foo`\n", + "html": "

foo

\n", + "example": 328, + "start_line": 5890, + "end_line": 5894, + "section": "Code spans" + }, + { + "markdown": "`` foo ` bar ``\n", + "html": "

foo ` bar

\n", + "example": 329, + "start_line": 5901, + "end_line": 5905, + "section": "Code spans" + }, + { + "markdown": "` `` `\n", + "html": "

``

\n", + "example": 330, + "start_line": 5911, + "end_line": 5915, + "section": "Code spans" + }, + { + "markdown": "` `` `\n", + "html": "

``

\n", + "example": 331, + "start_line": 5919, + "end_line": 5923, + "section": "Code spans" + }, + { + "markdown": "` a`\n", + "html": "

a

\n", + "example": 332, + "start_line": 5928, + "end_line": 5932, + "section": "Code spans" + }, + { + "markdown": "` b `\n", + "html": "

 b 

\n", + "example": 333, + "start_line": 5937, + "end_line": 5941, + "section": "Code spans" + }, + { + "markdown": "` `\n` `\n", + "html": "

 \n

\n", + "example": 334, + "start_line": 5945, + "end_line": 5951, + "section": "Code spans" + }, + { + "markdown": "``\nfoo\nbar \nbaz\n``\n", + "html": "

foo bar baz

\n", + "example": 335, + "start_line": 5956, + "end_line": 5964, + "section": "Code spans" + }, + { + "markdown": "``\nfoo \n``\n", + "html": "

foo

\n", + "example": 336, + "start_line": 5966, + "end_line": 5972, + "section": "Code spans" + }, + { + "markdown": "`foo bar \nbaz`\n", + "html": "

foo bar baz

\n", + "example": 337, + "start_line": 5977, + "end_line": 5982, + "section": "Code spans" + }, + { + "markdown": "`foo\\`bar`\n", + "html": "

foo\\bar`

\n", + "example": 338, + "start_line": 5994, + "end_line": 5998, + "section": "Code spans" + }, + { + "markdown": "``foo`bar``\n", + "html": "

foo`bar

\n", + "example": 339, + "start_line": 6005, + "end_line": 6009, + "section": "Code spans" + }, + { + "markdown": "` foo `` bar `\n", + "html": "

foo `` bar

\n", + "example": 340, + "start_line": 6011, + "end_line": 6015, + "section": "Code spans" + }, + { + "markdown": "*foo`*`\n", + "html": "

*foo*

\n", + "example": 341, + "start_line": 6023, + "end_line": 6027, + "section": "Code spans" + }, + { + "markdown": "[not a `link](/foo`)\n", + "html": "

[not a link](/foo)

\n", + "example": 342, + "start_line": 6032, + "end_line": 6036, + "section": "Code spans" + }, + { + "markdown": "``\n", + "html": "

<a href="">`

\n", + "example": 343, + "start_line": 6042, + "end_line": 6046, + "section": "Code spans" + }, + { + "markdown": "
`\n", + "html": "

`

\n", + "example": 344, + "start_line": 6051, + "end_line": 6055, + "section": "Code spans" + }, + { + "markdown": "``\n", + "html": "

<http://foo.bar.baz>`

\n", + "example": 345, + "start_line": 6060, + "end_line": 6064, + "section": "Code spans" + }, + { + "markdown": "`\n", + "html": "

http://foo.bar.`baz`

\n", + "example": 346, + "start_line": 6069, + "end_line": 6073, + "section": "Code spans" + }, + { + "markdown": "```foo``\n", + "html": "

```foo``

\n", + "example": 347, + "start_line": 6079, + "end_line": 6083, + "section": "Code spans" + }, + { + "markdown": "`foo\n", + "html": "

`foo

\n", + "example": 348, + "start_line": 6086, + "end_line": 6090, + "section": "Code spans" + }, + { + "markdown": "`foo``bar``\n", + "html": "

`foobar

\n", + "example": 349, + "start_line": 6095, + "end_line": 6099, + "section": "Code spans" + }, + { + "markdown": "*foo bar*\n", + "html": "

foo bar

\n", + "example": 350, + "start_line": 6312, + "end_line": 6316, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a * foo bar*\n", + "html": "

a * foo bar*

\n", + "example": 351, + "start_line": 6322, + "end_line": 6326, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a*\"foo\"*\n", + "html": "

a*"foo"*

\n", + "example": 352, + "start_line": 6333, + "end_line": 6337, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "* a *\n", + "html": "

* a *

\n", + "example": 353, + "start_line": 6342, + "end_line": 6346, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo*bar*\n", + "html": "

foobar

\n", + "example": 354, + "start_line": 6351, + "end_line": 6355, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5*6*78\n", + "html": "

5678

\n", + "example": 355, + "start_line": 6358, + "end_line": 6362, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo bar_\n", + "html": "

foo bar

\n", + "example": 356, + "start_line": 6367, + "end_line": 6371, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_ foo bar_\n", + "html": "

_ foo bar_

\n", + "example": 357, + "start_line": 6377, + "end_line": 6381, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a_\"foo\"_\n", + "html": "

a_"foo"_

\n", + "example": 358, + "start_line": 6387, + "end_line": 6391, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo_bar_\n", + "html": "

foo_bar_

\n", + "example": 359, + "start_line": 6396, + "end_line": 6400, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5_6_78\n", + "html": "

5_6_78

\n", + "example": 360, + "start_line": 6403, + "end_line": 6407, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "пристаням_стремятся_\n", + "html": "

пристаням_стремятся_

\n", + "example": 361, + "start_line": 6410, + "end_line": 6414, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "aa_\"bb\"_cc\n", + "html": "

aa_"bb"_cc

\n", + "example": 362, + "start_line": 6420, + "end_line": 6424, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo-_(bar)_\n", + "html": "

foo-(bar)

\n", + "example": 363, + "start_line": 6431, + "end_line": 6435, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo*\n", + "html": "

_foo*

\n", + "example": 364, + "start_line": 6443, + "end_line": 6447, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo bar *\n", + "html": "

*foo bar *

\n", + "example": 365, + "start_line": 6453, + "end_line": 6457, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo bar\n*\n", + "html": "

*foo bar\n*

\n", + "example": 366, + "start_line": 6462, + "end_line": 6468, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(*foo)\n", + "html": "

*(*foo)

\n", + "example": 367, + "start_line": 6475, + "end_line": 6479, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(*foo*)*\n", + "html": "

(foo)

\n", + "example": 368, + "start_line": 6485, + "end_line": 6489, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo*bar\n", + "html": "

foobar

\n", + "example": 369, + "start_line": 6494, + "end_line": 6498, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo bar _\n", + "html": "

_foo bar _

\n", + "example": 370, + "start_line": 6507, + "end_line": 6511, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(_foo)\n", + "html": "

_(_foo)

\n", + "example": 371, + "start_line": 6517, + "end_line": 6521, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(_foo_)_\n", + "html": "

(foo)

\n", + "example": 372, + "start_line": 6526, + "end_line": 6530, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo_bar\n", + "html": "

_foo_bar

\n", + "example": 373, + "start_line": 6535, + "end_line": 6539, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_пристаням_стремятся\n", + "html": "

_пристаням_стремятся

\n", + "example": 374, + "start_line": 6542, + "end_line": 6546, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo_bar_baz_\n", + "html": "

foo_bar_baz

\n", + "example": 375, + "start_line": 6549, + "end_line": 6553, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(bar)_.\n", + "html": "

(bar).

\n", + "example": 376, + "start_line": 6560, + "end_line": 6564, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo bar**\n", + "html": "

foo bar

\n", + "example": 377, + "start_line": 6569, + "end_line": 6573, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "** foo bar**\n", + "html": "

** foo bar**

\n", + "example": 378, + "start_line": 6579, + "end_line": 6583, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a**\"foo\"**\n", + "html": "

a**"foo"**

\n", + "example": 379, + "start_line": 6590, + "end_line": 6594, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo**bar**\n", + "html": "

foobar

\n", + "example": 380, + "start_line": 6599, + "end_line": 6603, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo bar__\n", + "html": "

foo bar

\n", + "example": 381, + "start_line": 6608, + "end_line": 6612, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__ foo bar__\n", + "html": "

__ foo bar__

\n", + "example": 382, + "start_line": 6618, + "end_line": 6622, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__\nfoo bar__\n", + "html": "

__\nfoo bar__

\n", + "example": 383, + "start_line": 6626, + "end_line": 6632, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a__\"foo\"__\n", + "html": "

a__"foo"__

\n", + "example": 384, + "start_line": 6638, + "end_line": 6642, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo__bar__\n", + "html": "

foo__bar__

\n", + "example": 385, + "start_line": 6647, + "end_line": 6651, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5__6__78\n", + "html": "

5__6__78

\n", + "example": 386, + "start_line": 6654, + "end_line": 6658, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "пристаням__стремятся__\n", + "html": "

пристаням__стремятся__

\n", + "example": 387, + "start_line": 6661, + "end_line": 6665, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo, __bar__, baz__\n", + "html": "

foo, bar, baz

\n", + "example": 388, + "start_line": 6668, + "end_line": 6672, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo-__(bar)__\n", + "html": "

foo-(bar)

\n", + "example": 389, + "start_line": 6679, + "end_line": 6683, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo bar **\n", + "html": "

**foo bar **

\n", + "example": 390, + "start_line": 6692, + "end_line": 6696, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**(**foo)\n", + "html": "

**(**foo)

\n", + "example": 391, + "start_line": 6705, + "end_line": 6709, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(**foo**)*\n", + "html": "

(foo)

\n", + "example": 392, + "start_line": 6715, + "end_line": 6719, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", + "html": "

Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

\n", + "example": 393, + "start_line": 6722, + "end_line": 6728, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo \"*bar*\" foo**\n", + "html": "

foo "bar" foo

\n", + "example": 394, + "start_line": 6731, + "end_line": 6735, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo**bar\n", + "html": "

foobar

\n", + "example": 395, + "start_line": 6740, + "end_line": 6744, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo bar __\n", + "html": "

__foo bar __

\n", + "example": 396, + "start_line": 6752, + "end_line": 6756, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__(__foo)\n", + "html": "

__(__foo)

\n", + "example": 397, + "start_line": 6762, + "end_line": 6766, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(__foo__)_\n", + "html": "

(foo)

\n", + "example": 398, + "start_line": 6772, + "end_line": 6776, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__bar\n", + "html": "

__foo__bar

\n", + "example": 399, + "start_line": 6781, + "end_line": 6785, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__пристаням__стремятся\n", + "html": "

__пристаням__стремятся

\n", + "example": 400, + "start_line": 6788, + "end_line": 6792, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__bar__baz__\n", + "html": "

foo__bar__baz

\n", + "example": 401, + "start_line": 6795, + "end_line": 6799, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__(bar)__.\n", + "html": "

(bar).

\n", + "example": 402, + "start_line": 6806, + "end_line": 6810, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo [bar](/url)*\n", + "html": "

foo bar

\n", + "example": 403, + "start_line": 6818, + "end_line": 6822, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo\nbar*\n", + "html": "

foo\nbar

\n", + "example": 404, + "start_line": 6825, + "end_line": 6831, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo __bar__ baz_\n", + "html": "

foo bar baz

\n", + "example": 405, + "start_line": 6837, + "end_line": 6841, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo _bar_ baz_\n", + "html": "

foo bar baz

\n", + "example": 406, + "start_line": 6844, + "end_line": 6848, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo_ bar_\n", + "html": "

foo bar

\n", + "example": 407, + "start_line": 6851, + "end_line": 6855, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo *bar**\n", + "html": "

foo bar

\n", + "example": 408, + "start_line": 6858, + "end_line": 6862, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar** baz*\n", + "html": "

foo bar baz

\n", + "example": 409, + "start_line": 6865, + "end_line": 6869, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar**baz*\n", + "html": "

foobarbaz

\n", + "example": 410, + "start_line": 6871, + "end_line": 6875, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar*\n", + "html": "

foo**bar

\n", + "example": 411, + "start_line": 6895, + "end_line": 6899, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo** bar*\n", + "html": "

foo bar

\n", + "example": 412, + "start_line": 6908, + "end_line": 6912, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar***\n", + "html": "

foo bar

\n", + "example": 413, + "start_line": 6915, + "end_line": 6919, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar***\n", + "html": "

foobar

\n", + "example": 414, + "start_line": 6922, + "end_line": 6926, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo***bar***baz\n", + "html": "

foobarbaz

\n", + "example": 415, + "start_line": 6933, + "end_line": 6937, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo******bar*********baz\n", + "html": "

foobar***baz

\n", + "example": 416, + "start_line": 6939, + "end_line": 6943, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar *baz* bim** bop*\n", + "html": "

foo bar baz bim bop

\n", + "example": 417, + "start_line": 6948, + "end_line": 6952, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo [*bar*](/url)*\n", + "html": "

foo bar

\n", + "example": 418, + "start_line": 6955, + "end_line": 6959, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "** is not an empty emphasis\n", + "html": "

** is not an empty emphasis

\n", + "example": 419, + "start_line": 6964, + "end_line": 6968, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**** is not an empty strong emphasis\n", + "html": "

**** is not an empty strong emphasis

\n", + "example": 420, + "start_line": 6971, + "end_line": 6975, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo [bar](/url)**\n", + "html": "

foo bar

\n", + "example": 421, + "start_line": 6984, + "end_line": 6988, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo\nbar**\n", + "html": "

foo\nbar

\n", + "example": 422, + "start_line": 6991, + "end_line": 6997, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo _bar_ baz__\n", + "html": "

foo bar baz

\n", + "example": 423, + "start_line": 7003, + "end_line": 7007, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo __bar__ baz__\n", + "html": "

foo bar baz

\n", + "example": 424, + "start_line": 7010, + "end_line": 7014, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo__ bar__\n", + "html": "

foo bar

\n", + "example": 425, + "start_line": 7017, + "end_line": 7021, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo **bar****\n", + "html": "

foo bar

\n", + "example": 426, + "start_line": 7024, + "end_line": 7028, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar* baz**\n", + "html": "

foo bar baz

\n", + "example": 427, + "start_line": 7031, + "end_line": 7035, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo*bar*baz**\n", + "html": "

foobarbaz

\n", + "example": 428, + "start_line": 7038, + "end_line": 7042, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo* bar**\n", + "html": "

foo bar

\n", + "example": 429, + "start_line": 7045, + "end_line": 7049, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar***\n", + "html": "

foo bar

\n", + "example": 430, + "start_line": 7052, + "end_line": 7056, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar **baz**\nbim* bop**\n", + "html": "

foo bar baz\nbim bop

\n", + "example": 431, + "start_line": 7061, + "end_line": 7067, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo [*bar*](/url)**\n", + "html": "

foo bar

\n", + "example": 432, + "start_line": 7070, + "end_line": 7074, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__ is not an empty emphasis\n", + "html": "

__ is not an empty emphasis

\n", + "example": 433, + "start_line": 7079, + "end_line": 7083, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____ is not an empty strong emphasis\n", + "html": "

____ is not an empty strong emphasis

\n", + "example": 434, + "start_line": 7086, + "end_line": 7090, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo ***\n", + "html": "

foo ***

\n", + "example": 435, + "start_line": 7096, + "end_line": 7100, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *\\**\n", + "html": "

foo *

\n", + "example": 436, + "start_line": 7103, + "end_line": 7107, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *_*\n", + "html": "

foo _

\n", + "example": 437, + "start_line": 7110, + "end_line": 7114, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *****\n", + "html": "

foo *****

\n", + "example": 438, + "start_line": 7117, + "end_line": 7121, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo **\\***\n", + "html": "

foo *

\n", + "example": 439, + "start_line": 7124, + "end_line": 7128, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo **_**\n", + "html": "

foo _

\n", + "example": 440, + "start_line": 7131, + "end_line": 7135, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo*\n", + "html": "

*foo

\n", + "example": 441, + "start_line": 7142, + "end_line": 7146, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**\n", + "html": "

foo*

\n", + "example": 442, + "start_line": 7149, + "end_line": 7153, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo**\n", + "html": "

*foo

\n", + "example": 443, + "start_line": 7156, + "end_line": 7160, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "****foo*\n", + "html": "

***foo

\n", + "example": 444, + "start_line": 7163, + "end_line": 7167, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo***\n", + "html": "

foo*

\n", + "example": 445, + "start_line": 7170, + "end_line": 7174, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo****\n", + "html": "

foo***

\n", + "example": 446, + "start_line": 7177, + "end_line": 7181, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo ___\n", + "html": "

foo ___

\n", + "example": 447, + "start_line": 7187, + "end_line": 7191, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _\\__\n", + "html": "

foo _

\n", + "example": 448, + "start_line": 7194, + "end_line": 7198, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _*_\n", + "html": "

foo *

\n", + "example": 449, + "start_line": 7201, + "end_line": 7205, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _____\n", + "html": "

foo _____

\n", + "example": 450, + "start_line": 7208, + "end_line": 7212, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo __\\___\n", + "html": "

foo _

\n", + "example": 451, + "start_line": 7215, + "end_line": 7219, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo __*__\n", + "html": "

foo *

\n", + "example": 452, + "start_line": 7222, + "end_line": 7226, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo_\n", + "html": "

_foo

\n", + "example": 453, + "start_line": 7229, + "end_line": 7233, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo__\n", + "html": "

foo_

\n", + "example": 454, + "start_line": 7240, + "end_line": 7244, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "___foo__\n", + "html": "

_foo

\n", + "example": 455, + "start_line": 7247, + "end_line": 7251, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo_\n", + "html": "

___foo

\n", + "example": 456, + "start_line": 7254, + "end_line": 7258, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo___\n", + "html": "

foo_

\n", + "example": 457, + "start_line": 7261, + "end_line": 7265, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo____\n", + "html": "

foo___

\n", + "example": 458, + "start_line": 7268, + "end_line": 7272, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo**\n", + "html": "

foo

\n", + "example": 459, + "start_line": 7278, + "end_line": 7282, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*_foo_*\n", + "html": "

foo

\n", + "example": 460, + "start_line": 7285, + "end_line": 7289, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__\n", + "html": "

foo

\n", + "example": 461, + "start_line": 7292, + "end_line": 7296, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_*foo*_\n", + "html": "

foo

\n", + "example": 462, + "start_line": 7299, + "end_line": 7303, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "****foo****\n", + "html": "

foo

\n", + "example": 463, + "start_line": 7309, + "end_line": 7313, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo____\n", + "html": "

foo

\n", + "example": 464, + "start_line": 7316, + "end_line": 7320, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "******foo******\n", + "html": "

foo

\n", + "example": 465, + "start_line": 7327, + "end_line": 7331, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo***\n", + "html": "

foo

\n", + "example": 466, + "start_line": 7336, + "end_line": 7340, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_____foo_____\n", + "html": "

foo

\n", + "example": 467, + "start_line": 7343, + "end_line": 7347, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo _bar* baz_\n", + "html": "

foo _bar baz_

\n", + "example": 468, + "start_line": 7352, + "end_line": 7356, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo __bar *baz bim__ bam*\n", + "html": "

foo bar *baz bim bam

\n", + "example": 469, + "start_line": 7359, + "end_line": 7363, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo **bar baz**\n", + "html": "

**foo bar baz

\n", + "example": 470, + "start_line": 7368, + "end_line": 7372, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo *bar baz*\n", + "html": "

*foo bar baz

\n", + "example": 471, + "start_line": 7375, + "end_line": 7379, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*[bar*](/url)\n", + "html": "

*bar*

\n", + "example": 472, + "start_line": 7384, + "end_line": 7388, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo [bar_](/url)\n", + "html": "

_foo bar_

\n", + "example": 473, + "start_line": 7391, + "end_line": 7395, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*\n", + "html": "

*

\n", + "example": 474, + "start_line": 7398, + "end_line": 7402, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**\n", + "html": "

**

\n", + "example": 475, + "start_line": 7405, + "end_line": 7409, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__\n", + "html": "

__

\n", + "example": 476, + "start_line": 7412, + "end_line": 7416, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*a `*`*\n", + "html": "

a *

\n", + "example": 477, + "start_line": 7419, + "end_line": 7423, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_a `_`_\n", + "html": "

a _

\n", + "example": 478, + "start_line": 7426, + "end_line": 7430, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**a\n", + "html": "

**ahttp://foo.bar/?q=**

\n", + "example": 479, + "start_line": 7433, + "end_line": 7437, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__a\n", + "html": "

__ahttp://foo.bar/?q=__

\n", + "example": 480, + "start_line": 7440, + "end_line": 7444, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "[link](/uri \"title\")\n", + "html": "

link

\n", + "example": 481, + "start_line": 7528, + "end_line": 7532, + "section": "Links" + }, + { + "markdown": "[link](/uri)\n", + "html": "

link

\n", + "example": 482, + "start_line": 7538, + "end_line": 7542, + "section": "Links" + }, + { + "markdown": "[](./target.md)\n", + "html": "

\n", + "example": 483, + "start_line": 7544, + "end_line": 7548, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

link

\n", + "example": 484, + "start_line": 7551, + "end_line": 7555, + "section": "Links" + }, + { + "markdown": "[link](<>)\n", + "html": "

link

\n", + "example": 485, + "start_line": 7558, + "end_line": 7562, + "section": "Links" + }, + { + "markdown": "[]()\n", + "html": "

\n", + "example": 486, + "start_line": 7565, + "end_line": 7569, + "section": "Links" + }, + { + "markdown": "[link](/my uri)\n", + "html": "

[link](/my uri)

\n", + "example": 487, + "start_line": 7574, + "end_line": 7578, + "section": "Links" + }, + { + "markdown": "[link](
)\n", + "html": "

link

\n", + "example": 488, + "start_line": 7580, + "end_line": 7584, + "section": "Links" + }, + { + "markdown": "[link](foo\nbar)\n", + "html": "

[link](foo\nbar)

\n", + "example": 489, + "start_line": 7589, + "end_line": 7595, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

[link]()

\n", + "example": 490, + "start_line": 7597, + "end_line": 7603, + "section": "Links" + }, + { + "markdown": "[a]()\n", + "html": "

a

\n", + "example": 491, + "start_line": 7608, + "end_line": 7612, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

[link](<foo>)

\n", + "example": 492, + "start_line": 7616, + "end_line": 7620, + "section": "Links" + }, + { + "markdown": "[a](\n[a](c)\n", + "html": "

[a](<b)c\n[a](<b)c>\n[a](c)

\n", + "example": 493, + "start_line": 7625, + "end_line": 7633, + "section": "Links" + }, + { + "markdown": "[link](\\(foo\\))\n", + "html": "

link

\n", + "example": 494, + "start_line": 7637, + "end_line": 7641, + "section": "Links" + }, + { + "markdown": "[link](foo(and(bar)))\n", + "html": "

link

\n", + "example": 495, + "start_line": 7646, + "end_line": 7650, + "section": "Links" + }, + { + "markdown": "[link](foo(and(bar))\n", + "html": "

[link](foo(and(bar))

\n", + "example": 496, + "start_line": 7655, + "end_line": 7659, + "section": "Links" + }, + { + "markdown": "[link](foo\\(and\\(bar\\))\n", + "html": "

link

\n", + "example": 497, + "start_line": 7662, + "end_line": 7666, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

link

\n", + "example": 498, + "start_line": 7669, + "end_line": 7673, + "section": "Links" + }, + { + "markdown": "[link](foo\\)\\:)\n", + "html": "

link

\n", + "example": 499, + "start_line": 7679, + "end_line": 7683, + "section": "Links" + }, + { + "markdown": "[link](#fragment)\n\n[link](http://example.com#fragment)\n\n[link](http://example.com?foo=3#frag)\n", + "html": "

link

\n

link

\n

link

\n", + "example": 500, + "start_line": 7688, + "end_line": 7698, + "section": "Links" + }, + { + "markdown": "[link](foo\\bar)\n", + "html": "

link

\n", + "example": 501, + "start_line": 7704, + "end_line": 7708, + "section": "Links" + }, + { + "markdown": "[link](foo%20bä)\n", + "html": "

link

\n", + "example": 502, + "start_line": 7720, + "end_line": 7724, + "section": "Links" + }, + { + "markdown": "[link](\"title\")\n", + "html": "

link

\n", + "example": 503, + "start_line": 7731, + "end_line": 7735, + "section": "Links" + }, + { + "markdown": "[link](/url \"title\")\n[link](/url 'title')\n[link](/url (title))\n", + "html": "

link\nlink\nlink

\n", + "example": 504, + "start_line": 7740, + "end_line": 7748, + "section": "Links" + }, + { + "markdown": "[link](/url \"title \\\""\")\n", + "html": "

link

\n", + "example": 505, + "start_line": 7754, + "end_line": 7758, + "section": "Links" + }, + { + "markdown": "[link](/url \"title\")\n", + "html": "

link

\n", + "example": 506, + "start_line": 7765, + "end_line": 7769, + "section": "Links" + }, + { + "markdown": "[link](/url \"title \"and\" title\")\n", + "html": "

[link](/url "title "and" title")

\n", + "example": 507, + "start_line": 7774, + "end_line": 7778, + "section": "Links" + }, + { + "markdown": "[link](/url 'title \"and\" title')\n", + "html": "

link

\n", + "example": 508, + "start_line": 7783, + "end_line": 7787, + "section": "Links" + }, + { + "markdown": "[link]( /uri\n \"title\" )\n", + "html": "

link

\n", + "example": 509, + "start_line": 7808, + "end_line": 7813, + "section": "Links" + }, + { + "markdown": "[link] (/uri)\n", + "html": "

[link] (/uri)

\n", + "example": 510, + "start_line": 7819, + "end_line": 7823, + "section": "Links" + }, + { + "markdown": "[link [foo [bar]]](/uri)\n", + "html": "

link [foo [bar]]

\n", + "example": 511, + "start_line": 7829, + "end_line": 7833, + "section": "Links" + }, + { + "markdown": "[link] bar](/uri)\n", + "html": "

[link] bar](/uri)

\n", + "example": 512, + "start_line": 7836, + "end_line": 7840, + "section": "Links" + }, + { + "markdown": "[link [bar](/uri)\n", + "html": "

[link bar

\n", + "example": 513, + "start_line": 7843, + "end_line": 7847, + "section": "Links" + }, + { + "markdown": "[link \\[bar](/uri)\n", + "html": "

link [bar

\n", + "example": 514, + "start_line": 7850, + "end_line": 7854, + "section": "Links" + }, + { + "markdown": "[link *foo **bar** `#`*](/uri)\n", + "html": "

link foo bar #

\n", + "example": 515, + "start_line": 7859, + "end_line": 7863, + "section": "Links" + }, + { + "markdown": "[![moon](moon.jpg)](/uri)\n", + "html": "

\"moon\"

\n", + "example": 516, + "start_line": 7866, + "end_line": 7870, + "section": "Links" + }, + { + "markdown": "[foo [bar](/uri)](/uri)\n", + "html": "

[foo bar](/uri)

\n", + "example": 517, + "start_line": 7875, + "end_line": 7879, + "section": "Links" + }, + { + "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", + "html": "

[foo [bar baz](/uri)](/uri)

\n", + "example": 518, + "start_line": 7882, + "end_line": 7886, + "section": "Links" + }, + { + "markdown": "![[[foo](uri1)](uri2)](uri3)\n", + "html": "

\"[foo](uri2)\"

\n", + "example": 519, + "start_line": 7889, + "end_line": 7893, + "section": "Links" + }, + { + "markdown": "*[foo*](/uri)\n", + "html": "

*foo*

\n", + "example": 520, + "start_line": 7899, + "end_line": 7903, + "section": "Links" + }, + { + "markdown": "[foo *bar](baz*)\n", + "html": "

foo *bar

\n", + "example": 521, + "start_line": 7906, + "end_line": 7910, + "section": "Links" + }, + { + "markdown": "*foo [bar* baz]\n", + "html": "

foo [bar baz]

\n", + "example": 522, + "start_line": 7916, + "end_line": 7920, + "section": "Links" + }, + { + "markdown": "[foo \n", + "html": "

[foo

\n", + "example": 523, + "start_line": 7926, + "end_line": 7930, + "section": "Links" + }, + { + "markdown": "[foo`](/uri)`\n", + "html": "

[foo](/uri)

\n", + "example": 524, + "start_line": 7933, + "end_line": 7937, + "section": "Links" + }, + { + "markdown": "[foo\n", + "html": "

[foohttp://example.com/?search=](uri)

\n", + "example": 525, + "start_line": 7940, + "end_line": 7944, + "section": "Links" + }, + { + "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", + "html": "

foo

\n", + "example": 526, + "start_line": 7978, + "end_line": 7984, + "section": "Links" + }, + { + "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", + "html": "

link [foo [bar]]

\n", + "example": 527, + "start_line": 7993, + "end_line": 7999, + "section": "Links" + }, + { + "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", + "html": "

link [bar

\n", + "example": 528, + "start_line": 8002, + "end_line": 8008, + "section": "Links" + }, + { + "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", + "html": "

link foo bar #

\n", + "example": 529, + "start_line": 8013, + "end_line": 8019, + "section": "Links" + }, + { + "markdown": "[![moon](moon.jpg)][ref]\n\n[ref]: /uri\n", + "html": "

\"moon\"

\n", + "example": 530, + "start_line": 8022, + "end_line": 8028, + "section": "Links" + }, + { + "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", + "html": "

[foo bar]ref

\n", + "example": 531, + "start_line": 8033, + "end_line": 8039, + "section": "Links" + }, + { + "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", + "html": "

[foo bar baz]ref

\n", + "example": 532, + "start_line": 8042, + "end_line": 8048, + "section": "Links" + }, + { + "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", + "html": "

*foo*

\n", + "example": 533, + "start_line": 8057, + "end_line": 8063, + "section": "Links" + }, + { + "markdown": "[foo *bar][ref]*\n\n[ref]: /uri\n", + "html": "

foo *bar*

\n", + "example": 534, + "start_line": 8066, + "end_line": 8072, + "section": "Links" + }, + { + "markdown": "[foo \n\n[ref]: /uri\n", + "html": "

[foo

\n", + "example": 535, + "start_line": 8078, + "end_line": 8084, + "section": "Links" + }, + { + "markdown": "[foo`][ref]`\n\n[ref]: /uri\n", + "html": "

[foo][ref]

\n", + "example": 536, + "start_line": 8087, + "end_line": 8093, + "section": "Links" + }, + { + "markdown": "[foo\n\n[ref]: /uri\n", + "html": "

[foohttp://example.com/?search=][ref]

\n", + "example": 537, + "start_line": 8096, + "end_line": 8102, + "section": "Links" + }, + { + "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", + "html": "

foo

\n", + "example": 538, + "start_line": 8107, + "end_line": 8113, + "section": "Links" + }, + { + "markdown": "[ẞ]\n\n[SS]: /url\n", + "html": "

ẞ

\n", + "example": 539, + "start_line": 8118, + "end_line": 8124, + "section": "Links" + }, + { + "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", + "html": "

Baz

\n", + "example": 540, + "start_line": 8130, + "end_line": 8137, + "section": "Links" + }, + { + "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", + "html": "

[foo] bar

\n", + "example": 541, + "start_line": 8143, + "end_line": 8149, + "section": "Links" + }, + { + "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", + "html": "

[foo]\nbar

\n", + "example": 542, + "start_line": 8152, + "end_line": 8160, + "section": "Links" + }, + { + "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", + "html": "

bar

\n", + "example": 543, + "start_line": 8193, + "end_line": 8201, + "section": "Links" + }, + { + "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", + "html": "

[bar][foo!]

\n", + "example": 544, + "start_line": 8208, + "end_line": 8214, + "section": "Links" + }, + { + "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", + "html": "

[foo][ref[]

\n

[ref[]: /uri

\n", + "example": 545, + "start_line": 8220, + "end_line": 8227, + "section": "Links" + }, + { + "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", + "html": "

[foo][ref[bar]]

\n

[ref[bar]]: /uri

\n", + "example": 546, + "start_line": 8230, + "end_line": 8237, + "section": "Links" + }, + { + "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", + "html": "

[[[foo]]]

\n

[[[foo]]]: /url

\n", + "example": 547, + "start_line": 8240, + "end_line": 8247, + "section": "Links" + }, + { + "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", + "html": "

foo

\n", + "example": 548, + "start_line": 8250, + "end_line": 8256, + "section": "Links" + }, + { + "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", + "html": "

bar\\

\n", + "example": 549, + "start_line": 8261, + "end_line": 8267, + "section": "Links" + }, + { + "markdown": "[]\n\n[]: /uri\n", + "html": "

[]

\n

[]: /uri

\n", + "example": 550, + "start_line": 8273, + "end_line": 8280, + "section": "Links" + }, + { + "markdown": "[\n ]\n\n[\n ]: /uri\n", + "html": "

[\n]

\n

[\n]: /uri

\n", + "example": 551, + "start_line": 8283, + "end_line": 8294, + "section": "Links" + }, + { + "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", + "html": "

foo

\n", + "example": 552, + "start_line": 8306, + "end_line": 8312, + "section": "Links" + }, + { + "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

foo bar

\n", + "example": 553, + "start_line": 8315, + "end_line": 8321, + "section": "Links" + }, + { + "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", + "html": "

Foo

\n", + "example": 554, + "start_line": 8326, + "end_line": 8332, + "section": "Links" + }, + { + "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", + "html": "

foo\n[]

\n", + "example": 555, + "start_line": 8339, + "end_line": 8347, + "section": "Links" + }, + { + "markdown": "[foo]\n\n[foo]: /url \"title\"\n", + "html": "

foo

\n", + "example": 556, + "start_line": 8359, + "end_line": 8365, + "section": "Links" + }, + { + "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

foo bar

\n", + "example": 557, + "start_line": 8368, + "end_line": 8374, + "section": "Links" + }, + { + "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

[foo bar]

\n", + "example": 558, + "start_line": 8377, + "end_line": 8383, + "section": "Links" + }, + { + "markdown": "[[bar [foo]\n\n[foo]: /url\n", + "html": "

[[bar foo

\n", + "example": 559, + "start_line": 8386, + "end_line": 8392, + "section": "Links" + }, + { + "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", + "html": "

Foo

\n", + "example": 560, + "start_line": 8397, + "end_line": 8403, + "section": "Links" + }, + { + "markdown": "[foo] bar\n\n[foo]: /url\n", + "html": "

foo bar

\n", + "example": 561, + "start_line": 8408, + "end_line": 8414, + "section": "Links" + }, + { + "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", + "html": "

[foo]

\n", + "example": 562, + "start_line": 8420, + "end_line": 8426, + "section": "Links" + }, + { + "markdown": "[foo*]: /url\n\n*[foo*]\n", + "html": "

*foo*

\n", + "example": 563, + "start_line": 8432, + "end_line": 8438, + "section": "Links" + }, + { + "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", + "html": "

foo

\n", + "example": 564, + "start_line": 8444, + "end_line": 8451, + "section": "Links" + }, + { + "markdown": "[foo][]\n\n[foo]: /url1\n", + "html": "

foo

\n", + "example": 565, + "start_line": 8453, + "end_line": 8459, + "section": "Links" + }, + { + "markdown": "[foo]()\n\n[foo]: /url1\n", + "html": "

foo

\n", + "example": 566, + "start_line": 8463, + "end_line": 8469, + "section": "Links" + }, + { + "markdown": "[foo](not a link)\n\n[foo]: /url1\n", + "html": "

foo(not a link)

\n", + "example": 567, + "start_line": 8471, + "end_line": 8477, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", + "html": "

[foo]bar

\n", + "example": 568, + "start_line": 8482, + "end_line": 8488, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", + "html": "

foobaz

\n", + "example": 569, + "start_line": 8494, + "end_line": 8501, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", + "html": "

[foo]bar

\n", + "example": 570, + "start_line": 8507, + "end_line": 8514, + "section": "Links" + }, + { + "markdown": "![foo](/url \"title\")\n", + "html": "

\"foo\"

\n", + "example": 571, + "start_line": 8530, + "end_line": 8534, + "section": "Images" + }, + { + "markdown": "![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 572, + "start_line": 8537, + "end_line": 8543, + "section": "Images" + }, + { + "markdown": "![foo ![bar](/url)](/url2)\n", + "html": "

\"foo

\n", + "example": 573, + "start_line": 8546, + "end_line": 8550, + "section": "Images" + }, + { + "markdown": "![foo [bar](/url)](/url2)\n", + "html": "

\"foo

\n", + "example": 574, + "start_line": 8553, + "end_line": 8557, + "section": "Images" + }, + { + "markdown": "![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 575, + "start_line": 8567, + "end_line": 8573, + "section": "Images" + }, + { + "markdown": "![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 576, + "start_line": 8576, + "end_line": 8582, + "section": "Images" + }, + { + "markdown": "![foo](train.jpg)\n", + "html": "

\"foo\"

\n", + "example": 577, + "start_line": 8585, + "end_line": 8589, + "section": "Images" + }, + { + "markdown": "My ![foo bar](/path/to/train.jpg \"title\" )\n", + "html": "

My \"foo

\n", + "example": 578, + "start_line": 8592, + "end_line": 8596, + "section": "Images" + }, + { + "markdown": "![foo]()\n", + "html": "

\"foo\"

\n", + "example": 579, + "start_line": 8599, + "end_line": 8603, + "section": "Images" + }, + { + "markdown": "![](/url)\n", + "html": "

\"\"

\n", + "example": 580, + "start_line": 8606, + "end_line": 8610, + "section": "Images" + }, + { + "markdown": "![foo][bar]\n\n[bar]: /url\n", + "html": "

\"foo\"

\n", + "example": 581, + "start_line": 8615, + "end_line": 8621, + "section": "Images" + }, + { + "markdown": "![foo][bar]\n\n[BAR]: /url\n", + "html": "

\"foo\"

\n", + "example": 582, + "start_line": 8624, + "end_line": 8630, + "section": "Images" + }, + { + "markdown": "![foo][]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"

\n", + "example": 583, + "start_line": 8635, + "end_line": 8641, + "section": "Images" + }, + { + "markdown": "![*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

\"foo

\n", + "example": 584, + "start_line": 8644, + "end_line": 8650, + "section": "Images" + }, + { + "markdown": "![Foo][]\n\n[foo]: /url \"title\"\n", + "html": "

\"Foo\"

\n", + "example": 585, + "start_line": 8655, + "end_line": 8661, + "section": "Images" + }, + { + "markdown": "![foo] \n[]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"\n[]

\n", + "example": 586, + "start_line": 8667, + "end_line": 8675, + "section": "Images" + }, + { + "markdown": "![foo]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"

\n", + "example": 587, + "start_line": 8680, + "end_line": 8686, + "section": "Images" + }, + { + "markdown": "![*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

\"foo

\n", + "example": 588, + "start_line": 8689, + "end_line": 8695, + "section": "Images" + }, + { + "markdown": "![[foo]]\n\n[[foo]]: /url \"title\"\n", + "html": "

![[foo]]

\n

[[foo]]: /url "title"

\n", + "example": 589, + "start_line": 8700, + "end_line": 8707, + "section": "Images" + }, + { + "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", + "html": "

\"Foo\"

\n", + "example": 590, + "start_line": 8712, + "end_line": 8718, + "section": "Images" + }, + { + "markdown": "!\\[foo]\n\n[foo]: /url \"title\"\n", + "html": "

![foo]

\n", + "example": 591, + "start_line": 8724, + "end_line": 8730, + "section": "Images" + }, + { + "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", + "html": "

!foo

\n", + "example": 592, + "start_line": 8736, + "end_line": 8742, + "section": "Images" + }, + { + "markdown": "\n", + "html": "

http://foo.bar.baz

\n", + "example": 593, + "start_line": 8769, + "end_line": 8773, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://foo.bar.baz/test?q=hello&id=22&boolean

\n", + "example": 594, + "start_line": 8776, + "end_line": 8780, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

irc://foo.bar:2233/baz

\n", + "example": 595, + "start_line": 8783, + "end_line": 8787, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

MAILTO:FOO@BAR.BAZ

\n", + "example": 596, + "start_line": 8792, + "end_line": 8796, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

a+b+c:d

\n", + "example": 597, + "start_line": 8804, + "end_line": 8808, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

made-up-scheme://foo,bar

\n", + "example": 598, + "start_line": 8811, + "end_line": 8815, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://../

\n", + "example": 599, + "start_line": 8818, + "end_line": 8822, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

localhost:5001/foo

\n", + "example": 600, + "start_line": 8825, + "end_line": 8829, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<http://foo.bar/baz bim>

\n", + "example": 601, + "start_line": 8834, + "end_line": 8838, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://example.com/\\[\\

\n", + "example": 602, + "start_line": 8843, + "end_line": 8847, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

foo@bar.example.com

\n", + "example": 603, + "start_line": 8865, + "end_line": 8869, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

foo+special@Bar.baz-bar0.com

\n", + "example": 604, + "start_line": 8872, + "end_line": 8876, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<foo+@bar.example.com>

\n", + "example": 605, + "start_line": 8881, + "end_line": 8885, + "section": "Autolinks" + }, + { + "markdown": "<>\n", + "html": "

<>

\n", + "example": 606, + "start_line": 8890, + "end_line": 8894, + "section": "Autolinks" + }, + { + "markdown": "< http://foo.bar >\n", + "html": "

< http://foo.bar >

\n", + "example": 607, + "start_line": 8897, + "end_line": 8901, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<m:abc>

\n", + "example": 608, + "start_line": 8904, + "end_line": 8908, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<foo.bar.baz>

\n", + "example": 609, + "start_line": 8911, + "end_line": 8915, + "section": "Autolinks" + }, + { + "markdown": "http://example.com\n", + "html": "

http://example.com

\n", + "example": 610, + "start_line": 8918, + "end_line": 8922, + "section": "Autolinks" + }, + { + "markdown": "foo@bar.example.com\n", + "html": "

foo@bar.example.com

\n", + "example": 611, + "start_line": 8925, + "end_line": 8929, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 612, + "start_line": 9006, + "end_line": 9010, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 613, + "start_line": 9015, + "end_line": 9019, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 614, + "start_line": 9024, + "end_line": 9030, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 615, + "start_line": 9035, + "end_line": 9041, + "section": "Raw HTML" + }, + { + "markdown": "Foo \n", + "html": "

Foo

\n", + "example": 616, + "start_line": 9046, + "end_line": 9050, + "section": "Raw HTML" + }, + { + "markdown": "<33> <__>\n", + "html": "

<33> <__>

\n", + "example": 617, + "start_line": 9055, + "end_line": 9059, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a h*#ref="hi">

\n", + "example": 618, + "start_line": 9064, + "end_line": 9068, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a href="hi'> <a href=hi'>

\n", + "example": 619, + "start_line": 9073, + "end_line": 9077, + "section": "Raw HTML" + }, + { + "markdown": "< a><\nfoo>\n\n", + "html": "

< a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop />

\n", + "example": 620, + "start_line": 9082, + "end_line": 9092, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a href='bar'title=title>

\n", + "example": 621, + "start_line": 9097, + "end_line": 9101, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

\n", + "example": 622, + "start_line": 9106, + "end_line": 9110, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

</a href="foo">

\n", + "example": 623, + "start_line": 9115, + "end_line": 9119, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 624, + "start_line": 9124, + "end_line": 9130, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo <!-- not a comment -- two hyphens -->

\n", + "example": 625, + "start_line": 9133, + "end_line": 9137, + "section": "Raw HTML" + }, + { + "markdown": "foo foo -->\n\nfoo \n", + "html": "

foo <!--> foo -->

\n

foo <!-- foo--->

\n", + "example": 626, + "start_line": 9142, + "end_line": 9149, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 627, + "start_line": 9154, + "end_line": 9158, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 628, + "start_line": 9163, + "end_line": 9167, + "section": "Raw HTML" + }, + { + "markdown": "foo &<]]>\n", + "html": "

foo &<]]>

\n", + "example": 629, + "start_line": 9172, + "end_line": 9176, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 630, + "start_line": 9182, + "end_line": 9186, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 631, + "start_line": 9191, + "end_line": 9195, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

<a href=""">

\n", + "example": 632, + "start_line": 9198, + "end_line": 9202, + "section": "Raw HTML" + }, + { + "markdown": "foo \nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 633, + "start_line": 9212, + "end_line": 9218, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 634, + "start_line": 9224, + "end_line": 9230, + "section": "Hard line breaks" + }, + { + "markdown": "foo \nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 635, + "start_line": 9235, + "end_line": 9241, + "section": "Hard line breaks" + }, + { + "markdown": "foo \n bar\n", + "html": "

foo
\nbar

\n", + "example": 636, + "start_line": 9246, + "end_line": 9252, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\n bar\n", + "html": "

foo
\nbar

\n", + "example": 637, + "start_line": 9255, + "end_line": 9261, + "section": "Hard line breaks" + }, + { + "markdown": "*foo \nbar*\n", + "html": "

foo
\nbar

\n", + "example": 638, + "start_line": 9267, + "end_line": 9273, + "section": "Hard line breaks" + }, + { + "markdown": "*foo\\\nbar*\n", + "html": "

foo
\nbar

\n", + "example": 639, + "start_line": 9276, + "end_line": 9282, + "section": "Hard line breaks" + }, + { + "markdown": "`code \nspan`\n", + "html": "

code span

\n", + "example": 640, + "start_line": 9287, + "end_line": 9292, + "section": "Hard line breaks" + }, + { + "markdown": "`code\\\nspan`\n", + "html": "

code\\ span

\n", + "example": 641, + "start_line": 9295, + "end_line": 9300, + "section": "Hard line breaks" + }, + { + "markdown": "
\n", + "html": "

\n", + "example": 642, + "start_line": 9305, + "end_line": 9311, + "section": "Hard line breaks" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 643, + "start_line": 9314, + "end_line": 9320, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\n", + "html": "

foo\\

\n", + "example": 644, + "start_line": 9327, + "end_line": 9331, + "section": "Hard line breaks" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 645, + "start_line": 9334, + "end_line": 9338, + "section": "Hard line breaks" + }, + { + "markdown": "### foo\\\n", + "html": "

foo\\

\n", + "example": 646, + "start_line": 9341, + "end_line": 9345, + "section": "Hard line breaks" + }, + { + "markdown": "### foo \n", + "html": "

foo

\n", + "example": 647, + "start_line": 9348, + "end_line": 9352, + "section": "Hard line breaks" + }, + { + "markdown": "foo\nbaz\n", + "html": "

foo\nbaz

\n", + "example": 648, + "start_line": 9363, + "end_line": 9369, + "section": "Soft line breaks" + }, + { + "markdown": "foo \n baz\n", + "html": "

foo\nbaz

\n", + "example": 649, + "start_line": 9375, + "end_line": 9381, + "section": "Soft line breaks" + }, + { + "markdown": "hello $.;'there\n", + "html": "

hello $.;'there

\n", + "example": 650, + "start_line": 9395, + "end_line": 9399, + "section": "Textual content" + }, + { + "markdown": "Foo χρῆν\n", + "html": "

Foo χρῆν

\n", + "example": 651, + "start_line": 9402, + "end_line": 9406, + "section": "Textual content" + }, + { + "markdown": "Multiple spaces\n", + "html": "

Multiple spaces

\n", + "example": 652, + "start_line": 9411, + "end_line": 9415, + "section": "Textual content" + } +] \ No newline at end of file diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/def_list.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/def_list.txt new file mode 100644 index 0000000000000000000000000000000000000000..6c5a210232576e53330d55888c2d041ffeccc145 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/def_list.txt @@ -0,0 +1,172 @@ +# Definition Lists + +```````````````````````````````` example +Term +: definition +. +
+
Term
+
definition
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: definition1 +: definition2 +. +
+
Term
+
definition1
+
definition2
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: definition1 +: definition2 + +paragraph +. +
+
Term
+
definition1
+
definition2
+
+

paragraph

+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. + +Second Term +: This is one definition of the second term. +: This is another definition of the second term. +. +
+
First Term
+
This is the definition of the first term.
+
Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. + +Second Term +: This is one definition of the second term. +: This is another definition of the second term. + +paragraph +. +
+
First Term
+
This is the definition of the first term.
+
Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+

paragraph

+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. +Not Second Term +: This is one definition of the second term. +: This is another definition of the second term. + +paragraph +. +
+
First Term
+
This is the definition of the first term. +Not Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+

paragraph

+```````````````````````````````` + +## Definition with Multiple Lines + +```````````````````````````````` example +Term + +: definition +. +
+
Term
+

definition

+
+
+```````````````````````````````` + + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+

bar

+
+
+```````````````````````````````` + +Leading 4 white spaces + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+

bar

+
+
+```````````````````````````````` + + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+
bar
+
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: foo + + - bar + - baz +. +
+
Term
+

foo

+
    +
  • bar
  • +
  • baz
  • +
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/diff-commonmark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/diff-commonmark.txt new file mode 100644 index 0000000000000000000000000000000000000000..9573e2a383b273af5db4a2386d9f9fe35120d9b4 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/diff-commonmark.txt @@ -0,0 +1,76 @@ +# Differences + +Results different than commonmark. + + +## Setext headings + + +Example: 93 + + +```````````````````````````````` example +> foo +bar +=== +. +
+

foo +bar

+
+```````````````````````````````` + +If the dash is less than 3, it is not a `
`, in this case, it +can be rendered into `

`. + +```````````````````````````````` example +- # Foo +- Bar + -- + baz +. +
    +
  • +

    Foo

    +
  • +
  • +

    Bar

    +baz
  • +
+```````````````````````````````` + +## Image + +Example 573 + +```````````````````````````````` example +![foo ![bar](/url)](/url2) +. +

foo ![bar](/url)

+```````````````````````````````` + +## Link + +Example 517 + +```````````````````````````````` example +[foo [bar](/uri)](/uri) +. +

foo [bar](/uri)

+```````````````````````````````` + +Example 518 + +```````````````````````````````` example +[foo *[bar [baz](/uri)](/uri)*](/uri) +. +

foo [bar [baz](/uri)](/uri)

+```````````````````````````````` + +Example 519 + +```````````````````````````````` example +![[[foo](uri1)](uri2)](uri3) +. +

[foo](uri1)

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_admonition.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_admonition.txt new file mode 100644 index 0000000000000000000000000000000000000000..0f962c5e4d44d9fa81effe866998e1fc6f88565d --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_admonition.txt @@ -0,0 +1,129 @@ +# Admonition + +```````````````````````````````` example +```{unknown} Hi + +this is **strong** world +``` +. +
{unknown} Hi
+
+this is **strong** world
+
+```````````````````````````````` + +```````````````````````````````` example +``` +this is code +``` +. +
this is code
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{note} Warning + +message +~~~ +. +
+

Warning

+

message

+
+```````````````````````````````` + +```````````````````````````````` example +~~~{note} A **strong** title + +_message_ +~~~ +. +
+

A strong title

+

message

+
+```````````````````````````````` + +Test with code block. + +```````````````````````````````` example +```{note} + + print() +``` +. +
+

Note

+
print()
+
+```````````````````````````````` + +Test with no message. + +```````````````````````````````` example +~~~{note} Warning +~~~ +. +
+

Warning

+
+```````````````````````````````` + +Test with no ending fence + +```````````````````````````````` example +~~~{note} Warning +. +
+

Warning

+
+```````````````````````````````` + +Test with nested admonition + +```````````````````````````````` example +~~~~~~~{note} +~~~~~~{warning} +~~~~~{tip} +~~~~{caution} +~~~{hint} +``````{danger} +`````{attention} +````{important} +```{error} +``` +```` +````` +`````` +~~~ +~~~~ +~~~~~ +~~~~~~ +~~~~~~~ +. +
+

Note

+
+

Warning

+
+

Tip

+
+

Caution

+
+

Hint

+
+

Danger

+
````{important}
+```{error}
+```
+````
+
+
+
+
+
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_figure.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_figure.txt new file mode 100644 index 0000000000000000000000000000000000000000..0fcd23c1f1280e6e9b17a43fbb8942d21b702254 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_figure.txt @@ -0,0 +1,166 @@ +# Figure + +## No options + +```````````````````````````````` example +~~~{figure} picture.png +~~~ +. +
+
+
+```````````````````````````````` + +## Align options + +```````````````````````````````` example +~~~{figure} picture.png +:align: left +~~~ +. +
+
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{figure} picture.png +:align: invalid +~~~ +. +
+
+
+```````````````````````````````` + +## width and height + +```````````````````````````````` example +~~~{figure} picture.png +:width: 100 +:height: 50 +~~~ +. +
+
+
+```````````````````````````````` + +```````````````````````````````` example +~~~{figure} picture.png +:width: 100px +:height: 50px +~~~ +. +
+
+
+```````````````````````````````` + +```````````````````````````````` example +~~~{figure} picture.png +:figwidth: 400px +~~~ +. +
+
+
+```````````````````````````````` + +## alt option + +```````````````````````````````` example +~~~{figure} picture.png +:alt: description text +~~~ +. +
+
description text
+
+```````````````````````````````` + +## target option + +```````````````````````````````` example +~~~{figure} picture.png +:target: https://lepture.com +~~~ +. +
+ +
+```````````````````````````````` + +## caption + +```````````````````````````````` example +~~~{figure} picture.png +a caption with **emphasis** text +~~~ +. +
+
+
a caption with emphasis text
+
+```````````````````````````````` + +## legend + +```````````````````````````````` example +~~~{figure} picture.png +a caption with **emphasis** text + +> quote +~~~ +. +
+
+
a caption with emphasis text
+
+
+

quote

+
+
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{figure} picture.png +> quote +~~~ +. +
+
+
+```````````````````````````````` + +## all options + + +```````````````````````````````` example +~~~{figure} picture.png +:figwidth: 400px +:figclass: all-options +:target: https://lepture.com +:alt: description +:align: left +:width: 100 +:height: 50 + +a caption with **emphasis** text + +> quote +~~~ +. +
+description +
a caption with emphasis text
+
+
+

quote

+
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_image.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_image.txt new file mode 100644 index 0000000000000000000000000000000000000000..afec622ce413acb5fcbb287e020c4588e892de8c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_image.txt @@ -0,0 +1,102 @@ +# Image + +## No options + +```````````````````````````````` example +~~~{image} picture.png +~~~ +. +
+```````````````````````````````` + +## Align options + +```````````````````````````````` example +~~~{image} picture.png +:align: left +~~~ +. +
+```````````````````````````````` + + +```````````````````````````````` example +~~~{image} picture.png +:align: invalid +~~~ +. +
+```````````````````````````````` + +## width and height + +```````````````````````````````` example +~~~{image} picture.png +:width: 100 +:height: 50 +~~~ +. +
+```````````````````````````````` + +```````````````````````````````` example +~~~{image} picture.png +:width: 100px +:height: 50px +~~~ +. +
+```````````````````````````````` + +## alt option + +```````````````````````````````` example +~~~{image} picture.png +:alt: description text +~~~ +. +
description text
+```````````````````````````````` + +## target option + +```````````````````````````````` example +~~~{image} picture.png +:target: https://lepture.com +~~~ +. + +```````````````````````````````` + +## all options + +```````````````````````````````` example +~~~{image} picture.png +:target: https://lepture.com +:alt: description +:align: left +:width: 100 +:height: 50 +~~~ +. +description +```````````````````````````````` + +## ampersand in source + +```````````````````````````````` example +~~~{image} https://example.com/picture.png?foo=qux&test=me +~~~ +. +
+```````````````````````````````` + +## ampersand in target + +```````````````````````````````` example +~~~{image} picture.png +:target: https://example.com/rickroll?a=1&b=2 +~~~ +. + +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..1744000ce6ca473d1d75fb2d9388d46d3463a64c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fenced_toc.txt @@ -0,0 +1,237 @@ +# Table of Contents + +## No TOC + +```````````````````````````````` example +none +. +

none

+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +. +

H1

+

H2

+```````````````````````````````` + + +## Simple TOC + +```````````````````````````````` example +~~~{toc} +~~~ + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` + +## Invalid Option + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:max-level: s +~~~ +. +

H1

+

H2

+
"max-level" option MUST be integer
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:max-level: 9 +~~~ +. +

H1

+

H2

+
"max-level" option MUST be <= 3
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:min-level: 2 +:max-level: 1 +~~~ +. +

H1

+

H2

+
"min-level" option MUST be less than "max-level" option
+```````````````````````````````` + +## Complex + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` + +```{toc} Contents +``` +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+
+Contents + +
+```````````````````````````````` + +## Insane + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B + +```{toc} +``` +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+
+Table of Contents + +
+```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 + +```{toc} +``` +. +

H3

+

H2

+

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) + +```{toc} +``` +. +

foo

+
+Table of Contents + +
+```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +```{toc} +``` +. +

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Collapse TOC + +```````````````````````````````` example + +```{toc} +:collapse: +``` + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fix-commonmark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fix-commonmark.txt new file mode 100644 index 0000000000000000000000000000000000000000..c7870065cc61e07f114050eaaecf60d3db5cbdf9 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/fix-commonmark.txt @@ -0,0 +1,123 @@ +Fix problems that commonmark has. + + +## Links + +Links can't contain links. + +```````````````````````````````` example +[](/foo) +. +

<https://example.com>

+```````````````````````````````` + +```````````````````````````````` example +[](/foo) +. +

<name@example.com>

+```````````````````````````````` + +## Emphasis + +`` doesn't contain ``, `` doesn't contain ``. + +```````````````````````````````` example +*_em_* __**strong**__ ______m______ +. +

_em_ **strong** ______m______

+```````````````````````````````` + +### Non aggressive emphasis + +```````````````````````````````` example +*a **b c* d** +. +

a **b c d**

+```````````````````````````````` + +While CommonMark would render it into: + +``` +

a b c d

+``` + +```````````````````````````````` example +*a **b c* d** +. +

a **b c d**

+```````````````````````````````` + +While CommonMark would render it into: + +``` +

a b c d

+``` + +What if the string is: + +```````````````````````````````` example +*a **b c* d +. +

a **b c d

+```````````````````````````````` + +CommonMark would still be a mess: + +``` +

*a *b c d

+``` + + +## Max depth + + +```````````````````````````````` example +> > > > > > > > b +. +
+
+
+
+
+
+

> > b

+
+
+
+
+
+
+```````````````````````````````` + + +```````````````````````````````` example +- a + - b + - c + - d + - e + - f + - g + - h +. +
    +
  • a
      +
    • b
        +
      • c
          +
        • d
            +
          • e
              +
            • f +- g +- h
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/footnotes.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/footnotes.txt new file mode 100644 index 0000000000000000000000000000000000000000..485cfd87c0a18859af15ec52b8baacad5c44fe6c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/footnotes.txt @@ -0,0 +1,45 @@ +# Footnotes + +```````````````````````````````` example +none [^1] +. +

none [^1]

+```````````````````````````````` + +```````````````````````````````` example +oneline [^1] + +[^1]: foo +. +

oneline 1

+
+
    +
  1. foo↩

  2. +
+
+```````````````````````````````` + +```````````````````````````````` example +multiple lines [^1] + +[^1]: foo + + one + + two + + three + + four +. +

multiple lines 1

+
four
+
+
    +
  1. foo

    +

    one

    +

    two

    +

    three↩

  2. +
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/hook_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/hook_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..62a1a1ec79dacaf8854a67e3b48f5a1c1e9d2f4b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/hook_toc.txt @@ -0,0 +1,122 @@ +# Table of Contents + +## Simple TOC + +```````````````````````````````` example +# H1 + +content + +## H2 +. +

H1

+

content

+

H2

+ +```````````````````````````````` + +## Complex TOC + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+ +```````````````````````````````` + +## Insane TOC + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+ +```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 +. +

H3

+

H2

+

H1

+ +```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) +. +

foo

+ +```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +. +

H1

+ +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/hello.md b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/hello.md new file mode 100644 index 0000000000000000000000000000000000000000..5e3d2769d88dd761efbd358b5dd0cb095d652294 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/hello.md @@ -0,0 +1 @@ +> hello diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/hello.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/hello.txt new file mode 100644 index 0000000000000000000000000000000000000000..ce013625030ba8dba906f756967f9e9ca394464a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/hello.txt @@ -0,0 +1 @@ +hello diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/text.html b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/text.html new file mode 100644 index 0000000000000000000000000000000000000000..da12a4c59bef8e4cc80b93ee6c98ebf6e9a10372 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/text.html @@ -0,0 +1 @@ +
include html
diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/text.md b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/text.md new file mode 100644 index 0000000000000000000000000000000000000000..e9faa6cc816e06f743ffb9a1ae753a209607840e --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/include/text.md @@ -0,0 +1,12 @@ +# Include + +.. include:: ./text.md + +.. include:: ./not-exist.md + +.. include:: ./text.html + :encoding: utf-8 + +.. include:: ./hello.md + +.. include:: ../rst_toc.txt diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/insert.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/insert.txt new file mode 100644 index 0000000000000000000000000000000000000000..74d02058f0a66e5598e91d8a84429d17b7c4b62a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/insert.txt @@ -0,0 +1,62 @@ +# Insert + +```````````````````````````````` example +^^insert me +. +

^^insert me

+```````````````````````````````` + + +## normal insert + +```````````````````````````````` example +^^insert me^^ +. +

insert me

+```````````````````````````````` + +```````````````````````````````` example +foo ^^insert me^^ +. +

foo insert me

+```````````````````````````````` + +```````````````````````````````` example +^^insert me^^foo +. +

insert mefoo

+```````````````````````````````` + +```````````````````````````````` example +^^insert me^^^ +. +

^^insert me^^^

+```````````````````````````````` + +## escape insert + +```````````````````````````````` example +^^insert me\^^^ +. +

insert me^

+```````````````````````````````` + +```````````````````````````````` example +^^insert \^\^ me^^ +. +

insert ^^ me

+```````````````````````````````` + +## insert link + +```````````````````````````````` example +^^insert [me^^](/) +. +

insert [me](/)

+```````````````````````````````` + +```````````````````````````````` example +^^[hello](/)^^ +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/mark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/mark.txt new file mode 100644 index 0000000000000000000000000000000000000000..9c8d2fbc1bf286f937a2ed288f5d497bcfca2136 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/mark.txt @@ -0,0 +1,61 @@ +# Mark + +```````````````````````````````` example +==mark me +. +

==mark me

+```````````````````````````````` + +## normal mark + +```````````````````````````````` example +==mark me== +. +

mark me

+```````````````````````````````` + +```````````````````````````````` example +foo ==mark me== +. +

foo mark me

+```````````````````````````````` + +```````````````````````````````` example +==mark me==foo +. +

mark mefoo

+```````````````````````````````` + +```````````````````````````````` example +==mark me=== +. +

==mark me===

+```````````````````````````````` + +## escape mark + +```````````````````````````````` example +==mark me\=== +. +

mark me=

+```````````````````````````````` + +```````````````````````````````` example +==mark \=\= me== +. +

mark == me

+```````````````````````````````` + +## mark link + +```````````````````````````````` example +==mark [me==](/) +. +

mark [me](/)

+```````````````````````````````` + +```````````````````````````````` example +==[hello](/)== +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/math.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/math.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7afaf9d1d2757c25e797b47ef4803bdeee503ef --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/math.txt @@ -0,0 +1,57 @@ +# Math + +## Block Math + +```````````````````````````````` example +$$ +. +

$$

+```````````````````````````````` + + +```````````````````````````````` example +$$ +\operatorname{ker} f=\{g\in G:f(g)=e_{H}\}{\mbox{.}} +$$ +. +
$$ +\operatorname{ker} f=\{g\in G:f(g)=e_{H}\}{\mbox{.}} +$$
+```````````````````````````````` + +```````````````````````````````` example +$$ +foo +$$ +bar +. +
$$ +foo +$$
+

bar

+```````````````````````````````` + +```````````````````````````````` example +$$ +foo +bar +$$ +. +
$$ +foo +bar +$$
+```````````````````````````````` + + +## Inline Math + +```````````````````````````````` example +The homomorphism $f$ is injective if and only if its kernel is only the +singleton set $e_G$, because otherwise $\exists a,b\in G$ +with $a\neq b$ such that $f(a)=f(b)$. +. +

The homomorphism \(f\) is injective if and only if its kernel is only the +singleton set \(e_G\), because otherwise \(\exists a,b\in G\) +with \(a\neq b\) such that \(f(a)=f(b)\).

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/renderer_markdown.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/renderer_markdown.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd618f9f281f83c0e5f2f51bcb19080e4188011a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/renderer_markdown.txt @@ -0,0 +1,299 @@ +# MarkdownRenderer + + +## inline + +```````````````````````````````` example +this is _em_, **strong**, and `code` +. +this is *em*, **strong**, and `code` +```````````````````````````````` + +## links + +```````````````````````````````` example +[link], [link][], [text][link], [link](/foo), [link](/foo "title") + +[link]: /url +. +[link][link], [link][link], [text][link], [link](/foo), [link](/foo "title") + +[link]: /url +```````````````````````````````` + +```````````````````````````````` example +[link], [link](https://foo(bar "title") + +[link]: /url "title" +. +[link][link], [link]( "title") + +[link]: /url "title" +```````````````````````````````` + +```````````````````````````````` example +[https://lepture.com](https://lepture.com) + + + + [demo@example.com](mailto:demo@example.com) +. + + + + + +```````````````````````````````` + +## images + +```````````````````````````````` example +[link]: /url + +![link], ![link][], ![alt][link] +. +![link][link], ![link][link], ![alt][link] + +[link]: /url +```````````````````````````````` + +## linebreak + +```````````````````````````````` example +foo\ +bar +. +foo +bar +```````````````````````````````` + +## html + +```````````````````````````````` example +inline html text + +and block html + +
hi
+. +inline html text + +and block html + +
hi
+```````````````````````````````` + +## heading + +```````````````````````````````` example +# h1 +## h2 +### h3 +#### h4 +##### h5 +###### h6 + +h1 +== +. +# h1 + +## h2 + +### h3 + +#### h4 + +##### h5 + +###### h6 + +# h1 +```````````````````````````````` + +## thematic break + +```````````````````````````````` example +hi +*** +. +hi + +*** +```````````````````````````````` + +## code + +```````````````````````````````` example +start + + def foo(): + pass + +end +. +start + +``` +def foo(): + pass +``` + +end +```````````````````````````````` + +```````````````````````````````` example +start +```py +def foo(): + pass +``` +end +. +start + +```py +def foo(): + pass +``` + +end +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ``` + fenced +. +indent code + +~~~ +markdown +``` +fenced +~~~ +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ~~~ + fenced +. +indent code + +``` +markdown +~~~ +fenced +``` +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ``` + fenced + ~~~ +. +indent code + +```` +markdown +``` +fenced +~~~ +```` +```````````````````````````````` + + +## quote + +```````````````````````````````` example +> quote +. +> quote +```````````````````````````````` + +```````````````````````````````` example +hello +> quote +. +hello + +> quote +```````````````````````````````` + +> quote + +> quote +> +> continuation +. +> quote + +> quote +> +> continuation + +## list + +```````````````````````````````` example +- list ++ list +. +- list + ++ list +```````````````````````````````` + +```````````````````````````````` example +- item 1 + item 2 +. +- item 1 + item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + item 2 +- item 3 +. +- item 1 + + item 2 + +- item 3 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + 1. item 2 +. +- item 1 + 1. item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + 2. item 2 +. +- item 1 + + 2. item 2 +```````````````````````````````` + +```````````````````````````````` example +- list +- +. +- list +- +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/renderer_rst.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/renderer_rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..1b2499ddb74fc532191d296612fd19687224ec5b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/renderer_rst.txt @@ -0,0 +1,250 @@ +# RSTRenderer + +## inline + +```````````````````````````````` example +this is _em_, **strong**, and `code` +. +this is *em*, **strong**, and ``code`` +```````````````````````````````` + +```````````````````````````````` example +| escape | +. +\| escape \| +```````````````````````````````` + +## links + +```````````````````````````````` example +this is [link][] and [link](/foo) + +[link]: /url +. +this is `link
`__ and `link `__ +```````````````````````````````` + +## images + +```````````````````````````````` example +this is inline ![alt _text_](/foo) +. +this is inline |img-0| + +.. |img-0| image:: /foo + :alt: alt *text* +```````````````````````````````` + +```````````````````````````````` example +this is figure + +![alt _text_](/foo) +. +this is figure + +.. figure:: /foo + + alt *text* +```````````````````````````````` + +```````````````````````````````` example +this is figure + +![alt _text_](/foo "title") +. +this is figure + +.. figure:: /foo + :alt: title + + alt *text* +```````````````````````````````` + + +## html + +```````````````````````````````` example +ignore inline html text + +but show block html + +
hi
+. +ignore inline html text + +but show block html + +.. raw:: html + +
hi
+```````````````````````````````` + +## line break + +```````````````````````````````` example +hello +world +. +| hello +| world +```````````````````````````````` + +## heading + +```````````````````````````````` example +# h1 +## h2 +### h3 +#### h4 +##### h5 +###### h6 +. +h1 +== + +h2 +-- + +h3 +~~ + +h4 +^^ + +h5 +"" + +h6 +'' +```````````````````````````````` + +## thematic break + +```````````````````````````````` example +hi +*** +. +hi + +-------------- +```````````````````````````````` + +## code + +```````````````````````````````` example +start + + def foo(): + pass + +end +. +start + +:: + + def foo(): + pass + +end +```````````````````````````````` + +```````````````````````````````` example +start + +```py +def foo(): + pass +``` + +end +. +start + +.. code:: py + + def foo(): + pass + +end +```````````````````````````````` + + +## quote + +```````````````````````````````` example +> quote +. + quote +```````````````````````````````` + +```````````````````````````````` example +hello + +> quote +. +hello + + quote +```````````````````````````````` + +```````````````````````````````` example +> hello + +> quote +. + hello + +.. + + quote +```````````````````````````````` + +## list + +```````````````````````````````` example +- list ++ list +. +- list + ++ list +```````````````````````````````` + +```````````````````````````````` example +- item 1 + item 2 +. +- item 1 item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + item 2 +- item 3 +. +- item 1 + + item 2 + +- item 3 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + 1. item 2 +. +- item 1 + 1. item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + 1. item 2 +. +- item 1 + + 1. item 2 +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/rst_admonition.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/rst_admonition.txt new file mode 100644 index 0000000000000000000000000000000000000000..b29bda3046fdb97802fefc9a7d16a9439d9efeb6 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/rst_admonition.txt @@ -0,0 +1,46 @@ +# Admonition + +```````````````````````````````` example +.. hello:: Warning + + message +. +
..  hello:: Warning
+
+    message
+
+```````````````````````````````` + +```````````````````````````````` example +.. note:: Warning + + message +. +
+

Warning

+

message

+
+```````````````````````````````` + +Test with code block. + +```````````````````````````````` example +.. note:: + + print() +. +
+

Note

+
print()
+
+```````````````````````````````` + +Test with no message. + +```````````````````````````````` example +.. note:: Warning +. +
+

Warning

+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/rst_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/rst_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..d65e7516398316de9532f5f52cd0ccfe182b86f1 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/rst_toc.txt @@ -0,0 +1,223 @@ +# Table of Contents + +## No TOC + +```````````````````````````````` example +none +. +

none

+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +. +

H1

+

H2

+```````````````````````````````` + + +## Simple TOC + +```````````````````````````````` example +.. toc:: + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` + +## Invalid Option + +```````````````````````````````` example +# H1 +## H2 + +.. toc:: + :max-level: s +. +

H1

+

H2

+
"max-level" option MUST be integer
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +.. toc:: + :max-level: 9 +. +

H1

+

H2

+
"max-level" option MUST be <= 3
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +.. toc:: + :min-level: 2 + :max-level: 1 +. +

H1

+

H2

+
"min-level" option MUST be less than "max-level" option
+```````````````````````````````` + + +## Complex + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` + +.. toc:: Contents + :max-level: 3 +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+
+Contents + +
+```````````````````````````````` + +## Insane + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B +.. toc:: +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+
+Table of Contents + +
+```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 +.. toc:: +. +

H3

+

H2

+

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) +.. toc:: +. +

foo

+
+Table of Contents + +
+```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +.. toc:: +. +

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Collapse TOC + +```````````````````````````````` example +.. toc:: + :collapse: + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/ruby.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/ruby.txt new file mode 100644 index 0000000000000000000000000000000000000000..d89ebe28e1161ec3915768d72303feaa168f3c63 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/ruby.txt @@ -0,0 +1,64 @@ +# Ruby + + +## ruby without link + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)] +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢(ㄏㄢˋ)字(ㄗˋ)] +. +

漢ㄏㄢˋ字ㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)][] +. +

漢字ㄏㄢˋㄗˋ[]

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)][link] +. +

漢字ㄏㄢˋㄗˋ[link]

+```````````````````````````````` + +## ruby with link + +```````````````````````````````` example +[link]: /url + +[漢字(ㄏㄢˋㄗˋ)][link] +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)]() +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)](/url) +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +## ruby splits + +```````````````````````````````` example +[漢(かん)][字(じ)] +. +

漢かん字じ

+```````````````````````````````` + +```````````````````````````````` example +[[漢(かん)][字(じ)]](https://jisho.org/search/漢字) +. +

漢かん字じ

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/spoiler.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/spoiler.txt new file mode 100644 index 0000000000000000000000000000000000000000..b1394193004aa9a896ac9212dcab200818613506 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/spoiler.txt @@ -0,0 +1,74 @@ +# Spoiler + +## Block spoiler + +```````````````````````````````` example +>! hi +. +
+

hi

+
+```````````````````````````````` + + +```````````````````````````````` example +>! not +> spoiler +. +
+

! not +spoiler

+
+```````````````````````````````` + +```````````````````````````````` example +>! multiple +>! lines +. +
+

multiple +lines

+
+```````````````````````````````` + +```````````````````````````````` example +>! foo +>! +>! bar +. +
+

foo

+

bar

+
+```````````````````````````````` + +```````````````````````````````` example +>! foo +> +>! bar +. +
+

! foo

+

! bar

+
+```````````````````````````````` + +## Inline spoiler + +```````````````````````````````` example +hi >! hide !< +. +

hi hide

+```````````````````````````````` + +```````````````````````````````` example +hi >!hide !< +. +

hi hide

+```````````````````````````````` + +```````````````````````````````` example +hi >!hide!< +. +

hi hide

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/strikethrough.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/strikethrough.txt new file mode 100644 index 0000000000000000000000000000000000000000..007a7777aefe1f68e20026c6d87675a12623f1b8 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/strikethrough.txt @@ -0,0 +1,46 @@ +# Strikethrough + + +## strikethrough + +```````````````````````````````` example +~~delete me +. +

~~delete me

+```````````````````````````````` + +```````````````````````````````` example +~~delete me~~ +. +

delete me

+```````````````````````````````` + +```````````````````````````````` example +~~delete me~~~ +. +

~~delete me~~~

+```````````````````````````````` + +```````````````````````````````` example +~~delete me\~~~ +. +

delete me~

+```````````````````````````````` + +```````````````````````````````` example +~~delete \~\~ me~~ +. +

delete ~~ me

+```````````````````````````````` + +```````````````````````````````` example +~~delete [me~~](/) +. +

delete [me](/)

+```````````````````````````````` + +```````````````````````````````` example +~~[hello](/)~~ +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/subscript.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/subscript.txt new file mode 100644 index 0000000000000000000000000000000000000000..9e4ef8bad50771b18039cd681d91d51c203128aa --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/subscript.txt @@ -0,0 +1,26 @@ +# Subscript + + +```````````````````````````````` example +CH~3~CH~2~OH +. +

CH3CH2OH

+```````````````````````````````` + +```````````````````````````````` example +text~a\ subscript~ +. +

texta subscript

+```````````````````````````````` + +```````````````````````````````` example +text~a subscript~ +. +

text~a subscript~

+```````````````````````````````` + +```````````````````````````````` example +text~a\~subscript~ +. +

texta~subscript

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/superscript.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/superscript.txt new file mode 100644 index 0000000000000000000000000000000000000000..8f114ca8c9566ddfd1d2800341f2065ded0ad560 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/superscript.txt @@ -0,0 +1,26 @@ +# Superscript + + +```````````````````````````````` example +CH^3^CH^2^OH +. +

CH3CH2OH

+```````````````````````````````` + +```````````````````````````````` example +text^a\ supscript^ +. +

texta supscript

+```````````````````````````````` + +```````````````````````````````` example +text^a supscript^ +. +

text^a supscript^

+```````````````````````````````` + +```````````````````````````````` example +text^a\^supscript^ +. +

texta^supscript

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/table.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/table.txt new file mode 100644 index 0000000000000000000000000000000000000000..ff4e13ae743b2733f0174cca08c10da2a9b6f1f1 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/table.txt @@ -0,0 +1,258 @@ +# Table in Markdown + +https://michelf.ca/projects/php-markdown/extra/#table + + +## nptable + + +```````````````````````````````` example +First Header | Second Header +------------- | ------------- +Content Cell | Content Cell +Content Cell | Content Cell +. + + + + + + + + + + + + + + + + + +
First HeaderSecond Header
Content CellContent Cell
Content CellContent Cell
+```````````````````````````````` + + +## table + +```````````````````````````````` example +| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell | +. + + + + + + + + + + + + + + + + + +
First HeaderSecond Header
Content Cell
Content CellContent Cell
+```````````````````````````````` + + +```````````````````````````````` example +| Command | Description | +| --- | --- | +| git status | List all new or modified files | +| git diff | Show file differences that haven't been staged | +. + + + + + + + + + + + + + + + + + +
CommandDescription
git statusList all new or modified files
git diffShow file differences that haven't been staged
+```````````````````````````````` + +## align table + +```````````````````````````````` example + Left | Center | Right +:---- | :--------: | ------: + a | b | c +. + + + + + + + + + + + + + + + +
LeftCenterRight
abc
+```````````````````````````````` + +```````````````````````````````` example +| Left | Center | Right | +| :--- | :----: | ----: | +| a | b | c | +. + + + + + + + + + + + + + + + +
LeftCenterRight
abc
+```````````````````````````````` + +## Misc Table + +```````````````````````````````` example +| A | | +| - | | +| a | b | +. + + + + + + + + + + + + + +
A
ab
+```````````````````````````````` + +```````````````````````````````` example +A | +- | +a | b +. + + + + + + + + + + + + + +
A
ab
+```````````````````````````````` + + +```````````````````````````````` example +| Foo | Bar | +|-----|-----| +| boo | baz | +| faz | | +. + + + + + + + + + + + + + + + + + +
FooBar
boobaz
faz
+```````````````````````````````` + +## Mismatch length + +```````````````````````````````` example +| First Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell | +. +

| First Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell |

+```````````````````````````````` + +```````````````````````````````` example +| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | +| Content Cell | Content Cell | +. +

| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | +| Content Cell | Content Cell |

+```````````````````````````````` + +```````````````````````````````` example +A | +- | - | +a | b | c +. +

A |

+
    +
  • | - | +a | b | c
  • +
+```````````````````````````````` + +```````````````````````````````` example +A | B | C +- | - | - +a | b +. +

A | B | C

+
    +
  • | - | - +a | b
  • +
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/task_lists.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/task_lists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1760acbdd4dd55d815789bc11afad6f2f3a8c3d --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/task_lists.txt @@ -0,0 +1,108 @@ +# Task Lists + +```````````````````````````````` example +- [ ] foo +- [x] bar +- [X] baz +. +
    +
  • foo
  • +
  • bar
  • +
  • baz
  • +
+```````````````````````````````` + +```````````````````````````````` example +- foo +- [ ] bar +. +
    +
  • foo
  • +
  • bar
  • +
+```````````````````````````````` + +```````````````````````````````` example +- foo + +- [ ] bar +- [x] baz + + text +. +
    +
  • foo

    +
  • +
  • bar

    +
  • +
  • baz

    +

    text

    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +1. [ ] foo +2. [x] bar +3. [X] baz +. +
    +
  1. foo
  2. +
  3. bar
  4. +
  5. baz
  6. +
+```````````````````````````````` + +```````````````````````````````` example +- [ ] Task list item + over two lines +. +
    +
  • Task list item +over two lines
  • +
+```````````````````````````````` + +```````````````````````````````` example +- [ ] foo + - [x] bar + - [ ] baz +. +
    +
  • foo
      +
    • bar
    • +
    • baz
    • +
    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +1. [ ] foo + 1. [ ] bar + 2. [ ] baz +. +
    +
  1. foo
      +
    1. bar
    2. +
    3. baz
    4. +
    +
  2. +
+```````````````````````````````` + +```````````````````````````````` example +> - [ ] foo +> - [x] bar +> - [ ] baz +. +
+
    +
  • foo
      +
    • bar
    • +
    • baz
    • +
    +
  • +
+
+```````````````````````````````` \ No newline at end of file diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/url.txt b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/url.txt new file mode 100644 index 0000000000000000000000000000000000000000..669bdd5f34d93942e407aa41569072a6ff6a2f91 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/fixtures/url.txt @@ -0,0 +1,22 @@ +# url plugin + + +```````````````````````````````` example +visit https://lepture.com/ +. +

visit https://lepture.com/

+```````````````````````````````` + + +```````````````````````````````` example +visit [https://lepture.com/](/foo) +. +

visit https://lepture.com/

+```````````````````````````````` + + +```````````````````````````````` example +visit https://lepture.com/ +. +

visit https://lepture.com/

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_commonmark.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_commonmark.py new file mode 100644 index 0000000000000000000000000000000000000000..5ece254838b130d5765744897028436efb73b0e6 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_commonmark.py @@ -0,0 +1,76 @@ +import mistune +from tests import BaseTestCase, normalize_html + + +DIFF_CASES = { + 'setext_headings_093', + 'html_blocks_191', # mistune keeps \n + + 'images_573', # image can not be in image + + 'links_495', + 'links_517', # aggressive link group + 'links_518', + 'links_519', + 'links_531', + 'links_532', +} + +IGNORE_CASES = { + # we don't support link title in (title) + 'links_496', + 'links_504', + + # we don't support flanking delimiter run + 'emphasis_and_strong_emphasis_352', + 'emphasis_and_strong_emphasis_367', + 'emphasis_and_strong_emphasis_368', + 'emphasis_and_strong_emphasis_372', + 'emphasis_and_strong_emphasis_379', + 'emphasis_and_strong_emphasis_388', + 'emphasis_and_strong_emphasis_391', + + 'emphasis_and_strong_emphasis_406', + 'emphasis_and_strong_emphasis_407', + 'emphasis_and_strong_emphasis_408', + + 'emphasis_and_strong_emphasis_412', + 'emphasis_and_strong_emphasis_413', + 'emphasis_and_strong_emphasis_414', + 'emphasis_and_strong_emphasis_416', + 'emphasis_and_strong_emphasis_417', + 'emphasis_and_strong_emphasis_418', + + 'emphasis_and_strong_emphasis_424', + 'emphasis_and_strong_emphasis_425', + 'emphasis_and_strong_emphasis_426', + 'emphasis_and_strong_emphasis_429', + 'emphasis_and_strong_emphasis_430', + 'emphasis_and_strong_emphasis_431', + 'emphasis_and_strong_emphasis_460', + 'emphasis_and_strong_emphasis_467', + 'emphasis_and_strong_emphasis_470', + 'emphasis_and_strong_emphasis_471', + 'emphasis_and_strong_emphasis_477', + 'emphasis_and_strong_emphasis_478', +} + +for i in range(441, 447): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) +for i in range(453, 459): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) +for i in range(462, 466): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) + + +class TestCommonMark(BaseTestCase): + @classmethod + def ignore_case(cls, n): + return n in IGNORE_CASES or n in DIFF_CASES + + def assert_case(self, n, text, html): + result = mistune.html(text) + self.assertEqual(normalize_html(result), normalize_html(html)) + + +TestCommonMark.load_fixtures('commonmark.json') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_directives.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_directives.py new file mode 100644 index 0000000000000000000000000000000000000000..388963a4b196c3252368bc842d1bd250d66f3d98 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_directives.py @@ -0,0 +1,93 @@ +import os +from mistune import create_markdown +from mistune.directives import ( + RSTDirective, + FencedDirective, + Admonition, + TableOfContents, + Include, + Image, + Figure, +) +from tests import BaseTestCase +from tests.fixtures import ROOT + + +def load_directive_test(filename, directive, cls): + class TestDirective(BaseTestCase): + @staticmethod + def parse(text): + md = create_markdown( + escape=False, + plugins=[cls([directive])], + ) + html = md(text) + return html + + TestDirective.load_fixtures(filename + '.txt') + globals()["TestDirective_" + filename] = TestDirective + + +load_directive_test('rst_admonition', Admonition(), RSTDirective) +load_directive_test('rst_toc', TableOfContents(), RSTDirective) +load_directive_test('fenced_admonition', Admonition(), FencedDirective) +load_directive_test('fenced_toc', TableOfContents(), FencedDirective) +load_directive_test('fenced_image', Image(), FencedDirective) +load_directive_test('fenced_figure', Figure(), FencedDirective) + + +class CustomizeTableOfContents(TableOfContents): + def generate_heading_id(self, token, i): + return 't-' + str(i + 1) + + +class TestCustomizeToc(BaseTestCase): + def test_rst_toc(self): + md = create_markdown( + escape=False, + plugins=[ + RSTDirective([CustomizeTableOfContents()]), + ], + ) + html = md('# h1\n\n.. toc::\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + def test_fenced_toc(self): + md = create_markdown( + escape=False, + plugins=[ + FencedDirective([CustomizeTableOfContents()]), + ], + ) + html = md('# h1\n\n```{toc}\n```\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + def test_colon_fenced_toc(self): + md = create_markdown( + escape=False, + plugins=[ + FencedDirective([CustomizeTableOfContents()], ':'), + ], + ) + html = md('# h1\n\n:::{toc}\n:::\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + +class TestDirectiveInclude(BaseTestCase): + md = create_markdown(escape=False, plugins=[RSTDirective([Include()])]) # type: ignore[list-item] + + def test_html_include(self): + html = self.md.read(os.path.join(ROOT, 'include/text.md'))[0] + self.assertIn('Could not include self', html) + self.assertIn('Could not find file', html) + self.assertIn('
include html
', html) + self.assertIn('
', html) + self.assertIn('# Table of Contents', html) + + def test_include_missing_source(self): + s = '.. include:: foo.txt' + html = self.md(s) + self.assertIn('Missing source file', html) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_hooks.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..8c0a02e9b600a6034ea367fd014ec7949fb0f5d3 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_hooks.py @@ -0,0 +1,26 @@ +import os +from mistune import create_markdown +from mistune.toc import add_toc_hook, render_toc_ul +from tests import BaseTestCase + + +class TestTocHook(BaseTestCase): + @staticmethod + def parse(text): + md = create_markdown(escape=False) + add_toc_hook(md) + html, state = md.parse(text) + result = html + render_toc_ul(state.env['toc_items']) + return result + + def test_customize_heading_id_func(self): + def heading_id(token, i): + return 't-' + str(i + 1) + + md = create_markdown(escape=False) + add_toc_hook(md, heading_id=heading_id) + html = md('# h1') + self.assertEqual(html, '

h1

\n') + + +TestTocHook.load_fixtures('hook_toc.txt') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_misc.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_misc.py new file mode 100644 index 0000000000000000000000000000000000000000..99bc68d6eca362d235a2dff0ad449ceb8dd5eebc --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_misc.py @@ -0,0 +1,137 @@ +import mistune +from unittest import TestCase + + +class TestMiscCases(TestCase): + def test_none(self): + self.assertEqual(mistune.html(None), '') + + def test_before_parse_hooks(self): + def _add_name(md, state): + state.env['name'] = 'test' + + md = mistune.create_markdown() + md.before_parse_hooks.append(_add_name) + state = md.block.state_cls() + md.parse('', state) + self.assertEqual(state.env['name'], 'test') + + def test_hard_wrap(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('foo\nbar') + expected = '

foo
\nbar

' + self.assertEqual(result.strip(), expected) + + md = mistune.create_markdown( + escape=False, hard_wrap=True, plugins=['speedup']) + result = md('foo\nbar') + self.assertEqual(result.strip(), expected) + + def test_escape_html(self): + md = mistune.create_markdown(escape=True) + result = md('
1
') + expected = '

<div>1</div>

' + self.assertEqual(result.strip(), expected) + + result = md('1') + expected = '

<em>1</em>

' + self.assertEqual(result.strip(), expected) + + def test_harmful_links(self): + result = mistune.html('[h](javAscript:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_ref_link(self): + result = mistune.html('[link][h]\n\n[h]: /foo') + expected = '

link

' + self.assertEqual(result.strip(), expected) + + def test_allow_harmful_protocols(self): + renderer = mistune.HTMLRenderer(allow_harmful_protocols=True) + md = mistune.Markdown(renderer) + result = md('[h](javascript:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_allow_data_protocols(self): + renderer = mistune.HTMLRenderer(allow_harmful_protocols=['data:']) + md = mistune.Markdown(renderer) + result = md('[h](data:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_use_plugin(self): + from mistune.plugins.url import url + md = mistune.Markdown(mistune.HTMLRenderer()) + md.use(url) + + def test_markdown_func(self): + result = mistune.markdown('**b**') + expected = '

b

\n' + self.assertEqual(result, expected) + + # trigger to use cached parser + result = mistune.markdown('**b**') + self.assertEqual(result, expected) + + def test_ast_output(self): + md = mistune.create_markdown(escape=False, renderer=None) + text = '# h1\n\nfoo **bar**\n\n`&<>"`' + result = md(text) + expected = [ + { + 'type': 'heading', + 'children': [{'type': 'text', 'raw': 'h1'}], + 'attrs': {'level': 1}, + 'style': 'atx', + }, + {'type': 'blank_line'}, + { + 'type': 'paragraph', + 'children': [ + {'type': 'text', 'raw': 'foo '}, + {'type': 'strong', 'children': [{'type': 'text', 'raw': 'bar'}]} + ] + }, + {'type': 'blank_line'}, + { + 'type': 'paragraph', + 'children': [ + {'type': 'codespan', 'raw': '&<>"'}, + ] + }, + ] + self.assertEqual(result, expected) + + def test_ast_url(self): + md = mistune.create_markdown(escape=False, renderer=None) + label = 'hi &<>"' + url = 'https://example.com/foo?a=1&b=2' + text = '[{}]({})'.format(label, url) + result = md(text) + expected = [ + { + 'type': 'paragraph', + 'children': [ + { + 'type': 'link', + 'children': [{'type': 'text', 'raw': label}], + 'attrs': {'url': url}, + }, + ], + }, + ] + self.assertEqual(result, expected) + + def test_emsp(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('\u2003\u2003foo\nbar\n\n\u2003\u2003foobar') + expected = '

\u2003\u2003foo
\nbar

\n

\u2003\u2003foobar

' + self.assertEqual(result.strip(), expected) + + def test_html_tag_text_following_list(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('foo\n- bar\n\ntable') + expected = '

foo

\n
    \n
  • bar
  • \n
\n

table

' + self.assertEqual(result.strip(), expected) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_plugins.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_plugins.py new file mode 100644 index 0000000000000000000000000000000000000000..408c5fac6733b3307ee4db14e0996137e1843ebf --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_plugins.py @@ -0,0 +1,66 @@ +from mistune import create_markdown +from mistune.plugins.table import table_in_list, table_in_quote +from mistune.plugins.math import math_in_list, math_in_quote +from tests import BaseTestCase + + +def load_plugin(plugin_name): + md1 = create_markdown(escape=False, plugins=[plugin_name]) + md2 = create_markdown(escape=False, plugins=[plugin_name, 'speedup']) + + class TestPlugin1(BaseTestCase): + parse = md1 + + class TestPlugin2(BaseTestCase): + parse = md2 + + TestPlugin1.load_fixtures(plugin_name + ".txt") + TestPlugin2.load_fixtures(plugin_name + ".txt") + globals()["TestPlugin1_" + plugin_name] = TestPlugin1 + globals()["TestPlugin2_" + plugin_name] = TestPlugin2 + + +load_plugin("url") +load_plugin("strikethrough") +load_plugin("mark") +load_plugin("insert") +load_plugin("superscript") +load_plugin("subscript") +load_plugin("task_lists") +load_plugin("table") +load_plugin("def_list") +load_plugin("footnotes") +load_plugin("abbr") +load_plugin("math") +load_plugin("ruby") +load_plugin("spoiler") + + +class TestExtraPlugins(BaseTestCase): + def test_table_in_list(self): + text = '''- Cell | Cell\n ---- | ----\n 1 | 2\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['table', table_in_list]) + self.assertNotIn('', md1(text)) + self.assertIn('
', md2(text)) + + def test_table_in_quote(self): + text = '''> Cell | Cell\n> ---- | ----\n> 1 | 2\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['table', table_in_quote]) + self.assertNotIn('
', md1(text)) + self.assertIn('
', md2(text)) + + def test_math_in_list(self): + text = '''- $$\n foo\n $$\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['math', math_in_list]) + self.assertNotIn('class="math"', md1(text)) + self.assertIn('class="math"', md2(text)) + + def test_math_in_quote(self): + text = '''> $$\n> foo\n> $$\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['math', math_in_quote]) + self.assertNotIn('class="math"', md1(text)) + self.assertIn('class="math"', md2(text)) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_renderers.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_renderers.py new file mode 100644 index 0000000000000000000000000000000000000000..dca515873cd24cf642fab5ff6dbb34d884c9a7ae --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_renderers.py @@ -0,0 +1,17 @@ +from mistune import create_markdown +from mistune.renderers.rst import RSTRenderer +from mistune.renderers.markdown import MarkdownRenderer +from tests import BaseTestCase + + +def load_renderer(renderer): + class TestRenderer(BaseTestCase): + parse = create_markdown(renderer=renderer) + + name = renderer.NAME + TestRenderer.load_fixtures('renderer_' + name + '.txt') + globals()["TestRenderer" + name.title()] = TestRenderer + + +load_renderer(RSTRenderer()) +load_renderer(MarkdownRenderer()) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_syntax.py b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_syntax.py new file mode 100644 index 0000000000000000000000000000000000000000..06341d595c3cc5ef64f36c729f97901f312317d7 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/tests/trusted/tests/test_syntax.py @@ -0,0 +1,12 @@ +import mistune +from tests import BaseTestCase, normalize_html + + +class TestSyntax(BaseTestCase): + def assert_case(self, n, text, html): + result = mistune.html(text) + self.assertEqual(normalize_html(result), normalize_html(html)) + + +TestSyntax.load_fixtures('fix-commonmark.txt') +TestSyntax.load_fixtures('diff-commonmark.txt') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/canaries/first-hunk-only.sh b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..9b98401cf5215e7796147170b83e5d1110fe0d48 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/canaries/first-hunk-only.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/src/mistune/util.py b/src/mistune/util.py +index 7f4e9428fda7a7ba05ce1fd6fdc33eff7d75d80b..884ed55215b3abd44d4513e26d95c26bad6b4ca2 100644 +--- a/src/mistune/util.py ++++ b/src/mistune/util.py +@@ -8,8 +8,8 @@ + + def expand_leading_tab(text: str, width: int = 4) -> str: + def repl(m: Match[str]) -> str: +- s = m.group(0) +- return s + ' ' * (len(s) - width) ++ s = m.group(1) ++ return s + ' ' * (width - len(s)) + return _expand_tab_re.sub(repl, text) + + +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/canaries/original-bug.sh b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/openenv.json b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__cq2by9to/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/LICENSE.source b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..b141cdb9f3cb8010b9c3dfb392ff1a00db58a413 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/LICENSE.source @@ -0,0 +1,14 @@ +Copyright (c) 2014, Hsiaoming Yang + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of the creator nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/adapter.json b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..3a95b03405746581b014a7084d00a3acfbeaf08c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/adapter.json @@ -0,0 +1,131 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "883d23539d00e744dc83da083548b6dd699be04238df34d5bd5b500a5dc53f28", + "gold_patch_sha256": "aaa8aa71b3934c4946d2e48df54715671181c3a98cd64933721734783e9c843a", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "fd2f35be40bd402d6d6931ba5f342e78abf98c30dd3a9c8cdf45de00c9e13ab9", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "MistuneBf54ef67", + "profile_lines": [ + 570, + 573 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "upstream_repo": "lepture/mistune" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": false, + "partial_repair_sha256": null, + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/lepture__mistune.bf54ef67.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "python -m pip install -e ." + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "pyproject.toml": "b2922e3ef89e2918935d38fb3a777bdbc741619942276a75fd21a8dd9faf6b42" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "daeaceaa300555d292005e8fe0dd61148dcb65d1", + "source_completion_sha256": "d8f4fcdeff5e9abc1c19ec22ed2893e41812b3542aaa8f8e473e3db23484759e", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:lepture__mistune.bf54ef67.combine_file__d7rfqbr0", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "62750c95db25a8fb93dda09242f64e07508d9231", + "instruction_sha256": "56593da424821c0cce3e5844f4c90b3eb0250fab921ba109595b471500eb1bd9", + "is_fork": true, + "learner_path": "tasks/670af8e4afeb4a2e45640646/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "actual_upstream_url": "https://raw.githubusercontent.com/lepture/mistune/bf54ef67390e02a5cdee7495d4386d7770c1902b/LICENSE", + "reviewed": true, + "sha256": "539013fd8e19f744f8bf0e27a532bbff54cd689ecef7a800f56ae5dc824be870", + "spdx": "BSD-3-Clause", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/lepture__mistune.bf54ef67/daeaceaa300555d292005e8fe0dd61148dcb65d1/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "patch_sha256": "d1b4fd8264b693c8967243ef353e46f663ab0e72c580aa07a319679362644cf4", + "provenance_path": "tasks/670af8e4afeb4a2e45640646/source-proof.json", + "repository_lineage": [ + "swesmith/lepture__mistune.bf54ef67", + "lepture/mistune" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "daeaceaa300555d292005e8fe0dd61148dcb65d1", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "347b2ad0cc359c47c059ec3ad8757134a08d2b65", + "source_kind": "mutation", + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "lepture__mistune.bf54ef67.combine_file__d7rfqbr0", + "task_sha256": "44b82ec6a146aba6d4861d1d15a51ae3c34195ecd0761d5312a643bd68daea9e", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "lepture/mistune", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "symlink_submodule_changes_supported": false, + "task_id": "lepture__mistune.bf54ef67.combine_file__d7rfqbr0", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "lepture/mistune" +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/dependency-setup.sh b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..551d5bb0d87bd3b22dd7098dddea7e0794a2ab40 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +python -m pip install -e . diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/environment/Dockerfile b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/instruction.md b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..52c1c4410a44dc38874bf97cbd2b5df7113cef42 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/instruction.md @@ -0,0 +1,46 @@ +RST renderer produces incorrect output after recent changes + +#### Description + +The RST renderer is generating malformed reStructuredText output. Several rendering functions appear to have issues with formatting, indentation, and parameter ordering. + +#### Steps/Code to Reproduce + +```python +import mistune +from mistune.renderers.rst import RSTRenderer + +# Test basic heading rendering +markdown_text = "# Hello World" +renderer = RSTRenderer() +rst = mistune.create_markdown(renderer=renderer) +result = rst(markdown_text) +print("Result:", repr(result)) +# Expected proper RST heading format + +# Test image rendering +markdown_text = "![alt text](image.png)" +result = rst(markdown_text) +print("Image result:", repr(result)) +# Expected proper RST figure directive + +# Test line breaks +markdown_text = "Line 1 \nLine 2" +result = rst(markdown_text) +print("Line break result:", repr(result)) +# Expected proper RST line break formatting +``` + +The output shows various formatting issues including: +- Incorrect heading underline lengths +- Missing indentation in image alt text +- Malformed line break handling +- Wrong parameter order in function calls + +#### Environment + +Python 3.8+ with mistune library + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/metadata.json b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..8e4e9a1ba1d197962cfe528f63d8630fe2119ffd --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/metadata.json @@ -0,0 +1,1190 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "MistuneBf54ef67", + "profile_lines": [ + 570, + 573 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "upstream_repo": "lepture/mistune" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_renderers.py::TestRendererRst::test_code_001", + "tests/test_renderers.py::TestRendererRst::test_code_002", + "tests/test_renderers.py::TestRendererRst::test_heading_001", + "tests/test_renderers.py::TestRendererRst::test_html_001", + "tests/test_renderers.py::TestRendererRst::test_images_001", + "tests/test_renderers.py::TestRendererRst::test_images_002", + "tests/test_renderers.py::TestRendererRst::test_images_003", + "tests/test_renderers.py::TestRendererRst::test_line_break_001", + "tests/test_renderers.py::TestRendererRst::test_list_003", + "tests/test_renderers.py::TestRendererRst::test_list_005", + "tests/test_renderers.py::TestRendererRst::test_quote_002", + "tests/test_renderers.py::TestRendererRst::test_quote_003", + "tests/test_renderers.py::TestRendererRst::test_thematic_break_001" + ], + "PASS_TO_PASS": [ + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_062", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_063", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_064", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_065", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_066", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_067", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_068", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_069", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_070", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_071", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_072", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_073", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_074", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_075", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_076", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_077", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_078", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_079", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_593", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_594", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_595", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_596", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_597", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_598", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_599", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_600", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_601", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_602", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_603", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_604", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_605", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_606", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_607", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_608", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_609", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_610", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_611", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_012", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_013", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_014", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_015", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_016", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_017", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_018", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_019", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_020", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_021", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_022", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_023", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_024", + "tests/test_commonmark.py::TestCommonMark::test_blank_lines_227", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_228", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_229", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_230", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_231", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_232", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_233", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_234", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_235", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_236", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_237", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_238", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_239", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_240", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_241", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_242", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_243", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_244", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_245", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_246", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_247", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_248", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_249", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_250", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_251", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_252", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_328", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_329", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_330", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_331", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_332", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_333", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_334", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_335", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_336", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_337", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_338", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_339", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_340", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_341", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_342", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_343", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_344", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_345", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_346", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_347", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_348", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_349", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_350", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_351", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_353", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_354", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_355", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_356", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_357", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_358", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_359", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_360", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_361", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_362", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_363", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_364", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_365", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_366", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_369", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_370", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_371", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_373", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_374", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_375", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_376", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_377", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_378", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_380", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_381", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_382", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_383", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_384", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_385", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_386", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_387", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_389", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_390", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_392", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_393", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_394", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_395", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_396", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_397", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_398", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_399", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_400", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_401", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_402", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_403", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_404", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_405", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_409", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_410", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_411", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_415", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_419", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_420", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_421", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_422", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_423", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_427", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_428", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_432", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_433", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_434", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_435", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_436", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_437", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_438", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_439", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_440", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_447", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_448", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_449", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_450", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_451", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_452", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_459", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_461", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_466", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_468", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_469", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_472", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_473", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_474", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_475", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_476", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_479", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_480", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_025", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_026", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_027", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_028", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_029", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_030", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_031", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_032", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_033", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_034", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_035", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_036", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_037", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_038", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_039", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_040", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_041", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_119", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_120", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_121", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_122", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_123", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_124", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_125", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_126", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_127", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_128", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_129", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_130", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_131", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_132", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_133", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_134", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_135", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_136", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_137", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_138", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_139", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_140", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_141", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_142", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_143", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_144", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_145", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_146", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_147", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_633", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_634", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_635", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_636", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_637", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_638", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_639", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_640", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_641", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_642", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_643", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_644", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_645", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_646", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_647", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_148", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_149", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_150", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_151", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_152", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_153", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_154", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_155", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_156", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_157", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_158", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_159", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_160", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_161", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_162", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_163", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_164", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_165", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_166", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_167", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_168", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_169", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_170", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_171", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_172", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_173", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_174", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_175", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_176", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_177", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_178", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_179", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_180", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_181", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_182", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_183", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_184", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_185", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_186", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_187", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_188", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_189", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_190", + "tests/test_commonmark.py::TestCommonMark::test_images_571", + "tests/test_commonmark.py::TestCommonMark::test_images_572", + "tests/test_commonmark.py::TestCommonMark::test_images_574", + "tests/test_commonmark.py::TestCommonMark::test_images_575", + "tests/test_commonmark.py::TestCommonMark::test_images_576", + "tests/test_commonmark.py::TestCommonMark::test_images_577", + "tests/test_commonmark.py::TestCommonMark::test_images_578", + "tests/test_commonmark.py::TestCommonMark::test_images_579", + "tests/test_commonmark.py::TestCommonMark::test_images_580", + "tests/test_commonmark.py::TestCommonMark::test_images_581", + "tests/test_commonmark.py::TestCommonMark::test_images_582", + "tests/test_commonmark.py::TestCommonMark::test_images_583", + "tests/test_commonmark.py::TestCommonMark::test_images_584", + "tests/test_commonmark.py::TestCommonMark::test_images_585", + "tests/test_commonmark.py::TestCommonMark::test_images_586", + "tests/test_commonmark.py::TestCommonMark::test_images_587", + "tests/test_commonmark.py::TestCommonMark::test_images_588", + "tests/test_commonmark.py::TestCommonMark::test_images_589", + "tests/test_commonmark.py::TestCommonMark::test_images_590", + "tests/test_commonmark.py::TestCommonMark::test_images_591", + "tests/test_commonmark.py::TestCommonMark::test_images_592", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_107", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_108", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_109", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_110", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_111", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_112", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_113", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_114", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_115", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_116", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_117", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_118", + "tests/test_commonmark.py::TestCommonMark::test_inlines_327", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_192", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_193", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_194", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_195", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_196", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_197", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_198", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_199", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_200", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_201", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_202", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_203", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_204", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_205", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_206", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_207", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_208", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_209", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_210", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_211", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_212", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_213", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_214", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_215", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_216", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_217", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_218", + "tests/test_commonmark.py::TestCommonMark::test_links_481", + "tests/test_commonmark.py::TestCommonMark::test_links_482", + "tests/test_commonmark.py::TestCommonMark::test_links_483", + "tests/test_commonmark.py::TestCommonMark::test_links_484", + "tests/test_commonmark.py::TestCommonMark::test_links_485", + "tests/test_commonmark.py::TestCommonMark::test_links_486", + "tests/test_commonmark.py::TestCommonMark::test_links_487", + "tests/test_commonmark.py::TestCommonMark::test_links_488", + "tests/test_commonmark.py::TestCommonMark::test_links_489", + "tests/test_commonmark.py::TestCommonMark::test_links_490", + "tests/test_commonmark.py::TestCommonMark::test_links_491", + "tests/test_commonmark.py::TestCommonMark::test_links_492", + "tests/test_commonmark.py::TestCommonMark::test_links_493", + "tests/test_commonmark.py::TestCommonMark::test_links_494", + "tests/test_commonmark.py::TestCommonMark::test_links_497", + "tests/test_commonmark.py::TestCommonMark::test_links_498", + "tests/test_commonmark.py::TestCommonMark::test_links_499", + "tests/test_commonmark.py::TestCommonMark::test_links_500", + "tests/test_commonmark.py::TestCommonMark::test_links_501", + "tests/test_commonmark.py::TestCommonMark::test_links_502", + "tests/test_commonmark.py::TestCommonMark::test_links_503", + "tests/test_commonmark.py::TestCommonMark::test_links_505", + "tests/test_commonmark.py::TestCommonMark::test_links_506", + "tests/test_commonmark.py::TestCommonMark::test_links_507", + "tests/test_commonmark.py::TestCommonMark::test_links_508", + "tests/test_commonmark.py::TestCommonMark::test_links_509", + "tests/test_commonmark.py::TestCommonMark::test_links_510", + "tests/test_commonmark.py::TestCommonMark::test_links_511", + "tests/test_commonmark.py::TestCommonMark::test_links_512", + "tests/test_commonmark.py::TestCommonMark::test_links_513", + "tests/test_commonmark.py::TestCommonMark::test_links_514", + "tests/test_commonmark.py::TestCommonMark::test_links_515", + "tests/test_commonmark.py::TestCommonMark::test_links_516", + "tests/test_commonmark.py::TestCommonMark::test_links_520", + "tests/test_commonmark.py::TestCommonMark::test_links_521", + "tests/test_commonmark.py::TestCommonMark::test_links_522", + "tests/test_commonmark.py::TestCommonMark::test_links_523", + "tests/test_commonmark.py::TestCommonMark::test_links_524", + "tests/test_commonmark.py::TestCommonMark::test_links_525", + "tests/test_commonmark.py::TestCommonMark::test_links_526", + "tests/test_commonmark.py::TestCommonMark::test_links_527", + "tests/test_commonmark.py::TestCommonMark::test_links_528", + "tests/test_commonmark.py::TestCommonMark::test_links_529", + "tests/test_commonmark.py::TestCommonMark::test_links_530", + "tests/test_commonmark.py::TestCommonMark::test_links_533", + "tests/test_commonmark.py::TestCommonMark::test_links_534", + "tests/test_commonmark.py::TestCommonMark::test_links_535", + "tests/test_commonmark.py::TestCommonMark::test_links_536", + "tests/test_commonmark.py::TestCommonMark::test_links_537", + "tests/test_commonmark.py::TestCommonMark::test_links_538", + "tests/test_commonmark.py::TestCommonMark::test_links_539", + "tests/test_commonmark.py::TestCommonMark::test_links_540", + "tests/test_commonmark.py::TestCommonMark::test_links_541", + "tests/test_commonmark.py::TestCommonMark::test_links_542", + "tests/test_commonmark.py::TestCommonMark::test_links_543", + "tests/test_commonmark.py::TestCommonMark::test_links_544", + "tests/test_commonmark.py::TestCommonMark::test_links_545", + "tests/test_commonmark.py::TestCommonMark::test_links_546", + "tests/test_commonmark.py::TestCommonMark::test_links_547", + "tests/test_commonmark.py::TestCommonMark::test_links_548", + "tests/test_commonmark.py::TestCommonMark::test_links_549", + "tests/test_commonmark.py::TestCommonMark::test_links_550", + "tests/test_commonmark.py::TestCommonMark::test_links_551", + "tests/test_commonmark.py::TestCommonMark::test_links_552", + "tests/test_commonmark.py::TestCommonMark::test_links_553", + "tests/test_commonmark.py::TestCommonMark::test_links_554", + "tests/test_commonmark.py::TestCommonMark::test_links_555", + "tests/test_commonmark.py::TestCommonMark::test_links_556", + "tests/test_commonmark.py::TestCommonMark::test_links_557", + "tests/test_commonmark.py::TestCommonMark::test_links_558", + "tests/test_commonmark.py::TestCommonMark::test_links_559", + "tests/test_commonmark.py::TestCommonMark::test_links_560", + "tests/test_commonmark.py::TestCommonMark::test_links_561", + "tests/test_commonmark.py::TestCommonMark::test_links_562", + "tests/test_commonmark.py::TestCommonMark::test_links_563", + "tests/test_commonmark.py::TestCommonMark::test_links_564", + "tests/test_commonmark.py::TestCommonMark::test_links_565", + "tests/test_commonmark.py::TestCommonMark::test_links_566", + "tests/test_commonmark.py::TestCommonMark::test_links_567", + "tests/test_commonmark.py::TestCommonMark::test_links_568", + "tests/test_commonmark.py::TestCommonMark::test_links_569", + "tests/test_commonmark.py::TestCommonMark::test_links_570", + "tests/test_commonmark.py::TestCommonMark::test_list_items_253", + "tests/test_commonmark.py::TestCommonMark::test_list_items_254", + "tests/test_commonmark.py::TestCommonMark::test_list_items_255", + "tests/test_commonmark.py::TestCommonMark::test_list_items_256", + "tests/test_commonmark.py::TestCommonMark::test_list_items_257", + "tests/test_commonmark.py::TestCommonMark::test_list_items_258", + "tests/test_commonmark.py::TestCommonMark::test_list_items_259", + "tests/test_commonmark.py::TestCommonMark::test_list_items_260", + "tests/test_commonmark.py::TestCommonMark::test_list_items_261", + "tests/test_commonmark.py::TestCommonMark::test_list_items_262", + "tests/test_commonmark.py::TestCommonMark::test_list_items_263", + "tests/test_commonmark.py::TestCommonMark::test_list_items_264", + "tests/test_commonmark.py::TestCommonMark::test_list_items_265", + "tests/test_commonmark.py::TestCommonMark::test_list_items_266", + "tests/test_commonmark.py::TestCommonMark::test_list_items_267", + "tests/test_commonmark.py::TestCommonMark::test_list_items_268", + "tests/test_commonmark.py::TestCommonMark::test_list_items_269", + "tests/test_commonmark.py::TestCommonMark::test_list_items_270", + "tests/test_commonmark.py::TestCommonMark::test_list_items_271", + "tests/test_commonmark.py::TestCommonMark::test_list_items_272", + "tests/test_commonmark.py::TestCommonMark::test_list_items_273", + "tests/test_commonmark.py::TestCommonMark::test_list_items_274", + "tests/test_commonmark.py::TestCommonMark::test_list_items_275", + "tests/test_commonmark.py::TestCommonMark::test_list_items_276", + "tests/test_commonmark.py::TestCommonMark::test_list_items_277", + "tests/test_commonmark.py::TestCommonMark::test_list_items_278", + "tests/test_commonmark.py::TestCommonMark::test_list_items_279", + "tests/test_commonmark.py::TestCommonMark::test_list_items_280", + "tests/test_commonmark.py::TestCommonMark::test_list_items_281", + "tests/test_commonmark.py::TestCommonMark::test_list_items_282", + "tests/test_commonmark.py::TestCommonMark::test_list_items_283", + "tests/test_commonmark.py::TestCommonMark::test_list_items_284", + "tests/test_commonmark.py::TestCommonMark::test_list_items_285", + "tests/test_commonmark.py::TestCommonMark::test_list_items_286", + "tests/test_commonmark.py::TestCommonMark::test_list_items_287", + "tests/test_commonmark.py::TestCommonMark::test_list_items_288", + "tests/test_commonmark.py::TestCommonMark::test_list_items_289", + "tests/test_commonmark.py::TestCommonMark::test_list_items_290", + "tests/test_commonmark.py::TestCommonMark::test_list_items_291", + "tests/test_commonmark.py::TestCommonMark::test_list_items_292", + "tests/test_commonmark.py::TestCommonMark::test_list_items_293", + "tests/test_commonmark.py::TestCommonMark::test_list_items_294", + "tests/test_commonmark.py::TestCommonMark::test_list_items_295", + "tests/test_commonmark.py::TestCommonMark::test_list_items_296", + "tests/test_commonmark.py::TestCommonMark::test_list_items_297", + "tests/test_commonmark.py::TestCommonMark::test_list_items_298", + "tests/test_commonmark.py::TestCommonMark::test_list_items_299", + "tests/test_commonmark.py::TestCommonMark::test_list_items_300", + "tests/test_commonmark.py::TestCommonMark::test_lists_301", + "tests/test_commonmark.py::TestCommonMark::test_lists_302", + "tests/test_commonmark.py::TestCommonMark::test_lists_303", + "tests/test_commonmark.py::TestCommonMark::test_lists_304", + "tests/test_commonmark.py::TestCommonMark::test_lists_305", + "tests/test_commonmark.py::TestCommonMark::test_lists_306", + "tests/test_commonmark.py::TestCommonMark::test_lists_307", + "tests/test_commonmark.py::TestCommonMark::test_lists_308", + "tests/test_commonmark.py::TestCommonMark::test_lists_309", + "tests/test_commonmark.py::TestCommonMark::test_lists_310", + "tests/test_commonmark.py::TestCommonMark::test_lists_311", + "tests/test_commonmark.py::TestCommonMark::test_lists_312", + "tests/test_commonmark.py::TestCommonMark::test_lists_313", + "tests/test_commonmark.py::TestCommonMark::test_lists_314", + "tests/test_commonmark.py::TestCommonMark::test_lists_315", + "tests/test_commonmark.py::TestCommonMark::test_lists_316", + "tests/test_commonmark.py::TestCommonMark::test_lists_317", + "tests/test_commonmark.py::TestCommonMark::test_lists_318", + "tests/test_commonmark.py::TestCommonMark::test_lists_319", + "tests/test_commonmark.py::TestCommonMark::test_lists_320", + "tests/test_commonmark.py::TestCommonMark::test_lists_321", + "tests/test_commonmark.py::TestCommonMark::test_lists_322", + "tests/test_commonmark.py::TestCommonMark::test_lists_323", + "tests/test_commonmark.py::TestCommonMark::test_lists_324", + "tests/test_commonmark.py::TestCommonMark::test_lists_325", + "tests/test_commonmark.py::TestCommonMark::test_lists_326", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_219", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_220", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_221", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_222", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_223", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_224", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_225", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_226", + "tests/test_commonmark.py::TestCommonMark::test_precedence_042", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_612", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_613", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_614", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_615", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_616", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_617", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_618", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_619", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_620", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_621", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_622", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_623", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_624", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_625", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_626", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_627", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_628", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_629", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_630", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_631", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_632", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_080", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_081", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_082", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_083", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_084", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_085", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_086", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_087", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_088", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_089", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_090", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_091", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_092", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_094", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_095", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_096", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_097", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_098", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_099", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_100", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_101", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_102", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_103", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_104", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_105", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_106", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_648", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_649", + "tests/test_commonmark.py::TestCommonMark::test_tabs_001", + "tests/test_commonmark.py::TestCommonMark::test_tabs_002", + "tests/test_commonmark.py::TestCommonMark::test_tabs_003", + "tests/test_commonmark.py::TestCommonMark::test_tabs_004", + "tests/test_commonmark.py::TestCommonMark::test_tabs_005", + "tests/test_commonmark.py::TestCommonMark::test_tabs_006", + "tests/test_commonmark.py::TestCommonMark::test_tabs_007", + "tests/test_commonmark.py::TestCommonMark::test_tabs_008", + "tests/test_commonmark.py::TestCommonMark::test_tabs_009", + "tests/test_commonmark.py::TestCommonMark::test_tabs_010", + "tests/test_commonmark.py::TestCommonMark::test_tabs_011", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_650", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_651", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_652", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_043", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_044", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_045", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_046", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_047", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_048", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_049", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_050", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_051", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_052", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_053", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_054", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_055", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_056", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_057", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_058", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_059", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_060", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_061", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_rst_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_complex_001", + "tests/test_directives.py::TestDirective_rst_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_rst_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_rst_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_005", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_006", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_007", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_008", + "tests/test_directives.py::TestDirective_fenced_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_complex_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_fenced_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_image::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_source_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_target_001", + "tests/test_directives.py::TestDirective_fenced_image::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_target_option_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_caption_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_target_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_003", + "tests/test_directives.py::TestCustomizeToc::test_colon_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_rst_toc", + "tests/test_directives.py::TestDirectiveInclude::test_html_include", + "tests/test_directives.py::TestDirectiveInclude::test_include_missing_source", + "tests/test_hooks.py::TestTocHook::test_complex_toc_001", + "tests/test_hooks.py::TestTocHook::test_customize_heading_id_func", + "tests/test_hooks.py::TestTocHook::test_html_in_heading_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_002", + "tests/test_hooks.py::TestTocHook::test_link_in_heading_001", + "tests/test_hooks.py::TestTocHook::test_simple_toc_001", + "tests/test_misc.py::TestMiscCases::test_allow_data_protocols", + "tests/test_misc.py::TestMiscCases::test_allow_harmful_protocols", + "tests/test_misc.py::TestMiscCases::test_ast_output", + "tests/test_misc.py::TestMiscCases::test_ast_url", + "tests/test_misc.py::TestMiscCases::test_before_parse_hooks", + "tests/test_misc.py::TestMiscCases::test_emsp", + "tests/test_misc.py::TestMiscCases::test_escape_html", + "tests/test_misc.py::TestMiscCases::test_hard_wrap", + "tests/test_misc.py::TestMiscCases::test_harmful_links", + "tests/test_misc.py::TestMiscCases::test_html_tag_text_following_list", + "tests/test_misc.py::TestMiscCases::test_markdown_func", + "tests/test_misc.py::TestMiscCases::test_none", + "tests/test_misc.py::TestMiscCases::test_ref_link", + "tests/test_misc.py::TestMiscCases::test_use_plugin", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin1_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin2_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin1_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin2_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_003", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_quote", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_quote", + "tests/test_renderers.py::TestRendererRst::test_inline_001", + "tests/test_renderers.py::TestRendererRst::test_inline_002", + "tests/test_renderers.py::TestRendererRst::test_links_001", + "tests/test_renderers.py::TestRendererRst::test_list_001", + "tests/test_renderers.py::TestRendererRst::test_list_002", + "tests/test_renderers.py::TestRendererRst::test_list_004", + "tests/test_renderers.py::TestRendererRst::test_quote_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_002", + "tests/test_renderers.py::TestRendererMarkdown::test_code_003", + "tests/test_renderers.py::TestRendererMarkdown::test_code_004", + "tests/test_renderers.py::TestRendererMarkdown::test_code_005", + "tests/test_renderers.py::TestRendererMarkdown::test_heading_001", + "tests/test_renderers.py::TestRendererMarkdown::test_html_001", + "tests/test_renderers.py::TestRendererMarkdown::test_images_001", + "tests/test_renderers.py::TestRendererMarkdown::test_inline_001", + "tests/test_renderers.py::TestRendererMarkdown::test_linebreak_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_002", + "tests/test_renderers.py::TestRendererMarkdown::test_links_003", + "tests/test_renderers.py::TestRendererMarkdown::test_list_001", + "tests/test_renderers.py::TestRendererMarkdown::test_list_002", + "tests/test_renderers.py::TestRendererMarkdown::test_list_003", + "tests/test_renderers.py::TestRendererMarkdown::test_list_004", + "tests/test_renderers.py::TestRendererMarkdown::test_list_005", + "tests/test_renderers.py::TestRendererMarkdown::test_list_006", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_001", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_002", + "tests/test_renderers.py::TestRendererMarkdown::test_thematic_break_001", + "tests/test_syntax.py::TestSyntax::test_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_image_001", + "tests/test_syntax.py::TestSyntax::test_link_001", + "tests/test_syntax.py::TestSyntax::test_link_002", + "tests/test_syntax.py::TestSyntax::test_link_003", + "tests/test_syntax.py::TestSyntax::test_links_001", + "tests/test_syntax.py::TestSyntax::test_links_002", + "tests/test_syntax.py::TestSyntax::test_max_depth_001", + "tests/test_syntax.py::TestSyntax::test_max_depth_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_003", + "tests/test_syntax.py::TestSyntax::test_setext_headings_001", + "tests/test_syntax.py::TestSyntax::test_setext_headings_002" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "347b2ad0cc359c47c059ec3ad8757134a08d2b65", + "healthy": "62750c95db25a8fb93dda09242f64e07508d9231", + "learner": "daeaceaa300555d292005e8fe0dd61148dcb65d1" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.editorconfig", + "/testbed/.github/FUNDING.yml", + "/testbed/.gitignore", + "/testbed/.readthedocs.yaml", + "/testbed/BACKERS.md", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/Makefile", + "/testbed/README.md", + "/testbed/README.rst", + "/testbed/benchmark/bench.py", + "/testbed/benchmark/cases/atx.txt", + "/testbed/benchmark/cases/auto_links.txt", + "/testbed/benchmark/cases/blockcode.txt", + "/testbed/benchmark/cases/blockhtml.txt", + "/testbed/benchmark/cases/blockquote.txt", + "/testbed/benchmark/cases/emphasis.txt", + "/testbed/benchmark/cases/fenced.txt", + "/testbed/benchmark/cases/insane_ol.txt", + "/testbed/benchmark/cases/insane_ul.txt", + "/testbed/benchmark/cases/normal_ol.txt", + "/testbed/benchmark/cases/normal_ul.txt", + "/testbed/benchmark/cases/paragraph.txt", + "/testbed/benchmark/cases/ref_links.txt", + "/testbed/benchmark/cases/setext.txt", + "/testbed/benchmark/cases/std_links.txt", + "/testbed/docs/Makefile", + "/testbed/docs/_static/dark-icon.svg", + "/testbed/docs/_static/light-icon.svg", + "/testbed/docs/_static/logo-black.svg", + "/testbed/docs/_static/logo-white.svg", + "/testbed/docs/_templates/partials/globaltoc-above.html", + "/testbed/docs/advanced.rst", + "/testbed/docs/api.rst", + "/testbed/docs/changes.rst", + "/testbed/docs/cli.rst", + "/testbed/docs/community.rst", + "/testbed/docs/conf.py", + "/testbed/docs/directives.rst", + "/testbed/docs/guide.rst", + "/testbed/docs/index.rst", + "/testbed/docs/plugins.rst", + "/testbed/docs/renderers.rst", + "/testbed/docs/requirements.txt", + "/testbed/docs/upgrade.rst", + "/testbed/pyproject.toml", + "/testbed/serve-doc.py", + "/testbed/setup.py", + "/testbed/src/mistune/__init__.py", + "/testbed/src/mistune/__main__.py", + "/testbed/src/mistune/block_parser.py", + "/testbed/src/mistune/core.py", + "/testbed/src/mistune/directives/__init__.py", + "/testbed/src/mistune/directives/_base.py", + "/testbed/src/mistune/directives/_fenced.py", + "/testbed/src/mistune/directives/_rst.py", + "/testbed/src/mistune/directives/admonition.py", + "/testbed/src/mistune/directives/image.py", + "/testbed/src/mistune/directives/include.py", + "/testbed/src/mistune/directives/toc.py", + "/testbed/src/mistune/helpers.py", + "/testbed/src/mistune/inline_parser.py", + "/testbed/src/mistune/list_parser.py", + "/testbed/src/mistune/markdown.py", + "/testbed/src/mistune/plugins/__init__.py", + "/testbed/src/mistune/plugins/abbr.py", + "/testbed/src/mistune/plugins/def_list.py", + "/testbed/src/mistune/plugins/footnotes.py", + "/testbed/src/mistune/plugins/formatting.py", + "/testbed/src/mistune/plugins/math.py", + "/testbed/src/mistune/plugins/ruby.py", + "/testbed/src/mistune/plugins/speedup.py", + "/testbed/src/mistune/plugins/spoiler.py", + "/testbed/src/mistune/plugins/table.py", + "/testbed/src/mistune/plugins/task_lists.py", + "/testbed/src/mistune/plugins/url.py", + "/testbed/src/mistune/py.typed", + "/testbed/src/mistune/renderers/__init__.py", + "/testbed/src/mistune/renderers/_list.py", + "/testbed/src/mistune/renderers/html.py", + "/testbed/src/mistune/renderers/markdown.py", + "/testbed/src/mistune/renderers/rst.py", + "/testbed/src/mistune/toc.py", + "/testbed/src/mistune/util.py", + "/testbed/tests/__init__.py", + "/testbed/tests/fixtures/__init__.py", + "/testbed/tests/fixtures/abbr.txt", + "/testbed/tests/fixtures/commonmark.json", + "/testbed/tests/fixtures/def_list.txt", + "/testbed/tests/fixtures/diff-commonmark.txt", + "/testbed/tests/fixtures/fenced_admonition.txt", + "/testbed/tests/fixtures/fenced_figure.txt", + "/testbed/tests/fixtures/fenced_image.txt", + "/testbed/tests/fixtures/fenced_toc.txt", + "/testbed/tests/fixtures/fix-commonmark.txt", + "/testbed/tests/fixtures/footnotes.txt", + "/testbed/tests/fixtures/hook_toc.txt", + "/testbed/tests/fixtures/include/hello.md", + "/testbed/tests/fixtures/include/hello.txt", + "/testbed/tests/fixtures/include/text.html", + "/testbed/tests/fixtures/include/text.md", + "/testbed/tests/fixtures/insert.txt", + "/testbed/tests/fixtures/mark.txt", + "/testbed/tests/fixtures/math.txt", + "/testbed/tests/fixtures/renderer_markdown.txt", + "/testbed/tests/fixtures/renderer_rst.txt", + "/testbed/tests/fixtures/rst_admonition.txt", + "/testbed/tests/fixtures/rst_toc.txt", + "/testbed/tests/fixtures/ruby.txt", + "/testbed/tests/fixtures/spoiler.txt", + "/testbed/tests/fixtures/strikethrough.txt", + "/testbed/tests/fixtures/subscript.txt", + "/testbed/tests/fixtures/superscript.txt", + "/testbed/tests/fixtures/table.txt", + "/testbed/tests/fixtures/task_lists.txt", + "/testbed/tests/fixtures/url.txt", + "/testbed/tests/test_commonmark.py", + "/testbed/tests/test_directives.py", + "/testbed/tests/test_hooks.py", + "/testbed/tests/test_misc.py", + "/testbed/tests/test_plugins.py", + "/testbed/tests/test_syntax.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "MistuneBf54ef67", + "profile_lines": [ + 570, + 573 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "upstream_repo": "lepture/mistune" + }, + "original_source_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "private_test_paths": [ + "tests/test_renderers.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "src/mistune/renderers/rst.py" + ], + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "source_stages_bytes": 1361849, + "task_id": "lepture__mistune.bf54ef67.combine_file__d7rfqbr0", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "lepture/mistune" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:lepture__mistune.bf54ef67.combine_file__d7rfqbr0", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "62750c95db25a8fb93dda09242f64e07508d9231", + "instruction_sha256": "56593da424821c0cce3e5844f4c90b3eb0250fab921ba109595b471500eb1bd9", + "is_fork": true, + "learner_path": "tasks/670af8e4afeb4a2e45640646/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "actual_upstream_url": "https://raw.githubusercontent.com/lepture/mistune/bf54ef67390e02a5cdee7495d4386d7770c1902b/LICENSE", + "reviewed": true, + "sha256": "539013fd8e19f744f8bf0e27a532bbff54cd689ecef7a800f56ae5dc824be870", + "spdx": "BSD-3-Clause", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/lepture__mistune.bf54ef67/daeaceaa300555d292005e8fe0dd61148dcb65d1/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "patch_sha256": "d1b4fd8264b693c8967243ef353e46f663ab0e72c580aa07a319679362644cf4", + "provenance_path": "tasks/670af8e4afeb4a2e45640646/source-proof.json", + "repository_lineage": [ + "swesmith/lepture__mistune.bf54ef67", + "lepture/mistune" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "daeaceaa300555d292005e8fe0dd61148dcb65d1", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "347b2ad0cc359c47c059ec3ad8757134a08d2b65", + "source_kind": "mutation", + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "lepture__mistune.bf54ef67.combine_file__d7rfqbr0", + "task_sha256": "44b82ec6a146aba6d4861d1d15a51ae3c34195ecd0761d5312a643bd68daea9e", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "lepture/mistune", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/provenance.json b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..dba8a8fce788d438a515841d7169c4e1717d080c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "aaa8aa71b3934c4946d2e48df54715671181c3a98cd64933721734783e9c843a", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "actual_upstream_url": "https://raw.githubusercontent.com/lepture/mistune/bf54ef67390e02a5cdee7495d4386d7770c1902b/LICENSE", + "reviewed": true, + "sha256": "539013fd8e19f744f8bf0e27a532bbff54cd689ecef7a800f56ae5dc824be870", + "spdx": "BSD-3-Clause", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/lepture__mistune.bf54ef67/daeaceaa300555d292005e8fe0dd61148dcb65d1/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "d8f4fcdeff5e9abc1c19ec22ed2893e41812b3542aaa8f8e473e3db23484759e", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "bbe7d3e50b074b56096399c78dde165dc9d9c519f53f8e98a68afd88619959a3", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:lepture__mistune.bf54ef67.combine_file__d7rfqbr0", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "62750c95db25a8fb93dda09242f64e07508d9231", + "instruction_sha256": "56593da424821c0cce3e5844f4c90b3eb0250fab921ba109595b471500eb1bd9", + "is_fork": true, + "learner_path": "tasks/670af8e4afeb4a2e45640646/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "actual_upstream_url": "https://raw.githubusercontent.com/lepture/mistune/bf54ef67390e02a5cdee7495d4386d7770c1902b/LICENSE", + "reviewed": true, + "sha256": "539013fd8e19f744f8bf0e27a532bbff54cd689ecef7a800f56ae5dc824be870", + "spdx": "BSD-3-Clause", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/lepture__mistune.bf54ef67/daeaceaa300555d292005e8fe0dd61148dcb65d1/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "patch_sha256": "d1b4fd8264b693c8967243ef353e46f663ab0e72c580aa07a319679362644cf4", + "provenance_path": "tasks/670af8e4afeb4a2e45640646/source-proof.json", + "repository_lineage": [ + "swesmith/lepture__mistune.bf54ef67", + "lepture/mistune" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "daeaceaa300555d292005e8fe0dd61148dcb65d1", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "347b2ad0cc359c47c059ec3ad8757134a08d2b65", + "source_kind": "mutation", + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "lepture__mistune.bf54ef67.combine_file__d7rfqbr0", + "task_sha256": "44b82ec6a146aba6d4861d1d15a51ae3c34195ecd0761d5312a643bd68daea9e", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "lepture/mistune", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "cb345067f46bf3d3e7a60b2963e26cee25fe8aae6cd4a620d05e02f799d96fca" +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/provided-gold.diff b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..bc016e44b9111aaaf0896a6278fcab36dbcf37d7 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/provided-gold.diff @@ -0,0 +1,31 @@ +diff --git a/src/mistune/renderers/rst.py b/src/mistune/renderers/rst.py +index 7fe2236f0a935678ced9c8a4f2c5c16266b4dc65..7022d159132997703fe862e0fd2f990ba63659f3 100644 +--- a/src/mistune/renderers/rst.py ++++ b/src/mistune/renderers/rst.py +@@ -96,21 +96,19 @@ + text = ".. figure:: " + cast(str, attrs["url"]) + if title: + text += '\n :alt: ' + title +- else: +- text += '\n :alt: ' + alt +- text += '\n\n' + alt # Removed indent function usage ++ text += '\n\n' + indent(alt, ' ') + else: + text = self.render_tokens(children, state) + lines = text.split('') + if len(lines) > 1: +- text = '\n'.join('| ' + lines[i] for i in range(1, len(lines))) # Changed starting index to 1 +- return text + '\n' ++ text = '\n'.join('| ' + line for line in lines) ++ return text + '\n\n' + + def heading(self, token: Dict[str, Any], state: BlockState) -> str: + attrs = token['attrs'] +- text = self.render_children(state, token) ++ text = self.render_children(token, state) + marker = self.HEADING_MARKERS[attrs['level']] +- return text + '\n' + marker * (len(text) + 1) + '\n' ++ return text + '\n' + marker * len(text) + '\n\n' + + def thematic_break(self, token: Dict[str, Any], state: BlockState) -> str: + return '--------------\n\n' diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/solution/solve.sh b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..6bd739b27009a3f719b5c6878b2503f75cfc07ee --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/solution/solve.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/src/mistune/renderers/rst.py b/src/mistune/renderers/rst.py +index 7fe2236f0a935678ced9c8a4f2c5c16266b4dc65..7022d159132997703fe862e0fd2f990ba63659f3 100644 +--- a/src/mistune/renderers/rst.py ++++ b/src/mistune/renderers/rst.py +@@ -96,21 +96,19 @@ + text = ".. figure:: " + cast(str, attrs["url"]) + if title: + text += '\n :alt: ' + title +- else: +- text += '\n :alt: ' + alt +- text += '\n\n' + alt # Removed indent function usage ++ text += '\n\n' + indent(alt, ' ') + else: + text = self.render_tokens(children, state) + lines = text.split('') + if len(lines) > 1: +- text = '\n'.join('| ' + lines[i] for i in range(1, len(lines))) # Changed starting index to 1 +- return text + '\n' ++ text = '\n'.join('| ' + line for line in lines) ++ return text + '\n\n' + + def heading(self, token: Dict[str, Any], state: BlockState) -> str: + attrs = token['attrs'] +- text = self.render_children(state, token) ++ text = self.render_children(token, state) + marker = self.HEADING_MARKERS[attrs['level']] +- return text + '\n' + marker * (len(text) + 1) + '\n' ++ return text + '\n' + marker * len(text) + '\n\n' + + def thematic_break(self, token: Dict[str, Any], state: BlockState) -> str: + return '--------------\n\n' +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/task.toml b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..706f734e716192e69392dff798a52916fe2d55ce --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:e0ce619ed913f57a186f1c47579fa93a8012211479c167d79af5fdb74b716f21" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/check_pytest.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/expected-panels.json b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..9adff43e5bffeb11cbecf9cbafb19fb528355f68 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/expected-panels.json @@ -0,0 +1,951 @@ +{ + "fail-to-pass": [ + "tests/test_renderers.py::TestRendererRst::test_code_001", + "tests/test_renderers.py::TestRendererRst::test_code_002", + "tests/test_renderers.py::TestRendererRst::test_heading_001", + "tests/test_renderers.py::TestRendererRst::test_html_001", + "tests/test_renderers.py::TestRendererRst::test_images_001", + "tests/test_renderers.py::TestRendererRst::test_images_002", + "tests/test_renderers.py::TestRendererRst::test_images_003", + "tests/test_renderers.py::TestRendererRst::test_line_break_001", + "tests/test_renderers.py::TestRendererRst::test_list_003", + "tests/test_renderers.py::TestRendererRst::test_list_005", + "tests/test_renderers.py::TestRendererRst::test_quote_002", + "tests/test_renderers.py::TestRendererRst::test_quote_003", + "tests/test_renderers.py::TestRendererRst::test_thematic_break_001" + ], + "pass-to-pass": [ + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_062", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_063", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_064", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_065", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_066", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_067", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_068", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_069", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_070", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_071", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_072", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_073", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_074", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_075", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_076", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_077", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_078", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_079", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_593", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_594", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_595", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_596", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_597", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_598", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_599", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_600", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_601", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_602", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_603", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_604", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_605", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_606", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_607", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_608", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_609", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_610", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_611", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_012", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_013", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_014", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_015", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_016", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_017", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_018", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_019", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_020", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_021", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_022", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_023", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_024", + "tests/test_commonmark.py::TestCommonMark::test_blank_lines_227", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_228", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_229", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_230", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_231", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_232", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_233", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_234", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_235", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_236", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_237", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_238", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_239", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_240", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_241", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_242", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_243", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_244", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_245", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_246", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_247", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_248", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_249", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_250", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_251", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_252", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_328", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_329", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_330", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_331", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_332", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_333", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_334", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_335", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_336", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_337", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_338", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_339", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_340", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_341", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_342", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_343", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_344", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_345", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_346", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_347", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_348", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_349", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_350", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_351", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_353", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_354", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_355", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_356", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_357", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_358", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_359", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_360", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_361", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_362", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_363", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_364", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_365", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_366", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_369", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_370", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_371", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_373", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_374", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_375", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_376", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_377", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_378", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_380", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_381", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_382", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_383", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_384", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_385", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_386", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_387", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_389", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_390", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_392", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_393", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_394", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_395", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_396", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_397", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_398", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_399", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_400", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_401", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_402", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_403", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_404", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_405", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_409", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_410", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_411", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_415", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_419", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_420", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_421", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_422", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_423", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_427", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_428", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_432", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_433", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_434", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_435", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_436", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_437", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_438", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_439", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_440", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_447", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_448", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_449", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_450", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_451", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_452", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_459", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_461", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_466", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_468", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_469", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_472", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_473", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_474", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_475", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_476", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_479", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_480", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_025", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_026", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_027", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_028", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_029", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_030", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_031", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_032", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_033", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_034", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_035", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_036", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_037", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_038", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_039", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_040", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_041", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_119", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_120", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_121", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_122", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_123", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_124", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_125", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_126", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_127", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_128", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_129", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_130", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_131", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_132", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_133", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_134", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_135", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_136", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_137", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_138", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_139", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_140", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_141", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_142", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_143", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_144", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_145", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_146", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_147", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_633", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_634", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_635", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_636", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_637", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_638", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_639", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_640", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_641", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_642", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_643", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_644", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_645", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_646", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_647", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_148", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_149", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_150", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_151", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_152", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_153", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_154", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_155", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_156", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_157", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_158", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_159", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_160", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_161", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_162", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_163", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_164", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_165", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_166", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_167", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_168", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_169", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_170", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_171", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_172", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_173", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_174", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_175", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_176", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_177", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_178", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_179", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_180", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_181", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_182", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_183", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_184", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_185", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_186", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_187", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_188", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_189", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_190", + "tests/test_commonmark.py::TestCommonMark::test_images_571", + "tests/test_commonmark.py::TestCommonMark::test_images_572", + "tests/test_commonmark.py::TestCommonMark::test_images_574", + "tests/test_commonmark.py::TestCommonMark::test_images_575", + "tests/test_commonmark.py::TestCommonMark::test_images_576", + "tests/test_commonmark.py::TestCommonMark::test_images_577", + "tests/test_commonmark.py::TestCommonMark::test_images_578", + "tests/test_commonmark.py::TestCommonMark::test_images_579", + "tests/test_commonmark.py::TestCommonMark::test_images_580", + "tests/test_commonmark.py::TestCommonMark::test_images_581", + "tests/test_commonmark.py::TestCommonMark::test_images_582", + "tests/test_commonmark.py::TestCommonMark::test_images_583", + "tests/test_commonmark.py::TestCommonMark::test_images_584", + "tests/test_commonmark.py::TestCommonMark::test_images_585", + "tests/test_commonmark.py::TestCommonMark::test_images_586", + "tests/test_commonmark.py::TestCommonMark::test_images_587", + "tests/test_commonmark.py::TestCommonMark::test_images_588", + "tests/test_commonmark.py::TestCommonMark::test_images_589", + "tests/test_commonmark.py::TestCommonMark::test_images_590", + "tests/test_commonmark.py::TestCommonMark::test_images_591", + "tests/test_commonmark.py::TestCommonMark::test_images_592", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_107", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_108", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_109", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_110", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_111", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_112", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_113", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_114", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_115", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_116", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_117", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_118", + "tests/test_commonmark.py::TestCommonMark::test_inlines_327", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_192", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_193", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_194", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_195", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_196", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_197", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_198", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_199", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_200", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_201", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_202", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_203", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_204", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_205", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_206", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_207", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_208", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_209", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_210", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_211", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_212", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_213", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_214", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_215", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_216", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_217", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_218", + "tests/test_commonmark.py::TestCommonMark::test_links_481", + "tests/test_commonmark.py::TestCommonMark::test_links_482", + "tests/test_commonmark.py::TestCommonMark::test_links_483", + "tests/test_commonmark.py::TestCommonMark::test_links_484", + "tests/test_commonmark.py::TestCommonMark::test_links_485", + "tests/test_commonmark.py::TestCommonMark::test_links_486", + "tests/test_commonmark.py::TestCommonMark::test_links_487", + "tests/test_commonmark.py::TestCommonMark::test_links_488", + "tests/test_commonmark.py::TestCommonMark::test_links_489", + "tests/test_commonmark.py::TestCommonMark::test_links_490", + "tests/test_commonmark.py::TestCommonMark::test_links_491", + "tests/test_commonmark.py::TestCommonMark::test_links_492", + "tests/test_commonmark.py::TestCommonMark::test_links_493", + "tests/test_commonmark.py::TestCommonMark::test_links_494", + "tests/test_commonmark.py::TestCommonMark::test_links_497", + "tests/test_commonmark.py::TestCommonMark::test_links_498", + "tests/test_commonmark.py::TestCommonMark::test_links_499", + "tests/test_commonmark.py::TestCommonMark::test_links_500", + "tests/test_commonmark.py::TestCommonMark::test_links_501", + "tests/test_commonmark.py::TestCommonMark::test_links_502", + "tests/test_commonmark.py::TestCommonMark::test_links_503", + "tests/test_commonmark.py::TestCommonMark::test_links_505", + "tests/test_commonmark.py::TestCommonMark::test_links_506", + "tests/test_commonmark.py::TestCommonMark::test_links_507", + "tests/test_commonmark.py::TestCommonMark::test_links_508", + "tests/test_commonmark.py::TestCommonMark::test_links_509", + "tests/test_commonmark.py::TestCommonMark::test_links_510", + "tests/test_commonmark.py::TestCommonMark::test_links_511", + "tests/test_commonmark.py::TestCommonMark::test_links_512", + "tests/test_commonmark.py::TestCommonMark::test_links_513", + "tests/test_commonmark.py::TestCommonMark::test_links_514", + "tests/test_commonmark.py::TestCommonMark::test_links_515", + "tests/test_commonmark.py::TestCommonMark::test_links_516", + "tests/test_commonmark.py::TestCommonMark::test_links_520", + "tests/test_commonmark.py::TestCommonMark::test_links_521", + "tests/test_commonmark.py::TestCommonMark::test_links_522", + "tests/test_commonmark.py::TestCommonMark::test_links_523", + "tests/test_commonmark.py::TestCommonMark::test_links_524", + "tests/test_commonmark.py::TestCommonMark::test_links_525", + "tests/test_commonmark.py::TestCommonMark::test_links_526", + "tests/test_commonmark.py::TestCommonMark::test_links_527", + "tests/test_commonmark.py::TestCommonMark::test_links_528", + "tests/test_commonmark.py::TestCommonMark::test_links_529", + "tests/test_commonmark.py::TestCommonMark::test_links_530", + "tests/test_commonmark.py::TestCommonMark::test_links_533", + "tests/test_commonmark.py::TestCommonMark::test_links_534", + "tests/test_commonmark.py::TestCommonMark::test_links_535", + "tests/test_commonmark.py::TestCommonMark::test_links_536", + "tests/test_commonmark.py::TestCommonMark::test_links_537", + "tests/test_commonmark.py::TestCommonMark::test_links_538", + "tests/test_commonmark.py::TestCommonMark::test_links_539", + "tests/test_commonmark.py::TestCommonMark::test_links_540", + "tests/test_commonmark.py::TestCommonMark::test_links_541", + "tests/test_commonmark.py::TestCommonMark::test_links_542", + "tests/test_commonmark.py::TestCommonMark::test_links_543", + "tests/test_commonmark.py::TestCommonMark::test_links_544", + "tests/test_commonmark.py::TestCommonMark::test_links_545", + "tests/test_commonmark.py::TestCommonMark::test_links_546", + "tests/test_commonmark.py::TestCommonMark::test_links_547", + "tests/test_commonmark.py::TestCommonMark::test_links_548", + "tests/test_commonmark.py::TestCommonMark::test_links_549", + "tests/test_commonmark.py::TestCommonMark::test_links_550", + "tests/test_commonmark.py::TestCommonMark::test_links_551", + "tests/test_commonmark.py::TestCommonMark::test_links_552", + "tests/test_commonmark.py::TestCommonMark::test_links_553", + "tests/test_commonmark.py::TestCommonMark::test_links_554", + "tests/test_commonmark.py::TestCommonMark::test_links_555", + "tests/test_commonmark.py::TestCommonMark::test_links_556", + "tests/test_commonmark.py::TestCommonMark::test_links_557", + "tests/test_commonmark.py::TestCommonMark::test_links_558", + "tests/test_commonmark.py::TestCommonMark::test_links_559", + "tests/test_commonmark.py::TestCommonMark::test_links_560", + "tests/test_commonmark.py::TestCommonMark::test_links_561", + "tests/test_commonmark.py::TestCommonMark::test_links_562", + "tests/test_commonmark.py::TestCommonMark::test_links_563", + "tests/test_commonmark.py::TestCommonMark::test_links_564", + "tests/test_commonmark.py::TestCommonMark::test_links_565", + "tests/test_commonmark.py::TestCommonMark::test_links_566", + "tests/test_commonmark.py::TestCommonMark::test_links_567", + "tests/test_commonmark.py::TestCommonMark::test_links_568", + "tests/test_commonmark.py::TestCommonMark::test_links_569", + "tests/test_commonmark.py::TestCommonMark::test_links_570", + "tests/test_commonmark.py::TestCommonMark::test_list_items_253", + "tests/test_commonmark.py::TestCommonMark::test_list_items_254", + "tests/test_commonmark.py::TestCommonMark::test_list_items_255", + "tests/test_commonmark.py::TestCommonMark::test_list_items_256", + "tests/test_commonmark.py::TestCommonMark::test_list_items_257", + "tests/test_commonmark.py::TestCommonMark::test_list_items_258", + "tests/test_commonmark.py::TestCommonMark::test_list_items_259", + "tests/test_commonmark.py::TestCommonMark::test_list_items_260", + "tests/test_commonmark.py::TestCommonMark::test_list_items_261", + "tests/test_commonmark.py::TestCommonMark::test_list_items_262", + "tests/test_commonmark.py::TestCommonMark::test_list_items_263", + "tests/test_commonmark.py::TestCommonMark::test_list_items_264", + "tests/test_commonmark.py::TestCommonMark::test_list_items_265", + "tests/test_commonmark.py::TestCommonMark::test_list_items_266", + "tests/test_commonmark.py::TestCommonMark::test_list_items_267", + "tests/test_commonmark.py::TestCommonMark::test_list_items_268", + "tests/test_commonmark.py::TestCommonMark::test_list_items_269", + "tests/test_commonmark.py::TestCommonMark::test_list_items_270", + "tests/test_commonmark.py::TestCommonMark::test_list_items_271", + "tests/test_commonmark.py::TestCommonMark::test_list_items_272", + "tests/test_commonmark.py::TestCommonMark::test_list_items_273", + "tests/test_commonmark.py::TestCommonMark::test_list_items_274", + "tests/test_commonmark.py::TestCommonMark::test_list_items_275", + "tests/test_commonmark.py::TestCommonMark::test_list_items_276", + "tests/test_commonmark.py::TestCommonMark::test_list_items_277", + "tests/test_commonmark.py::TestCommonMark::test_list_items_278", + "tests/test_commonmark.py::TestCommonMark::test_list_items_279", + "tests/test_commonmark.py::TestCommonMark::test_list_items_280", + "tests/test_commonmark.py::TestCommonMark::test_list_items_281", + "tests/test_commonmark.py::TestCommonMark::test_list_items_282", + "tests/test_commonmark.py::TestCommonMark::test_list_items_283", + "tests/test_commonmark.py::TestCommonMark::test_list_items_284", + "tests/test_commonmark.py::TestCommonMark::test_list_items_285", + "tests/test_commonmark.py::TestCommonMark::test_list_items_286", + "tests/test_commonmark.py::TestCommonMark::test_list_items_287", + "tests/test_commonmark.py::TestCommonMark::test_list_items_288", + "tests/test_commonmark.py::TestCommonMark::test_list_items_289", + "tests/test_commonmark.py::TestCommonMark::test_list_items_290", + "tests/test_commonmark.py::TestCommonMark::test_list_items_291", + "tests/test_commonmark.py::TestCommonMark::test_list_items_292", + "tests/test_commonmark.py::TestCommonMark::test_list_items_293", + "tests/test_commonmark.py::TestCommonMark::test_list_items_294", + "tests/test_commonmark.py::TestCommonMark::test_list_items_295", + "tests/test_commonmark.py::TestCommonMark::test_list_items_296", + "tests/test_commonmark.py::TestCommonMark::test_list_items_297", + "tests/test_commonmark.py::TestCommonMark::test_list_items_298", + "tests/test_commonmark.py::TestCommonMark::test_list_items_299", + "tests/test_commonmark.py::TestCommonMark::test_list_items_300", + "tests/test_commonmark.py::TestCommonMark::test_lists_301", + "tests/test_commonmark.py::TestCommonMark::test_lists_302", + "tests/test_commonmark.py::TestCommonMark::test_lists_303", + "tests/test_commonmark.py::TestCommonMark::test_lists_304", + "tests/test_commonmark.py::TestCommonMark::test_lists_305", + "tests/test_commonmark.py::TestCommonMark::test_lists_306", + "tests/test_commonmark.py::TestCommonMark::test_lists_307", + "tests/test_commonmark.py::TestCommonMark::test_lists_308", + "tests/test_commonmark.py::TestCommonMark::test_lists_309", + "tests/test_commonmark.py::TestCommonMark::test_lists_310", + "tests/test_commonmark.py::TestCommonMark::test_lists_311", + "tests/test_commonmark.py::TestCommonMark::test_lists_312", + "tests/test_commonmark.py::TestCommonMark::test_lists_313", + "tests/test_commonmark.py::TestCommonMark::test_lists_314", + "tests/test_commonmark.py::TestCommonMark::test_lists_315", + "tests/test_commonmark.py::TestCommonMark::test_lists_316", + "tests/test_commonmark.py::TestCommonMark::test_lists_317", + "tests/test_commonmark.py::TestCommonMark::test_lists_318", + "tests/test_commonmark.py::TestCommonMark::test_lists_319", + "tests/test_commonmark.py::TestCommonMark::test_lists_320", + "tests/test_commonmark.py::TestCommonMark::test_lists_321", + "tests/test_commonmark.py::TestCommonMark::test_lists_322", + "tests/test_commonmark.py::TestCommonMark::test_lists_323", + "tests/test_commonmark.py::TestCommonMark::test_lists_324", + "tests/test_commonmark.py::TestCommonMark::test_lists_325", + "tests/test_commonmark.py::TestCommonMark::test_lists_326", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_219", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_220", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_221", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_222", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_223", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_224", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_225", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_226", + "tests/test_commonmark.py::TestCommonMark::test_precedence_042", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_612", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_613", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_614", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_615", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_616", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_617", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_618", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_619", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_620", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_621", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_622", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_623", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_624", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_625", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_626", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_627", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_628", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_629", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_630", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_631", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_632", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_080", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_081", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_082", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_083", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_084", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_085", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_086", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_087", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_088", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_089", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_090", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_091", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_092", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_094", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_095", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_096", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_097", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_098", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_099", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_100", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_101", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_102", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_103", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_104", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_105", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_106", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_648", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_649", + "tests/test_commonmark.py::TestCommonMark::test_tabs_001", + "tests/test_commonmark.py::TestCommonMark::test_tabs_002", + "tests/test_commonmark.py::TestCommonMark::test_tabs_003", + "tests/test_commonmark.py::TestCommonMark::test_tabs_004", + "tests/test_commonmark.py::TestCommonMark::test_tabs_005", + "tests/test_commonmark.py::TestCommonMark::test_tabs_006", + "tests/test_commonmark.py::TestCommonMark::test_tabs_007", + "tests/test_commonmark.py::TestCommonMark::test_tabs_008", + "tests/test_commonmark.py::TestCommonMark::test_tabs_009", + "tests/test_commonmark.py::TestCommonMark::test_tabs_010", + "tests/test_commonmark.py::TestCommonMark::test_tabs_011", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_650", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_651", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_652", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_043", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_044", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_045", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_046", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_047", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_048", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_049", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_050", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_051", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_052", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_053", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_054", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_055", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_056", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_057", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_058", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_059", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_060", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_061", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_rst_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_complex_001", + "tests/test_directives.py::TestDirective_rst_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_rst_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_rst_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_005", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_006", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_007", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_008", + "tests/test_directives.py::TestDirective_fenced_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_complex_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_fenced_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_image::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_source_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_target_001", + "tests/test_directives.py::TestDirective_fenced_image::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_target_option_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_caption_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_target_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_003", + "tests/test_directives.py::TestCustomizeToc::test_colon_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_rst_toc", + "tests/test_directives.py::TestDirectiveInclude::test_html_include", + "tests/test_directives.py::TestDirectiveInclude::test_include_missing_source", + "tests/test_hooks.py::TestTocHook::test_complex_toc_001", + "tests/test_hooks.py::TestTocHook::test_customize_heading_id_func", + "tests/test_hooks.py::TestTocHook::test_html_in_heading_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_002", + "tests/test_hooks.py::TestTocHook::test_link_in_heading_001", + "tests/test_hooks.py::TestTocHook::test_simple_toc_001", + "tests/test_misc.py::TestMiscCases::test_allow_data_protocols", + "tests/test_misc.py::TestMiscCases::test_allow_harmful_protocols", + "tests/test_misc.py::TestMiscCases::test_ast_output", + "tests/test_misc.py::TestMiscCases::test_ast_url", + "tests/test_misc.py::TestMiscCases::test_before_parse_hooks", + "tests/test_misc.py::TestMiscCases::test_emsp", + "tests/test_misc.py::TestMiscCases::test_escape_html", + "tests/test_misc.py::TestMiscCases::test_hard_wrap", + "tests/test_misc.py::TestMiscCases::test_harmful_links", + "tests/test_misc.py::TestMiscCases::test_html_tag_text_following_list", + "tests/test_misc.py::TestMiscCases::test_markdown_func", + "tests/test_misc.py::TestMiscCases::test_none", + "tests/test_misc.py::TestMiscCases::test_ref_link", + "tests/test_misc.py::TestMiscCases::test_use_plugin", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin1_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin2_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin1_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin2_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_003", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_quote", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_quote", + "tests/test_renderers.py::TestRendererRst::test_inline_001", + "tests/test_renderers.py::TestRendererRst::test_inline_002", + "tests/test_renderers.py::TestRendererRst::test_links_001", + "tests/test_renderers.py::TestRendererRst::test_list_001", + "tests/test_renderers.py::TestRendererRst::test_list_002", + "tests/test_renderers.py::TestRendererRst::test_list_004", + "tests/test_renderers.py::TestRendererRst::test_quote_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_002", + "tests/test_renderers.py::TestRendererMarkdown::test_code_003", + "tests/test_renderers.py::TestRendererMarkdown::test_code_004", + "tests/test_renderers.py::TestRendererMarkdown::test_code_005", + "tests/test_renderers.py::TestRendererMarkdown::test_heading_001", + "tests/test_renderers.py::TestRendererMarkdown::test_html_001", + "tests/test_renderers.py::TestRendererMarkdown::test_images_001", + "tests/test_renderers.py::TestRendererMarkdown::test_inline_001", + "tests/test_renderers.py::TestRendererMarkdown::test_linebreak_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_002", + "tests/test_renderers.py::TestRendererMarkdown::test_links_003", + "tests/test_renderers.py::TestRendererMarkdown::test_list_001", + "tests/test_renderers.py::TestRendererMarkdown::test_list_002", + "tests/test_renderers.py::TestRendererMarkdown::test_list_003", + "tests/test_renderers.py::TestRendererMarkdown::test_list_004", + "tests/test_renderers.py::TestRendererMarkdown::test_list_005", + "tests/test_renderers.py::TestRendererMarkdown::test_list_006", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_001", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_002", + "tests/test_renderers.py::TestRendererMarkdown::test_thematic_break_001", + "tests/test_syntax.py::TestSyntax::test_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_image_001", + "tests/test_syntax.py::TestSyntax::test_link_001", + "tests/test_syntax.py::TestSyntax::test_link_002", + "tests/test_syntax.py::TestSyntax::test_link_003", + "tests/test_syntax.py::TestSyntax::test_links_001", + "tests/test_syntax.py::TestSyntax::test_links_002", + "tests/test_syntax.py::TestSyntax::test_max_depth_001", + "tests/test_syntax.py::TestSyntax::test_max_depth_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_003", + "tests/test_syntax.py::TestSyntax::test_setext_headings_001", + "tests/test_syntax.py::TestSyntax::test_setext_headings_002" + ] +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/grade.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/panel-config.json b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..fcf9afd120808ef57ca8e15a2ff5adfbb1b9b425 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/panel-config.json @@ -0,0 +1,24 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "python -m pip install -e ." + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "pyproject.toml": "b2922e3ef89e2918935d38fb3a777bdbc741619942276a75fd21a8dd9faf6b42" + } +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/test.sh b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted-inventory.json b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..aa70e1f5d5d129ced763ef7db40f73f94595e1e2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted-inventory.json @@ -0,0 +1,212 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 1781, + "mode": 420, + "sha256": "b2922e3ef89e2918935d38fb3a777bdbc741619942276a75fd21a8dd9faf6b42" + }, + "setup.py": { + "bytes": 52, + "mode": 420, + "sha256": "504f5c8cbb3b966b1f3f838da0a0cdc77b312f0c5935951357d17328e5324e21" + }, + "tests/__init__.py": { + "bytes": 1149, + "mode": 420, + "sha256": "229cc35ee9a5f5a9fb37e036683e2276f940b80df2dc6203102c0f36f960e467" + }, + "tests/fixtures/__init__.py": { + "bytes": 1502, + "mode": 420, + "sha256": "960fa58f01c3a473a956cc2d5430314d10f070bff18b35c9707c52c1c42a57e2" + }, + "tests/fixtures/abbr.txt": { + "bytes": 2703, + "mode": 420, + "sha256": "18c7e06359486daeaafa88c7404f4ca8248cd47bf38a7ed475ddd35353e68bea" + }, + "tests/fixtures/commonmark.json": { + "bytes": 140423, + "mode": 420, + "sha256": "ae6129f3ce3caf4f99cf4f9a5ad3558a309652b5b887171013e2bf0797289b98" + }, + "tests/fixtures/def_list.txt": { + "bytes": 2834, + "mode": 420, + "sha256": "909b7156a5ba1f005ea3d8a203946e7ab3576149ec5af73ecad657bb046f386d" + }, + "tests/fixtures/diff-commonmark.txt": { + "bytes": 1176, + "mode": 420, + "sha256": "920df6e3c9c8e3d4627842d5a7aeb172bdd23229acfbbb9a9b728a9f6ce2c1f0" + }, + "tests/fixtures/fenced_admonition.txt": { + "bytes": 2344, + "mode": 420, + "sha256": "0f231afd472bc2c742170798e619d1baa5dd34e9e4a6cb18906dabd1aa37a1d0" + }, + "tests/fixtures/fenced_figure.txt": { + "bytes": 3481, + "mode": 420, + "sha256": "83c3d636e8d4f0dd5a767045cf38877fd3c6c03a20c351f06c50e30ae7f30cda" + }, + "tests/fixtures/fenced_image.txt": { + "bytes": 2343, + "mode": 420, + "sha256": "fa7ede5a90b718aaeb46af7f5a4d98a0e17cec0411355f460a166356020e6780" + }, + "tests/fixtures/fenced_toc.txt": { + "bytes": 3656, + "mode": 420, + "sha256": "019a12ca2e293699d88241460bdea48ee6a65981b36b6bae4c0bbf78f020a296" + }, + "tests/fixtures/fix-commonmark.txt": { + "bytes": 1905, + "mode": 420, + "sha256": "1f2777b457f4da70e02983bbcb2104fa3b442dbb8a5bcac1621499b0b796292f" + }, + "tests/fixtures/footnotes.txt": { + "bytes": 847, + "mode": 420, + "sha256": "55227ab43a3986fd07ecbf0742903a977f04cd9ed403086d7c76f23b1967aab1" + }, + "tests/fixtures/hook_toc.txt": { + "bytes": 1896, + "mode": 420, + "sha256": "bdb1a5c90f08cb29c4eed3c892e9c694f92855507b6cd5809eac3b8eb4fc7dc5" + }, + "tests/fixtures/include/hello.md": { + "bytes": 8, + "mode": 420, + "sha256": "389aaf8f17da55ef35fedf530bc70cd1287042f6410ec94c2b44c1b22c36e60a" + }, + "tests/fixtures/include/hello.txt": { + "bytes": 6, + "mode": 420, + "sha256": "5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03" + }, + "tests/fixtures/include/text.html": { + "bytes": 24, + "mode": 420, + "sha256": "bac2f8a2e3937f8923da8e560248d2a52867b502fbda531ba73f1d066b35d2ba" + }, + "tests/fixtures/include/text.md": { + "bytes": 163, + "mode": 420, + "sha256": "3ffb497b2829ca6333bc6eb4e7d2959aa7baeaa44180225a4820e0051ae7ef75" + }, + "tests/fixtures/insert.txt": { + "bytes": 1165, + "mode": 420, + "sha256": "de7b89a58c2cbd2d4948c10b8c599fd7500b3ae6734d271a35ff2cf2854b1572" + }, + "tests/fixtures/mark.txt": { + "bytes": 1138, + "mode": 420, + "sha256": "6b5c232cf89f61097ae6d032865a99bdcd9f65e3ef99517d9423b2da0aa983d0" + }, + "tests/fixtures/math.txt": { + "bytes": 1174, + "mode": 420, + "sha256": "eadc29b04cc85928e50003b2908b002a778447ef028c4b773ca1753b907fd898" + }, + "tests/fixtures/renderer_markdown.txt": { + "bytes": 3569, + "mode": 420, + "sha256": "2ba5fc55634d7dbaabd91aedea9e04b34882e67abc3020034bd809a408cac2a7" + }, + "tests/fixtures/renderer_rst.txt": { + "bytes": 2915, + "mode": 420, + "sha256": "47007bc353f230e9b73d8604548539bb16374a4b837bf7ba8d2f478444fff84e" + }, + "tests/fixtures/rst_admonition.txt": { + "bytes": 848, + "mode": 420, + "sha256": "821676f07a4e595c51c84da87edc592e22e8bbed6241e070040d87a4de7c5d7e" + }, + "tests/fixtures/rst_toc.txt": { + "bytes": 3643, + "mode": 420, + "sha256": "f9ae334cef85d776c37d7ad029e1e38d9e1b035423ab624dab8499aff28f7e98" + }, + "tests/fixtures/ruby.txt": { + "bytes": 1773, + "mode": 420, + "sha256": "1302542447ac0befc2618d9c2da1657581fcc1d90c332896e6dc086b698e30ed" + }, + "tests/fixtures/spoiler.txt": { + "bytes": 1154, + "mode": 420, + "sha256": "21446f2e88b70cc3c50e606c36fbcdf567993581ccf8397ace5948973c251985" + }, + "tests/fixtures/strikethrough.txt": { + "bytes": 886, + "mode": 420, + "sha256": "fee85a2207da74bdcf437c2c58804b009b657b4dfd505989fdbee46f78feac07" + }, + "tests/fixtures/subscript.txt": { + "bytes": 521, + "mode": 420, + "sha256": "61fd94b4718edbbfaa782533f659f4f193585fb09e61761a662cd313906932b8" + }, + "tests/fixtures/superscript.txt": { + "bytes": 523, + "mode": 420, + "sha256": "658ac752d95d74e6e97e7daceba6f48ef279dc6f1389a878610bc608e82f34b3" + }, + "tests/fixtures/table.txt": { + "bytes": 4134, + "mode": 420, + "sha256": "f92d66b63d00f95f7a9938cb6e0e42ea4968d6e9f1f62e902b63bc1be69f51b6" + }, + "tests/fixtures/task_lists.txt": { + "bytes": 3104, + "mode": 420, + "sha256": "d17a07a9cb077dd25c3b4c4dd7301bc9f508ab75ec83c2293b0ebaca954be76c" + }, + "tests/fixtures/url.txt": { + "bytes": 530, + "mode": 420, + "sha256": "441ea5e1e27f6edcd52b51f8c20ca1eee8b76d4adcc3b2fcdd419448c528ef21" + }, + "tests/test_commonmark.py": { + "bytes": 2199, + "mode": 420, + "sha256": "77396377672a8419ecab283aebf55a5e206b1aa413626975dc8b2a006c796973" + }, + "tests/test_directives.py": { + "bytes": 2954, + "mode": 420, + "sha256": "3d46db4f9e52d3067954ab7fcaba80ef855008a516a86ee3baf07b2a9c730817" + }, + "tests/test_hooks.py": { + "bytes": 729, + "mode": 420, + "sha256": "9d6f177c6dd52223ac44e31508ed66bbc2b6fc7a4725ed7121fb39842b0a6a61" + }, + "tests/test_misc.py": { + "bytes": 4830, + "mode": 420, + "sha256": "a1bba411b7b74f1b9d43bf88459db1d9fa2c13e7db32dfee707c93cd8ccb5575" + }, + "tests/test_plugins.py": { + "bytes": 2280, + "mode": 420, + "sha256": "56a6731c5e5667870122edfb3d49925a34dc394ae00ce3282dc3e89cbe2fd6b8" + }, + "tests/test_renderers.py": { + "bytes": 500, + "mode": 420, + "sha256": "efc0fa48c74f8ee1b84c961e4ca034eb5f0246b69b4663428c93cc77d471e7b8" + }, + "tests/test_syntax.py": { + "bytes": 342, + "mode": 420, + "sha256": "88f99c6afc5f39f088c0cd1cdf4fab8a69b60b208a1b28924eeb8fbd0d7bef2e" + } + } +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/pyproject.toml b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..2d95f9b3bd4ee9817157eab051c5277fb0a3846f --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/pyproject.toml @@ -0,0 +1,69 @@ +[project] +name = "mistune" +description = "A sane and fast Markdown parser with useful plugins and renderers" +authors = [{name = "Hsiaoming Yang", email="me@lepture.com"}] +dependencies = [ + "typing-extensions; python_version<'3.11'", +] +license = {text = "BSD-3-Clause"} +dynamic = ["version"] +requires-python = ">=3.8" +readme = "README.rst" +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Text Processing :: Markup", +] + +[project.urls] +Documentation = "https://mistune.lepture.com/" +Source = "https://github.com/lepture/mistune" +Donate = "https://github.com/sponsors/lepture" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +version = {attr = "mistune.__version__"} + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +mistune = ["py.typed"] + +[tool.ruff] +line-length = 120 + +[tool.pytest.ini_options] +pythonpath = ["src", "."] +testpaths = ["tests"] +filterwarnings = ["error"] + +[tool.coverage.run] +branch = true +source = ["mistune"] + +[tool.coverage.paths] +source = ["src"] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "raise NotImplementedError", + "@(abc\\.)?abstractmethod", +] diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/setup.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..af8a0fc50e9db1a27585118393965a8c87e19129 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup(name="mistune") diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/__init__.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b715104d1f96221038f7c9060d66b4bc6a5bdda2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/__init__.py @@ -0,0 +1,40 @@ +import re +from abc import abstractmethod +from unittest import TestCase + +from tests import fixtures + + +class BaseTestCase(TestCase): + @classmethod + def load_fixtures(cls, case_file: str) -> None: + def attach_case(n: str, text: str, html: str) -> None: + def method(self: 'BaseTestCase') -> None: + self.assert_case(n, text, html) + + name = 'test_{}'.format(n) + method.__name__ = name + method.__doc__ = 'Run fixture {} - {}'.format(case_file, n) + setattr(cls, name, method) + + for n, text, html in fixtures.load_examples(case_file): + if cls.ignore_case(n): + continue + attach_case(n, text, html) + + @classmethod + def ignore_case(cls, name: str) -> bool: + return False + + @abstractmethod + def parse(self, text: str) -> str: ... + + def assert_case(self, name: str, text: str, html: str) -> None: + result = self.parse(text) + self.assertEqual(result, html) + + +def normalize_html(html: str) -> str: + html = re.sub(r'>\n+', '>', html) + html = re.sub(r'\n+<', '<', html) + return html.strip() diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/__init__.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a1abe299918fbbac039621a46f85061a7f0c31e --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/__init__.py @@ -0,0 +1,56 @@ +import os +import re +import json +from typing import Any, Iterable, Tuple + +ROOT = os.path.join(os.path.dirname(__file__)) + +EXAMPLE_PATTERN = re.compile( + r'^`{32} example\n([\s\S]*?)' + r'^\.\n([\s\S]*?)' + r'^`{32}$|^#{1,6} *(.*)$', + flags=re.M +) + + +def load_ast(filename: str) -> Any: + with open(os.path.join(ROOT, 'ast', filename)) as f: + return json.load(f) + + +def load_json(filename: str) -> Any: + with open(os.path.join(ROOT, filename)) as f: + return json.load(f) + + +def load_examples(filename: str) -> Iterable[Tuple[str, str, str]]: + if filename.endswith('.json'): + data = load_json(filename) + for item in data: + section = item['section'].lower().replace(' ', '_') + n = '%s_%03d' % (section, item['example']) + yield n, item['markdown'], item['html'] + else: + with open(os.path.join(ROOT, filename), 'rb') as f: + content = f.read() + s = content.decode('utf-8') + yield from parse_examples(s) + + + +def parse_examples(text: str) -> Iterable[Tuple[str, str, str]]: + data = EXAMPLE_PATTERN.findall(text) + + section = None + count = 0 + for md, html, title in data: + if title: + count = 0 + section = title.lower().replace(' ', '_') + + if md and html: + count += 1 + n = '%s_%03d' % (section, count) + md = md.replace(u'\u2192', '\t') + html = html.replace(u'\u2192', '\t') + yield n, md, html diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/abbr.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/abbr.txt new file mode 100644 index 0000000000000000000000000000000000000000..a87b4f1521511a9071a901311c07372340bb958c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/abbr.txt @@ -0,0 +1,79 @@ +# Abbreviation + +## abbreviation + +```````````````````````````````` example +HTML +. +

HTML

+```````````````````````````````` + +```````````````````````````````` example +HTML +*[HTML]: Hyper Text Markup Language +. +

HTML

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: Hyper Text Markup Language +*[W3C]: World Wide Web Consortium +. +

The HTML specification is maintained by the W3C.

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: + Hyper Text Markup Language +*[W3C]: + World Wide Web Consortium +. +

The HTML specification is maintained by the W3C.

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: Hyper Text Markup Language +*[W3C]: World Wide Web Consortium +There is more text below this one. +. +

The HTML specification is maintained by the W3C.

+

There is more text below this one.

+```````````````````````````````` + +```````````````````````````````` example +The latest spec of HTML is HTML5. +*[HTML]: Hyper Text Markup Language +. +

The latest spec of HTML is HTML5.

+```````````````````````````````` + +```````````````````````````````` example +HTML should always be spelt with capital letters and not spelt html. +*[HTML]: Hyper Text Markup Language +. +

HTML should always be spelt with capital letters and not spelt html.

+```````````````````````````````` + +```````````````````````````````` example +HTML is an abbreviation but nobody knows what it stands for. +*[HTML]: +. +

HTML is an abbreviation but nobody knows what it stands for.

+```````````````````````````````` + +```````````````````````````````` example +Foo.* looks like a regular expression. +*[Foo.*]: Just foo +. +

Foo.* looks like a regular expression.

+```````````````````````````````` + +```````````````````````````````` example +Untrusted HTML should be escaped. +*[HTML]:

This is some HTML

+. +

Untrusted HTML should be escaped.

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/commonmark.json b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/commonmark.json new file mode 100644 index 0000000000000000000000000000000000000000..d742f941312421f89a3491b7e1d5edd0e44d2207 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/commonmark.json @@ -0,0 +1,5218 @@ +[ + { + "markdown": "\tfoo\tbaz\t\tbim\n", + "html": "
foo\tbaz\t\tbim\n
\n", + "example": 1, + "start_line": 356, + "end_line": 361, + "section": "Tabs" + }, + { + "markdown": " \tfoo\tbaz\t\tbim\n", + "html": "
foo\tbaz\t\tbim\n
\n", + "example": 2, + "start_line": 363, + "end_line": 368, + "section": "Tabs" + }, + { + "markdown": " a\ta\n ὐ\ta\n", + "html": "
a\ta\nὐ\ta\n
\n", + "example": 3, + "start_line": 370, + "end_line": 377, + "section": "Tabs" + }, + { + "markdown": " - foo\n\n\tbar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 4, + "start_line": 383, + "end_line": 394, + "section": "Tabs" + }, + { + "markdown": "- foo\n\n\t\tbar\n", + "html": "
    \n
  • \n

    foo

    \n
      bar\n
    \n
  • \n
\n", + "example": 5, + "start_line": 396, + "end_line": 408, + "section": "Tabs" + }, + { + "markdown": ">\t\tfoo\n", + "html": "
\n
  foo\n
\n
\n", + "example": 6, + "start_line": 419, + "end_line": 426, + "section": "Tabs" + }, + { + "markdown": "-\t\tfoo\n", + "html": "
    \n
  • \n
      foo\n
    \n
  • \n
\n", + "example": 7, + "start_line": 428, + "end_line": 437, + "section": "Tabs" + }, + { + "markdown": " foo\n\tbar\n", + "html": "
foo\nbar\n
\n", + "example": 8, + "start_line": 440, + "end_line": 447, + "section": "Tabs" + }, + { + "markdown": " - foo\n - bar\n\t - baz\n", + "html": "
    \n
  • foo\n
      \n
    • bar\n
        \n
      • baz
      • \n
      \n
    • \n
    \n
  • \n
\n", + "example": 9, + "start_line": 449, + "end_line": 465, + "section": "Tabs" + }, + { + "markdown": "#\tFoo\n", + "html": "

Foo

\n", + "example": 10, + "start_line": 467, + "end_line": 471, + "section": "Tabs" + }, + { + "markdown": "*\t*\t*\t\n", + "html": "
\n", + "example": 11, + "start_line": 473, + "end_line": 477, + "section": "Tabs" + }, + { + "markdown": "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\n", + "html": "

!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~

\n", + "example": 12, + "start_line": 490, + "end_line": 494, + "section": "Backslash escapes" + }, + { + "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", + "html": "

\\\t\\A\\a\\ \\3\\φ\\«

\n", + "example": 13, + "start_line": 500, + "end_line": 504, + "section": "Backslash escapes" + }, + { + "markdown": "\\*not emphasized*\n\\
not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\ö not a character entity\n", + "html": "

*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\n&ouml; not a character entity

\n", + "example": 14, + "start_line": 510, + "end_line": 530, + "section": "Backslash escapes" + }, + { + "markdown": "\\\\*emphasis*\n", + "html": "

\\emphasis

\n", + "example": 15, + "start_line": 535, + "end_line": 539, + "section": "Backslash escapes" + }, + { + "markdown": "foo\\\nbar\n", + "html": "

foo
\nbar

\n", + "example": 16, + "start_line": 544, + "end_line": 550, + "section": "Backslash escapes" + }, + { + "markdown": "`` \\[\\` ``\n", + "html": "

\\[\\`

\n", + "example": 17, + "start_line": 556, + "end_line": 560, + "section": "Backslash escapes" + }, + { + "markdown": " \\[\\]\n", + "html": "
\\[\\]\n
\n", + "example": 18, + "start_line": 563, + "end_line": 568, + "section": "Backslash escapes" + }, + { + "markdown": "~~~\n\\[\\]\n~~~\n", + "html": "
\\[\\]\n
\n", + "example": 19, + "start_line": 571, + "end_line": 578, + "section": "Backslash escapes" + }, + { + "markdown": "\n", + "html": "

http://example.com?find=\\*

\n", + "example": 20, + "start_line": 581, + "end_line": 585, + "section": "Backslash escapes" + }, + { + "markdown": "\n", + "html": "\n", + "example": 21, + "start_line": 588, + "end_line": 592, + "section": "Backslash escapes" + }, + { + "markdown": "[foo](/bar\\* \"ti\\*tle\")\n", + "html": "

foo

\n", + "example": 22, + "start_line": 598, + "end_line": 602, + "section": "Backslash escapes" + }, + { + "markdown": "[foo]\n\n[foo]: /bar\\* \"ti\\*tle\"\n", + "html": "

foo

\n", + "example": 23, + "start_line": 605, + "end_line": 611, + "section": "Backslash escapes" + }, + { + "markdown": "``` foo\\+bar\nfoo\n```\n", + "html": "
foo\n
\n", + "example": 24, + "start_line": 614, + "end_line": 621, + "section": "Backslash escapes" + }, + { + "markdown": "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n", + "html": "

  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

\n", + "example": 25, + "start_line": 650, + "end_line": 658, + "section": "Entity and numeric character references" + }, + { + "markdown": "# Ӓ Ϡ �\n", + "html": "

# Ӓ Ϡ �

\n", + "example": 26, + "start_line": 669, + "end_line": 673, + "section": "Entity and numeric character references" + }, + { + "markdown": "" ആ ಫ\n", + "html": "

" ആ ಫ

\n", + "example": 27, + "start_line": 682, + "end_line": 686, + "section": "Entity and numeric character references" + }, + { + "markdown": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;\n", + "html": "

&nbsp &x; &#; &#x;\n&#87654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;

\n", + "example": 28, + "start_line": 691, + "end_line": 701, + "section": "Entity and numeric character references" + }, + { + "markdown": "©\n", + "html": "

&copy

\n", + "example": 29, + "start_line": 708, + "end_line": 712, + "section": "Entity and numeric character references" + }, + { + "markdown": "&MadeUpEntity;\n", + "html": "

&MadeUpEntity;

\n", + "example": 30, + "start_line": 718, + "end_line": 722, + "section": "Entity and numeric character references" + }, + { + "markdown": "\n", + "html": "\n", + "example": 31, + "start_line": 729, + "end_line": 733, + "section": "Entity and numeric character references" + }, + { + "markdown": "[foo](/föö \"föö\")\n", + "html": "

foo

\n", + "example": 32, + "start_line": 736, + "end_line": 740, + "section": "Entity and numeric character references" + }, + { + "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", + "html": "

foo

\n", + "example": 33, + "start_line": 743, + "end_line": 749, + "section": "Entity and numeric character references" + }, + { + "markdown": "``` föö\nfoo\n```\n", + "html": "
foo\n
\n", + "example": 34, + "start_line": 752, + "end_line": 759, + "section": "Entity and numeric character references" + }, + { + "markdown": "`föö`\n", + "html": "

f&ouml;&ouml;

\n", + "example": 35, + "start_line": 765, + "end_line": 769, + "section": "Entity and numeric character references" + }, + { + "markdown": " föfö\n", + "html": "
f&ouml;f&ouml;\n
\n", + "example": 36, + "start_line": 772, + "end_line": 777, + "section": "Entity and numeric character references" + }, + { + "markdown": "*foo*\n*foo*\n", + "html": "

*foo*\nfoo

\n", + "example": 37, + "start_line": 784, + "end_line": 790, + "section": "Entity and numeric character references" + }, + { + "markdown": "* foo\n\n* foo\n", + "html": "

* foo

\n
    \n
  • foo
  • \n
\n", + "example": 38, + "start_line": 792, + "end_line": 801, + "section": "Entity and numeric character references" + }, + { + "markdown": "foo bar\n", + "html": "

foo\n\nbar

\n", + "example": 39, + "start_line": 803, + "end_line": 809, + "section": "Entity and numeric character references" + }, + { + "markdown": " foo\n", + "html": "

\tfoo

\n", + "example": 40, + "start_line": 811, + "end_line": 815, + "section": "Entity and numeric character references" + }, + { + "markdown": "[a](url "tit")\n", + "html": "

[a](url "tit")

\n", + "example": 41, + "start_line": 818, + "end_line": 822, + "section": "Entity and numeric character references" + }, + { + "markdown": "- `one\n- two`\n", + "html": "
    \n
  • `one
  • \n
  • two`
  • \n
\n", + "example": 42, + "start_line": 841, + "end_line": 849, + "section": "Precedence" + }, + { + "markdown": "***\n---\n___\n", + "html": "
\n
\n
\n", + "example": 43, + "start_line": 880, + "end_line": 888, + "section": "Thematic breaks" + }, + { + "markdown": "+++\n", + "html": "

+++

\n", + "example": 44, + "start_line": 893, + "end_line": 897, + "section": "Thematic breaks" + }, + { + "markdown": "===\n", + "html": "

===

\n", + "example": 45, + "start_line": 900, + "end_line": 904, + "section": "Thematic breaks" + }, + { + "markdown": "--\n**\n__\n", + "html": "

--\n**\n__

\n", + "example": 46, + "start_line": 909, + "end_line": 917, + "section": "Thematic breaks" + }, + { + "markdown": " ***\n ***\n ***\n", + "html": "
\n
\n
\n", + "example": 47, + "start_line": 922, + "end_line": 930, + "section": "Thematic breaks" + }, + { + "markdown": " ***\n", + "html": "
***\n
\n", + "example": 48, + "start_line": 935, + "end_line": 940, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n ***\n", + "html": "

Foo\n***

\n", + "example": 49, + "start_line": 943, + "end_line": 949, + "section": "Thematic breaks" + }, + { + "markdown": "_____________________________________\n", + "html": "
\n", + "example": 50, + "start_line": 954, + "end_line": 958, + "section": "Thematic breaks" + }, + { + "markdown": " - - -\n", + "html": "
\n", + "example": 51, + "start_line": 963, + "end_line": 967, + "section": "Thematic breaks" + }, + { + "markdown": " ** * ** * ** * **\n", + "html": "
\n", + "example": 52, + "start_line": 970, + "end_line": 974, + "section": "Thematic breaks" + }, + { + "markdown": "- - - -\n", + "html": "
\n", + "example": 53, + "start_line": 977, + "end_line": 981, + "section": "Thematic breaks" + }, + { + "markdown": "- - - - \n", + "html": "
\n", + "example": 54, + "start_line": 986, + "end_line": 990, + "section": "Thematic breaks" + }, + { + "markdown": "_ _ _ _ a\n\na------\n\n---a---\n", + "html": "

_ _ _ _ a

\n

a------

\n

---a---

\n", + "example": 55, + "start_line": 995, + "end_line": 1005, + "section": "Thematic breaks" + }, + { + "markdown": " *-*\n", + "html": "

-

\n", + "example": 56, + "start_line": 1011, + "end_line": 1015, + "section": "Thematic breaks" + }, + { + "markdown": "- foo\n***\n- bar\n", + "html": "
    \n
  • foo
  • \n
\n
\n
    \n
  • bar
  • \n
\n", + "example": 57, + "start_line": 1020, + "end_line": 1032, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n***\nbar\n", + "html": "

Foo

\n
\n

bar

\n", + "example": 58, + "start_line": 1037, + "end_line": 1045, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n---\nbar\n", + "html": "

Foo

\n

bar

\n", + "example": 59, + "start_line": 1054, + "end_line": 1061, + "section": "Thematic breaks" + }, + { + "markdown": "* Foo\n* * *\n* Bar\n", + "html": "
    \n
  • Foo
  • \n
\n
\n
    \n
  • Bar
  • \n
\n", + "example": 60, + "start_line": 1067, + "end_line": 1079, + "section": "Thematic breaks" + }, + { + "markdown": "- Foo\n- * * *\n", + "html": "
    \n
  • Foo
  • \n
  • \n
    \n
  • \n
\n", + "example": 61, + "start_line": 1084, + "end_line": 1094, + "section": "Thematic breaks" + }, + { + "markdown": "# foo\n## foo\n### foo\n#### foo\n##### foo\n###### foo\n", + "html": "

foo

\n

foo

\n

foo

\n

foo

\n
foo
\n
foo
\n", + "example": 62, + "start_line": 1113, + "end_line": 1127, + "section": "ATX headings" + }, + { + "markdown": "####### foo\n", + "html": "

####### foo

\n", + "example": 63, + "start_line": 1132, + "end_line": 1136, + "section": "ATX headings" + }, + { + "markdown": "#5 bolt\n\n#hashtag\n", + "html": "

#5 bolt

\n

#hashtag

\n", + "example": 64, + "start_line": 1147, + "end_line": 1154, + "section": "ATX headings" + }, + { + "markdown": "\\## foo\n", + "html": "

## foo

\n", + "example": 65, + "start_line": 1159, + "end_line": 1163, + "section": "ATX headings" + }, + { + "markdown": "# foo *bar* \\*baz\\*\n", + "html": "

foo bar *baz*

\n", + "example": 66, + "start_line": 1168, + "end_line": 1172, + "section": "ATX headings" + }, + { + "markdown": "# foo \n", + "html": "

foo

\n", + "example": 67, + "start_line": 1177, + "end_line": 1181, + "section": "ATX headings" + }, + { + "markdown": " ### foo\n ## foo\n # foo\n", + "html": "

foo

\n

foo

\n

foo

\n", + "example": 68, + "start_line": 1186, + "end_line": 1194, + "section": "ATX headings" + }, + { + "markdown": " # foo\n", + "html": "
# foo\n
\n", + "example": 69, + "start_line": 1199, + "end_line": 1204, + "section": "ATX headings" + }, + { + "markdown": "foo\n # bar\n", + "html": "

foo\n# bar

\n", + "example": 70, + "start_line": 1207, + "end_line": 1213, + "section": "ATX headings" + }, + { + "markdown": "## foo ##\n ### bar ###\n", + "html": "

foo

\n

bar

\n", + "example": 71, + "start_line": 1218, + "end_line": 1224, + "section": "ATX headings" + }, + { + "markdown": "# foo ##################################\n##### foo ##\n", + "html": "

foo

\n
foo
\n", + "example": 72, + "start_line": 1229, + "end_line": 1235, + "section": "ATX headings" + }, + { + "markdown": "### foo ### \n", + "html": "

foo

\n", + "example": 73, + "start_line": 1240, + "end_line": 1244, + "section": "ATX headings" + }, + { + "markdown": "### foo ### b\n", + "html": "

foo ### b

\n", + "example": 74, + "start_line": 1251, + "end_line": 1255, + "section": "ATX headings" + }, + { + "markdown": "# foo#\n", + "html": "

foo#

\n", + "example": 75, + "start_line": 1260, + "end_line": 1264, + "section": "ATX headings" + }, + { + "markdown": "### foo \\###\n## foo #\\##\n# foo \\#\n", + "html": "

foo ###

\n

foo ###

\n

foo #

\n", + "example": 76, + "start_line": 1270, + "end_line": 1278, + "section": "ATX headings" + }, + { + "markdown": "****\n## foo\n****\n", + "html": "
\n

foo

\n
\n", + "example": 77, + "start_line": 1284, + "end_line": 1292, + "section": "ATX headings" + }, + { + "markdown": "Foo bar\n# baz\nBar foo\n", + "html": "

Foo bar

\n

baz

\n

Bar foo

\n", + "example": 78, + "start_line": 1295, + "end_line": 1303, + "section": "ATX headings" + }, + { + "markdown": "## \n#\n### ###\n", + "html": "

\n

\n

\n", + "example": 79, + "start_line": 1308, + "end_line": 1316, + "section": "ATX headings" + }, + { + "markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n", + "html": "

Foo bar

\n

Foo bar

\n", + "example": 80, + "start_line": 1351, + "end_line": 1360, + "section": "Setext headings" + }, + { + "markdown": "Foo *bar\nbaz*\n====\n", + "html": "

Foo bar\nbaz

\n", + "example": 81, + "start_line": 1365, + "end_line": 1372, + "section": "Setext headings" + }, + { + "markdown": " Foo *bar\nbaz*\t\n====\n", + "html": "

Foo bar\nbaz

\n", + "example": 82, + "start_line": 1379, + "end_line": 1386, + "section": "Setext headings" + }, + { + "markdown": "Foo\n-------------------------\n\nFoo\n=\n", + "html": "

Foo

\n

Foo

\n", + "example": 83, + "start_line": 1391, + "end_line": 1400, + "section": "Setext headings" + }, + { + "markdown": " Foo\n---\n\n Foo\n-----\n\n Foo\n ===\n", + "html": "

Foo

\n

Foo

\n

Foo

\n", + "example": 84, + "start_line": 1406, + "end_line": 1419, + "section": "Setext headings" + }, + { + "markdown": " Foo\n ---\n\n Foo\n---\n", + "html": "
Foo\n---\n\nFoo\n
\n
\n", + "example": 85, + "start_line": 1424, + "end_line": 1437, + "section": "Setext headings" + }, + { + "markdown": "Foo\n ---- \n", + "html": "

Foo

\n", + "example": 86, + "start_line": 1443, + "end_line": 1448, + "section": "Setext headings" + }, + { + "markdown": "Foo\n ---\n", + "html": "

Foo\n---

\n", + "example": 87, + "start_line": 1453, + "end_line": 1459, + "section": "Setext headings" + }, + { + "markdown": "Foo\n= =\n\nFoo\n--- -\n", + "html": "

Foo\n= =

\n

Foo

\n
\n", + "example": 88, + "start_line": 1464, + "end_line": 1475, + "section": "Setext headings" + }, + { + "markdown": "Foo \n-----\n", + "html": "

Foo

\n", + "example": 89, + "start_line": 1480, + "end_line": 1485, + "section": "Setext headings" + }, + { + "markdown": "Foo\\\n----\n", + "html": "

Foo\\

\n", + "example": 90, + "start_line": 1490, + "end_line": 1495, + "section": "Setext headings" + }, + { + "markdown": "`Foo\n----\n`\n\n\n", + "html": "

`Foo

\n

`

\n

<a title="a lot

\n

of dashes"/>

\n", + "example": 91, + "start_line": 1501, + "end_line": 1514, + "section": "Setext headings" + }, + { + "markdown": "> Foo\n---\n", + "html": "
\n

Foo

\n
\n
\n", + "example": 92, + "start_line": 1520, + "end_line": 1528, + "section": "Setext headings" + }, + { + "markdown": "> foo\nbar\n===\n", + "html": "
\n

foo\nbar\n===

\n
\n", + "example": 93, + "start_line": 1531, + "end_line": 1541, + "section": "Setext headings" + }, + { + "markdown": "- Foo\n---\n", + "html": "
    \n
  • Foo
  • \n
\n
\n", + "example": 94, + "start_line": 1544, + "end_line": 1552, + "section": "Setext headings" + }, + { + "markdown": "Foo\nBar\n---\n", + "html": "

Foo\nBar

\n", + "example": 95, + "start_line": 1559, + "end_line": 1566, + "section": "Setext headings" + }, + { + "markdown": "---\nFoo\n---\nBar\n---\nBaz\n", + "html": "
\n

Foo

\n

Bar

\n

Baz

\n", + "example": 96, + "start_line": 1572, + "end_line": 1584, + "section": "Setext headings" + }, + { + "markdown": "\n====\n", + "html": "

====

\n", + "example": 97, + "start_line": 1589, + "end_line": 1594, + "section": "Setext headings" + }, + { + "markdown": "---\n---\n", + "html": "
\n
\n", + "example": 98, + "start_line": 1601, + "end_line": 1607, + "section": "Setext headings" + }, + { + "markdown": "- foo\n-----\n", + "html": "
    \n
  • foo
  • \n
\n
\n", + "example": 99, + "start_line": 1610, + "end_line": 1618, + "section": "Setext headings" + }, + { + "markdown": " foo\n---\n", + "html": "
foo\n
\n
\n", + "example": 100, + "start_line": 1621, + "end_line": 1628, + "section": "Setext headings" + }, + { + "markdown": "> foo\n-----\n", + "html": "
\n

foo

\n
\n
\n", + "example": 101, + "start_line": 1631, + "end_line": 1639, + "section": "Setext headings" + }, + { + "markdown": "\\> foo\n------\n", + "html": "

> foo

\n", + "example": 102, + "start_line": 1645, + "end_line": 1650, + "section": "Setext headings" + }, + { + "markdown": "Foo\n\nbar\n---\nbaz\n", + "html": "

Foo

\n

bar

\n

baz

\n", + "example": 103, + "start_line": 1676, + "end_line": 1686, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n\n---\n\nbaz\n", + "html": "

Foo\nbar

\n
\n

baz

\n", + "example": 104, + "start_line": 1692, + "end_line": 1704, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n* * *\nbaz\n", + "html": "

Foo\nbar

\n
\n

baz

\n", + "example": 105, + "start_line": 1710, + "end_line": 1720, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n\\---\nbaz\n", + "html": "

Foo\nbar\n---\nbaz

\n", + "example": 106, + "start_line": 1725, + "end_line": 1735, + "section": "Setext headings" + }, + { + "markdown": " a simple\n indented code block\n", + "html": "
a simple\n  indented code block\n
\n", + "example": 107, + "start_line": 1753, + "end_line": 1760, + "section": "Indented code blocks" + }, + { + "markdown": " - foo\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 108, + "start_line": 1767, + "end_line": 1778, + "section": "Indented code blocks" + }, + { + "markdown": "1. foo\n\n - bar\n", + "html": "
    \n
  1. \n

    foo

    \n
      \n
    • bar
    • \n
    \n
  2. \n
\n", + "example": 109, + "start_line": 1781, + "end_line": 1794, + "section": "Indented code blocks" + }, + { + "markdown": "
\n *hi*\n\n - one\n", + "html": "
<a/>\n*hi*\n\n- one\n
\n", + "example": 110, + "start_line": 1801, + "end_line": 1812, + "section": "Indented code blocks" + }, + { + "markdown": " chunk1\n\n chunk2\n \n \n \n chunk3\n", + "html": "
chunk1\n\nchunk2\n\n\n\nchunk3\n
\n", + "example": 111, + "start_line": 1817, + "end_line": 1834, + "section": "Indented code blocks" + }, + { + "markdown": " chunk1\n \n chunk2\n", + "html": "
chunk1\n  \n  chunk2\n
\n", + "example": 112, + "start_line": 1840, + "end_line": 1849, + "section": "Indented code blocks" + }, + { + "markdown": "Foo\n bar\n\n", + "html": "

Foo\nbar

\n", + "example": 113, + "start_line": 1855, + "end_line": 1862, + "section": "Indented code blocks" + }, + { + "markdown": " foo\nbar\n", + "html": "
foo\n
\n

bar

\n", + "example": 114, + "start_line": 1869, + "end_line": 1876, + "section": "Indented code blocks" + }, + { + "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", + "html": "

Heading

\n
foo\n
\n

Heading

\n
foo\n
\n
\n", + "example": 115, + "start_line": 1882, + "end_line": 1897, + "section": "Indented code blocks" + }, + { + "markdown": " foo\n bar\n", + "html": "
    foo\nbar\n
\n", + "example": 116, + "start_line": 1902, + "end_line": 1909, + "section": "Indented code blocks" + }, + { + "markdown": "\n \n foo\n \n\n", + "html": "
foo\n
\n", + "example": 117, + "start_line": 1915, + "end_line": 1924, + "section": "Indented code blocks" + }, + { + "markdown": " foo \n", + "html": "
foo  \n
\n", + "example": 118, + "start_line": 1929, + "end_line": 1934, + "section": "Indented code blocks" + }, + { + "markdown": "```\n<\n >\n```\n", + "html": "
<\n >\n
\n", + "example": 119, + "start_line": 1984, + "end_line": 1993, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~\n<\n >\n~~~\n", + "html": "
<\n >\n
\n", + "example": 120, + "start_line": 1998, + "end_line": 2007, + "section": "Fenced code blocks" + }, + { + "markdown": "``\nfoo\n``\n", + "html": "

foo

\n", + "example": 121, + "start_line": 2011, + "end_line": 2017, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n~~~\n```\n", + "html": "
aaa\n~~~\n
\n", + "example": 122, + "start_line": 2022, + "end_line": 2031, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~\naaa\n```\n~~~\n", + "html": "
aaa\n```\n
\n", + "example": 123, + "start_line": 2034, + "end_line": 2043, + "section": "Fenced code blocks" + }, + { + "markdown": "````\naaa\n```\n``````\n", + "html": "
aaa\n```\n
\n", + "example": 124, + "start_line": 2048, + "end_line": 2057, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~\naaa\n~~~\n~~~~\n", + "html": "
aaa\n~~~\n
\n", + "example": 125, + "start_line": 2060, + "end_line": 2069, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n", + "html": "
\n", + "example": 126, + "start_line": 2075, + "end_line": 2079, + "section": "Fenced code blocks" + }, + { + "markdown": "`````\n\n```\naaa\n", + "html": "
\n```\naaa\n
\n", + "example": 127, + "start_line": 2082, + "end_line": 2092, + "section": "Fenced code blocks" + }, + { + "markdown": "> ```\n> aaa\n\nbbb\n", + "html": "
\n
aaa\n
\n
\n

bbb

\n", + "example": 128, + "start_line": 2095, + "end_line": 2106, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n\n \n```\n", + "html": "
\n  \n
\n", + "example": 129, + "start_line": 2111, + "end_line": 2120, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n```\n", + "html": "
\n", + "example": 130, + "start_line": 2125, + "end_line": 2130, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\naaa\n```\n", + "html": "
aaa\naaa\n
\n", + "example": 131, + "start_line": 2137, + "end_line": 2146, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\naaa\n aaa\naaa\n ```\n", + "html": "
aaa\naaa\naaa\n
\n", + "example": 132, + "start_line": 2149, + "end_line": 2160, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\n aaa\n aaa\n ```\n", + "html": "
aaa\n aaa\naaa\n
\n", + "example": 133, + "start_line": 2163, + "end_line": 2174, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\n ```\n", + "html": "
```\naaa\n```\n
\n", + "example": 134, + "start_line": 2179, + "end_line": 2188, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n ```\n", + "html": "
aaa\n
\n", + "example": 135, + "start_line": 2194, + "end_line": 2201, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\naaa\n ```\n", + "html": "
aaa\n
\n", + "example": 136, + "start_line": 2204, + "end_line": 2211, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n ```\n", + "html": "
aaa\n    ```\n
\n", + "example": 137, + "start_line": 2216, + "end_line": 2224, + "section": "Fenced code blocks" + }, + { + "markdown": "``` ```\naaa\n", + "html": "

\naaa

\n", + "example": 138, + "start_line": 2230, + "end_line": 2236, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~~~\naaa\n~~~ ~~\n", + "html": "
aaa\n~~~ ~~\n
\n", + "example": 139, + "start_line": 2239, + "end_line": 2247, + "section": "Fenced code blocks" + }, + { + "markdown": "foo\n```\nbar\n```\nbaz\n", + "html": "

foo

\n
bar\n
\n

baz

\n", + "example": 140, + "start_line": 2253, + "end_line": 2264, + "section": "Fenced code blocks" + }, + { + "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", + "html": "

foo

\n
bar\n
\n

baz

\n", + "example": 141, + "start_line": 2270, + "end_line": 2282, + "section": "Fenced code blocks" + }, + { + "markdown": "```ruby\ndef foo(x)\n return 3\nend\n```\n", + "html": "
def foo(x)\n  return 3\nend\n
\n", + "example": 142, + "start_line": 2292, + "end_line": 2303, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n", + "html": "
def foo(x)\n  return 3\nend\n
\n", + "example": 143, + "start_line": 2306, + "end_line": 2317, + "section": "Fenced code blocks" + }, + { + "markdown": "````;\n````\n", + "html": "
\n", + "example": 144, + "start_line": 2320, + "end_line": 2325, + "section": "Fenced code blocks" + }, + { + "markdown": "``` aa ```\nfoo\n", + "html": "

aa\nfoo

\n", + "example": 145, + "start_line": 2330, + "end_line": 2336, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~ aa ``` ~~~\nfoo\n~~~\n", + "html": "
foo\n
\n", + "example": 146, + "start_line": 2341, + "end_line": 2348, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n``` aaa\n```\n", + "html": "
``` aaa\n
\n", + "example": 147, + "start_line": 2353, + "end_line": 2360, + "section": "Fenced code blocks" + }, + { + "markdown": "
\n
\n**Hello**,\n\n_world_.\n
\n
\n", + "html": "
\n
\n**Hello**,\n

world.\n

\n
\n", + "example": 148, + "start_line": 2432, + "end_line": 2447, + "section": "HTML blocks" + }, + { + "markdown": "\n \n \n \n
\n hi\n
\n\nokay.\n", + "html": "\n \n \n \n
\n hi\n
\n

okay.

\n", + "example": 149, + "start_line": 2461, + "end_line": 2480, + "section": "HTML blocks" + }, + { + "markdown": "
\n*foo*\n", + "example": 151, + "start_line": 2496, + "end_line": 2502, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n*Markdown*\n\n
\n", + "html": "
\n

Markdown

\n
\n", + "example": 152, + "start_line": 2507, + "end_line": 2517, + "section": "HTML blocks" + }, + { + "markdown": "
\n
\n", + "html": "
\n
\n", + "example": 153, + "start_line": 2523, + "end_line": 2531, + "section": "HTML blocks" + }, + { + "markdown": "
\n
\n", + "html": "
\n
\n", + "example": 154, + "start_line": 2534, + "end_line": 2542, + "section": "HTML blocks" + }, + { + "markdown": "
\n*foo*\n\n*bar*\n", + "html": "
\n*foo*\n

bar

\n", + "example": 155, + "start_line": 2546, + "end_line": 2555, + "section": "HTML blocks" + }, + { + "markdown": "
\n", + "html": "\n", + "example": 159, + "start_line": 2595, + "end_line": 2599, + "section": "HTML blocks" + }, + { + "markdown": "
\nfoo\n
\n", + "html": "
\nfoo\n
\n", + "example": 160, + "start_line": 2602, + "end_line": 2610, + "section": "HTML blocks" + }, + { + "markdown": "
\n``` c\nint x = 33;\n```\n", + "html": "
\n``` c\nint x = 33;\n```\n", + "example": 161, + "start_line": 2619, + "end_line": 2629, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 162, + "start_line": 2636, + "end_line": 2644, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 163, + "start_line": 2649, + "end_line": 2657, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 164, + "start_line": 2660, + "end_line": 2668, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n", + "html": "\n*bar*\n", + "example": 165, + "start_line": 2671, + "end_line": 2677, + "section": "HTML blocks" + }, + { + "markdown": "\n*foo*\n\n", + "html": "\n*foo*\n\n", + "example": 166, + "start_line": 2686, + "end_line": 2694, + "section": "HTML blocks" + }, + { + "markdown": "\n\n*foo*\n\n\n", + "html": "\n

foo

\n
\n", + "example": 167, + "start_line": 2701, + "end_line": 2711, + "section": "HTML blocks" + }, + { + "markdown": "*foo*\n", + "html": "

foo

\n", + "example": 168, + "start_line": 2719, + "end_line": 2723, + "section": "HTML blocks" + }, + { + "markdown": "
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay\n", + "html": "
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\n

okay

\n", + "example": 169, + "start_line": 2735, + "end_line": 2751, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 170, + "start_line": 2756, + "end_line": 2770, + "section": "HTML blocks" + }, + { + "markdown": "\n", + "html": "\n", + "example": 171, + "start_line": 2775, + "end_line": 2791, + "section": "HTML blocks" + }, + { + "markdown": "\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n", + "html": "\nh1 {color:red;}\n\np {color:blue;}\n\n

okay

\n", + "example": 172, + "start_line": 2795, + "end_line": 2811, + "section": "HTML blocks" + }, + { + "markdown": "\n\nfoo\n", + "html": "\n\nfoo\n", + "example": 173, + "start_line": 2818, + "end_line": 2828, + "section": "HTML blocks" + }, + { + "markdown": ">
\n> foo\n\nbar\n", + "html": "
\n
\nfoo\n
\n

bar

\n", + "example": 174, + "start_line": 2831, + "end_line": 2842, + "section": "HTML blocks" + }, + { + "markdown": "-
\n- foo\n", + "html": "
    \n
  • \n
    \n
  • \n
  • foo
  • \n
\n", + "example": 175, + "start_line": 2845, + "end_line": 2855, + "section": "HTML blocks" + }, + { + "markdown": "\n*foo*\n", + "html": "\n

foo

\n", + "example": 176, + "start_line": 2860, + "end_line": 2866, + "section": "HTML blocks" + }, + { + "markdown": "*bar*\n*baz*\n", + "html": "*bar*\n

baz

\n", + "example": 177, + "start_line": 2869, + "end_line": 2875, + "section": "HTML blocks" + }, + { + "markdown": "1. *bar*\n", + "html": "1. *bar*\n", + "example": 178, + "start_line": 2881, + "end_line": 2889, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 179, + "start_line": 2894, + "end_line": 2906, + "section": "HTML blocks" + }, + { + "markdown": "';\n\n?>\nokay\n", + "html": "';\n\n?>\n

okay

\n", + "example": 180, + "start_line": 2912, + "end_line": 2926, + "section": "HTML blocks" + }, + { + "markdown": "\n", + "html": "\n", + "example": 181, + "start_line": 2931, + "end_line": 2935, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 182, + "start_line": 2940, + "end_line": 2968, + "section": "HTML blocks" + }, + { + "markdown": " \n\n \n", + "html": " \n
<!-- foo -->\n
\n", + "example": 183, + "start_line": 2974, + "end_line": 2982, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n
\n", + "html": "
\n
<div>\n
\n", + "example": 184, + "start_line": 2985, + "end_line": 2993, + "section": "HTML blocks" + }, + { + "markdown": "Foo\n
\nbar\n
\n", + "html": "

Foo

\n
\nbar\n
\n", + "example": 185, + "start_line": 2999, + "end_line": 3009, + "section": "HTML blocks" + }, + { + "markdown": "
\nbar\n
\n*foo*\n", + "html": "
\nbar\n
\n*foo*\n", + "example": 186, + "start_line": 3016, + "end_line": 3026, + "section": "HTML blocks" + }, + { + "markdown": "Foo\n\nbaz\n", + "html": "

Foo\n\nbaz

\n", + "example": 187, + "start_line": 3031, + "end_line": 3039, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n*Emphasized* text.\n\n
\n", + "html": "
\n

Emphasized text.

\n
\n", + "example": 188, + "start_line": 3072, + "end_line": 3082, + "section": "HTML blocks" + }, + { + "markdown": "
\n*Emphasized* text.\n
\n", + "html": "
\n*Emphasized* text.\n
\n", + "example": 189, + "start_line": 3085, + "end_line": 3093, + "section": "HTML blocks" + }, + { + "markdown": "\n\n\n\n\n\n\n\n
\nHi\n
\n", + "html": "\n\n\n\n
\nHi\n
\n", + "example": 190, + "start_line": 3107, + "end_line": 3127, + "section": "HTML blocks" + }, + { + "markdown": "\n\n \n\n \n\n \n\n
\n Hi\n
\n", + "html": "\n \n
<td>\n  Hi\n</td>\n
\n \n
\n", + "example": 191, + "start_line": 3134, + "end_line": 3155, + "section": "HTML blocks" + }, + { + "markdown": "[foo]: /url \"title\"\n\n[foo]\n", + "html": "

foo

\n", + "example": 192, + "start_line": 3183, + "end_line": 3189, + "section": "Link reference definitions" + }, + { + "markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n", + "html": "

foo

\n", + "example": 193, + "start_line": 3192, + "end_line": 3200, + "section": "Link reference definitions" + }, + { + "markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n", + "html": "

Foo*bar]

\n", + "example": 194, + "start_line": 3203, + "end_line": 3209, + "section": "Link reference definitions" + }, + { + "markdown": "[Foo bar]:\n\n'title'\n\n[Foo bar]\n", + "html": "

Foo bar

\n", + "example": 195, + "start_line": 3212, + "end_line": 3220, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n", + "html": "

foo

\n", + "example": 196, + "start_line": 3225, + "end_line": 3239, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n", + "html": "

[foo]: /url 'title

\n

with blank line'

\n

[foo]

\n", + "example": 197, + "start_line": 3244, + "end_line": 3254, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]:\n/url\n\n[foo]\n", + "html": "

foo

\n", + "example": 198, + "start_line": 3259, + "end_line": 3266, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]:\n\n[foo]\n", + "html": "

[foo]:

\n

[foo]

\n", + "example": 199, + "start_line": 3271, + "end_line": 3278, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: <>\n\n[foo]\n", + "html": "

foo

\n", + "example": 200, + "start_line": 3283, + "end_line": 3289, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: (baz)\n\n[foo]\n", + "html": "

[foo]: (baz)

\n

[foo]

\n", + "example": 201, + "start_line": 3294, + "end_line": 3301, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", + "html": "

foo

\n", + "example": 202, + "start_line": 3307, + "end_line": 3313, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n[foo]: url\n", + "html": "

foo

\n", + "example": 203, + "start_line": 3318, + "end_line": 3324, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", + "html": "

foo

\n", + "example": 204, + "start_line": 3330, + "end_line": 3337, + "section": "Link reference definitions" + }, + { + "markdown": "[FOO]: /url\n\n[Foo]\n", + "html": "

Foo

\n", + "example": 205, + "start_line": 3343, + "end_line": 3349, + "section": "Link reference definitions" + }, + { + "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", + "html": "

αγω

\n", + "example": 206, + "start_line": 3352, + "end_line": 3358, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n", + "html": "", + "example": 207, + "start_line": 3367, + "end_line": 3370, + "section": "Link reference definitions" + }, + { + "markdown": "[\nfoo\n]: /url\nbar\n", + "html": "

bar

\n", + "example": 208, + "start_line": 3375, + "end_line": 3382, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url \"title\" ok\n", + "html": "

[foo]: /url "title" ok

\n", + "example": 209, + "start_line": 3388, + "end_line": 3392, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n\"title\" ok\n", + "html": "

"title" ok

\n", + "example": 210, + "start_line": 3397, + "end_line": 3402, + "section": "Link reference definitions" + }, + { + "markdown": " [foo]: /url \"title\"\n\n[foo]\n", + "html": "
[foo]: /url "title"\n
\n

[foo]

\n", + "example": 211, + "start_line": 3408, + "end_line": 3416, + "section": "Link reference definitions" + }, + { + "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", + "html": "
[foo]: /url\n
\n

[foo]

\n", + "example": 212, + "start_line": 3422, + "end_line": 3432, + "section": "Link reference definitions" + }, + { + "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", + "html": "

Foo\n[bar]: /baz

\n

[bar]

\n", + "example": 213, + "start_line": 3437, + "end_line": 3446, + "section": "Link reference definitions" + }, + { + "markdown": "# [Foo]\n[foo]: /url\n> bar\n", + "html": "

Foo

\n
\n

bar

\n
\n", + "example": 214, + "start_line": 3452, + "end_line": 3461, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\nbar\n===\n[foo]\n", + "html": "

bar

\n

foo

\n", + "example": 215, + "start_line": 3463, + "end_line": 3471, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n===\n[foo]\n", + "html": "

===\nfoo

\n", + "example": 216, + "start_line": 3473, + "end_line": 3480, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", + "html": "

foo,\nbar,\nbaz

\n", + "example": 217, + "start_line": 3486, + "end_line": 3499, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n> [foo]: /url\n", + "html": "

foo

\n
\n
\n", + "example": 218, + "start_line": 3507, + "end_line": 3515, + "section": "Link reference definitions" + }, + { + "markdown": "aaa\n\nbbb\n", + "html": "

aaa

\n

bbb

\n", + "example": 219, + "start_line": 3529, + "end_line": 3536, + "section": "Paragraphs" + }, + { + "markdown": "aaa\nbbb\n\nccc\nddd\n", + "html": "

aaa\nbbb

\n

ccc\nddd

\n", + "example": 220, + "start_line": 3541, + "end_line": 3552, + "section": "Paragraphs" + }, + { + "markdown": "aaa\n\n\nbbb\n", + "html": "

aaa

\n

bbb

\n", + "example": 221, + "start_line": 3557, + "end_line": 3565, + "section": "Paragraphs" + }, + { + "markdown": " aaa\n bbb\n", + "html": "

aaa\nbbb

\n", + "example": 222, + "start_line": 3570, + "end_line": 3576, + "section": "Paragraphs" + }, + { + "markdown": "aaa\n bbb\n ccc\n", + "html": "

aaa\nbbb\nccc

\n", + "example": 223, + "start_line": 3582, + "end_line": 3590, + "section": "Paragraphs" + }, + { + "markdown": " aaa\nbbb\n", + "html": "

aaa\nbbb

\n", + "example": 224, + "start_line": 3596, + "end_line": 3602, + "section": "Paragraphs" + }, + { + "markdown": " aaa\nbbb\n", + "html": "
aaa\n
\n

bbb

\n", + "example": 225, + "start_line": 3605, + "end_line": 3612, + "section": "Paragraphs" + }, + { + "markdown": "aaa \nbbb \n", + "html": "

aaa
\nbbb

\n", + "example": 226, + "start_line": 3619, + "end_line": 3625, + "section": "Paragraphs" + }, + { + "markdown": " \n\naaa\n \n\n# aaa\n\n \n", + "html": "

aaa

\n

aaa

\n", + "example": 227, + "start_line": 3636, + "end_line": 3648, + "section": "Blank lines" + }, + { + "markdown": "> # Foo\n> bar\n> baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 228, + "start_line": 3704, + "end_line": 3714, + "section": "Block quotes" + }, + { + "markdown": "># Foo\n>bar\n> baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 229, + "start_line": 3719, + "end_line": 3729, + "section": "Block quotes" + }, + { + "markdown": " > # Foo\n > bar\n > baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 230, + "start_line": 3734, + "end_line": 3744, + "section": "Block quotes" + }, + { + "markdown": " > # Foo\n > bar\n > baz\n", + "html": "
> # Foo\n> bar\n> baz\n
\n", + "example": 231, + "start_line": 3749, + "end_line": 3758, + "section": "Block quotes" + }, + { + "markdown": "> # Foo\n> bar\nbaz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 232, + "start_line": 3764, + "end_line": 3774, + "section": "Block quotes" + }, + { + "markdown": "> bar\nbaz\n> foo\n", + "html": "
\n

bar\nbaz\nfoo

\n
\n", + "example": 233, + "start_line": 3780, + "end_line": 3790, + "section": "Block quotes" + }, + { + "markdown": "> foo\n---\n", + "html": "
\n

foo

\n
\n
\n", + "example": 234, + "start_line": 3804, + "end_line": 3812, + "section": "Block quotes" + }, + { + "markdown": "> - foo\n- bar\n", + "html": "
\n
    \n
  • foo
  • \n
\n
\n
    \n
  • bar
  • \n
\n", + "example": 235, + "start_line": 3824, + "end_line": 3836, + "section": "Block quotes" + }, + { + "markdown": "> foo\n bar\n", + "html": "
\n
foo\n
\n
\n
bar\n
\n", + "example": 236, + "start_line": 3842, + "end_line": 3852, + "section": "Block quotes" + }, + { + "markdown": "> ```\nfoo\n```\n", + "html": "
\n
\n
\n

foo

\n
\n", + "example": 237, + "start_line": 3855, + "end_line": 3865, + "section": "Block quotes" + }, + { + "markdown": "> foo\n - bar\n", + "html": "
\n

foo\n- bar

\n
\n", + "example": 238, + "start_line": 3871, + "end_line": 3879, + "section": "Block quotes" + }, + { + "markdown": ">\n", + "html": "
\n
\n", + "example": 239, + "start_line": 3895, + "end_line": 3900, + "section": "Block quotes" + }, + { + "markdown": ">\n> \n> \n", + "html": "
\n
\n", + "example": 240, + "start_line": 3903, + "end_line": 3910, + "section": "Block quotes" + }, + { + "markdown": ">\n> foo\n> \n", + "html": "
\n

foo

\n
\n", + "example": 241, + "start_line": 3915, + "end_line": 3923, + "section": "Block quotes" + }, + { + "markdown": "> foo\n\n> bar\n", + "html": "
\n

foo

\n
\n
\n

bar

\n
\n", + "example": 242, + "start_line": 3928, + "end_line": 3939, + "section": "Block quotes" + }, + { + "markdown": "> foo\n> bar\n", + "html": "
\n

foo\nbar

\n
\n", + "example": 243, + "start_line": 3950, + "end_line": 3958, + "section": "Block quotes" + }, + { + "markdown": "> foo\n>\n> bar\n", + "html": "
\n

foo

\n

bar

\n
\n", + "example": 244, + "start_line": 3963, + "end_line": 3972, + "section": "Block quotes" + }, + { + "markdown": "foo\n> bar\n", + "html": "

foo

\n
\n

bar

\n
\n", + "example": 245, + "start_line": 3977, + "end_line": 3985, + "section": "Block quotes" + }, + { + "markdown": "> aaa\n***\n> bbb\n", + "html": "
\n

aaa

\n
\n
\n
\n

bbb

\n
\n", + "example": 246, + "start_line": 3991, + "end_line": 4003, + "section": "Block quotes" + }, + { + "markdown": "> bar\nbaz\n", + "html": "
\n

bar\nbaz

\n
\n", + "example": 247, + "start_line": 4009, + "end_line": 4017, + "section": "Block quotes" + }, + { + "markdown": "> bar\n\nbaz\n", + "html": "
\n

bar

\n
\n

baz

\n", + "example": 248, + "start_line": 4020, + "end_line": 4029, + "section": "Block quotes" + }, + { + "markdown": "> bar\n>\nbaz\n", + "html": "
\n

bar

\n
\n

baz

\n", + "example": 249, + "start_line": 4032, + "end_line": 4041, + "section": "Block quotes" + }, + { + "markdown": "> > > foo\nbar\n", + "html": "
\n
\n
\n

foo\nbar

\n
\n
\n
\n", + "example": 250, + "start_line": 4048, + "end_line": 4060, + "section": "Block quotes" + }, + { + "markdown": ">>> foo\n> bar\n>>baz\n", + "html": "
\n
\n
\n

foo\nbar\nbaz

\n
\n
\n
\n", + "example": 251, + "start_line": 4063, + "end_line": 4077, + "section": "Block quotes" + }, + { + "markdown": "> code\n\n> not code\n", + "html": "
\n
code\n
\n
\n
\n

not code

\n
\n", + "example": 252, + "start_line": 4085, + "end_line": 4097, + "section": "Block quotes" + }, + { + "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", + "html": "

A paragraph\nwith two lines.

\n
indented code\n
\n
\n

A block quote.

\n
\n", + "example": 253, + "start_line": 4139, + "end_line": 4154, + "section": "List items" + }, + { + "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 254, + "start_line": 4161, + "end_line": 4180, + "section": "List items" + }, + { + "markdown": "- one\n\n two\n", + "html": "
    \n
  • one
  • \n
\n

two

\n", + "example": 255, + "start_line": 4194, + "end_line": 4203, + "section": "List items" + }, + { + "markdown": "- one\n\n two\n", + "html": "
    \n
  • \n

    one

    \n

    two

    \n
  • \n
\n", + "example": 256, + "start_line": 4206, + "end_line": 4217, + "section": "List items" + }, + { + "markdown": " - one\n\n two\n", + "html": "
    \n
  • one
  • \n
\n
 two\n
\n", + "example": 257, + "start_line": 4220, + "end_line": 4230, + "section": "List items" + }, + { + "markdown": " - one\n\n two\n", + "html": "
    \n
  • \n

    one

    \n

    two

    \n
  • \n
\n", + "example": 258, + "start_line": 4233, + "end_line": 4244, + "section": "List items" + }, + { + "markdown": " > > 1. one\n>>\n>> two\n", + "html": "
\n
\n
    \n
  1. \n

    one

    \n

    two

    \n
  2. \n
\n
\n
\n", + "example": 259, + "start_line": 4255, + "end_line": 4270, + "section": "List items" + }, + { + "markdown": ">>- one\n>>\n > > two\n", + "html": "
\n
\n
    \n
  • one
  • \n
\n

two

\n
\n
\n", + "example": 260, + "start_line": 4282, + "end_line": 4295, + "section": "List items" + }, + { + "markdown": "-one\n\n2.two\n", + "html": "

-one

\n

2.two

\n", + "example": 261, + "start_line": 4301, + "end_line": 4308, + "section": "List items" + }, + { + "markdown": "- foo\n\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 262, + "start_line": 4314, + "end_line": 4326, + "section": "List items" + }, + { + "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", + "html": "
    \n
  1. \n

    foo

    \n
    bar\n
    \n

    baz

    \n
    \n

    bam

    \n
    \n
  2. \n
\n", + "example": 263, + "start_line": 4331, + "end_line": 4353, + "section": "List items" + }, + { + "markdown": "- Foo\n\n bar\n\n\n baz\n", + "html": "
    \n
  • \n

    Foo

    \n
    bar\n\n\nbaz\n
    \n
  • \n
\n", + "example": 264, + "start_line": 4359, + "end_line": 4377, + "section": "List items" + }, + { + "markdown": "123456789. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 265, + "start_line": 4381, + "end_line": 4387, + "section": "List items" + }, + { + "markdown": "1234567890. not ok\n", + "html": "

1234567890. not ok

\n", + "example": 266, + "start_line": 4390, + "end_line": 4394, + "section": "List items" + }, + { + "markdown": "0. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 267, + "start_line": 4399, + "end_line": 4405, + "section": "List items" + }, + { + "markdown": "003. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 268, + "start_line": 4408, + "end_line": 4414, + "section": "List items" + }, + { + "markdown": "-1. not ok\n", + "html": "

-1. not ok

\n", + "example": 269, + "start_line": 4419, + "end_line": 4423, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n
    bar\n
    \n
  • \n
\n", + "example": 270, + "start_line": 4442, + "end_line": 4454, + "section": "List items" + }, + { + "markdown": " 10. foo\n\n bar\n", + "html": "
    \n
  1. \n

    foo

    \n
    bar\n
    \n
  2. \n
\n", + "example": 271, + "start_line": 4459, + "end_line": 4471, + "section": "List items" + }, + { + "markdown": " indented code\n\nparagraph\n\n more code\n", + "html": "
indented code\n
\n

paragraph

\n
more code\n
\n", + "example": 272, + "start_line": 4478, + "end_line": 4490, + "section": "List items" + }, + { + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "html": "
    \n
  1. \n
    indented code\n
    \n

    paragraph

    \n
    more code\n
    \n
  2. \n
\n", + "example": 273, + "start_line": 4493, + "end_line": 4509, + "section": "List items" + }, + { + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "html": "
    \n
  1. \n
     indented code\n
    \n

    paragraph

    \n
    more code\n
    \n
  2. \n
\n", + "example": 274, + "start_line": 4515, + "end_line": 4531, + "section": "List items" + }, + { + "markdown": " foo\n\nbar\n", + "html": "

foo

\n

bar

\n", + "example": 275, + "start_line": 4542, + "end_line": 4549, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • foo
  • \n
\n

bar

\n", + "example": 276, + "start_line": 4552, + "end_line": 4561, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 277, + "start_line": 4569, + "end_line": 4580, + "section": "List items" + }, + { + "markdown": "-\n foo\n-\n ```\n bar\n ```\n-\n baz\n", + "html": "
    \n
  • foo
  • \n
  • \n
    bar\n
    \n
  • \n
  • \n
    baz\n
    \n
  • \n
\n", + "example": 278, + "start_line": 4596, + "end_line": 4617, + "section": "List items" + }, + { + "markdown": "- \n foo\n", + "html": "
    \n
  • foo
  • \n
\n", + "example": 279, + "start_line": 4622, + "end_line": 4629, + "section": "List items" + }, + { + "markdown": "-\n\n foo\n", + "html": "
    \n
  • \n
\n

foo

\n", + "example": 280, + "start_line": 4636, + "end_line": 4645, + "section": "List items" + }, + { + "markdown": "- foo\n-\n- bar\n", + "html": "
    \n
  • foo
  • \n
  • \n
  • bar
  • \n
\n", + "example": 281, + "start_line": 4650, + "end_line": 4660, + "section": "List items" + }, + { + "markdown": "- foo\n- \n- bar\n", + "html": "
    \n
  • foo
  • \n
  • \n
  • bar
  • \n
\n", + "example": 282, + "start_line": 4665, + "end_line": 4675, + "section": "List items" + }, + { + "markdown": "1. foo\n2.\n3. bar\n", + "html": "
    \n
  1. foo
  2. \n
  3. \n
  4. bar
  5. \n
\n", + "example": 283, + "start_line": 4680, + "end_line": 4690, + "section": "List items" + }, + { + "markdown": "*\n", + "html": "
    \n
  • \n
\n", + "example": 284, + "start_line": 4695, + "end_line": 4701, + "section": "List items" + }, + { + "markdown": "foo\n*\n\nfoo\n1.\n", + "html": "

foo\n*

\n

foo\n1.

\n", + "example": 285, + "start_line": 4705, + "end_line": 4716, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 286, + "start_line": 4727, + "end_line": 4746, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 287, + "start_line": 4751, + "end_line": 4770, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 288, + "start_line": 4775, + "end_line": 4794, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
\n", + "example": 289, + "start_line": 4799, + "end_line": 4814, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 290, + "start_line": 4829, + "end_line": 4848, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n", + "html": "
    \n
  1. A paragraph\nwith two lines.
  2. \n
\n", + "example": 291, + "start_line": 4853, + "end_line": 4861, + "section": "List items" + }, + { + "markdown": "> 1. > Blockquote\ncontinued here.\n", + "html": "
\n
    \n
  1. \n
    \n

    Blockquote\ncontinued here.

    \n
    \n
  2. \n
\n
\n", + "example": 292, + "start_line": 4866, + "end_line": 4880, + "section": "List items" + }, + { + "markdown": "> 1. > Blockquote\n> continued here.\n", + "html": "
\n
    \n
  1. \n
    \n

    Blockquote\ncontinued here.

    \n
    \n
  2. \n
\n
\n", + "example": 293, + "start_line": 4883, + "end_line": 4897, + "section": "List items" + }, + { + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "html": "
    \n
  • foo\n
      \n
    • bar\n
        \n
      • baz\n
          \n
        • boo
        • \n
        \n
      • \n
      \n
    • \n
    \n
  • \n
\n", + "example": 294, + "start_line": 4911, + "end_line": 4932, + "section": "List items" + }, + { + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
  • baz
  • \n
  • boo
  • \n
\n", + "example": 295, + "start_line": 4937, + "end_line": 4949, + "section": "List items" + }, + { + "markdown": "10) foo\n - bar\n", + "html": "
    \n
  1. foo\n
      \n
    • bar
    • \n
    \n
  2. \n
\n", + "example": 296, + "start_line": 4954, + "end_line": 4965, + "section": "List items" + }, + { + "markdown": "10) foo\n - bar\n", + "html": "
    \n
  1. foo
  2. \n
\n
    \n
  • bar
  • \n
\n", + "example": 297, + "start_line": 4970, + "end_line": 4980, + "section": "List items" + }, + { + "markdown": "- - foo\n", + "html": "
    \n
  • \n
      \n
    • foo
    • \n
    \n
  • \n
\n", + "example": 298, + "start_line": 4985, + "end_line": 4995, + "section": "List items" + }, + { + "markdown": "1. - 2. foo\n", + "html": "
    \n
  1. \n
      \n
    • \n
        \n
      1. foo
      2. \n
      \n
    • \n
    \n
  2. \n
\n", + "example": 299, + "start_line": 4998, + "end_line": 5012, + "section": "List items" + }, + { + "markdown": "- # Foo\n- Bar\n ---\n baz\n", + "html": "
    \n
  • \n

    Foo

    \n
  • \n
  • \n

    Bar

    \nbaz
  • \n
\n", + "example": 300, + "start_line": 5017, + "end_line": 5031, + "section": "List items" + }, + { + "markdown": "- foo\n- bar\n+ baz\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
\n
    \n
  • baz
  • \n
\n", + "example": 301, + "start_line": 5253, + "end_line": 5265, + "section": "Lists" + }, + { + "markdown": "1. foo\n2. bar\n3) baz\n", + "html": "
    \n
  1. foo
  2. \n
  3. bar
  4. \n
\n
    \n
  1. baz
  2. \n
\n", + "example": 302, + "start_line": 5268, + "end_line": 5280, + "section": "Lists" + }, + { + "markdown": "Foo\n- bar\n- baz\n", + "html": "

Foo

\n
    \n
  • bar
  • \n
  • baz
  • \n
\n", + "example": 303, + "start_line": 5287, + "end_line": 5297, + "section": "Lists" + }, + { + "markdown": "The number of windows in my house is\n14. The number of doors is 6.\n", + "html": "

The number of windows in my house is\n14. The number of doors is 6.

\n", + "example": 304, + "start_line": 5364, + "end_line": 5370, + "section": "Lists" + }, + { + "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", + "html": "

The number of windows in my house is

\n
    \n
  1. The number of doors is 6.
  2. \n
\n", + "example": 305, + "start_line": 5374, + "end_line": 5382, + "section": "Lists" + }, + { + "markdown": "- foo\n\n- bar\n\n\n- baz\n", + "html": "
    \n
  • \n

    foo

    \n
  • \n
  • \n

    bar

    \n
  • \n
  • \n

    baz

    \n
  • \n
\n", + "example": 306, + "start_line": 5388, + "end_line": 5407, + "section": "Lists" + }, + { + "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", + "html": "
    \n
  • foo\n
      \n
    • bar\n
        \n
      • \n

        baz

        \n

        bim

        \n
      • \n
      \n
    • \n
    \n
  • \n
\n", + "example": 307, + "start_line": 5409, + "end_line": 5431, + "section": "Lists" + }, + { + "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
\n\n
    \n
  • baz
  • \n
  • bim
  • \n
\n", + "example": 308, + "start_line": 5439, + "end_line": 5457, + "section": "Lists" + }, + { + "markdown": "- foo\n\n notcode\n\n- foo\n\n\n\n code\n", + "html": "
    \n
  • \n

    foo

    \n

    notcode

    \n
  • \n
  • \n

    foo

    \n
  • \n
\n\n
code\n
\n", + "example": 309, + "start_line": 5460, + "end_line": 5483, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n - d\n - e\n - f\n- g\n", + "html": "
    \n
  • a
  • \n
  • b
  • \n
  • c
  • \n
  • d
  • \n
  • e
  • \n
  • f
  • \n
  • g
  • \n
\n", + "example": 310, + "start_line": 5491, + "end_line": 5509, + "section": "Lists" + }, + { + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "html": "
    \n
  1. \n

    a

    \n
  2. \n
  3. \n

    b

    \n
  4. \n
  5. \n

    c

    \n
  6. \n
\n", + "example": 311, + "start_line": 5512, + "end_line": 5530, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n - d\n - e\n", + "html": "
    \n
  • a
  • \n
  • b
  • \n
  • c
  • \n
  • d\n- e
  • \n
\n", + "example": 312, + "start_line": 5536, + "end_line": 5550, + "section": "Lists" + }, + { + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "html": "
    \n
  1. \n

    a

    \n
  2. \n
  3. \n

    b

    \n
  4. \n
\n
3. c\n
\n", + "example": 313, + "start_line": 5556, + "end_line": 5573, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n- c\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n
  • \n
  • \n

    c

    \n
  • \n
\n", + "example": 314, + "start_line": 5579, + "end_line": 5596, + "section": "Lists" + }, + { + "markdown": "* a\n*\n\n* c\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n
  • \n

    c

    \n
  • \n
\n", + "example": 315, + "start_line": 5601, + "end_line": 5616, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n c\n- d\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n

    c

    \n
  • \n
  • \n

    d

    \n
  • \n
\n", + "example": 316, + "start_line": 5623, + "end_line": 5642, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n [ref]: /url\n- d\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n
  • \n
  • \n

    d

    \n
  • \n
\n", + "example": 317, + "start_line": 5645, + "end_line": 5663, + "section": "Lists" + }, + { + "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", + "html": "
    \n
  • a
  • \n
  • \n
    b\n\n\n
    \n
  • \n
  • c
  • \n
\n", + "example": 318, + "start_line": 5668, + "end_line": 5687, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n\n c\n- d\n", + "html": "
    \n
  • a\n
      \n
    • \n

      b

      \n

      c

      \n
    • \n
    \n
  • \n
  • d
  • \n
\n", + "example": 319, + "start_line": 5694, + "end_line": 5712, + "section": "Lists" + }, + { + "markdown": "* a\n > b\n >\n* c\n", + "html": "
    \n
  • a\n
    \n

    b

    \n
    \n
  • \n
  • c
  • \n
\n", + "example": 320, + "start_line": 5718, + "end_line": 5732, + "section": "Lists" + }, + { + "markdown": "- a\n > b\n ```\n c\n ```\n- d\n", + "html": "
    \n
  • a\n
    \n

    b

    \n
    \n
    c\n
    \n
  • \n
  • d
  • \n
\n", + "example": 321, + "start_line": 5738, + "end_line": 5756, + "section": "Lists" + }, + { + "markdown": "- a\n", + "html": "
    \n
  • a
  • \n
\n", + "example": 322, + "start_line": 5761, + "end_line": 5767, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n", + "html": "
    \n
  • a\n
      \n
    • b
    • \n
    \n
  • \n
\n", + "example": 323, + "start_line": 5770, + "end_line": 5781, + "section": "Lists" + }, + { + "markdown": "1. ```\n foo\n ```\n\n bar\n", + "html": "
    \n
  1. \n
    foo\n
    \n

    bar

    \n
  2. \n
\n", + "example": 324, + "start_line": 5787, + "end_line": 5801, + "section": "Lists" + }, + { + "markdown": "* foo\n * bar\n\n baz\n", + "html": "
    \n
  • \n

    foo

    \n
      \n
    • bar
    • \n
    \n

    baz

    \n
  • \n
\n", + "example": 325, + "start_line": 5806, + "end_line": 5821, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", + "html": "
    \n
  • \n

    a

    \n
      \n
    • b
    • \n
    • c
    • \n
    \n
  • \n
  • \n

    d

    \n
      \n
    • e
    • \n
    • f
    • \n
    \n
  • \n
\n", + "example": 326, + "start_line": 5824, + "end_line": 5849, + "section": "Lists" + }, + { + "markdown": "`hi`lo`\n", + "html": "

hilo`

\n", + "example": 327, + "start_line": 5858, + "end_line": 5862, + "section": "Inlines" + }, + { + "markdown": "`foo`\n", + "html": "

foo

\n", + "example": 328, + "start_line": 5890, + "end_line": 5894, + "section": "Code spans" + }, + { + "markdown": "`` foo ` bar ``\n", + "html": "

foo ` bar

\n", + "example": 329, + "start_line": 5901, + "end_line": 5905, + "section": "Code spans" + }, + { + "markdown": "` `` `\n", + "html": "

``

\n", + "example": 330, + "start_line": 5911, + "end_line": 5915, + "section": "Code spans" + }, + { + "markdown": "` `` `\n", + "html": "

``

\n", + "example": 331, + "start_line": 5919, + "end_line": 5923, + "section": "Code spans" + }, + { + "markdown": "` a`\n", + "html": "

a

\n", + "example": 332, + "start_line": 5928, + "end_line": 5932, + "section": "Code spans" + }, + { + "markdown": "` b `\n", + "html": "

 b 

\n", + "example": 333, + "start_line": 5937, + "end_line": 5941, + "section": "Code spans" + }, + { + "markdown": "` `\n` `\n", + "html": "

 \n

\n", + "example": 334, + "start_line": 5945, + "end_line": 5951, + "section": "Code spans" + }, + { + "markdown": "``\nfoo\nbar \nbaz\n``\n", + "html": "

foo bar baz

\n", + "example": 335, + "start_line": 5956, + "end_line": 5964, + "section": "Code spans" + }, + { + "markdown": "``\nfoo \n``\n", + "html": "

foo

\n", + "example": 336, + "start_line": 5966, + "end_line": 5972, + "section": "Code spans" + }, + { + "markdown": "`foo bar \nbaz`\n", + "html": "

foo bar baz

\n", + "example": 337, + "start_line": 5977, + "end_line": 5982, + "section": "Code spans" + }, + { + "markdown": "`foo\\`bar`\n", + "html": "

foo\\bar`

\n", + "example": 338, + "start_line": 5994, + "end_line": 5998, + "section": "Code spans" + }, + { + "markdown": "``foo`bar``\n", + "html": "

foo`bar

\n", + "example": 339, + "start_line": 6005, + "end_line": 6009, + "section": "Code spans" + }, + { + "markdown": "` foo `` bar `\n", + "html": "

foo `` bar

\n", + "example": 340, + "start_line": 6011, + "end_line": 6015, + "section": "Code spans" + }, + { + "markdown": "*foo`*`\n", + "html": "

*foo*

\n", + "example": 341, + "start_line": 6023, + "end_line": 6027, + "section": "Code spans" + }, + { + "markdown": "[not a `link](/foo`)\n", + "html": "

[not a link](/foo)

\n", + "example": 342, + "start_line": 6032, + "end_line": 6036, + "section": "Code spans" + }, + { + "markdown": "``\n", + "html": "

<a href="">`

\n", + "example": 343, + "start_line": 6042, + "end_line": 6046, + "section": "Code spans" + }, + { + "markdown": "
`\n", + "html": "

`

\n", + "example": 344, + "start_line": 6051, + "end_line": 6055, + "section": "Code spans" + }, + { + "markdown": "``\n", + "html": "

<http://foo.bar.baz>`

\n", + "example": 345, + "start_line": 6060, + "end_line": 6064, + "section": "Code spans" + }, + { + "markdown": "`\n", + "html": "

http://foo.bar.`baz`

\n", + "example": 346, + "start_line": 6069, + "end_line": 6073, + "section": "Code spans" + }, + { + "markdown": "```foo``\n", + "html": "

```foo``

\n", + "example": 347, + "start_line": 6079, + "end_line": 6083, + "section": "Code spans" + }, + { + "markdown": "`foo\n", + "html": "

`foo

\n", + "example": 348, + "start_line": 6086, + "end_line": 6090, + "section": "Code spans" + }, + { + "markdown": "`foo``bar``\n", + "html": "

`foobar

\n", + "example": 349, + "start_line": 6095, + "end_line": 6099, + "section": "Code spans" + }, + { + "markdown": "*foo bar*\n", + "html": "

foo bar

\n", + "example": 350, + "start_line": 6312, + "end_line": 6316, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a * foo bar*\n", + "html": "

a * foo bar*

\n", + "example": 351, + "start_line": 6322, + "end_line": 6326, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a*\"foo\"*\n", + "html": "

a*"foo"*

\n", + "example": 352, + "start_line": 6333, + "end_line": 6337, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "* a *\n", + "html": "

* a *

\n", + "example": 353, + "start_line": 6342, + "end_line": 6346, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo*bar*\n", + "html": "

foobar

\n", + "example": 354, + "start_line": 6351, + "end_line": 6355, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5*6*78\n", + "html": "

5678

\n", + "example": 355, + "start_line": 6358, + "end_line": 6362, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo bar_\n", + "html": "

foo bar

\n", + "example": 356, + "start_line": 6367, + "end_line": 6371, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_ foo bar_\n", + "html": "

_ foo bar_

\n", + "example": 357, + "start_line": 6377, + "end_line": 6381, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a_\"foo\"_\n", + "html": "

a_"foo"_

\n", + "example": 358, + "start_line": 6387, + "end_line": 6391, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo_bar_\n", + "html": "

foo_bar_

\n", + "example": 359, + "start_line": 6396, + "end_line": 6400, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5_6_78\n", + "html": "

5_6_78

\n", + "example": 360, + "start_line": 6403, + "end_line": 6407, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "пристаням_стремятся_\n", + "html": "

пристаням_стремятся_

\n", + "example": 361, + "start_line": 6410, + "end_line": 6414, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "aa_\"bb\"_cc\n", + "html": "

aa_"bb"_cc

\n", + "example": 362, + "start_line": 6420, + "end_line": 6424, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo-_(bar)_\n", + "html": "

foo-(bar)

\n", + "example": 363, + "start_line": 6431, + "end_line": 6435, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo*\n", + "html": "

_foo*

\n", + "example": 364, + "start_line": 6443, + "end_line": 6447, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo bar *\n", + "html": "

*foo bar *

\n", + "example": 365, + "start_line": 6453, + "end_line": 6457, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo bar\n*\n", + "html": "

*foo bar\n*

\n", + "example": 366, + "start_line": 6462, + "end_line": 6468, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(*foo)\n", + "html": "

*(*foo)

\n", + "example": 367, + "start_line": 6475, + "end_line": 6479, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(*foo*)*\n", + "html": "

(foo)

\n", + "example": 368, + "start_line": 6485, + "end_line": 6489, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo*bar\n", + "html": "

foobar

\n", + "example": 369, + "start_line": 6494, + "end_line": 6498, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo bar _\n", + "html": "

_foo bar _

\n", + "example": 370, + "start_line": 6507, + "end_line": 6511, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(_foo)\n", + "html": "

_(_foo)

\n", + "example": 371, + "start_line": 6517, + "end_line": 6521, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(_foo_)_\n", + "html": "

(foo)

\n", + "example": 372, + "start_line": 6526, + "end_line": 6530, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo_bar\n", + "html": "

_foo_bar

\n", + "example": 373, + "start_line": 6535, + "end_line": 6539, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_пристаням_стремятся\n", + "html": "

_пристаням_стремятся

\n", + "example": 374, + "start_line": 6542, + "end_line": 6546, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo_bar_baz_\n", + "html": "

foo_bar_baz

\n", + "example": 375, + "start_line": 6549, + "end_line": 6553, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(bar)_.\n", + "html": "

(bar).

\n", + "example": 376, + "start_line": 6560, + "end_line": 6564, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo bar**\n", + "html": "

foo bar

\n", + "example": 377, + "start_line": 6569, + "end_line": 6573, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "** foo bar**\n", + "html": "

** foo bar**

\n", + "example": 378, + "start_line": 6579, + "end_line": 6583, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a**\"foo\"**\n", + "html": "

a**"foo"**

\n", + "example": 379, + "start_line": 6590, + "end_line": 6594, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo**bar**\n", + "html": "

foobar

\n", + "example": 380, + "start_line": 6599, + "end_line": 6603, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo bar__\n", + "html": "

foo bar

\n", + "example": 381, + "start_line": 6608, + "end_line": 6612, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__ foo bar__\n", + "html": "

__ foo bar__

\n", + "example": 382, + "start_line": 6618, + "end_line": 6622, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__\nfoo bar__\n", + "html": "

__\nfoo bar__

\n", + "example": 383, + "start_line": 6626, + "end_line": 6632, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a__\"foo\"__\n", + "html": "

a__"foo"__

\n", + "example": 384, + "start_line": 6638, + "end_line": 6642, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo__bar__\n", + "html": "

foo__bar__

\n", + "example": 385, + "start_line": 6647, + "end_line": 6651, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5__6__78\n", + "html": "

5__6__78

\n", + "example": 386, + "start_line": 6654, + "end_line": 6658, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "пристаням__стремятся__\n", + "html": "

пристаням__стремятся__

\n", + "example": 387, + "start_line": 6661, + "end_line": 6665, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo, __bar__, baz__\n", + "html": "

foo, bar, baz

\n", + "example": 388, + "start_line": 6668, + "end_line": 6672, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo-__(bar)__\n", + "html": "

foo-(bar)

\n", + "example": 389, + "start_line": 6679, + "end_line": 6683, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo bar **\n", + "html": "

**foo bar **

\n", + "example": 390, + "start_line": 6692, + "end_line": 6696, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**(**foo)\n", + "html": "

**(**foo)

\n", + "example": 391, + "start_line": 6705, + "end_line": 6709, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(**foo**)*\n", + "html": "

(foo)

\n", + "example": 392, + "start_line": 6715, + "end_line": 6719, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", + "html": "

Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

\n", + "example": 393, + "start_line": 6722, + "end_line": 6728, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo \"*bar*\" foo**\n", + "html": "

foo "bar" foo

\n", + "example": 394, + "start_line": 6731, + "end_line": 6735, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo**bar\n", + "html": "

foobar

\n", + "example": 395, + "start_line": 6740, + "end_line": 6744, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo bar __\n", + "html": "

__foo bar __

\n", + "example": 396, + "start_line": 6752, + "end_line": 6756, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__(__foo)\n", + "html": "

__(__foo)

\n", + "example": 397, + "start_line": 6762, + "end_line": 6766, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(__foo__)_\n", + "html": "

(foo)

\n", + "example": 398, + "start_line": 6772, + "end_line": 6776, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__bar\n", + "html": "

__foo__bar

\n", + "example": 399, + "start_line": 6781, + "end_line": 6785, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__пристаням__стремятся\n", + "html": "

__пристаням__стремятся

\n", + "example": 400, + "start_line": 6788, + "end_line": 6792, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__bar__baz__\n", + "html": "

foo__bar__baz

\n", + "example": 401, + "start_line": 6795, + "end_line": 6799, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__(bar)__.\n", + "html": "

(bar).

\n", + "example": 402, + "start_line": 6806, + "end_line": 6810, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo [bar](/url)*\n", + "html": "

foo bar

\n", + "example": 403, + "start_line": 6818, + "end_line": 6822, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo\nbar*\n", + "html": "

foo\nbar

\n", + "example": 404, + "start_line": 6825, + "end_line": 6831, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo __bar__ baz_\n", + "html": "

foo bar baz

\n", + "example": 405, + "start_line": 6837, + "end_line": 6841, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo _bar_ baz_\n", + "html": "

foo bar baz

\n", + "example": 406, + "start_line": 6844, + "end_line": 6848, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo_ bar_\n", + "html": "

foo bar

\n", + "example": 407, + "start_line": 6851, + "end_line": 6855, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo *bar**\n", + "html": "

foo bar

\n", + "example": 408, + "start_line": 6858, + "end_line": 6862, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar** baz*\n", + "html": "

foo bar baz

\n", + "example": 409, + "start_line": 6865, + "end_line": 6869, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar**baz*\n", + "html": "

foobarbaz

\n", + "example": 410, + "start_line": 6871, + "end_line": 6875, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar*\n", + "html": "

foo**bar

\n", + "example": 411, + "start_line": 6895, + "end_line": 6899, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo** bar*\n", + "html": "

foo bar

\n", + "example": 412, + "start_line": 6908, + "end_line": 6912, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar***\n", + "html": "

foo bar

\n", + "example": 413, + "start_line": 6915, + "end_line": 6919, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar***\n", + "html": "

foobar

\n", + "example": 414, + "start_line": 6922, + "end_line": 6926, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo***bar***baz\n", + "html": "

foobarbaz

\n", + "example": 415, + "start_line": 6933, + "end_line": 6937, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo******bar*********baz\n", + "html": "

foobar***baz

\n", + "example": 416, + "start_line": 6939, + "end_line": 6943, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar *baz* bim** bop*\n", + "html": "

foo bar baz bim bop

\n", + "example": 417, + "start_line": 6948, + "end_line": 6952, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo [*bar*](/url)*\n", + "html": "

foo bar

\n", + "example": 418, + "start_line": 6955, + "end_line": 6959, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "** is not an empty emphasis\n", + "html": "

** is not an empty emphasis

\n", + "example": 419, + "start_line": 6964, + "end_line": 6968, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**** is not an empty strong emphasis\n", + "html": "

**** is not an empty strong emphasis

\n", + "example": 420, + "start_line": 6971, + "end_line": 6975, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo [bar](/url)**\n", + "html": "

foo bar

\n", + "example": 421, + "start_line": 6984, + "end_line": 6988, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo\nbar**\n", + "html": "

foo\nbar

\n", + "example": 422, + "start_line": 6991, + "end_line": 6997, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo _bar_ baz__\n", + "html": "

foo bar baz

\n", + "example": 423, + "start_line": 7003, + "end_line": 7007, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo __bar__ baz__\n", + "html": "

foo bar baz

\n", + "example": 424, + "start_line": 7010, + "end_line": 7014, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo__ bar__\n", + "html": "

foo bar

\n", + "example": 425, + "start_line": 7017, + "end_line": 7021, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo **bar****\n", + "html": "

foo bar

\n", + "example": 426, + "start_line": 7024, + "end_line": 7028, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar* baz**\n", + "html": "

foo bar baz

\n", + "example": 427, + "start_line": 7031, + "end_line": 7035, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo*bar*baz**\n", + "html": "

foobarbaz

\n", + "example": 428, + "start_line": 7038, + "end_line": 7042, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo* bar**\n", + "html": "

foo bar

\n", + "example": 429, + "start_line": 7045, + "end_line": 7049, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar***\n", + "html": "

foo bar

\n", + "example": 430, + "start_line": 7052, + "end_line": 7056, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar **baz**\nbim* bop**\n", + "html": "

foo bar baz\nbim bop

\n", + "example": 431, + "start_line": 7061, + "end_line": 7067, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo [*bar*](/url)**\n", + "html": "

foo bar

\n", + "example": 432, + "start_line": 7070, + "end_line": 7074, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__ is not an empty emphasis\n", + "html": "

__ is not an empty emphasis

\n", + "example": 433, + "start_line": 7079, + "end_line": 7083, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____ is not an empty strong emphasis\n", + "html": "

____ is not an empty strong emphasis

\n", + "example": 434, + "start_line": 7086, + "end_line": 7090, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo ***\n", + "html": "

foo ***

\n", + "example": 435, + "start_line": 7096, + "end_line": 7100, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *\\**\n", + "html": "

foo *

\n", + "example": 436, + "start_line": 7103, + "end_line": 7107, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *_*\n", + "html": "

foo _

\n", + "example": 437, + "start_line": 7110, + "end_line": 7114, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *****\n", + "html": "

foo *****

\n", + "example": 438, + "start_line": 7117, + "end_line": 7121, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo **\\***\n", + "html": "

foo *

\n", + "example": 439, + "start_line": 7124, + "end_line": 7128, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo **_**\n", + "html": "

foo _

\n", + "example": 440, + "start_line": 7131, + "end_line": 7135, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo*\n", + "html": "

*foo

\n", + "example": 441, + "start_line": 7142, + "end_line": 7146, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**\n", + "html": "

foo*

\n", + "example": 442, + "start_line": 7149, + "end_line": 7153, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo**\n", + "html": "

*foo

\n", + "example": 443, + "start_line": 7156, + "end_line": 7160, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "****foo*\n", + "html": "

***foo

\n", + "example": 444, + "start_line": 7163, + "end_line": 7167, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo***\n", + "html": "

foo*

\n", + "example": 445, + "start_line": 7170, + "end_line": 7174, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo****\n", + "html": "

foo***

\n", + "example": 446, + "start_line": 7177, + "end_line": 7181, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo ___\n", + "html": "

foo ___

\n", + "example": 447, + "start_line": 7187, + "end_line": 7191, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _\\__\n", + "html": "

foo _

\n", + "example": 448, + "start_line": 7194, + "end_line": 7198, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _*_\n", + "html": "

foo *

\n", + "example": 449, + "start_line": 7201, + "end_line": 7205, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _____\n", + "html": "

foo _____

\n", + "example": 450, + "start_line": 7208, + "end_line": 7212, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo __\\___\n", + "html": "

foo _

\n", + "example": 451, + "start_line": 7215, + "end_line": 7219, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo __*__\n", + "html": "

foo *

\n", + "example": 452, + "start_line": 7222, + "end_line": 7226, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo_\n", + "html": "

_foo

\n", + "example": 453, + "start_line": 7229, + "end_line": 7233, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo__\n", + "html": "

foo_

\n", + "example": 454, + "start_line": 7240, + "end_line": 7244, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "___foo__\n", + "html": "

_foo

\n", + "example": 455, + "start_line": 7247, + "end_line": 7251, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo_\n", + "html": "

___foo

\n", + "example": 456, + "start_line": 7254, + "end_line": 7258, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo___\n", + "html": "

foo_

\n", + "example": 457, + "start_line": 7261, + "end_line": 7265, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo____\n", + "html": "

foo___

\n", + "example": 458, + "start_line": 7268, + "end_line": 7272, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo**\n", + "html": "

foo

\n", + "example": 459, + "start_line": 7278, + "end_line": 7282, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*_foo_*\n", + "html": "

foo

\n", + "example": 460, + "start_line": 7285, + "end_line": 7289, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__\n", + "html": "

foo

\n", + "example": 461, + "start_line": 7292, + "end_line": 7296, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_*foo*_\n", + "html": "

foo

\n", + "example": 462, + "start_line": 7299, + "end_line": 7303, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "****foo****\n", + "html": "

foo

\n", + "example": 463, + "start_line": 7309, + "end_line": 7313, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo____\n", + "html": "

foo

\n", + "example": 464, + "start_line": 7316, + "end_line": 7320, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "******foo******\n", + "html": "

foo

\n", + "example": 465, + "start_line": 7327, + "end_line": 7331, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo***\n", + "html": "

foo

\n", + "example": 466, + "start_line": 7336, + "end_line": 7340, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_____foo_____\n", + "html": "

foo

\n", + "example": 467, + "start_line": 7343, + "end_line": 7347, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo _bar* baz_\n", + "html": "

foo _bar baz_

\n", + "example": 468, + "start_line": 7352, + "end_line": 7356, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo __bar *baz bim__ bam*\n", + "html": "

foo bar *baz bim bam

\n", + "example": 469, + "start_line": 7359, + "end_line": 7363, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo **bar baz**\n", + "html": "

**foo bar baz

\n", + "example": 470, + "start_line": 7368, + "end_line": 7372, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo *bar baz*\n", + "html": "

*foo bar baz

\n", + "example": 471, + "start_line": 7375, + "end_line": 7379, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*[bar*](/url)\n", + "html": "

*bar*

\n", + "example": 472, + "start_line": 7384, + "end_line": 7388, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo [bar_](/url)\n", + "html": "

_foo bar_

\n", + "example": 473, + "start_line": 7391, + "end_line": 7395, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*\n", + "html": "

*

\n", + "example": 474, + "start_line": 7398, + "end_line": 7402, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**\n", + "html": "

**

\n", + "example": 475, + "start_line": 7405, + "end_line": 7409, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__\n", + "html": "

__

\n", + "example": 476, + "start_line": 7412, + "end_line": 7416, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*a `*`*\n", + "html": "

a *

\n", + "example": 477, + "start_line": 7419, + "end_line": 7423, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_a `_`_\n", + "html": "

a _

\n", + "example": 478, + "start_line": 7426, + "end_line": 7430, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**a\n", + "html": "

**ahttp://foo.bar/?q=**

\n", + "example": 479, + "start_line": 7433, + "end_line": 7437, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__a\n", + "html": "

__ahttp://foo.bar/?q=__

\n", + "example": 480, + "start_line": 7440, + "end_line": 7444, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "[link](/uri \"title\")\n", + "html": "

link

\n", + "example": 481, + "start_line": 7528, + "end_line": 7532, + "section": "Links" + }, + { + "markdown": "[link](/uri)\n", + "html": "

link

\n", + "example": 482, + "start_line": 7538, + "end_line": 7542, + "section": "Links" + }, + { + "markdown": "[](./target.md)\n", + "html": "

\n", + "example": 483, + "start_line": 7544, + "end_line": 7548, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

link

\n", + "example": 484, + "start_line": 7551, + "end_line": 7555, + "section": "Links" + }, + { + "markdown": "[link](<>)\n", + "html": "

link

\n", + "example": 485, + "start_line": 7558, + "end_line": 7562, + "section": "Links" + }, + { + "markdown": "[]()\n", + "html": "

\n", + "example": 486, + "start_line": 7565, + "end_line": 7569, + "section": "Links" + }, + { + "markdown": "[link](/my uri)\n", + "html": "

[link](/my uri)

\n", + "example": 487, + "start_line": 7574, + "end_line": 7578, + "section": "Links" + }, + { + "markdown": "[link](
)\n", + "html": "

link

\n", + "example": 488, + "start_line": 7580, + "end_line": 7584, + "section": "Links" + }, + { + "markdown": "[link](foo\nbar)\n", + "html": "

[link](foo\nbar)

\n", + "example": 489, + "start_line": 7589, + "end_line": 7595, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

[link]()

\n", + "example": 490, + "start_line": 7597, + "end_line": 7603, + "section": "Links" + }, + { + "markdown": "[a]()\n", + "html": "

a

\n", + "example": 491, + "start_line": 7608, + "end_line": 7612, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

[link](<foo>)

\n", + "example": 492, + "start_line": 7616, + "end_line": 7620, + "section": "Links" + }, + { + "markdown": "[a](\n[a](c)\n", + "html": "

[a](<b)c\n[a](<b)c>\n[a](c)

\n", + "example": 493, + "start_line": 7625, + "end_line": 7633, + "section": "Links" + }, + { + "markdown": "[link](\\(foo\\))\n", + "html": "

link

\n", + "example": 494, + "start_line": 7637, + "end_line": 7641, + "section": "Links" + }, + { + "markdown": "[link](foo(and(bar)))\n", + "html": "

link

\n", + "example": 495, + "start_line": 7646, + "end_line": 7650, + "section": "Links" + }, + { + "markdown": "[link](foo(and(bar))\n", + "html": "

[link](foo(and(bar))

\n", + "example": 496, + "start_line": 7655, + "end_line": 7659, + "section": "Links" + }, + { + "markdown": "[link](foo\\(and\\(bar\\))\n", + "html": "

link

\n", + "example": 497, + "start_line": 7662, + "end_line": 7666, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

link

\n", + "example": 498, + "start_line": 7669, + "end_line": 7673, + "section": "Links" + }, + { + "markdown": "[link](foo\\)\\:)\n", + "html": "

link

\n", + "example": 499, + "start_line": 7679, + "end_line": 7683, + "section": "Links" + }, + { + "markdown": "[link](#fragment)\n\n[link](http://example.com#fragment)\n\n[link](http://example.com?foo=3#frag)\n", + "html": "

link

\n

link

\n

link

\n", + "example": 500, + "start_line": 7688, + "end_line": 7698, + "section": "Links" + }, + { + "markdown": "[link](foo\\bar)\n", + "html": "

link

\n", + "example": 501, + "start_line": 7704, + "end_line": 7708, + "section": "Links" + }, + { + "markdown": "[link](foo%20bä)\n", + "html": "

link

\n", + "example": 502, + "start_line": 7720, + "end_line": 7724, + "section": "Links" + }, + { + "markdown": "[link](\"title\")\n", + "html": "

link

\n", + "example": 503, + "start_line": 7731, + "end_line": 7735, + "section": "Links" + }, + { + "markdown": "[link](/url \"title\")\n[link](/url 'title')\n[link](/url (title))\n", + "html": "

link\nlink\nlink

\n", + "example": 504, + "start_line": 7740, + "end_line": 7748, + "section": "Links" + }, + { + "markdown": "[link](/url \"title \\\""\")\n", + "html": "

link

\n", + "example": 505, + "start_line": 7754, + "end_line": 7758, + "section": "Links" + }, + { + "markdown": "[link](/url \"title\")\n", + "html": "

link

\n", + "example": 506, + "start_line": 7765, + "end_line": 7769, + "section": "Links" + }, + { + "markdown": "[link](/url \"title \"and\" title\")\n", + "html": "

[link](/url "title "and" title")

\n", + "example": 507, + "start_line": 7774, + "end_line": 7778, + "section": "Links" + }, + { + "markdown": "[link](/url 'title \"and\" title')\n", + "html": "

link

\n", + "example": 508, + "start_line": 7783, + "end_line": 7787, + "section": "Links" + }, + { + "markdown": "[link]( /uri\n \"title\" )\n", + "html": "

link

\n", + "example": 509, + "start_line": 7808, + "end_line": 7813, + "section": "Links" + }, + { + "markdown": "[link] (/uri)\n", + "html": "

[link] (/uri)

\n", + "example": 510, + "start_line": 7819, + "end_line": 7823, + "section": "Links" + }, + { + "markdown": "[link [foo [bar]]](/uri)\n", + "html": "

link [foo [bar]]

\n", + "example": 511, + "start_line": 7829, + "end_line": 7833, + "section": "Links" + }, + { + "markdown": "[link] bar](/uri)\n", + "html": "

[link] bar](/uri)

\n", + "example": 512, + "start_line": 7836, + "end_line": 7840, + "section": "Links" + }, + { + "markdown": "[link [bar](/uri)\n", + "html": "

[link bar

\n", + "example": 513, + "start_line": 7843, + "end_line": 7847, + "section": "Links" + }, + { + "markdown": "[link \\[bar](/uri)\n", + "html": "

link [bar

\n", + "example": 514, + "start_line": 7850, + "end_line": 7854, + "section": "Links" + }, + { + "markdown": "[link *foo **bar** `#`*](/uri)\n", + "html": "

link foo bar #

\n", + "example": 515, + "start_line": 7859, + "end_line": 7863, + "section": "Links" + }, + { + "markdown": "[![moon](moon.jpg)](/uri)\n", + "html": "

\"moon\"

\n", + "example": 516, + "start_line": 7866, + "end_line": 7870, + "section": "Links" + }, + { + "markdown": "[foo [bar](/uri)](/uri)\n", + "html": "

[foo bar](/uri)

\n", + "example": 517, + "start_line": 7875, + "end_line": 7879, + "section": "Links" + }, + { + "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", + "html": "

[foo [bar baz](/uri)](/uri)

\n", + "example": 518, + "start_line": 7882, + "end_line": 7886, + "section": "Links" + }, + { + "markdown": "![[[foo](uri1)](uri2)](uri3)\n", + "html": "

\"[foo](uri2)\"

\n", + "example": 519, + "start_line": 7889, + "end_line": 7893, + "section": "Links" + }, + { + "markdown": "*[foo*](/uri)\n", + "html": "

*foo*

\n", + "example": 520, + "start_line": 7899, + "end_line": 7903, + "section": "Links" + }, + { + "markdown": "[foo *bar](baz*)\n", + "html": "

foo *bar

\n", + "example": 521, + "start_line": 7906, + "end_line": 7910, + "section": "Links" + }, + { + "markdown": "*foo [bar* baz]\n", + "html": "

foo [bar baz]

\n", + "example": 522, + "start_line": 7916, + "end_line": 7920, + "section": "Links" + }, + { + "markdown": "[foo \n", + "html": "

[foo

\n", + "example": 523, + "start_line": 7926, + "end_line": 7930, + "section": "Links" + }, + { + "markdown": "[foo`](/uri)`\n", + "html": "

[foo](/uri)

\n", + "example": 524, + "start_line": 7933, + "end_line": 7937, + "section": "Links" + }, + { + "markdown": "[foo\n", + "html": "

[foohttp://example.com/?search=](uri)

\n", + "example": 525, + "start_line": 7940, + "end_line": 7944, + "section": "Links" + }, + { + "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", + "html": "

foo

\n", + "example": 526, + "start_line": 7978, + "end_line": 7984, + "section": "Links" + }, + { + "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", + "html": "

link [foo [bar]]

\n", + "example": 527, + "start_line": 7993, + "end_line": 7999, + "section": "Links" + }, + { + "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", + "html": "

link [bar

\n", + "example": 528, + "start_line": 8002, + "end_line": 8008, + "section": "Links" + }, + { + "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", + "html": "

link foo bar #

\n", + "example": 529, + "start_line": 8013, + "end_line": 8019, + "section": "Links" + }, + { + "markdown": "[![moon](moon.jpg)][ref]\n\n[ref]: /uri\n", + "html": "

\"moon\"

\n", + "example": 530, + "start_line": 8022, + "end_line": 8028, + "section": "Links" + }, + { + "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", + "html": "

[foo bar]ref

\n", + "example": 531, + "start_line": 8033, + "end_line": 8039, + "section": "Links" + }, + { + "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", + "html": "

[foo bar baz]ref

\n", + "example": 532, + "start_line": 8042, + "end_line": 8048, + "section": "Links" + }, + { + "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", + "html": "

*foo*

\n", + "example": 533, + "start_line": 8057, + "end_line": 8063, + "section": "Links" + }, + { + "markdown": "[foo *bar][ref]*\n\n[ref]: /uri\n", + "html": "

foo *bar*

\n", + "example": 534, + "start_line": 8066, + "end_line": 8072, + "section": "Links" + }, + { + "markdown": "[foo \n\n[ref]: /uri\n", + "html": "

[foo

\n", + "example": 535, + "start_line": 8078, + "end_line": 8084, + "section": "Links" + }, + { + "markdown": "[foo`][ref]`\n\n[ref]: /uri\n", + "html": "

[foo][ref]

\n", + "example": 536, + "start_line": 8087, + "end_line": 8093, + "section": "Links" + }, + { + "markdown": "[foo\n\n[ref]: /uri\n", + "html": "

[foohttp://example.com/?search=][ref]

\n", + "example": 537, + "start_line": 8096, + "end_line": 8102, + "section": "Links" + }, + { + "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", + "html": "

foo

\n", + "example": 538, + "start_line": 8107, + "end_line": 8113, + "section": "Links" + }, + { + "markdown": "[ẞ]\n\n[SS]: /url\n", + "html": "

ẞ

\n", + "example": 539, + "start_line": 8118, + "end_line": 8124, + "section": "Links" + }, + { + "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", + "html": "

Baz

\n", + "example": 540, + "start_line": 8130, + "end_line": 8137, + "section": "Links" + }, + { + "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", + "html": "

[foo] bar

\n", + "example": 541, + "start_line": 8143, + "end_line": 8149, + "section": "Links" + }, + { + "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", + "html": "

[foo]\nbar

\n", + "example": 542, + "start_line": 8152, + "end_line": 8160, + "section": "Links" + }, + { + "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", + "html": "

bar

\n", + "example": 543, + "start_line": 8193, + "end_line": 8201, + "section": "Links" + }, + { + "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", + "html": "

[bar][foo!]

\n", + "example": 544, + "start_line": 8208, + "end_line": 8214, + "section": "Links" + }, + { + "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", + "html": "

[foo][ref[]

\n

[ref[]: /uri

\n", + "example": 545, + "start_line": 8220, + "end_line": 8227, + "section": "Links" + }, + { + "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", + "html": "

[foo][ref[bar]]

\n

[ref[bar]]: /uri

\n", + "example": 546, + "start_line": 8230, + "end_line": 8237, + "section": "Links" + }, + { + "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", + "html": "

[[[foo]]]

\n

[[[foo]]]: /url

\n", + "example": 547, + "start_line": 8240, + "end_line": 8247, + "section": "Links" + }, + { + "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", + "html": "

foo

\n", + "example": 548, + "start_line": 8250, + "end_line": 8256, + "section": "Links" + }, + { + "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", + "html": "

bar\\

\n", + "example": 549, + "start_line": 8261, + "end_line": 8267, + "section": "Links" + }, + { + "markdown": "[]\n\n[]: /uri\n", + "html": "

[]

\n

[]: /uri

\n", + "example": 550, + "start_line": 8273, + "end_line": 8280, + "section": "Links" + }, + { + "markdown": "[\n ]\n\n[\n ]: /uri\n", + "html": "

[\n]

\n

[\n]: /uri

\n", + "example": 551, + "start_line": 8283, + "end_line": 8294, + "section": "Links" + }, + { + "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", + "html": "

foo

\n", + "example": 552, + "start_line": 8306, + "end_line": 8312, + "section": "Links" + }, + { + "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

foo bar

\n", + "example": 553, + "start_line": 8315, + "end_line": 8321, + "section": "Links" + }, + { + "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", + "html": "

Foo

\n", + "example": 554, + "start_line": 8326, + "end_line": 8332, + "section": "Links" + }, + { + "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", + "html": "

foo\n[]

\n", + "example": 555, + "start_line": 8339, + "end_line": 8347, + "section": "Links" + }, + { + "markdown": "[foo]\n\n[foo]: /url \"title\"\n", + "html": "

foo

\n", + "example": 556, + "start_line": 8359, + "end_line": 8365, + "section": "Links" + }, + { + "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

foo bar

\n", + "example": 557, + "start_line": 8368, + "end_line": 8374, + "section": "Links" + }, + { + "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

[foo bar]

\n", + "example": 558, + "start_line": 8377, + "end_line": 8383, + "section": "Links" + }, + { + "markdown": "[[bar [foo]\n\n[foo]: /url\n", + "html": "

[[bar foo

\n", + "example": 559, + "start_line": 8386, + "end_line": 8392, + "section": "Links" + }, + { + "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", + "html": "

Foo

\n", + "example": 560, + "start_line": 8397, + "end_line": 8403, + "section": "Links" + }, + { + "markdown": "[foo] bar\n\n[foo]: /url\n", + "html": "

foo bar

\n", + "example": 561, + "start_line": 8408, + "end_line": 8414, + "section": "Links" + }, + { + "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", + "html": "

[foo]

\n", + "example": 562, + "start_line": 8420, + "end_line": 8426, + "section": "Links" + }, + { + "markdown": "[foo*]: /url\n\n*[foo*]\n", + "html": "

*foo*

\n", + "example": 563, + "start_line": 8432, + "end_line": 8438, + "section": "Links" + }, + { + "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", + "html": "

foo

\n", + "example": 564, + "start_line": 8444, + "end_line": 8451, + "section": "Links" + }, + { + "markdown": "[foo][]\n\n[foo]: /url1\n", + "html": "

foo

\n", + "example": 565, + "start_line": 8453, + "end_line": 8459, + "section": "Links" + }, + { + "markdown": "[foo]()\n\n[foo]: /url1\n", + "html": "

foo

\n", + "example": 566, + "start_line": 8463, + "end_line": 8469, + "section": "Links" + }, + { + "markdown": "[foo](not a link)\n\n[foo]: /url1\n", + "html": "

foo(not a link)

\n", + "example": 567, + "start_line": 8471, + "end_line": 8477, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", + "html": "

[foo]bar

\n", + "example": 568, + "start_line": 8482, + "end_line": 8488, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", + "html": "

foobaz

\n", + "example": 569, + "start_line": 8494, + "end_line": 8501, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", + "html": "

[foo]bar

\n", + "example": 570, + "start_line": 8507, + "end_line": 8514, + "section": "Links" + }, + { + "markdown": "![foo](/url \"title\")\n", + "html": "

\"foo\"

\n", + "example": 571, + "start_line": 8530, + "end_line": 8534, + "section": "Images" + }, + { + "markdown": "![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 572, + "start_line": 8537, + "end_line": 8543, + "section": "Images" + }, + { + "markdown": "![foo ![bar](/url)](/url2)\n", + "html": "

\"foo

\n", + "example": 573, + "start_line": 8546, + "end_line": 8550, + "section": "Images" + }, + { + "markdown": "![foo [bar](/url)](/url2)\n", + "html": "

\"foo

\n", + "example": 574, + "start_line": 8553, + "end_line": 8557, + "section": "Images" + }, + { + "markdown": "![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 575, + "start_line": 8567, + "end_line": 8573, + "section": "Images" + }, + { + "markdown": "![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 576, + "start_line": 8576, + "end_line": 8582, + "section": "Images" + }, + { + "markdown": "![foo](train.jpg)\n", + "html": "

\"foo\"

\n", + "example": 577, + "start_line": 8585, + "end_line": 8589, + "section": "Images" + }, + { + "markdown": "My ![foo bar](/path/to/train.jpg \"title\" )\n", + "html": "

My \"foo

\n", + "example": 578, + "start_line": 8592, + "end_line": 8596, + "section": "Images" + }, + { + "markdown": "![foo]()\n", + "html": "

\"foo\"

\n", + "example": 579, + "start_line": 8599, + "end_line": 8603, + "section": "Images" + }, + { + "markdown": "![](/url)\n", + "html": "

\"\"

\n", + "example": 580, + "start_line": 8606, + "end_line": 8610, + "section": "Images" + }, + { + "markdown": "![foo][bar]\n\n[bar]: /url\n", + "html": "

\"foo\"

\n", + "example": 581, + "start_line": 8615, + "end_line": 8621, + "section": "Images" + }, + { + "markdown": "![foo][bar]\n\n[BAR]: /url\n", + "html": "

\"foo\"

\n", + "example": 582, + "start_line": 8624, + "end_line": 8630, + "section": "Images" + }, + { + "markdown": "![foo][]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"

\n", + "example": 583, + "start_line": 8635, + "end_line": 8641, + "section": "Images" + }, + { + "markdown": "![*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

\"foo

\n", + "example": 584, + "start_line": 8644, + "end_line": 8650, + "section": "Images" + }, + { + "markdown": "![Foo][]\n\n[foo]: /url \"title\"\n", + "html": "

\"Foo\"

\n", + "example": 585, + "start_line": 8655, + "end_line": 8661, + "section": "Images" + }, + { + "markdown": "![foo] \n[]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"\n[]

\n", + "example": 586, + "start_line": 8667, + "end_line": 8675, + "section": "Images" + }, + { + "markdown": "![foo]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"

\n", + "example": 587, + "start_line": 8680, + "end_line": 8686, + "section": "Images" + }, + { + "markdown": "![*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

\"foo

\n", + "example": 588, + "start_line": 8689, + "end_line": 8695, + "section": "Images" + }, + { + "markdown": "![[foo]]\n\n[[foo]]: /url \"title\"\n", + "html": "

![[foo]]

\n

[[foo]]: /url "title"

\n", + "example": 589, + "start_line": 8700, + "end_line": 8707, + "section": "Images" + }, + { + "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", + "html": "

\"Foo\"

\n", + "example": 590, + "start_line": 8712, + "end_line": 8718, + "section": "Images" + }, + { + "markdown": "!\\[foo]\n\n[foo]: /url \"title\"\n", + "html": "

![foo]

\n", + "example": 591, + "start_line": 8724, + "end_line": 8730, + "section": "Images" + }, + { + "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", + "html": "

!foo

\n", + "example": 592, + "start_line": 8736, + "end_line": 8742, + "section": "Images" + }, + { + "markdown": "\n", + "html": "

http://foo.bar.baz

\n", + "example": 593, + "start_line": 8769, + "end_line": 8773, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://foo.bar.baz/test?q=hello&id=22&boolean

\n", + "example": 594, + "start_line": 8776, + "end_line": 8780, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

irc://foo.bar:2233/baz

\n", + "example": 595, + "start_line": 8783, + "end_line": 8787, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

MAILTO:FOO@BAR.BAZ

\n", + "example": 596, + "start_line": 8792, + "end_line": 8796, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

a+b+c:d

\n", + "example": 597, + "start_line": 8804, + "end_line": 8808, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

made-up-scheme://foo,bar

\n", + "example": 598, + "start_line": 8811, + "end_line": 8815, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://../

\n", + "example": 599, + "start_line": 8818, + "end_line": 8822, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

localhost:5001/foo

\n", + "example": 600, + "start_line": 8825, + "end_line": 8829, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<http://foo.bar/baz bim>

\n", + "example": 601, + "start_line": 8834, + "end_line": 8838, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://example.com/\\[\\

\n", + "example": 602, + "start_line": 8843, + "end_line": 8847, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

foo@bar.example.com

\n", + "example": 603, + "start_line": 8865, + "end_line": 8869, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

foo+special@Bar.baz-bar0.com

\n", + "example": 604, + "start_line": 8872, + "end_line": 8876, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<foo+@bar.example.com>

\n", + "example": 605, + "start_line": 8881, + "end_line": 8885, + "section": "Autolinks" + }, + { + "markdown": "<>\n", + "html": "

<>

\n", + "example": 606, + "start_line": 8890, + "end_line": 8894, + "section": "Autolinks" + }, + { + "markdown": "< http://foo.bar >\n", + "html": "

< http://foo.bar >

\n", + "example": 607, + "start_line": 8897, + "end_line": 8901, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<m:abc>

\n", + "example": 608, + "start_line": 8904, + "end_line": 8908, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<foo.bar.baz>

\n", + "example": 609, + "start_line": 8911, + "end_line": 8915, + "section": "Autolinks" + }, + { + "markdown": "http://example.com\n", + "html": "

http://example.com

\n", + "example": 610, + "start_line": 8918, + "end_line": 8922, + "section": "Autolinks" + }, + { + "markdown": "foo@bar.example.com\n", + "html": "

foo@bar.example.com

\n", + "example": 611, + "start_line": 8925, + "end_line": 8929, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 612, + "start_line": 9006, + "end_line": 9010, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 613, + "start_line": 9015, + "end_line": 9019, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 614, + "start_line": 9024, + "end_line": 9030, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 615, + "start_line": 9035, + "end_line": 9041, + "section": "Raw HTML" + }, + { + "markdown": "Foo \n", + "html": "

Foo

\n", + "example": 616, + "start_line": 9046, + "end_line": 9050, + "section": "Raw HTML" + }, + { + "markdown": "<33> <__>\n", + "html": "

<33> <__>

\n", + "example": 617, + "start_line": 9055, + "end_line": 9059, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a h*#ref="hi">

\n", + "example": 618, + "start_line": 9064, + "end_line": 9068, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a href="hi'> <a href=hi'>

\n", + "example": 619, + "start_line": 9073, + "end_line": 9077, + "section": "Raw HTML" + }, + { + "markdown": "< a><\nfoo>\n\n", + "html": "

< a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop />

\n", + "example": 620, + "start_line": 9082, + "end_line": 9092, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a href='bar'title=title>

\n", + "example": 621, + "start_line": 9097, + "end_line": 9101, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

\n", + "example": 622, + "start_line": 9106, + "end_line": 9110, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

</a href="foo">

\n", + "example": 623, + "start_line": 9115, + "end_line": 9119, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 624, + "start_line": 9124, + "end_line": 9130, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo <!-- not a comment -- two hyphens -->

\n", + "example": 625, + "start_line": 9133, + "end_line": 9137, + "section": "Raw HTML" + }, + { + "markdown": "foo foo -->\n\nfoo \n", + "html": "

foo <!--> foo -->

\n

foo <!-- foo--->

\n", + "example": 626, + "start_line": 9142, + "end_line": 9149, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 627, + "start_line": 9154, + "end_line": 9158, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 628, + "start_line": 9163, + "end_line": 9167, + "section": "Raw HTML" + }, + { + "markdown": "foo &<]]>\n", + "html": "

foo &<]]>

\n", + "example": 629, + "start_line": 9172, + "end_line": 9176, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 630, + "start_line": 9182, + "end_line": 9186, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 631, + "start_line": 9191, + "end_line": 9195, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

<a href=""">

\n", + "example": 632, + "start_line": 9198, + "end_line": 9202, + "section": "Raw HTML" + }, + { + "markdown": "foo \nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 633, + "start_line": 9212, + "end_line": 9218, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 634, + "start_line": 9224, + "end_line": 9230, + "section": "Hard line breaks" + }, + { + "markdown": "foo \nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 635, + "start_line": 9235, + "end_line": 9241, + "section": "Hard line breaks" + }, + { + "markdown": "foo \n bar\n", + "html": "

foo
\nbar

\n", + "example": 636, + "start_line": 9246, + "end_line": 9252, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\n bar\n", + "html": "

foo
\nbar

\n", + "example": 637, + "start_line": 9255, + "end_line": 9261, + "section": "Hard line breaks" + }, + { + "markdown": "*foo \nbar*\n", + "html": "

foo
\nbar

\n", + "example": 638, + "start_line": 9267, + "end_line": 9273, + "section": "Hard line breaks" + }, + { + "markdown": "*foo\\\nbar*\n", + "html": "

foo
\nbar

\n", + "example": 639, + "start_line": 9276, + "end_line": 9282, + "section": "Hard line breaks" + }, + { + "markdown": "`code \nspan`\n", + "html": "

code span

\n", + "example": 640, + "start_line": 9287, + "end_line": 9292, + "section": "Hard line breaks" + }, + { + "markdown": "`code\\\nspan`\n", + "html": "

code\\ span

\n", + "example": 641, + "start_line": 9295, + "end_line": 9300, + "section": "Hard line breaks" + }, + { + "markdown": "
\n", + "html": "

\n", + "example": 642, + "start_line": 9305, + "end_line": 9311, + "section": "Hard line breaks" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 643, + "start_line": 9314, + "end_line": 9320, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\n", + "html": "

foo\\

\n", + "example": 644, + "start_line": 9327, + "end_line": 9331, + "section": "Hard line breaks" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 645, + "start_line": 9334, + "end_line": 9338, + "section": "Hard line breaks" + }, + { + "markdown": "### foo\\\n", + "html": "

foo\\

\n", + "example": 646, + "start_line": 9341, + "end_line": 9345, + "section": "Hard line breaks" + }, + { + "markdown": "### foo \n", + "html": "

foo

\n", + "example": 647, + "start_line": 9348, + "end_line": 9352, + "section": "Hard line breaks" + }, + { + "markdown": "foo\nbaz\n", + "html": "

foo\nbaz

\n", + "example": 648, + "start_line": 9363, + "end_line": 9369, + "section": "Soft line breaks" + }, + { + "markdown": "foo \n baz\n", + "html": "

foo\nbaz

\n", + "example": 649, + "start_line": 9375, + "end_line": 9381, + "section": "Soft line breaks" + }, + { + "markdown": "hello $.;'there\n", + "html": "

hello $.;'there

\n", + "example": 650, + "start_line": 9395, + "end_line": 9399, + "section": "Textual content" + }, + { + "markdown": "Foo χρῆν\n", + "html": "

Foo χρῆν

\n", + "example": 651, + "start_line": 9402, + "end_line": 9406, + "section": "Textual content" + }, + { + "markdown": "Multiple spaces\n", + "html": "

Multiple spaces

\n", + "example": 652, + "start_line": 9411, + "end_line": 9415, + "section": "Textual content" + } +] \ No newline at end of file diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/def_list.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/def_list.txt new file mode 100644 index 0000000000000000000000000000000000000000..6c5a210232576e53330d55888c2d041ffeccc145 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/def_list.txt @@ -0,0 +1,172 @@ +# Definition Lists + +```````````````````````````````` example +Term +: definition +. +
+
Term
+
definition
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: definition1 +: definition2 +. +
+
Term
+
definition1
+
definition2
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: definition1 +: definition2 + +paragraph +. +
+
Term
+
definition1
+
definition2
+
+

paragraph

+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. + +Second Term +: This is one definition of the second term. +: This is another definition of the second term. +. +
+
First Term
+
This is the definition of the first term.
+
Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. + +Second Term +: This is one definition of the second term. +: This is another definition of the second term. + +paragraph +. +
+
First Term
+
This is the definition of the first term.
+
Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+

paragraph

+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. +Not Second Term +: This is one definition of the second term. +: This is another definition of the second term. + +paragraph +. +
+
First Term
+
This is the definition of the first term. +Not Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+

paragraph

+```````````````````````````````` + +## Definition with Multiple Lines + +```````````````````````````````` example +Term + +: definition +. +
+
Term
+

definition

+
+
+```````````````````````````````` + + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+

bar

+
+
+```````````````````````````````` + +Leading 4 white spaces + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+

bar

+
+
+```````````````````````````````` + + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+
bar
+
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: foo + + - bar + - baz +. +
+
Term
+

foo

+
    +
  • bar
  • +
  • baz
  • +
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/diff-commonmark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/diff-commonmark.txt new file mode 100644 index 0000000000000000000000000000000000000000..9573e2a383b273af5db4a2386d9f9fe35120d9b4 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/diff-commonmark.txt @@ -0,0 +1,76 @@ +# Differences + +Results different than commonmark. + + +## Setext headings + + +Example: 93 + + +```````````````````````````````` example +> foo +bar +=== +. +
+

foo +bar

+
+```````````````````````````````` + +If the dash is less than 3, it is not a `
`, in this case, it +can be rendered into `

`. + +```````````````````````````````` example +- # Foo +- Bar + -- + baz +. +
    +
  • +

    Foo

    +
  • +
  • +

    Bar

    +baz
  • +
+```````````````````````````````` + +## Image + +Example 573 + +```````````````````````````````` example +![foo ![bar](/url)](/url2) +. +

foo ![bar](/url)

+```````````````````````````````` + +## Link + +Example 517 + +```````````````````````````````` example +[foo [bar](/uri)](/uri) +. +

foo [bar](/uri)

+```````````````````````````````` + +Example 518 + +```````````````````````````````` example +[foo *[bar [baz](/uri)](/uri)*](/uri) +. +

foo [bar [baz](/uri)](/uri)

+```````````````````````````````` + +Example 519 + +```````````````````````````````` example +![[[foo](uri1)](uri2)](uri3) +. +

[foo](uri1)

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_admonition.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_admonition.txt new file mode 100644 index 0000000000000000000000000000000000000000..0f962c5e4d44d9fa81effe866998e1fc6f88565d --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_admonition.txt @@ -0,0 +1,129 @@ +# Admonition + +```````````````````````````````` example +```{unknown} Hi + +this is **strong** world +``` +. +
{unknown} Hi
+
+this is **strong** world
+
+```````````````````````````````` + +```````````````````````````````` example +``` +this is code +``` +. +
this is code
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{note} Warning + +message +~~~ +. +
+

Warning

+

message

+
+```````````````````````````````` + +```````````````````````````````` example +~~~{note} A **strong** title + +_message_ +~~~ +. +
+

A strong title

+

message

+
+```````````````````````````````` + +Test with code block. + +```````````````````````````````` example +```{note} + + print() +``` +. +
+

Note

+
print()
+
+```````````````````````````````` + +Test with no message. + +```````````````````````````````` example +~~~{note} Warning +~~~ +. +
+

Warning

+
+```````````````````````````````` + +Test with no ending fence + +```````````````````````````````` example +~~~{note} Warning +. +
+

Warning

+
+```````````````````````````````` + +Test with nested admonition + +```````````````````````````````` example +~~~~~~~{note} +~~~~~~{warning} +~~~~~{tip} +~~~~{caution} +~~~{hint} +``````{danger} +`````{attention} +````{important} +```{error} +``` +```` +````` +`````` +~~~ +~~~~ +~~~~~ +~~~~~~ +~~~~~~~ +. +
+

Note

+
+

Warning

+
+

Tip

+
+

Caution

+
+

Hint

+
+

Danger

+
````{important}
+```{error}
+```
+````
+
+
+
+
+
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_figure.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_figure.txt new file mode 100644 index 0000000000000000000000000000000000000000..0fcd23c1f1280e6e9b17a43fbb8942d21b702254 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_figure.txt @@ -0,0 +1,166 @@ +# Figure + +## No options + +```````````````````````````````` example +~~~{figure} picture.png +~~~ +. +
+
+
+```````````````````````````````` + +## Align options + +```````````````````````````````` example +~~~{figure} picture.png +:align: left +~~~ +. +
+
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{figure} picture.png +:align: invalid +~~~ +. +
+
+
+```````````````````````````````` + +## width and height + +```````````````````````````````` example +~~~{figure} picture.png +:width: 100 +:height: 50 +~~~ +. +
+
+
+```````````````````````````````` + +```````````````````````````````` example +~~~{figure} picture.png +:width: 100px +:height: 50px +~~~ +. +
+
+
+```````````````````````````````` + +```````````````````````````````` example +~~~{figure} picture.png +:figwidth: 400px +~~~ +. +
+
+
+```````````````````````````````` + +## alt option + +```````````````````````````````` example +~~~{figure} picture.png +:alt: description text +~~~ +. +
+
description text
+
+```````````````````````````````` + +## target option + +```````````````````````````````` example +~~~{figure} picture.png +:target: https://lepture.com +~~~ +. +
+ +
+```````````````````````````````` + +## caption + +```````````````````````````````` example +~~~{figure} picture.png +a caption with **emphasis** text +~~~ +. +
+
+
a caption with emphasis text
+
+```````````````````````````````` + +## legend + +```````````````````````````````` example +~~~{figure} picture.png +a caption with **emphasis** text + +> quote +~~~ +. +
+
+
a caption with emphasis text
+
+
+

quote

+
+
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{figure} picture.png +> quote +~~~ +. +
+
+
+```````````````````````````````` + +## all options + + +```````````````````````````````` example +~~~{figure} picture.png +:figwidth: 400px +:figclass: all-options +:target: https://lepture.com +:alt: description +:align: left +:width: 100 +:height: 50 + +a caption with **emphasis** text + +> quote +~~~ +. +
+description +
a caption with emphasis text
+
+
+

quote

+
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_image.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_image.txt new file mode 100644 index 0000000000000000000000000000000000000000..afec622ce413acb5fcbb287e020c4588e892de8c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_image.txt @@ -0,0 +1,102 @@ +# Image + +## No options + +```````````````````````````````` example +~~~{image} picture.png +~~~ +. +
+```````````````````````````````` + +## Align options + +```````````````````````````````` example +~~~{image} picture.png +:align: left +~~~ +. +
+```````````````````````````````` + + +```````````````````````````````` example +~~~{image} picture.png +:align: invalid +~~~ +. +
+```````````````````````````````` + +## width and height + +```````````````````````````````` example +~~~{image} picture.png +:width: 100 +:height: 50 +~~~ +. +
+```````````````````````````````` + +```````````````````````````````` example +~~~{image} picture.png +:width: 100px +:height: 50px +~~~ +. +
+```````````````````````````````` + +## alt option + +```````````````````````````````` example +~~~{image} picture.png +:alt: description text +~~~ +. +
description text
+```````````````````````````````` + +## target option + +```````````````````````````````` example +~~~{image} picture.png +:target: https://lepture.com +~~~ +. + +```````````````````````````````` + +## all options + +```````````````````````````````` example +~~~{image} picture.png +:target: https://lepture.com +:alt: description +:align: left +:width: 100 +:height: 50 +~~~ +. +description +```````````````````````````````` + +## ampersand in source + +```````````````````````````````` example +~~~{image} https://example.com/picture.png?foo=qux&test=me +~~~ +. +
+```````````````````````````````` + +## ampersand in target + +```````````````````````````````` example +~~~{image} picture.png +:target: https://example.com/rickroll?a=1&b=2 +~~~ +. + +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..1744000ce6ca473d1d75fb2d9388d46d3463a64c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fenced_toc.txt @@ -0,0 +1,237 @@ +# Table of Contents + +## No TOC + +```````````````````````````````` example +none +. +

none

+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +. +

H1

+

H2

+```````````````````````````````` + + +## Simple TOC + +```````````````````````````````` example +~~~{toc} +~~~ + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` + +## Invalid Option + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:max-level: s +~~~ +. +

H1

+

H2

+
"max-level" option MUST be integer
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:max-level: 9 +~~~ +. +

H1

+

H2

+
"max-level" option MUST be <= 3
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:min-level: 2 +:max-level: 1 +~~~ +. +

H1

+

H2

+
"min-level" option MUST be less than "max-level" option
+```````````````````````````````` + +## Complex + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` + +```{toc} Contents +``` +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+
+Contents + +
+```````````````````````````````` + +## Insane + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B + +```{toc} +``` +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+
+Table of Contents + +
+```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 + +```{toc} +``` +. +

H3

+

H2

+

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) + +```{toc} +``` +. +

foo

+
+Table of Contents + +
+```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +```{toc} +``` +. +

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Collapse TOC + +```````````````````````````````` example + +```{toc} +:collapse: +``` + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fix-commonmark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fix-commonmark.txt new file mode 100644 index 0000000000000000000000000000000000000000..c7870065cc61e07f114050eaaecf60d3db5cbdf9 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/fix-commonmark.txt @@ -0,0 +1,123 @@ +Fix problems that commonmark has. + + +## Links + +Links can't contain links. + +```````````````````````````````` example +[](/foo) +. +

<https://example.com>

+```````````````````````````````` + +```````````````````````````````` example +[](/foo) +. +

<name@example.com>

+```````````````````````````````` + +## Emphasis + +`` doesn't contain ``, `` doesn't contain ``. + +```````````````````````````````` example +*_em_* __**strong**__ ______m______ +. +

_em_ **strong** ______m______

+```````````````````````````````` + +### Non aggressive emphasis + +```````````````````````````````` example +*a **b c* d** +. +

a **b c d**

+```````````````````````````````` + +While CommonMark would render it into: + +``` +

a b c d

+``` + +```````````````````````````````` example +*a **b c* d** +. +

a **b c d**

+```````````````````````````````` + +While CommonMark would render it into: + +``` +

a b c d

+``` + +What if the string is: + +```````````````````````````````` example +*a **b c* d +. +

a **b c d

+```````````````````````````````` + +CommonMark would still be a mess: + +``` +

*a *b c d

+``` + + +## Max depth + + +```````````````````````````````` example +> > > > > > > > b +. +
+
+
+
+
+
+

> > b

+
+
+
+
+
+
+```````````````````````````````` + + +```````````````````````````````` example +- a + - b + - c + - d + - e + - f + - g + - h +. +
    +
  • a
      +
    • b
        +
      • c
          +
        • d
            +
          • e
              +
            • f +- g +- h
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/footnotes.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/footnotes.txt new file mode 100644 index 0000000000000000000000000000000000000000..485cfd87c0a18859af15ec52b8baacad5c44fe6c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/footnotes.txt @@ -0,0 +1,45 @@ +# Footnotes + +```````````````````````````````` example +none [^1] +. +

none [^1]

+```````````````````````````````` + +```````````````````````````````` example +oneline [^1] + +[^1]: foo +. +

oneline 1

+
+
    +
  1. foo↩

  2. +
+
+```````````````````````````````` + +```````````````````````````````` example +multiple lines [^1] + +[^1]: foo + + one + + two + + three + + four +. +

multiple lines 1

+
four
+
+
    +
  1. foo

    +

    one

    +

    two

    +

    three↩

  2. +
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/hook_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/hook_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..62a1a1ec79dacaf8854a67e3b48f5a1c1e9d2f4b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/hook_toc.txt @@ -0,0 +1,122 @@ +# Table of Contents + +## Simple TOC + +```````````````````````````````` example +# H1 + +content + +## H2 +. +

H1

+

content

+

H2

+ +```````````````````````````````` + +## Complex TOC + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+ +```````````````````````````````` + +## Insane TOC + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+ +```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 +. +

H3

+

H2

+

H1

+ +```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) +. +

foo

+ +```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +. +

H1

+ +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/hello.md b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/hello.md new file mode 100644 index 0000000000000000000000000000000000000000..5e3d2769d88dd761efbd358b5dd0cb095d652294 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/hello.md @@ -0,0 +1 @@ +> hello diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/hello.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/hello.txt new file mode 100644 index 0000000000000000000000000000000000000000..ce013625030ba8dba906f756967f9e9ca394464a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/hello.txt @@ -0,0 +1 @@ +hello diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/text.html b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/text.html new file mode 100644 index 0000000000000000000000000000000000000000..da12a4c59bef8e4cc80b93ee6c98ebf6e9a10372 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/text.html @@ -0,0 +1 @@ +
include html
diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/text.md b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/text.md new file mode 100644 index 0000000000000000000000000000000000000000..e9faa6cc816e06f743ffb9a1ae753a209607840e --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/include/text.md @@ -0,0 +1,12 @@ +# Include + +.. include:: ./text.md + +.. include:: ./not-exist.md + +.. include:: ./text.html + :encoding: utf-8 + +.. include:: ./hello.md + +.. include:: ../rst_toc.txt diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/insert.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/insert.txt new file mode 100644 index 0000000000000000000000000000000000000000..74d02058f0a66e5598e91d8a84429d17b7c4b62a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/insert.txt @@ -0,0 +1,62 @@ +# Insert + +```````````````````````````````` example +^^insert me +. +

^^insert me

+```````````````````````````````` + + +## normal insert + +```````````````````````````````` example +^^insert me^^ +. +

insert me

+```````````````````````````````` + +```````````````````````````````` example +foo ^^insert me^^ +. +

foo insert me

+```````````````````````````````` + +```````````````````````````````` example +^^insert me^^foo +. +

insert mefoo

+```````````````````````````````` + +```````````````````````````````` example +^^insert me^^^ +. +

^^insert me^^^

+```````````````````````````````` + +## escape insert + +```````````````````````````````` example +^^insert me\^^^ +. +

insert me^

+```````````````````````````````` + +```````````````````````````````` example +^^insert \^\^ me^^ +. +

insert ^^ me

+```````````````````````````````` + +## insert link + +```````````````````````````````` example +^^insert [me^^](/) +. +

insert [me](/)

+```````````````````````````````` + +```````````````````````````````` example +^^[hello](/)^^ +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/mark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/mark.txt new file mode 100644 index 0000000000000000000000000000000000000000..9c8d2fbc1bf286f937a2ed288f5d497bcfca2136 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/mark.txt @@ -0,0 +1,61 @@ +# Mark + +```````````````````````````````` example +==mark me +. +

==mark me

+```````````````````````````````` + +## normal mark + +```````````````````````````````` example +==mark me== +. +

mark me

+```````````````````````````````` + +```````````````````````````````` example +foo ==mark me== +. +

foo mark me

+```````````````````````````````` + +```````````````````````````````` example +==mark me==foo +. +

mark mefoo

+```````````````````````````````` + +```````````````````````````````` example +==mark me=== +. +

==mark me===

+```````````````````````````````` + +## escape mark + +```````````````````````````````` example +==mark me\=== +. +

mark me=

+```````````````````````````````` + +```````````````````````````````` example +==mark \=\= me== +. +

mark == me

+```````````````````````````````` + +## mark link + +```````````````````````````````` example +==mark [me==](/) +. +

mark [me](/)

+```````````````````````````````` + +```````````````````````````````` example +==[hello](/)== +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/math.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/math.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7afaf9d1d2757c25e797b47ef4803bdeee503ef --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/math.txt @@ -0,0 +1,57 @@ +# Math + +## Block Math + +```````````````````````````````` example +$$ +. +

$$

+```````````````````````````````` + + +```````````````````````````````` example +$$ +\operatorname{ker} f=\{g\in G:f(g)=e_{H}\}{\mbox{.}} +$$ +. +
$$ +\operatorname{ker} f=\{g\in G:f(g)=e_{H}\}{\mbox{.}} +$$
+```````````````````````````````` + +```````````````````````````````` example +$$ +foo +$$ +bar +. +
$$ +foo +$$
+

bar

+```````````````````````````````` + +```````````````````````````````` example +$$ +foo +bar +$$ +. +
$$ +foo +bar +$$
+```````````````````````````````` + + +## Inline Math + +```````````````````````````````` example +The homomorphism $f$ is injective if and only if its kernel is only the +singleton set $e_G$, because otherwise $\exists a,b\in G$ +with $a\neq b$ such that $f(a)=f(b)$. +. +

The homomorphism \(f\) is injective if and only if its kernel is only the +singleton set \(e_G\), because otherwise \(\exists a,b\in G\) +with \(a\neq b\) such that \(f(a)=f(b)\).

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/renderer_markdown.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/renderer_markdown.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd618f9f281f83c0e5f2f51bcb19080e4188011a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/renderer_markdown.txt @@ -0,0 +1,299 @@ +# MarkdownRenderer + + +## inline + +```````````````````````````````` example +this is _em_, **strong**, and `code` +. +this is *em*, **strong**, and `code` +```````````````````````````````` + +## links + +```````````````````````````````` example +[link], [link][], [text][link], [link](/foo), [link](/foo "title") + +[link]: /url +. +[link][link], [link][link], [text][link], [link](/foo), [link](/foo "title") + +[link]: /url +```````````````````````````````` + +```````````````````````````````` example +[link], [link](https://foo(bar "title") + +[link]: /url "title" +. +[link][link], [link]( "title") + +[link]: /url "title" +```````````````````````````````` + +```````````````````````````````` example +[https://lepture.com](https://lepture.com) + + + + [demo@example.com](mailto:demo@example.com) +. + + + + + +```````````````````````````````` + +## images + +```````````````````````````````` example +[link]: /url + +![link], ![link][], ![alt][link] +. +![link][link], ![link][link], ![alt][link] + +[link]: /url +```````````````````````````````` + +## linebreak + +```````````````````````````````` example +foo\ +bar +. +foo +bar +```````````````````````````````` + +## html + +```````````````````````````````` example +inline html text + +and block html + +
hi
+. +inline html text + +and block html + +
hi
+```````````````````````````````` + +## heading + +```````````````````````````````` example +# h1 +## h2 +### h3 +#### h4 +##### h5 +###### h6 + +h1 +== +. +# h1 + +## h2 + +### h3 + +#### h4 + +##### h5 + +###### h6 + +# h1 +```````````````````````````````` + +## thematic break + +```````````````````````````````` example +hi +*** +. +hi + +*** +```````````````````````````````` + +## code + +```````````````````````````````` example +start + + def foo(): + pass + +end +. +start + +``` +def foo(): + pass +``` + +end +```````````````````````````````` + +```````````````````````````````` example +start +```py +def foo(): + pass +``` +end +. +start + +```py +def foo(): + pass +``` + +end +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ``` + fenced +. +indent code + +~~~ +markdown +``` +fenced +~~~ +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ~~~ + fenced +. +indent code + +``` +markdown +~~~ +fenced +``` +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ``` + fenced + ~~~ +. +indent code + +```` +markdown +``` +fenced +~~~ +```` +```````````````````````````````` + + +## quote + +```````````````````````````````` example +> quote +. +> quote +```````````````````````````````` + +```````````````````````````````` example +hello +> quote +. +hello + +> quote +```````````````````````````````` + +> quote + +> quote +> +> continuation +. +> quote + +> quote +> +> continuation + +## list + +```````````````````````````````` example +- list ++ list +. +- list + ++ list +```````````````````````````````` + +```````````````````````````````` example +- item 1 + item 2 +. +- item 1 + item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + item 2 +- item 3 +. +- item 1 + + item 2 + +- item 3 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + 1. item 2 +. +- item 1 + 1. item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + 2. item 2 +. +- item 1 + + 2. item 2 +```````````````````````````````` + +```````````````````````````````` example +- list +- +. +- list +- +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/renderer_rst.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/renderer_rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..1b2499ddb74fc532191d296612fd19687224ec5b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/renderer_rst.txt @@ -0,0 +1,250 @@ +# RSTRenderer + +## inline + +```````````````````````````````` example +this is _em_, **strong**, and `code` +. +this is *em*, **strong**, and ``code`` +```````````````````````````````` + +```````````````````````````````` example +| escape | +. +\| escape \| +```````````````````````````````` + +## links + +```````````````````````````````` example +this is [link][] and [link](/foo) + +[link]: /url +. +this is `link
`__ and `link `__ +```````````````````````````````` + +## images + +```````````````````````````````` example +this is inline ![alt _text_](/foo) +. +this is inline |img-0| + +.. |img-0| image:: /foo + :alt: alt *text* +```````````````````````````````` + +```````````````````````````````` example +this is figure + +![alt _text_](/foo) +. +this is figure + +.. figure:: /foo + + alt *text* +```````````````````````````````` + +```````````````````````````````` example +this is figure + +![alt _text_](/foo "title") +. +this is figure + +.. figure:: /foo + :alt: title + + alt *text* +```````````````````````````````` + + +## html + +```````````````````````````````` example +ignore inline html text + +but show block html + +
hi
+. +ignore inline html text + +but show block html + +.. raw:: html + +
hi
+```````````````````````````````` + +## line break + +```````````````````````````````` example +hello +world +. +| hello +| world +```````````````````````````````` + +## heading + +```````````````````````````````` example +# h1 +## h2 +### h3 +#### h4 +##### h5 +###### h6 +. +h1 +== + +h2 +-- + +h3 +~~ + +h4 +^^ + +h5 +"" + +h6 +'' +```````````````````````````````` + +## thematic break + +```````````````````````````````` example +hi +*** +. +hi + +-------------- +```````````````````````````````` + +## code + +```````````````````````````````` example +start + + def foo(): + pass + +end +. +start + +:: + + def foo(): + pass + +end +```````````````````````````````` + +```````````````````````````````` example +start + +```py +def foo(): + pass +``` + +end +. +start + +.. code:: py + + def foo(): + pass + +end +```````````````````````````````` + + +## quote + +```````````````````````````````` example +> quote +. + quote +```````````````````````````````` + +```````````````````````````````` example +hello + +> quote +. +hello + + quote +```````````````````````````````` + +```````````````````````````````` example +> hello + +> quote +. + hello + +.. + + quote +```````````````````````````````` + +## list + +```````````````````````````````` example +- list ++ list +. +- list + ++ list +```````````````````````````````` + +```````````````````````````````` example +- item 1 + item 2 +. +- item 1 item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + item 2 +- item 3 +. +- item 1 + + item 2 + +- item 3 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + 1. item 2 +. +- item 1 + 1. item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + 1. item 2 +. +- item 1 + + 1. item 2 +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/rst_admonition.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/rst_admonition.txt new file mode 100644 index 0000000000000000000000000000000000000000..b29bda3046fdb97802fefc9a7d16a9439d9efeb6 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/rst_admonition.txt @@ -0,0 +1,46 @@ +# Admonition + +```````````````````````````````` example +.. hello:: Warning + + message +. +
..  hello:: Warning
+
+    message
+
+```````````````````````````````` + +```````````````````````````````` example +.. note:: Warning + + message +. +
+

Warning

+

message

+
+```````````````````````````````` + +Test with code block. + +```````````````````````````````` example +.. note:: + + print() +. +
+

Note

+
print()
+
+```````````````````````````````` + +Test with no message. + +```````````````````````````````` example +.. note:: Warning +. +
+

Warning

+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/rst_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/rst_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..d65e7516398316de9532f5f52cd0ccfe182b86f1 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/rst_toc.txt @@ -0,0 +1,223 @@ +# Table of Contents + +## No TOC + +```````````````````````````````` example +none +. +

none

+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +. +

H1

+

H2

+```````````````````````````````` + + +## Simple TOC + +```````````````````````````````` example +.. toc:: + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` + +## Invalid Option + +```````````````````````````````` example +# H1 +## H2 + +.. toc:: + :max-level: s +. +

H1

+

H2

+
"max-level" option MUST be integer
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +.. toc:: + :max-level: 9 +. +

H1

+

H2

+
"max-level" option MUST be <= 3
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +.. toc:: + :min-level: 2 + :max-level: 1 +. +

H1

+

H2

+
"min-level" option MUST be less than "max-level" option
+```````````````````````````````` + + +## Complex + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` + +.. toc:: Contents + :max-level: 3 +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+
+Contents + +
+```````````````````````````````` + +## Insane + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B +.. toc:: +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+
+Table of Contents + +
+```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 +.. toc:: +. +

H3

+

H2

+

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) +.. toc:: +. +

foo

+
+Table of Contents + +
+```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +.. toc:: +. +

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Collapse TOC + +```````````````````````````````` example +.. toc:: + :collapse: + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/ruby.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/ruby.txt new file mode 100644 index 0000000000000000000000000000000000000000..d89ebe28e1161ec3915768d72303feaa168f3c63 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/ruby.txt @@ -0,0 +1,64 @@ +# Ruby + + +## ruby without link + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)] +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢(ㄏㄢˋ)字(ㄗˋ)] +. +

漢ㄏㄢˋ字ㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)][] +. +

漢字ㄏㄢˋㄗˋ[]

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)][link] +. +

漢字ㄏㄢˋㄗˋ[link]

+```````````````````````````````` + +## ruby with link + +```````````````````````````````` example +[link]: /url + +[漢字(ㄏㄢˋㄗˋ)][link] +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)]() +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)](/url) +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +## ruby splits + +```````````````````````````````` example +[漢(かん)][字(じ)] +. +

漢かん字じ

+```````````````````````````````` + +```````````````````````````````` example +[[漢(かん)][字(じ)]](https://jisho.org/search/漢字) +. +

漢かん字じ

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/spoiler.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/spoiler.txt new file mode 100644 index 0000000000000000000000000000000000000000..b1394193004aa9a896ac9212dcab200818613506 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/spoiler.txt @@ -0,0 +1,74 @@ +# Spoiler + +## Block spoiler + +```````````````````````````````` example +>! hi +. +
+

hi

+
+```````````````````````````````` + + +```````````````````````````````` example +>! not +> spoiler +. +
+

! not +spoiler

+
+```````````````````````````````` + +```````````````````````````````` example +>! multiple +>! lines +. +
+

multiple +lines

+
+```````````````````````````````` + +```````````````````````````````` example +>! foo +>! +>! bar +. +
+

foo

+

bar

+
+```````````````````````````````` + +```````````````````````````````` example +>! foo +> +>! bar +. +
+

! foo

+

! bar

+
+```````````````````````````````` + +## Inline spoiler + +```````````````````````````````` example +hi >! hide !< +. +

hi hide

+```````````````````````````````` + +```````````````````````````````` example +hi >!hide !< +. +

hi hide

+```````````````````````````````` + +```````````````````````````````` example +hi >!hide!< +. +

hi hide

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/strikethrough.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/strikethrough.txt new file mode 100644 index 0000000000000000000000000000000000000000..007a7777aefe1f68e20026c6d87675a12623f1b8 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/strikethrough.txt @@ -0,0 +1,46 @@ +# Strikethrough + + +## strikethrough + +```````````````````````````````` example +~~delete me +. +

~~delete me

+```````````````````````````````` + +```````````````````````````````` example +~~delete me~~ +. +

delete me

+```````````````````````````````` + +```````````````````````````````` example +~~delete me~~~ +. +

~~delete me~~~

+```````````````````````````````` + +```````````````````````````````` example +~~delete me\~~~ +. +

delete me~

+```````````````````````````````` + +```````````````````````````````` example +~~delete \~\~ me~~ +. +

delete ~~ me

+```````````````````````````````` + +```````````````````````````````` example +~~delete [me~~](/) +. +

delete [me](/)

+```````````````````````````````` + +```````````````````````````````` example +~~[hello](/)~~ +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/subscript.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/subscript.txt new file mode 100644 index 0000000000000000000000000000000000000000..9e4ef8bad50771b18039cd681d91d51c203128aa --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/subscript.txt @@ -0,0 +1,26 @@ +# Subscript + + +```````````````````````````````` example +CH~3~CH~2~OH +. +

CH3CH2OH

+```````````````````````````````` + +```````````````````````````````` example +text~a\ subscript~ +. +

texta subscript

+```````````````````````````````` + +```````````````````````````````` example +text~a subscript~ +. +

text~a subscript~

+```````````````````````````````` + +```````````````````````````````` example +text~a\~subscript~ +. +

texta~subscript

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/superscript.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/superscript.txt new file mode 100644 index 0000000000000000000000000000000000000000..8f114ca8c9566ddfd1d2800341f2065ded0ad560 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/superscript.txt @@ -0,0 +1,26 @@ +# Superscript + + +```````````````````````````````` example +CH^3^CH^2^OH +. +

CH3CH2OH

+```````````````````````````````` + +```````````````````````````````` example +text^a\ supscript^ +. +

texta supscript

+```````````````````````````````` + +```````````````````````````````` example +text^a supscript^ +. +

text^a supscript^

+```````````````````````````````` + +```````````````````````````````` example +text^a\^supscript^ +. +

texta^supscript

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/table.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/table.txt new file mode 100644 index 0000000000000000000000000000000000000000..ff4e13ae743b2733f0174cca08c10da2a9b6f1f1 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/table.txt @@ -0,0 +1,258 @@ +# Table in Markdown + +https://michelf.ca/projects/php-markdown/extra/#table + + +## nptable + + +```````````````````````````````` example +First Header | Second Header +------------- | ------------- +Content Cell | Content Cell +Content Cell | Content Cell +. + + + + + + + + + + + + + + + + + +
First HeaderSecond Header
Content CellContent Cell
Content CellContent Cell
+```````````````````````````````` + + +## table + +```````````````````````````````` example +| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell | +. + + + + + + + + + + + + + + + + + +
First HeaderSecond Header
Content Cell
Content CellContent Cell
+```````````````````````````````` + + +```````````````````````````````` example +| Command | Description | +| --- | --- | +| git status | List all new or modified files | +| git diff | Show file differences that haven't been staged | +. + + + + + + + + + + + + + + + + + +
CommandDescription
git statusList all new or modified files
git diffShow file differences that haven't been staged
+```````````````````````````````` + +## align table + +```````````````````````````````` example + Left | Center | Right +:---- | :--------: | ------: + a | b | c +. + + + + + + + + + + + + + + + +
LeftCenterRight
abc
+```````````````````````````````` + +```````````````````````````````` example +| Left | Center | Right | +| :--- | :----: | ----: | +| a | b | c | +. + + + + + + + + + + + + + + + +
LeftCenterRight
abc
+```````````````````````````````` + +## Misc Table + +```````````````````````````````` example +| A | | +| - | | +| a | b | +. + + + + + + + + + + + + + +
A
ab
+```````````````````````````````` + +```````````````````````````````` example +A | +- | +a | b +. + + + + + + + + + + + + + +
A
ab
+```````````````````````````````` + + +```````````````````````````````` example +| Foo | Bar | +|-----|-----| +| boo | baz | +| faz | | +. + + + + + + + + + + + + + + + + + +
FooBar
boobaz
faz
+```````````````````````````````` + +## Mismatch length + +```````````````````````````````` example +| First Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell | +. +

| First Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell |

+```````````````````````````````` + +```````````````````````````````` example +| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | +| Content Cell | Content Cell | +. +

| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | +| Content Cell | Content Cell |

+```````````````````````````````` + +```````````````````````````````` example +A | +- | - | +a | b | c +. +

A |

+
    +
  • | - | +a | b | c
  • +
+```````````````````````````````` + +```````````````````````````````` example +A | B | C +- | - | - +a | b +. +

A | B | C

+
    +
  • | - | - +a | b
  • +
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/task_lists.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/task_lists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1760acbdd4dd55d815789bc11afad6f2f3a8c3d --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/task_lists.txt @@ -0,0 +1,108 @@ +# Task Lists + +```````````````````````````````` example +- [ ] foo +- [x] bar +- [X] baz +. +
    +
  • foo
  • +
  • bar
  • +
  • baz
  • +
+```````````````````````````````` + +```````````````````````````````` example +- foo +- [ ] bar +. +
    +
  • foo
  • +
  • bar
  • +
+```````````````````````````````` + +```````````````````````````````` example +- foo + +- [ ] bar +- [x] baz + + text +. +
    +
  • foo

    +
  • +
  • bar

    +
  • +
  • baz

    +

    text

    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +1. [ ] foo +2. [x] bar +3. [X] baz +. +
    +
  1. foo
  2. +
  3. bar
  4. +
  5. baz
  6. +
+```````````````````````````````` + +```````````````````````````````` example +- [ ] Task list item + over two lines +. +
    +
  • Task list item +over two lines
  • +
+```````````````````````````````` + +```````````````````````````````` example +- [ ] foo + - [x] bar + - [ ] baz +. +
    +
  • foo
      +
    • bar
    • +
    • baz
    • +
    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +1. [ ] foo + 1. [ ] bar + 2. [ ] baz +. +
    +
  1. foo
      +
    1. bar
    2. +
    3. baz
    4. +
    +
  2. +
+```````````````````````````````` + +```````````````````````````````` example +> - [ ] foo +> - [x] bar +> - [ ] baz +. +
+
    +
  • foo
      +
    • bar
    • +
    • baz
    • +
    +
  • +
+
+```````````````````````````````` \ No newline at end of file diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/url.txt b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/url.txt new file mode 100644 index 0000000000000000000000000000000000000000..669bdd5f34d93942e407aa41569072a6ff6a2f91 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/fixtures/url.txt @@ -0,0 +1,22 @@ +# url plugin + + +```````````````````````````````` example +visit https://lepture.com/ +. +

visit https://lepture.com/

+```````````````````````````````` + + +```````````````````````````````` example +visit [https://lepture.com/](/foo) +. +

visit https://lepture.com/

+```````````````````````````````` + + +```````````````````````````````` example +visit https://lepture.com/ +. +

visit https://lepture.com/

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_commonmark.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_commonmark.py new file mode 100644 index 0000000000000000000000000000000000000000..5ece254838b130d5765744897028436efb73b0e6 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_commonmark.py @@ -0,0 +1,76 @@ +import mistune +from tests import BaseTestCase, normalize_html + + +DIFF_CASES = { + 'setext_headings_093', + 'html_blocks_191', # mistune keeps \n + + 'images_573', # image can not be in image + + 'links_495', + 'links_517', # aggressive link group + 'links_518', + 'links_519', + 'links_531', + 'links_532', +} + +IGNORE_CASES = { + # we don't support link title in (title) + 'links_496', + 'links_504', + + # we don't support flanking delimiter run + 'emphasis_and_strong_emphasis_352', + 'emphasis_and_strong_emphasis_367', + 'emphasis_and_strong_emphasis_368', + 'emphasis_and_strong_emphasis_372', + 'emphasis_and_strong_emphasis_379', + 'emphasis_and_strong_emphasis_388', + 'emphasis_and_strong_emphasis_391', + + 'emphasis_and_strong_emphasis_406', + 'emphasis_and_strong_emphasis_407', + 'emphasis_and_strong_emphasis_408', + + 'emphasis_and_strong_emphasis_412', + 'emphasis_and_strong_emphasis_413', + 'emphasis_and_strong_emphasis_414', + 'emphasis_and_strong_emphasis_416', + 'emphasis_and_strong_emphasis_417', + 'emphasis_and_strong_emphasis_418', + + 'emphasis_and_strong_emphasis_424', + 'emphasis_and_strong_emphasis_425', + 'emphasis_and_strong_emphasis_426', + 'emphasis_and_strong_emphasis_429', + 'emphasis_and_strong_emphasis_430', + 'emphasis_and_strong_emphasis_431', + 'emphasis_and_strong_emphasis_460', + 'emphasis_and_strong_emphasis_467', + 'emphasis_and_strong_emphasis_470', + 'emphasis_and_strong_emphasis_471', + 'emphasis_and_strong_emphasis_477', + 'emphasis_and_strong_emphasis_478', +} + +for i in range(441, 447): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) +for i in range(453, 459): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) +for i in range(462, 466): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) + + +class TestCommonMark(BaseTestCase): + @classmethod + def ignore_case(cls, n): + return n in IGNORE_CASES or n in DIFF_CASES + + def assert_case(self, n, text, html): + result = mistune.html(text) + self.assertEqual(normalize_html(result), normalize_html(html)) + + +TestCommonMark.load_fixtures('commonmark.json') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_directives.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_directives.py new file mode 100644 index 0000000000000000000000000000000000000000..388963a4b196c3252368bc842d1bd250d66f3d98 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_directives.py @@ -0,0 +1,93 @@ +import os +from mistune import create_markdown +from mistune.directives import ( + RSTDirective, + FencedDirective, + Admonition, + TableOfContents, + Include, + Image, + Figure, +) +from tests import BaseTestCase +from tests.fixtures import ROOT + + +def load_directive_test(filename, directive, cls): + class TestDirective(BaseTestCase): + @staticmethod + def parse(text): + md = create_markdown( + escape=False, + plugins=[cls([directive])], + ) + html = md(text) + return html + + TestDirective.load_fixtures(filename + '.txt') + globals()["TestDirective_" + filename] = TestDirective + + +load_directive_test('rst_admonition', Admonition(), RSTDirective) +load_directive_test('rst_toc', TableOfContents(), RSTDirective) +load_directive_test('fenced_admonition', Admonition(), FencedDirective) +load_directive_test('fenced_toc', TableOfContents(), FencedDirective) +load_directive_test('fenced_image', Image(), FencedDirective) +load_directive_test('fenced_figure', Figure(), FencedDirective) + + +class CustomizeTableOfContents(TableOfContents): + def generate_heading_id(self, token, i): + return 't-' + str(i + 1) + + +class TestCustomizeToc(BaseTestCase): + def test_rst_toc(self): + md = create_markdown( + escape=False, + plugins=[ + RSTDirective([CustomizeTableOfContents()]), + ], + ) + html = md('# h1\n\n.. toc::\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + def test_fenced_toc(self): + md = create_markdown( + escape=False, + plugins=[ + FencedDirective([CustomizeTableOfContents()]), + ], + ) + html = md('# h1\n\n```{toc}\n```\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + def test_colon_fenced_toc(self): + md = create_markdown( + escape=False, + plugins=[ + FencedDirective([CustomizeTableOfContents()], ':'), + ], + ) + html = md('# h1\n\n:::{toc}\n:::\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + +class TestDirectiveInclude(BaseTestCase): + md = create_markdown(escape=False, plugins=[RSTDirective([Include()])]) # type: ignore[list-item] + + def test_html_include(self): + html = self.md.read(os.path.join(ROOT, 'include/text.md'))[0] + self.assertIn('Could not include self', html) + self.assertIn('Could not find file', html) + self.assertIn('
include html
', html) + self.assertIn('
', html) + self.assertIn('# Table of Contents', html) + + def test_include_missing_source(self): + s = '.. include:: foo.txt' + html = self.md(s) + self.assertIn('Missing source file', html) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_hooks.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..8c0a02e9b600a6034ea367fd014ec7949fb0f5d3 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_hooks.py @@ -0,0 +1,26 @@ +import os +from mistune import create_markdown +from mistune.toc import add_toc_hook, render_toc_ul +from tests import BaseTestCase + + +class TestTocHook(BaseTestCase): + @staticmethod + def parse(text): + md = create_markdown(escape=False) + add_toc_hook(md) + html, state = md.parse(text) + result = html + render_toc_ul(state.env['toc_items']) + return result + + def test_customize_heading_id_func(self): + def heading_id(token, i): + return 't-' + str(i + 1) + + md = create_markdown(escape=False) + add_toc_hook(md, heading_id=heading_id) + html = md('# h1') + self.assertEqual(html, '

h1

\n') + + +TestTocHook.load_fixtures('hook_toc.txt') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_misc.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_misc.py new file mode 100644 index 0000000000000000000000000000000000000000..99bc68d6eca362d235a2dff0ad449ceb8dd5eebc --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_misc.py @@ -0,0 +1,137 @@ +import mistune +from unittest import TestCase + + +class TestMiscCases(TestCase): + def test_none(self): + self.assertEqual(mistune.html(None), '') + + def test_before_parse_hooks(self): + def _add_name(md, state): + state.env['name'] = 'test' + + md = mistune.create_markdown() + md.before_parse_hooks.append(_add_name) + state = md.block.state_cls() + md.parse('', state) + self.assertEqual(state.env['name'], 'test') + + def test_hard_wrap(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('foo\nbar') + expected = '

foo
\nbar

' + self.assertEqual(result.strip(), expected) + + md = mistune.create_markdown( + escape=False, hard_wrap=True, plugins=['speedup']) + result = md('foo\nbar') + self.assertEqual(result.strip(), expected) + + def test_escape_html(self): + md = mistune.create_markdown(escape=True) + result = md('
1
') + expected = '

<div>1</div>

' + self.assertEqual(result.strip(), expected) + + result = md('1') + expected = '

<em>1</em>

' + self.assertEqual(result.strip(), expected) + + def test_harmful_links(self): + result = mistune.html('[h](javAscript:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_ref_link(self): + result = mistune.html('[link][h]\n\n[h]: /foo') + expected = '

link

' + self.assertEqual(result.strip(), expected) + + def test_allow_harmful_protocols(self): + renderer = mistune.HTMLRenderer(allow_harmful_protocols=True) + md = mistune.Markdown(renderer) + result = md('[h](javascript:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_allow_data_protocols(self): + renderer = mistune.HTMLRenderer(allow_harmful_protocols=['data:']) + md = mistune.Markdown(renderer) + result = md('[h](data:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_use_plugin(self): + from mistune.plugins.url import url + md = mistune.Markdown(mistune.HTMLRenderer()) + md.use(url) + + def test_markdown_func(self): + result = mistune.markdown('**b**') + expected = '

b

\n' + self.assertEqual(result, expected) + + # trigger to use cached parser + result = mistune.markdown('**b**') + self.assertEqual(result, expected) + + def test_ast_output(self): + md = mistune.create_markdown(escape=False, renderer=None) + text = '# h1\n\nfoo **bar**\n\n`&<>"`' + result = md(text) + expected = [ + { + 'type': 'heading', + 'children': [{'type': 'text', 'raw': 'h1'}], + 'attrs': {'level': 1}, + 'style': 'atx', + }, + {'type': 'blank_line'}, + { + 'type': 'paragraph', + 'children': [ + {'type': 'text', 'raw': 'foo '}, + {'type': 'strong', 'children': [{'type': 'text', 'raw': 'bar'}]} + ] + }, + {'type': 'blank_line'}, + { + 'type': 'paragraph', + 'children': [ + {'type': 'codespan', 'raw': '&<>"'}, + ] + }, + ] + self.assertEqual(result, expected) + + def test_ast_url(self): + md = mistune.create_markdown(escape=False, renderer=None) + label = 'hi &<>"' + url = 'https://example.com/foo?a=1&b=2' + text = '[{}]({})'.format(label, url) + result = md(text) + expected = [ + { + 'type': 'paragraph', + 'children': [ + { + 'type': 'link', + 'children': [{'type': 'text', 'raw': label}], + 'attrs': {'url': url}, + }, + ], + }, + ] + self.assertEqual(result, expected) + + def test_emsp(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('\u2003\u2003foo\nbar\n\n\u2003\u2003foobar') + expected = '

\u2003\u2003foo
\nbar

\n

\u2003\u2003foobar

' + self.assertEqual(result.strip(), expected) + + def test_html_tag_text_following_list(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('foo\n- bar\n\ntable') + expected = '

foo

\n
    \n
  • bar
  • \n
\n

table

' + self.assertEqual(result.strip(), expected) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_plugins.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_plugins.py new file mode 100644 index 0000000000000000000000000000000000000000..408c5fac6733b3307ee4db14e0996137e1843ebf --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_plugins.py @@ -0,0 +1,66 @@ +from mistune import create_markdown +from mistune.plugins.table import table_in_list, table_in_quote +from mistune.plugins.math import math_in_list, math_in_quote +from tests import BaseTestCase + + +def load_plugin(plugin_name): + md1 = create_markdown(escape=False, plugins=[plugin_name]) + md2 = create_markdown(escape=False, plugins=[plugin_name, 'speedup']) + + class TestPlugin1(BaseTestCase): + parse = md1 + + class TestPlugin2(BaseTestCase): + parse = md2 + + TestPlugin1.load_fixtures(plugin_name + ".txt") + TestPlugin2.load_fixtures(plugin_name + ".txt") + globals()["TestPlugin1_" + plugin_name] = TestPlugin1 + globals()["TestPlugin2_" + plugin_name] = TestPlugin2 + + +load_plugin("url") +load_plugin("strikethrough") +load_plugin("mark") +load_plugin("insert") +load_plugin("superscript") +load_plugin("subscript") +load_plugin("task_lists") +load_plugin("table") +load_plugin("def_list") +load_plugin("footnotes") +load_plugin("abbr") +load_plugin("math") +load_plugin("ruby") +load_plugin("spoiler") + + +class TestExtraPlugins(BaseTestCase): + def test_table_in_list(self): + text = '''- Cell | Cell\n ---- | ----\n 1 | 2\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['table', table_in_list]) + self.assertNotIn('', md1(text)) + self.assertIn('
', md2(text)) + + def test_table_in_quote(self): + text = '''> Cell | Cell\n> ---- | ----\n> 1 | 2\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['table', table_in_quote]) + self.assertNotIn('
', md1(text)) + self.assertIn('
', md2(text)) + + def test_math_in_list(self): + text = '''- $$\n foo\n $$\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['math', math_in_list]) + self.assertNotIn('class="math"', md1(text)) + self.assertIn('class="math"', md2(text)) + + def test_math_in_quote(self): + text = '''> $$\n> foo\n> $$\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['math', math_in_quote]) + self.assertNotIn('class="math"', md1(text)) + self.assertIn('class="math"', md2(text)) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_renderers.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_renderers.py new file mode 100644 index 0000000000000000000000000000000000000000..dca515873cd24cf642fab5ff6dbb34d884c9a7ae --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_renderers.py @@ -0,0 +1,17 @@ +from mistune import create_markdown +from mistune.renderers.rst import RSTRenderer +from mistune.renderers.markdown import MarkdownRenderer +from tests import BaseTestCase + + +def load_renderer(renderer): + class TestRenderer(BaseTestCase): + parse = create_markdown(renderer=renderer) + + name = renderer.NAME + TestRenderer.load_fixtures('renderer_' + name + '.txt') + globals()["TestRenderer" + name.title()] = TestRenderer + + +load_renderer(RSTRenderer()) +load_renderer(MarkdownRenderer()) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_syntax.py b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_syntax.py new file mode 100644 index 0000000000000000000000000000000000000000..06341d595c3cc5ef64f36c729f97901f312317d7 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/tests/trusted/tests/test_syntax.py @@ -0,0 +1,12 @@ +import mistune +from tests import BaseTestCase, normalize_html + + +class TestSyntax(BaseTestCase): + def assert_case(self, n, text, html): + result = mistune.html(text) + self.assertEqual(normalize_html(result), normalize_html(html)) + + +TestSyntax.load_fixtures('fix-commonmark.txt') +TestSyntax.load_fixtures('diff-commonmark.txt') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/validation/canaries/original-bug.sh b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/validation/openenv.json b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__d7rfqbr0/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/LICENSE.source b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..b141cdb9f3cb8010b9c3dfb392ff1a00db58a413 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/LICENSE.source @@ -0,0 +1,14 @@ +Copyright (c) 2014, Hsiaoming Yang + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of the creator nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/adapter.json b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..7cfeab689e383173dbc1805bc222db8385227880 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/adapter.json @@ -0,0 +1,131 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "883d23539d00e744dc83da083548b6dd699be04238df34d5bd5b500a5dc53f28", + "gold_patch_sha256": "e119aa0617d965066787824e4d0dbd2223aa72c43f9f7c050a10f78f64ec6069", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "322ee09a94bf70fad8243c34439e07211e62200bcaa592ce5b9ac35567d1b2c4", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "MistuneBf54ef67", + "profile_lines": [ + 570, + 573 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "upstream_repo": "lepture/mistune" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "e282903e6032631a66f68805d1462822130bb59c6f0b968b4338bb9dc42eb732", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/lepture__mistune.bf54ef67.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "python -m pip install -e ." + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "pyproject.toml": "b2922e3ef89e2918935d38fb3a777bdbc741619942276a75fd21a8dd9faf6b42" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "265e77770af1a926ce3e965bf03ac44de4ffbfa8", + "source_completion_sha256": "159cd56887229835deb77a8568e23148e64089d35e18affccd60ea329e1e4856", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:lepture__mistune.bf54ef67.combine_file__dbh7vcn1", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "62750c95db25a8fb93dda09242f64e07508d9231", + "instruction_sha256": "b18db5c71ccb3f609be30938f808376dbcd9a25d2ea589b30405e0b25277ddbc", + "is_fork": true, + "learner_path": "tasks/1769dacd0d4025aee8db83ba/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "actual_upstream_url": "https://raw.githubusercontent.com/lepture/mistune/bf54ef67390e02a5cdee7495d4386d7770c1902b/LICENSE", + "reviewed": true, + "sha256": "539013fd8e19f744f8bf0e27a532bbff54cd689ecef7a800f56ae5dc824be870", + "spdx": "BSD-3-Clause", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/lepture__mistune.bf54ef67/265e77770af1a926ce3e965bf03ac44de4ffbfa8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "patch_sha256": "ad739c93d775e8a03ad5c4761d6e7930a698a1a2282c4c43e68d064080e4561d", + "provenance_path": "tasks/1769dacd0d4025aee8db83ba/source-proof.json", + "repository_lineage": [ + "swesmith/lepture__mistune.bf54ef67", + "lepture/mistune" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "265e77770af1a926ce3e965bf03ac44de4ffbfa8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "1970fde210cc98017247106799d6d11b3cbe8c9d", + "source_kind": "mutation", + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "lepture__mistune.bf54ef67.combine_file__dbh7vcn1", + "task_sha256": "84d2eb16a3e849eed5b6f76de419c25f77d48c73544d43b2c19ede0c410e7721", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "lepture/mistune", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "symlink_submodule_changes_supported": false, + "task_id": "lepture__mistune.bf54ef67.combine_file__dbh7vcn1", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "lepture/mistune" +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/dependency-setup.sh b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..551d5bb0d87bd3b22dd7098dddea7e0794a2ab40 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +python -m pip install -e . diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/environment/Dockerfile b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/instruction.md b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..a6afa373237b3f3a747162f668ecb7d6994def85 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/instruction.md @@ -0,0 +1,31 @@ +Tab expansion produces incorrect indentation + +#### Description + +The `expand_leading_tab` function is not correctly expanding tabs to spaces. Instead of replacing tabs with the appropriate number of spaces to reach the next tab stop, it's adding too many spaces. + +#### Steps/Code to Reproduce + +```python +from mistune.util import expand_leading_tab + +# Test basic tab expansion +text = "\tHello" +result = expand_leading_tab(text, width=4) +print(f"Input: {repr(text)}") +print(f"Output: {repr(result)}") +print(f"Expected: {repr(' Hello')}") + +# Test with existing spaces before tab +text = " \tWorld" +result = expand_leading_tab(text, width=4) +print(f"Input: {repr(text)}") +print(f"Output: {repr(result)}") +print(f"Expected: {repr(' World')}") +``` + +The function should expand tabs to align with tab stops (multiples of the width parameter), but currently it's producing incorrect spacing that breaks markdown parsing, especially for code blocks and lists that rely on proper indentation. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/metadata.json b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..5e2df53b6a5a06fd8a68dc2625266b8a9a9636c2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/metadata.json @@ -0,0 +1,1190 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "MistuneBf54ef67", + "profile_lines": [ + 570, + 573 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "upstream_repo": "lepture/mistune" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_commonmark.py::TestCommonMark::test_autolinks_593", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_594", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_595", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_598", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_599", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_600", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_602", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_020", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_022", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_023", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_346", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_403", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_421", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_432", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_472", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_473", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_479", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_480", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_032", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_033", + "tests/test_commonmark.py::TestCommonMark::test_images_571", + "tests/test_commonmark.py::TestCommonMark::test_images_574", + "tests/test_commonmark.py::TestCommonMark::test_images_578", + "tests/test_commonmark.py::TestCommonMark::test_images_580", + "tests/test_commonmark.py::TestCommonMark::test_images_581", + "tests/test_commonmark.py::TestCommonMark::test_images_582", + "tests/test_commonmark.py::TestCommonMark::test_images_583", + "tests/test_commonmark.py::TestCommonMark::test_images_584", + "tests/test_commonmark.py::TestCommonMark::test_images_585", + "tests/test_commonmark.py::TestCommonMark::test_images_586", + "tests/test_commonmark.py::TestCommonMark::test_images_587", + "tests/test_commonmark.py::TestCommonMark::test_images_588", + "tests/test_commonmark.py::TestCommonMark::test_images_590", + "tests/test_commonmark.py::TestCommonMark::test_images_592", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_192", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_193", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_196", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_198", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_202", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_205", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_206", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_214", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_215", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_216", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_217", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_218", + "tests/test_commonmark.py::TestCommonMark::test_links_481", + "tests/test_commonmark.py::TestCommonMark::test_links_482", + "tests/test_commonmark.py::TestCommonMark::test_links_483", + "tests/test_commonmark.py::TestCommonMark::test_links_488", + "tests/test_commonmark.py::TestCommonMark::test_links_500", + "tests/test_commonmark.py::TestCommonMark::test_links_502", + "tests/test_commonmark.py::TestCommonMark::test_links_505", + "tests/test_commonmark.py::TestCommonMark::test_links_506", + "tests/test_commonmark.py::TestCommonMark::test_links_508", + "tests/test_commonmark.py::TestCommonMark::test_links_509", + "tests/test_commonmark.py::TestCommonMark::test_links_511", + "tests/test_commonmark.py::TestCommonMark::test_links_513", + "tests/test_commonmark.py::TestCommonMark::test_links_514", + "tests/test_commonmark.py::TestCommonMark::test_links_515", + "tests/test_commonmark.py::TestCommonMark::test_links_516", + "tests/test_commonmark.py::TestCommonMark::test_links_520", + "tests/test_commonmark.py::TestCommonMark::test_links_521", + "tests/test_commonmark.py::TestCommonMark::test_links_525", + "tests/test_commonmark.py::TestCommonMark::test_links_526", + "tests/test_commonmark.py::TestCommonMark::test_links_527", + "tests/test_commonmark.py::TestCommonMark::test_links_528", + "tests/test_commonmark.py::TestCommonMark::test_links_529", + "tests/test_commonmark.py::TestCommonMark::test_links_530", + "tests/test_commonmark.py::TestCommonMark::test_links_533", + "tests/test_commonmark.py::TestCommonMark::test_links_534", + "tests/test_commonmark.py::TestCommonMark::test_links_537", + "tests/test_commonmark.py::TestCommonMark::test_links_538", + "tests/test_commonmark.py::TestCommonMark::test_links_539", + "tests/test_commonmark.py::TestCommonMark::test_links_540", + "tests/test_commonmark.py::TestCommonMark::test_links_541", + "tests/test_commonmark.py::TestCommonMark::test_links_542", + "tests/test_commonmark.py::TestCommonMark::test_links_543", + "tests/test_commonmark.py::TestCommonMark::test_links_548", + "tests/test_commonmark.py::TestCommonMark::test_links_549", + "tests/test_commonmark.py::TestCommonMark::test_links_552", + "tests/test_commonmark.py::TestCommonMark::test_links_553", + "tests/test_commonmark.py::TestCommonMark::test_links_554", + "tests/test_commonmark.py::TestCommonMark::test_links_555", + "tests/test_commonmark.py::TestCommonMark::test_links_556", + "tests/test_commonmark.py::TestCommonMark::test_links_557", + "tests/test_commonmark.py::TestCommonMark::test_links_558", + "tests/test_commonmark.py::TestCommonMark::test_links_559", + "tests/test_commonmark.py::TestCommonMark::test_links_560", + "tests/test_commonmark.py::TestCommonMark::test_links_561", + "tests/test_commonmark.py::TestCommonMark::test_links_563", + "tests/test_commonmark.py::TestCommonMark::test_links_564", + "tests/test_commonmark.py::TestCommonMark::test_links_565", + "tests/test_commonmark.py::TestCommonMark::test_links_567", + "tests/test_commonmark.py::TestCommonMark::test_links_568", + "tests/test_commonmark.py::TestCommonMark::test_links_569", + "tests/test_commonmark.py::TestCommonMark::test_links_570", + "tests/test_commonmark.py::TestCommonMark::test_tabs_002", + "tests/test_directives.py::TestDirective_rst_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_image::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_target_001", + "tests/test_directives.py::TestDirective_fenced_image::test_target_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_target_option_001", + "tests/test_hooks.py::TestTocHook::test_link_in_heading_001", + "tests/test_misc.py::TestMiscCases::test_ast_url", + "tests/test_misc.py::TestMiscCases::test_ref_link", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_003", + "tests/test_renderers.py::TestRendererRst::test_images_001", + "tests/test_renderers.py::TestRendererRst::test_images_002", + "tests/test_renderers.py::TestRendererRst::test_images_003", + "tests/test_renderers.py::TestRendererRst::test_links_001", + "tests/test_renderers.py::TestRendererMarkdown::test_images_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_002", + "tests/test_renderers.py::TestRendererMarkdown::test_links_003", + "tests/test_syntax.py::TestSyntax::test_image_001", + "tests/test_syntax.py::TestSyntax::test_link_001", + "tests/test_syntax.py::TestSyntax::test_link_002", + "tests/test_syntax.py::TestSyntax::test_links_001", + "tests/test_syntax.py::TestSyntax::test_links_002" + ], + "PASS_TO_PASS": [ + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_062", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_063", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_064", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_065", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_066", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_067", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_068", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_069", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_070", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_071", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_072", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_073", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_074", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_075", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_076", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_077", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_078", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_079", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_596", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_597", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_601", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_603", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_604", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_605", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_606", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_607", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_608", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_609", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_610", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_611", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_012", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_013", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_014", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_015", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_016", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_017", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_018", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_019", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_021", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_024", + "tests/test_commonmark.py::TestCommonMark::test_blank_lines_227", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_228", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_229", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_230", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_231", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_232", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_233", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_234", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_235", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_236", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_237", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_238", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_239", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_240", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_241", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_242", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_243", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_244", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_245", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_246", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_247", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_248", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_249", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_250", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_251", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_252", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_328", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_329", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_330", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_331", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_332", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_333", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_334", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_335", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_336", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_337", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_338", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_339", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_340", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_341", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_342", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_343", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_344", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_345", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_347", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_348", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_349", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_350", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_351", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_353", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_354", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_355", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_356", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_357", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_358", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_359", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_360", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_361", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_362", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_363", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_364", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_365", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_366", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_369", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_370", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_371", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_373", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_374", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_375", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_376", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_377", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_378", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_380", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_381", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_382", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_383", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_384", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_385", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_386", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_387", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_389", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_390", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_392", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_393", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_394", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_395", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_396", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_397", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_398", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_399", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_400", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_401", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_402", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_404", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_405", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_409", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_410", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_411", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_415", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_419", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_420", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_422", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_423", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_427", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_428", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_433", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_434", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_435", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_436", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_437", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_438", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_439", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_440", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_447", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_448", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_449", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_450", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_451", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_452", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_459", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_461", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_466", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_468", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_469", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_474", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_475", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_476", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_025", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_026", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_027", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_028", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_029", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_030", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_031", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_034", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_035", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_036", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_037", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_038", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_039", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_040", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_041", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_119", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_120", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_121", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_122", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_123", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_124", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_125", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_126", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_127", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_128", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_129", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_130", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_131", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_132", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_133", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_134", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_135", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_136", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_137", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_138", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_139", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_140", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_141", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_142", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_143", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_144", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_145", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_146", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_147", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_633", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_634", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_635", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_636", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_637", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_638", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_639", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_640", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_641", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_642", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_643", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_644", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_645", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_646", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_647", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_148", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_149", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_150", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_151", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_152", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_153", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_154", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_155", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_156", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_157", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_158", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_159", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_160", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_161", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_162", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_163", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_164", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_165", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_166", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_167", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_168", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_169", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_170", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_171", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_172", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_173", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_174", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_175", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_176", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_177", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_178", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_179", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_180", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_181", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_182", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_183", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_184", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_185", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_186", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_187", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_188", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_189", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_190", + "tests/test_commonmark.py::TestCommonMark::test_images_572", + "tests/test_commonmark.py::TestCommonMark::test_images_575", + "tests/test_commonmark.py::TestCommonMark::test_images_576", + "tests/test_commonmark.py::TestCommonMark::test_images_577", + "tests/test_commonmark.py::TestCommonMark::test_images_579", + "tests/test_commonmark.py::TestCommonMark::test_images_589", + "tests/test_commonmark.py::TestCommonMark::test_images_591", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_107", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_108", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_109", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_110", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_111", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_112", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_113", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_114", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_115", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_116", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_117", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_118", + "tests/test_commonmark.py::TestCommonMark::test_inlines_327", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_194", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_195", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_197", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_199", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_200", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_201", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_203", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_204", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_207", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_208", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_209", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_210", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_211", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_212", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_213", + "tests/test_commonmark.py::TestCommonMark::test_links_484", + "tests/test_commonmark.py::TestCommonMark::test_links_485", + "tests/test_commonmark.py::TestCommonMark::test_links_486", + "tests/test_commonmark.py::TestCommonMark::test_links_487", + "tests/test_commonmark.py::TestCommonMark::test_links_489", + "tests/test_commonmark.py::TestCommonMark::test_links_490", + "tests/test_commonmark.py::TestCommonMark::test_links_491", + "tests/test_commonmark.py::TestCommonMark::test_links_492", + "tests/test_commonmark.py::TestCommonMark::test_links_493", + "tests/test_commonmark.py::TestCommonMark::test_links_494", + "tests/test_commonmark.py::TestCommonMark::test_links_497", + "tests/test_commonmark.py::TestCommonMark::test_links_498", + "tests/test_commonmark.py::TestCommonMark::test_links_499", + "tests/test_commonmark.py::TestCommonMark::test_links_501", + "tests/test_commonmark.py::TestCommonMark::test_links_503", + "tests/test_commonmark.py::TestCommonMark::test_links_507", + "tests/test_commonmark.py::TestCommonMark::test_links_510", + "tests/test_commonmark.py::TestCommonMark::test_links_512", + "tests/test_commonmark.py::TestCommonMark::test_links_522", + "tests/test_commonmark.py::TestCommonMark::test_links_523", + "tests/test_commonmark.py::TestCommonMark::test_links_524", + "tests/test_commonmark.py::TestCommonMark::test_links_535", + "tests/test_commonmark.py::TestCommonMark::test_links_536", + "tests/test_commonmark.py::TestCommonMark::test_links_544", + "tests/test_commonmark.py::TestCommonMark::test_links_545", + "tests/test_commonmark.py::TestCommonMark::test_links_546", + "tests/test_commonmark.py::TestCommonMark::test_links_547", + "tests/test_commonmark.py::TestCommonMark::test_links_550", + "tests/test_commonmark.py::TestCommonMark::test_links_551", + "tests/test_commonmark.py::TestCommonMark::test_links_562", + "tests/test_commonmark.py::TestCommonMark::test_links_566", + "tests/test_commonmark.py::TestCommonMark::test_list_items_253", + "tests/test_commonmark.py::TestCommonMark::test_list_items_254", + "tests/test_commonmark.py::TestCommonMark::test_list_items_255", + "tests/test_commonmark.py::TestCommonMark::test_list_items_256", + "tests/test_commonmark.py::TestCommonMark::test_list_items_257", + "tests/test_commonmark.py::TestCommonMark::test_list_items_258", + "tests/test_commonmark.py::TestCommonMark::test_list_items_259", + "tests/test_commonmark.py::TestCommonMark::test_list_items_260", + "tests/test_commonmark.py::TestCommonMark::test_list_items_261", + "tests/test_commonmark.py::TestCommonMark::test_list_items_262", + "tests/test_commonmark.py::TestCommonMark::test_list_items_263", + "tests/test_commonmark.py::TestCommonMark::test_list_items_264", + "tests/test_commonmark.py::TestCommonMark::test_list_items_265", + "tests/test_commonmark.py::TestCommonMark::test_list_items_266", + "tests/test_commonmark.py::TestCommonMark::test_list_items_267", + "tests/test_commonmark.py::TestCommonMark::test_list_items_268", + "tests/test_commonmark.py::TestCommonMark::test_list_items_269", + "tests/test_commonmark.py::TestCommonMark::test_list_items_270", + "tests/test_commonmark.py::TestCommonMark::test_list_items_271", + "tests/test_commonmark.py::TestCommonMark::test_list_items_272", + "tests/test_commonmark.py::TestCommonMark::test_list_items_273", + "tests/test_commonmark.py::TestCommonMark::test_list_items_274", + "tests/test_commonmark.py::TestCommonMark::test_list_items_275", + "tests/test_commonmark.py::TestCommonMark::test_list_items_276", + "tests/test_commonmark.py::TestCommonMark::test_list_items_277", + "tests/test_commonmark.py::TestCommonMark::test_list_items_278", + "tests/test_commonmark.py::TestCommonMark::test_list_items_279", + "tests/test_commonmark.py::TestCommonMark::test_list_items_280", + "tests/test_commonmark.py::TestCommonMark::test_list_items_281", + "tests/test_commonmark.py::TestCommonMark::test_list_items_282", + "tests/test_commonmark.py::TestCommonMark::test_list_items_283", + "tests/test_commonmark.py::TestCommonMark::test_list_items_284", + "tests/test_commonmark.py::TestCommonMark::test_list_items_285", + "tests/test_commonmark.py::TestCommonMark::test_list_items_286", + "tests/test_commonmark.py::TestCommonMark::test_list_items_287", + "tests/test_commonmark.py::TestCommonMark::test_list_items_288", + "tests/test_commonmark.py::TestCommonMark::test_list_items_289", + "tests/test_commonmark.py::TestCommonMark::test_list_items_290", + "tests/test_commonmark.py::TestCommonMark::test_list_items_291", + "tests/test_commonmark.py::TestCommonMark::test_list_items_292", + "tests/test_commonmark.py::TestCommonMark::test_list_items_293", + "tests/test_commonmark.py::TestCommonMark::test_list_items_294", + "tests/test_commonmark.py::TestCommonMark::test_list_items_295", + "tests/test_commonmark.py::TestCommonMark::test_list_items_296", + "tests/test_commonmark.py::TestCommonMark::test_list_items_297", + "tests/test_commonmark.py::TestCommonMark::test_list_items_298", + "tests/test_commonmark.py::TestCommonMark::test_list_items_299", + "tests/test_commonmark.py::TestCommonMark::test_list_items_300", + "tests/test_commonmark.py::TestCommonMark::test_lists_301", + "tests/test_commonmark.py::TestCommonMark::test_lists_302", + "tests/test_commonmark.py::TestCommonMark::test_lists_303", + "tests/test_commonmark.py::TestCommonMark::test_lists_304", + "tests/test_commonmark.py::TestCommonMark::test_lists_305", + "tests/test_commonmark.py::TestCommonMark::test_lists_306", + "tests/test_commonmark.py::TestCommonMark::test_lists_307", + "tests/test_commonmark.py::TestCommonMark::test_lists_308", + "tests/test_commonmark.py::TestCommonMark::test_lists_309", + "tests/test_commonmark.py::TestCommonMark::test_lists_310", + "tests/test_commonmark.py::TestCommonMark::test_lists_311", + "tests/test_commonmark.py::TestCommonMark::test_lists_312", + "tests/test_commonmark.py::TestCommonMark::test_lists_313", + "tests/test_commonmark.py::TestCommonMark::test_lists_314", + "tests/test_commonmark.py::TestCommonMark::test_lists_315", + "tests/test_commonmark.py::TestCommonMark::test_lists_316", + "tests/test_commonmark.py::TestCommonMark::test_lists_317", + "tests/test_commonmark.py::TestCommonMark::test_lists_318", + "tests/test_commonmark.py::TestCommonMark::test_lists_319", + "tests/test_commonmark.py::TestCommonMark::test_lists_320", + "tests/test_commonmark.py::TestCommonMark::test_lists_321", + "tests/test_commonmark.py::TestCommonMark::test_lists_322", + "tests/test_commonmark.py::TestCommonMark::test_lists_323", + "tests/test_commonmark.py::TestCommonMark::test_lists_324", + "tests/test_commonmark.py::TestCommonMark::test_lists_325", + "tests/test_commonmark.py::TestCommonMark::test_lists_326", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_219", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_220", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_221", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_222", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_223", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_224", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_225", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_226", + "tests/test_commonmark.py::TestCommonMark::test_precedence_042", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_612", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_613", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_614", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_615", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_616", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_617", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_618", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_619", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_620", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_621", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_622", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_623", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_624", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_625", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_626", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_627", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_628", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_629", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_630", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_631", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_632", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_080", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_081", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_082", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_083", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_084", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_085", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_086", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_087", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_088", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_089", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_090", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_091", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_092", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_094", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_095", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_096", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_097", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_098", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_099", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_100", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_101", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_102", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_103", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_104", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_105", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_106", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_648", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_649", + "tests/test_commonmark.py::TestCommonMark::test_tabs_001", + "tests/test_commonmark.py::TestCommonMark::test_tabs_003", + "tests/test_commonmark.py::TestCommonMark::test_tabs_004", + "tests/test_commonmark.py::TestCommonMark::test_tabs_005", + "tests/test_commonmark.py::TestCommonMark::test_tabs_006", + "tests/test_commonmark.py::TestCommonMark::test_tabs_007", + "tests/test_commonmark.py::TestCommonMark::test_tabs_008", + "tests/test_commonmark.py::TestCommonMark::test_tabs_009", + "tests/test_commonmark.py::TestCommonMark::test_tabs_010", + "tests/test_commonmark.py::TestCommonMark::test_tabs_011", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_650", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_651", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_652", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_043", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_044", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_045", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_046", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_047", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_048", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_049", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_050", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_051", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_052", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_053", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_054", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_055", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_056", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_057", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_058", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_059", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_060", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_061", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_rst_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_complex_001", + "tests/test_directives.py::TestDirective_rst_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_rst_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_005", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_006", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_007", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_008", + "tests/test_directives.py::TestDirective_fenced_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_complex_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_image::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_source_001", + "tests/test_directives.py::TestDirective_fenced_image::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_caption_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_003", + "tests/test_directives.py::TestCustomizeToc::test_colon_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_rst_toc", + "tests/test_directives.py::TestDirectiveInclude::test_html_include", + "tests/test_directives.py::TestDirectiveInclude::test_include_missing_source", + "tests/test_hooks.py::TestTocHook::test_complex_toc_001", + "tests/test_hooks.py::TestTocHook::test_customize_heading_id_func", + "tests/test_hooks.py::TestTocHook::test_html_in_heading_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_002", + "tests/test_hooks.py::TestTocHook::test_simple_toc_001", + "tests/test_misc.py::TestMiscCases::test_allow_data_protocols", + "tests/test_misc.py::TestMiscCases::test_allow_harmful_protocols", + "tests/test_misc.py::TestMiscCases::test_ast_output", + "tests/test_misc.py::TestMiscCases::test_before_parse_hooks", + "tests/test_misc.py::TestMiscCases::test_emsp", + "tests/test_misc.py::TestMiscCases::test_escape_html", + "tests/test_misc.py::TestMiscCases::test_hard_wrap", + "tests/test_misc.py::TestMiscCases::test_harmful_links", + "tests/test_misc.py::TestMiscCases::test_html_tag_text_following_list", + "tests/test_misc.py::TestMiscCases::test_markdown_func", + "tests/test_misc.py::TestMiscCases::test_none", + "tests/test_misc.py::TestMiscCases::test_use_plugin", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin1_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin2_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin1_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin2_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_quote", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_quote", + "tests/test_renderers.py::TestRendererRst::test_code_001", + "tests/test_renderers.py::TestRendererRst::test_code_002", + "tests/test_renderers.py::TestRendererRst::test_heading_001", + "tests/test_renderers.py::TestRendererRst::test_html_001", + "tests/test_renderers.py::TestRendererRst::test_inline_001", + "tests/test_renderers.py::TestRendererRst::test_inline_002", + "tests/test_renderers.py::TestRendererRst::test_line_break_001", + "tests/test_renderers.py::TestRendererRst::test_list_001", + "tests/test_renderers.py::TestRendererRst::test_list_002", + "tests/test_renderers.py::TestRendererRst::test_list_003", + "tests/test_renderers.py::TestRendererRst::test_list_004", + "tests/test_renderers.py::TestRendererRst::test_list_005", + "tests/test_renderers.py::TestRendererRst::test_quote_001", + "tests/test_renderers.py::TestRendererRst::test_quote_002", + "tests/test_renderers.py::TestRendererRst::test_quote_003", + "tests/test_renderers.py::TestRendererRst::test_thematic_break_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_002", + "tests/test_renderers.py::TestRendererMarkdown::test_code_003", + "tests/test_renderers.py::TestRendererMarkdown::test_code_004", + "tests/test_renderers.py::TestRendererMarkdown::test_code_005", + "tests/test_renderers.py::TestRendererMarkdown::test_heading_001", + "tests/test_renderers.py::TestRendererMarkdown::test_html_001", + "tests/test_renderers.py::TestRendererMarkdown::test_inline_001", + "tests/test_renderers.py::TestRendererMarkdown::test_linebreak_001", + "tests/test_renderers.py::TestRendererMarkdown::test_list_001", + "tests/test_renderers.py::TestRendererMarkdown::test_list_002", + "tests/test_renderers.py::TestRendererMarkdown::test_list_003", + "tests/test_renderers.py::TestRendererMarkdown::test_list_004", + "tests/test_renderers.py::TestRendererMarkdown::test_list_005", + "tests/test_renderers.py::TestRendererMarkdown::test_list_006", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_001", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_002", + "tests/test_renderers.py::TestRendererMarkdown::test_thematic_break_001", + "tests/test_syntax.py::TestSyntax::test_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_link_003", + "tests/test_syntax.py::TestSyntax::test_max_depth_001", + "tests/test_syntax.py::TestSyntax::test_max_depth_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_003", + "tests/test_syntax.py::TestSyntax::test_setext_headings_001", + "tests/test_syntax.py::TestSyntax::test_setext_headings_002" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "1970fde210cc98017247106799d6d11b3cbe8c9d", + "healthy": "62750c95db25a8fb93dda09242f64e07508d9231", + "learner": "265e77770af1a926ce3e965bf03ac44de4ffbfa8" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.editorconfig", + "/testbed/.github/FUNDING.yml", + "/testbed/.gitignore", + "/testbed/.readthedocs.yaml", + "/testbed/BACKERS.md", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/Makefile", + "/testbed/README.md", + "/testbed/README.rst", + "/testbed/benchmark/bench.py", + "/testbed/benchmark/cases/atx.txt", + "/testbed/benchmark/cases/auto_links.txt", + "/testbed/benchmark/cases/blockcode.txt", + "/testbed/benchmark/cases/blockhtml.txt", + "/testbed/benchmark/cases/blockquote.txt", + "/testbed/benchmark/cases/emphasis.txt", + "/testbed/benchmark/cases/fenced.txt", + "/testbed/benchmark/cases/insane_ol.txt", + "/testbed/benchmark/cases/insane_ul.txt", + "/testbed/benchmark/cases/normal_ol.txt", + "/testbed/benchmark/cases/normal_ul.txt", + "/testbed/benchmark/cases/paragraph.txt", + "/testbed/benchmark/cases/ref_links.txt", + "/testbed/benchmark/cases/setext.txt", + "/testbed/benchmark/cases/std_links.txt", + "/testbed/docs/Makefile", + "/testbed/docs/_static/dark-icon.svg", + "/testbed/docs/_static/light-icon.svg", + "/testbed/docs/_static/logo-black.svg", + "/testbed/docs/_static/logo-white.svg", + "/testbed/docs/_templates/partials/globaltoc-above.html", + "/testbed/docs/advanced.rst", + "/testbed/docs/api.rst", + "/testbed/docs/changes.rst", + "/testbed/docs/cli.rst", + "/testbed/docs/community.rst", + "/testbed/docs/conf.py", + "/testbed/docs/directives.rst", + "/testbed/docs/guide.rst", + "/testbed/docs/index.rst", + "/testbed/docs/plugins.rst", + "/testbed/docs/renderers.rst", + "/testbed/docs/requirements.txt", + "/testbed/docs/upgrade.rst", + "/testbed/pyproject.toml", + "/testbed/serve-doc.py", + "/testbed/setup.py", + "/testbed/src/mistune/__init__.py", + "/testbed/src/mistune/__main__.py", + "/testbed/src/mistune/block_parser.py", + "/testbed/src/mistune/core.py", + "/testbed/src/mistune/directives/__init__.py", + "/testbed/src/mistune/directives/_base.py", + "/testbed/src/mistune/directives/_fenced.py", + "/testbed/src/mistune/directives/_rst.py", + "/testbed/src/mistune/directives/admonition.py", + "/testbed/src/mistune/directives/image.py", + "/testbed/src/mistune/directives/include.py", + "/testbed/src/mistune/directives/toc.py", + "/testbed/src/mistune/helpers.py", + "/testbed/src/mistune/inline_parser.py", + "/testbed/src/mistune/list_parser.py", + "/testbed/src/mistune/markdown.py", + "/testbed/src/mistune/plugins/__init__.py", + "/testbed/src/mistune/plugins/abbr.py", + "/testbed/src/mistune/plugins/def_list.py", + "/testbed/src/mistune/plugins/footnotes.py", + "/testbed/src/mistune/plugins/formatting.py", + "/testbed/src/mistune/plugins/math.py", + "/testbed/src/mistune/plugins/ruby.py", + "/testbed/src/mistune/plugins/speedup.py", + "/testbed/src/mistune/plugins/spoiler.py", + "/testbed/src/mistune/plugins/table.py", + "/testbed/src/mistune/plugins/task_lists.py", + "/testbed/src/mistune/plugins/url.py", + "/testbed/src/mistune/py.typed", + "/testbed/src/mistune/renderers/__init__.py", + "/testbed/src/mistune/renderers/_list.py", + "/testbed/src/mistune/renderers/html.py", + "/testbed/src/mistune/renderers/markdown.py", + "/testbed/src/mistune/renderers/rst.py", + "/testbed/src/mistune/toc.py", + "/testbed/src/mistune/util.py", + "/testbed/tests/__init__.py", + "/testbed/tests/fixtures/__init__.py", + "/testbed/tests/fixtures/abbr.txt", + "/testbed/tests/fixtures/commonmark.json", + "/testbed/tests/fixtures/def_list.txt", + "/testbed/tests/fixtures/diff-commonmark.txt", + "/testbed/tests/fixtures/fenced_admonition.txt", + "/testbed/tests/fixtures/fenced_figure.txt", + "/testbed/tests/fixtures/fenced_image.txt", + "/testbed/tests/fixtures/fenced_toc.txt", + "/testbed/tests/fixtures/fix-commonmark.txt", + "/testbed/tests/fixtures/footnotes.txt", + "/testbed/tests/fixtures/hook_toc.txt", + "/testbed/tests/fixtures/include/hello.md", + "/testbed/tests/fixtures/include/hello.txt", + "/testbed/tests/fixtures/include/text.html", + "/testbed/tests/fixtures/include/text.md", + "/testbed/tests/fixtures/insert.txt", + "/testbed/tests/fixtures/mark.txt", + "/testbed/tests/fixtures/math.txt", + "/testbed/tests/fixtures/renderer_markdown.txt", + "/testbed/tests/fixtures/renderer_rst.txt", + "/testbed/tests/fixtures/rst_admonition.txt", + "/testbed/tests/fixtures/rst_toc.txt", + "/testbed/tests/fixtures/ruby.txt", + "/testbed/tests/fixtures/spoiler.txt", + "/testbed/tests/fixtures/strikethrough.txt", + "/testbed/tests/fixtures/subscript.txt", + "/testbed/tests/fixtures/superscript.txt", + "/testbed/tests/fixtures/table.txt", + "/testbed/tests/fixtures/task_lists.txt", + "/testbed/tests/fixtures/url.txt" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "MistuneBf54ef67", + "profile_lines": [ + 570, + 573 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "upstream_repo": "lepture/mistune" + }, + "original_source_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "private_test_paths": [ + "tests/test_commonmark.py", + "tests/test_directives.py", + "tests/test_hooks.py", + "tests/test_misc.py", + "tests/test_plugins.py", + "tests/test_renderers.py", + "tests/test_syntax.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "src/mistune/util.py" + ], + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "source_stages_bytes": 1348255, + "task_id": "lepture__mistune.bf54ef67.combine_file__dbh7vcn1", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "lepture/mistune" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:lepture__mistune.bf54ef67.combine_file__dbh7vcn1", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "62750c95db25a8fb93dda09242f64e07508d9231", + "instruction_sha256": "b18db5c71ccb3f609be30938f808376dbcd9a25d2ea589b30405e0b25277ddbc", + "is_fork": true, + "learner_path": "tasks/1769dacd0d4025aee8db83ba/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "actual_upstream_url": "https://raw.githubusercontent.com/lepture/mistune/bf54ef67390e02a5cdee7495d4386d7770c1902b/LICENSE", + "reviewed": true, + "sha256": "539013fd8e19f744f8bf0e27a532bbff54cd689ecef7a800f56ae5dc824be870", + "spdx": "BSD-3-Clause", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/lepture__mistune.bf54ef67/265e77770af1a926ce3e965bf03ac44de4ffbfa8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "patch_sha256": "ad739c93d775e8a03ad5c4761d6e7930a698a1a2282c4c43e68d064080e4561d", + "provenance_path": "tasks/1769dacd0d4025aee8db83ba/source-proof.json", + "repository_lineage": [ + "swesmith/lepture__mistune.bf54ef67", + "lepture/mistune" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "265e77770af1a926ce3e965bf03ac44de4ffbfa8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "1970fde210cc98017247106799d6d11b3cbe8c9d", + "source_kind": "mutation", + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "lepture__mistune.bf54ef67.combine_file__dbh7vcn1", + "task_sha256": "84d2eb16a3e849eed5b6f76de419c25f77d48c73544d43b2c19ede0c410e7721", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "lepture/mistune", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/provenance.json b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..bfd0e243094b8eadf02c09f031b6de72cad357aa --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "e119aa0617d965066787824e4d0dbd2223aa72c43f9f7c050a10f78f64ec6069", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "actual_upstream_url": "https://raw.githubusercontent.com/lepture/mistune/bf54ef67390e02a5cdee7495d4386d7770c1902b/LICENSE", + "reviewed": true, + "sha256": "539013fd8e19f744f8bf0e27a532bbff54cd689ecef7a800f56ae5dc824be870", + "spdx": "BSD-3-Clause", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/lepture__mistune.bf54ef67/265e77770af1a926ce3e965bf03ac44de4ffbfa8/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "159cd56887229835deb77a8568e23148e64089d35e18affccd60ea329e1e4856", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "b3975ca2944dd6b3b9c0059f6d2528f9ef34061e0337f836b32c755991759211", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:lepture__mistune.bf54ef67.combine_file__dbh7vcn1", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "62750c95db25a8fb93dda09242f64e07508d9231", + "instruction_sha256": "b18db5c71ccb3f609be30938f808376dbcd9a25d2ea589b30405e0b25277ddbc", + "is_fork": true, + "learner_path": "tasks/1769dacd0d4025aee8db83ba/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "actual_upstream_url": "https://raw.githubusercontent.com/lepture/mistune/bf54ef67390e02a5cdee7495d4386d7770c1902b/LICENSE", + "reviewed": true, + "sha256": "539013fd8e19f744f8bf0e27a532bbff54cd689ecef7a800f56ae5dc824be870", + "spdx": "BSD-3-Clause", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/lepture__mistune.bf54ef67/265e77770af1a926ce3e965bf03ac44de4ffbfa8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "bf54ef67390e02a5cdee7495d4386d7770c1902b", + "patch_sha256": "ad739c93d775e8a03ad5c4761d6e7930a698a1a2282c4c43e68d064080e4561d", + "provenance_path": "tasks/1769dacd0d4025aee8db83ba/source-proof.json", + "repository_lineage": [ + "swesmith/lepture__mistune.bf54ef67", + "lepture/mistune" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "265e77770af1a926ce3e965bf03ac44de4ffbfa8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "1970fde210cc98017247106799d6d11b3cbe8c9d", + "source_kind": "mutation", + "source_repo": "swesmith/lepture__mistune.bf54ef67", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "lepture__mistune.bf54ef67.combine_file__dbh7vcn1", + "task_sha256": "84d2eb16a3e849eed5b6f76de419c25f77d48c73544d43b2c19ede0c410e7721", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "lepture/mistune", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "cb345067f46bf3d3e7a60b2963e26cee25fe8aae6cd4a620d05e02f799d96fca" +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/provided-gold.diff b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..b043b030feeb561d610b730a17f252cbc7c3a2ea --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/provided-gold.diff @@ -0,0 +1,29 @@ +diff --git a/src/mistune/util.py b/src/mistune/util.py +index 76f7dcb53d1752024d941ab6e4feff9cb86705e9..884ed55215b3abd44d4513e26d95c26bad6b4ca2 100644 +--- a/src/mistune/util.py ++++ b/src/mistune/util.py +@@ -9,7 +9,7 @@ + def expand_leading_tab(text: str, width: int = 4) -> str: + def repl(m: Match[str]) -> str: + s = m.group(1) +- return ' ' * (width + len(s)) ++ return s + ' ' * (width - len(s)) + return _expand_tab_re.sub(repl, text) + + +@@ -32,11 +32,11 @@ + def escape_url(link: str) -> str: + """Escape URL for safety.""" + safe = ( +- ':@#' # removed certain gen-delims +- '!$&()+=,' # sub-delims reordered and missing some characters +- '%' # leave already-encoded octets alone ++ ':/?#@' # gen-delims - '[]' (rfc3986) ++ '!$&()*+,;=' # sub-delims - "'" (rfc3986) ++ '%' # leave already-encoded octets alone + ) +- return quote(link, safe=safe) ++ return quote(unescape(link), safe=safe) + + + def safe_entity(s: str) -> str: diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/solution/solve.sh b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c8a498b5ef6a7fa6f870df116d320660be5afd28 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/solution/solve.sh @@ -0,0 +1,35 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/src/mistune/util.py b/src/mistune/util.py +index 76f7dcb53d1752024d941ab6e4feff9cb86705e9..884ed55215b3abd44d4513e26d95c26bad6b4ca2 100644 +--- a/src/mistune/util.py ++++ b/src/mistune/util.py +@@ -9,7 +9,7 @@ + def expand_leading_tab(text: str, width: int = 4) -> str: + def repl(m: Match[str]) -> str: + s = m.group(1) +- return ' ' * (width + len(s)) ++ return s + ' ' * (width - len(s)) + return _expand_tab_re.sub(repl, text) + + +@@ -32,11 +32,11 @@ + def escape_url(link: str) -> str: + """Escape URL for safety.""" + safe = ( +- ':@#' # removed certain gen-delims +- '!$&()+=,' # sub-delims reordered and missing some characters +- '%' # leave already-encoded octets alone ++ ':/?#@' # gen-delims - '[]' (rfc3986) ++ '!$&()*+,;=' # sub-delims - "'" (rfc3986) ++ '%' # leave already-encoded octets alone + ) +- return quote(link, safe=safe) ++ return quote(unescape(link), safe=safe) + + + def safe_entity(s: str) -> str: +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/task.toml b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8eb24ee5015431d21f13db5b769a05b864a1796b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:de6ee7419cb4f52416eda9df07ec17c97d6dfcdf70dd0f97617b1e00e85ca96e" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/check_pytest.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/expected-panels.json b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..bc40c2af5a7bdd521f85c26c912813eee3c3e1ca --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/expected-panels.json @@ -0,0 +1,951 @@ +{ + "fail-to-pass": [ + "tests/test_commonmark.py::TestCommonMark::test_autolinks_593", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_594", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_595", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_598", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_599", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_600", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_602", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_020", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_022", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_023", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_346", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_403", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_421", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_432", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_472", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_473", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_479", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_480", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_032", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_033", + "tests/test_commonmark.py::TestCommonMark::test_images_571", + "tests/test_commonmark.py::TestCommonMark::test_images_574", + "tests/test_commonmark.py::TestCommonMark::test_images_578", + "tests/test_commonmark.py::TestCommonMark::test_images_580", + "tests/test_commonmark.py::TestCommonMark::test_images_581", + "tests/test_commonmark.py::TestCommonMark::test_images_582", + "tests/test_commonmark.py::TestCommonMark::test_images_583", + "tests/test_commonmark.py::TestCommonMark::test_images_584", + "tests/test_commonmark.py::TestCommonMark::test_images_585", + "tests/test_commonmark.py::TestCommonMark::test_images_586", + "tests/test_commonmark.py::TestCommonMark::test_images_587", + "tests/test_commonmark.py::TestCommonMark::test_images_588", + "tests/test_commonmark.py::TestCommonMark::test_images_590", + "tests/test_commonmark.py::TestCommonMark::test_images_592", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_192", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_193", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_196", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_198", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_202", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_205", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_206", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_214", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_215", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_216", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_217", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_218", + "tests/test_commonmark.py::TestCommonMark::test_links_481", + "tests/test_commonmark.py::TestCommonMark::test_links_482", + "tests/test_commonmark.py::TestCommonMark::test_links_483", + "tests/test_commonmark.py::TestCommonMark::test_links_488", + "tests/test_commonmark.py::TestCommonMark::test_links_500", + "tests/test_commonmark.py::TestCommonMark::test_links_502", + "tests/test_commonmark.py::TestCommonMark::test_links_505", + "tests/test_commonmark.py::TestCommonMark::test_links_506", + "tests/test_commonmark.py::TestCommonMark::test_links_508", + "tests/test_commonmark.py::TestCommonMark::test_links_509", + "tests/test_commonmark.py::TestCommonMark::test_links_511", + "tests/test_commonmark.py::TestCommonMark::test_links_513", + "tests/test_commonmark.py::TestCommonMark::test_links_514", + "tests/test_commonmark.py::TestCommonMark::test_links_515", + "tests/test_commonmark.py::TestCommonMark::test_links_516", + "tests/test_commonmark.py::TestCommonMark::test_links_520", + "tests/test_commonmark.py::TestCommonMark::test_links_521", + "tests/test_commonmark.py::TestCommonMark::test_links_525", + "tests/test_commonmark.py::TestCommonMark::test_links_526", + "tests/test_commonmark.py::TestCommonMark::test_links_527", + "tests/test_commonmark.py::TestCommonMark::test_links_528", + "tests/test_commonmark.py::TestCommonMark::test_links_529", + "tests/test_commonmark.py::TestCommonMark::test_links_530", + "tests/test_commonmark.py::TestCommonMark::test_links_533", + "tests/test_commonmark.py::TestCommonMark::test_links_534", + "tests/test_commonmark.py::TestCommonMark::test_links_537", + "tests/test_commonmark.py::TestCommonMark::test_links_538", + "tests/test_commonmark.py::TestCommonMark::test_links_539", + "tests/test_commonmark.py::TestCommonMark::test_links_540", + "tests/test_commonmark.py::TestCommonMark::test_links_541", + "tests/test_commonmark.py::TestCommonMark::test_links_542", + "tests/test_commonmark.py::TestCommonMark::test_links_543", + "tests/test_commonmark.py::TestCommonMark::test_links_548", + "tests/test_commonmark.py::TestCommonMark::test_links_549", + "tests/test_commonmark.py::TestCommonMark::test_links_552", + "tests/test_commonmark.py::TestCommonMark::test_links_553", + "tests/test_commonmark.py::TestCommonMark::test_links_554", + "tests/test_commonmark.py::TestCommonMark::test_links_555", + "tests/test_commonmark.py::TestCommonMark::test_links_556", + "tests/test_commonmark.py::TestCommonMark::test_links_557", + "tests/test_commonmark.py::TestCommonMark::test_links_558", + "tests/test_commonmark.py::TestCommonMark::test_links_559", + "tests/test_commonmark.py::TestCommonMark::test_links_560", + "tests/test_commonmark.py::TestCommonMark::test_links_561", + "tests/test_commonmark.py::TestCommonMark::test_links_563", + "tests/test_commonmark.py::TestCommonMark::test_links_564", + "tests/test_commonmark.py::TestCommonMark::test_links_565", + "tests/test_commonmark.py::TestCommonMark::test_links_567", + "tests/test_commonmark.py::TestCommonMark::test_links_568", + "tests/test_commonmark.py::TestCommonMark::test_links_569", + "tests/test_commonmark.py::TestCommonMark::test_links_570", + "tests/test_commonmark.py::TestCommonMark::test_tabs_002", + "tests/test_directives.py::TestDirective_rst_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_link_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_image::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_target_001", + "tests/test_directives.py::TestDirective_fenced_image::test_target_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_all_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_target_option_001", + "tests/test_hooks.py::TestTocHook::test_link_in_heading_001", + "tests/test_misc.py::TestMiscCases::test_ast_url", + "tests/test_misc.py::TestMiscCases::test_ref_link", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_001", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_002", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_007", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_002", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_003", + "tests/test_renderers.py::TestRendererRst::test_images_001", + "tests/test_renderers.py::TestRendererRst::test_images_002", + "tests/test_renderers.py::TestRendererRst::test_images_003", + "tests/test_renderers.py::TestRendererRst::test_links_001", + "tests/test_renderers.py::TestRendererMarkdown::test_images_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_001", + "tests/test_renderers.py::TestRendererMarkdown::test_links_002", + "tests/test_renderers.py::TestRendererMarkdown::test_links_003", + "tests/test_syntax.py::TestSyntax::test_image_001", + "tests/test_syntax.py::TestSyntax::test_link_001", + "tests/test_syntax.py::TestSyntax::test_link_002", + "tests/test_syntax.py::TestSyntax::test_links_001", + "tests/test_syntax.py::TestSyntax::test_links_002" + ], + "pass-to-pass": [ + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_062", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_063", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_064", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_065", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_066", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_067", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_068", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_069", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_070", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_071", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_072", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_073", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_074", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_075", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_076", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_077", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_078", + "tests/test_commonmark.py::TestCommonMark::test_atx_headings_079", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_596", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_597", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_601", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_603", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_604", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_605", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_606", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_607", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_608", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_609", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_610", + "tests/test_commonmark.py::TestCommonMark::test_autolinks_611", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_012", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_013", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_014", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_015", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_016", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_017", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_018", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_019", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_021", + "tests/test_commonmark.py::TestCommonMark::test_backslash_escapes_024", + "tests/test_commonmark.py::TestCommonMark::test_blank_lines_227", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_228", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_229", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_230", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_231", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_232", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_233", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_234", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_235", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_236", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_237", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_238", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_239", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_240", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_241", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_242", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_243", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_244", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_245", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_246", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_247", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_248", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_249", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_250", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_251", + "tests/test_commonmark.py::TestCommonMark::test_block_quotes_252", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_328", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_329", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_330", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_331", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_332", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_333", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_334", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_335", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_336", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_337", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_338", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_339", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_340", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_341", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_342", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_343", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_344", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_345", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_347", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_348", + "tests/test_commonmark.py::TestCommonMark::test_code_spans_349", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_350", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_351", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_353", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_354", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_355", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_356", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_357", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_358", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_359", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_360", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_361", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_362", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_363", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_364", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_365", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_366", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_369", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_370", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_371", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_373", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_374", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_375", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_376", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_377", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_378", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_380", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_381", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_382", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_383", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_384", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_385", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_386", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_387", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_389", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_390", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_392", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_393", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_394", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_395", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_396", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_397", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_398", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_399", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_400", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_401", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_402", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_404", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_405", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_409", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_410", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_411", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_415", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_419", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_420", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_422", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_423", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_427", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_428", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_433", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_434", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_435", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_436", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_437", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_438", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_439", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_440", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_447", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_448", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_449", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_450", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_451", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_452", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_459", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_461", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_466", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_468", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_469", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_474", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_475", + "tests/test_commonmark.py::TestCommonMark::test_emphasis_and_strong_emphasis_476", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_025", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_026", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_027", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_028", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_029", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_030", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_031", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_034", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_035", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_036", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_037", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_038", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_039", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_040", + "tests/test_commonmark.py::TestCommonMark::test_entity_and_numeric_character_references_041", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_119", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_120", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_121", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_122", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_123", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_124", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_125", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_126", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_127", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_128", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_129", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_130", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_131", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_132", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_133", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_134", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_135", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_136", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_137", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_138", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_139", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_140", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_141", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_142", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_143", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_144", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_145", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_146", + "tests/test_commonmark.py::TestCommonMark::test_fenced_code_blocks_147", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_633", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_634", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_635", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_636", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_637", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_638", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_639", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_640", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_641", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_642", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_643", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_644", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_645", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_646", + "tests/test_commonmark.py::TestCommonMark::test_hard_line_breaks_647", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_148", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_149", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_150", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_151", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_152", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_153", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_154", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_155", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_156", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_157", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_158", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_159", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_160", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_161", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_162", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_163", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_164", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_165", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_166", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_167", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_168", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_169", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_170", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_171", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_172", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_173", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_174", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_175", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_176", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_177", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_178", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_179", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_180", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_181", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_182", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_183", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_184", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_185", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_186", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_187", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_188", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_189", + "tests/test_commonmark.py::TestCommonMark::test_html_blocks_190", + "tests/test_commonmark.py::TestCommonMark::test_images_572", + "tests/test_commonmark.py::TestCommonMark::test_images_575", + "tests/test_commonmark.py::TestCommonMark::test_images_576", + "tests/test_commonmark.py::TestCommonMark::test_images_577", + "tests/test_commonmark.py::TestCommonMark::test_images_579", + "tests/test_commonmark.py::TestCommonMark::test_images_589", + "tests/test_commonmark.py::TestCommonMark::test_images_591", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_107", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_108", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_109", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_110", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_111", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_112", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_113", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_114", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_115", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_116", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_117", + "tests/test_commonmark.py::TestCommonMark::test_indented_code_blocks_118", + "tests/test_commonmark.py::TestCommonMark::test_inlines_327", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_194", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_195", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_197", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_199", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_200", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_201", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_203", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_204", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_207", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_208", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_209", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_210", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_211", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_212", + "tests/test_commonmark.py::TestCommonMark::test_link_reference_definitions_213", + "tests/test_commonmark.py::TestCommonMark::test_links_484", + "tests/test_commonmark.py::TestCommonMark::test_links_485", + "tests/test_commonmark.py::TestCommonMark::test_links_486", + "tests/test_commonmark.py::TestCommonMark::test_links_487", + "tests/test_commonmark.py::TestCommonMark::test_links_489", + "tests/test_commonmark.py::TestCommonMark::test_links_490", + "tests/test_commonmark.py::TestCommonMark::test_links_491", + "tests/test_commonmark.py::TestCommonMark::test_links_492", + "tests/test_commonmark.py::TestCommonMark::test_links_493", + "tests/test_commonmark.py::TestCommonMark::test_links_494", + "tests/test_commonmark.py::TestCommonMark::test_links_497", + "tests/test_commonmark.py::TestCommonMark::test_links_498", + "tests/test_commonmark.py::TestCommonMark::test_links_499", + "tests/test_commonmark.py::TestCommonMark::test_links_501", + "tests/test_commonmark.py::TestCommonMark::test_links_503", + "tests/test_commonmark.py::TestCommonMark::test_links_507", + "tests/test_commonmark.py::TestCommonMark::test_links_510", + "tests/test_commonmark.py::TestCommonMark::test_links_512", + "tests/test_commonmark.py::TestCommonMark::test_links_522", + "tests/test_commonmark.py::TestCommonMark::test_links_523", + "tests/test_commonmark.py::TestCommonMark::test_links_524", + "tests/test_commonmark.py::TestCommonMark::test_links_535", + "tests/test_commonmark.py::TestCommonMark::test_links_536", + "tests/test_commonmark.py::TestCommonMark::test_links_544", + "tests/test_commonmark.py::TestCommonMark::test_links_545", + "tests/test_commonmark.py::TestCommonMark::test_links_546", + "tests/test_commonmark.py::TestCommonMark::test_links_547", + "tests/test_commonmark.py::TestCommonMark::test_links_550", + "tests/test_commonmark.py::TestCommonMark::test_links_551", + "tests/test_commonmark.py::TestCommonMark::test_links_562", + "tests/test_commonmark.py::TestCommonMark::test_links_566", + "tests/test_commonmark.py::TestCommonMark::test_list_items_253", + "tests/test_commonmark.py::TestCommonMark::test_list_items_254", + "tests/test_commonmark.py::TestCommonMark::test_list_items_255", + "tests/test_commonmark.py::TestCommonMark::test_list_items_256", + "tests/test_commonmark.py::TestCommonMark::test_list_items_257", + "tests/test_commonmark.py::TestCommonMark::test_list_items_258", + "tests/test_commonmark.py::TestCommonMark::test_list_items_259", + "tests/test_commonmark.py::TestCommonMark::test_list_items_260", + "tests/test_commonmark.py::TestCommonMark::test_list_items_261", + "tests/test_commonmark.py::TestCommonMark::test_list_items_262", + "tests/test_commonmark.py::TestCommonMark::test_list_items_263", + "tests/test_commonmark.py::TestCommonMark::test_list_items_264", + "tests/test_commonmark.py::TestCommonMark::test_list_items_265", + "tests/test_commonmark.py::TestCommonMark::test_list_items_266", + "tests/test_commonmark.py::TestCommonMark::test_list_items_267", + "tests/test_commonmark.py::TestCommonMark::test_list_items_268", + "tests/test_commonmark.py::TestCommonMark::test_list_items_269", + "tests/test_commonmark.py::TestCommonMark::test_list_items_270", + "tests/test_commonmark.py::TestCommonMark::test_list_items_271", + "tests/test_commonmark.py::TestCommonMark::test_list_items_272", + "tests/test_commonmark.py::TestCommonMark::test_list_items_273", + "tests/test_commonmark.py::TestCommonMark::test_list_items_274", + "tests/test_commonmark.py::TestCommonMark::test_list_items_275", + "tests/test_commonmark.py::TestCommonMark::test_list_items_276", + "tests/test_commonmark.py::TestCommonMark::test_list_items_277", + "tests/test_commonmark.py::TestCommonMark::test_list_items_278", + "tests/test_commonmark.py::TestCommonMark::test_list_items_279", + "tests/test_commonmark.py::TestCommonMark::test_list_items_280", + "tests/test_commonmark.py::TestCommonMark::test_list_items_281", + "tests/test_commonmark.py::TestCommonMark::test_list_items_282", + "tests/test_commonmark.py::TestCommonMark::test_list_items_283", + "tests/test_commonmark.py::TestCommonMark::test_list_items_284", + "tests/test_commonmark.py::TestCommonMark::test_list_items_285", + "tests/test_commonmark.py::TestCommonMark::test_list_items_286", + "tests/test_commonmark.py::TestCommonMark::test_list_items_287", + "tests/test_commonmark.py::TestCommonMark::test_list_items_288", + "tests/test_commonmark.py::TestCommonMark::test_list_items_289", + "tests/test_commonmark.py::TestCommonMark::test_list_items_290", + "tests/test_commonmark.py::TestCommonMark::test_list_items_291", + "tests/test_commonmark.py::TestCommonMark::test_list_items_292", + "tests/test_commonmark.py::TestCommonMark::test_list_items_293", + "tests/test_commonmark.py::TestCommonMark::test_list_items_294", + "tests/test_commonmark.py::TestCommonMark::test_list_items_295", + "tests/test_commonmark.py::TestCommonMark::test_list_items_296", + "tests/test_commonmark.py::TestCommonMark::test_list_items_297", + "tests/test_commonmark.py::TestCommonMark::test_list_items_298", + "tests/test_commonmark.py::TestCommonMark::test_list_items_299", + "tests/test_commonmark.py::TestCommonMark::test_list_items_300", + "tests/test_commonmark.py::TestCommonMark::test_lists_301", + "tests/test_commonmark.py::TestCommonMark::test_lists_302", + "tests/test_commonmark.py::TestCommonMark::test_lists_303", + "tests/test_commonmark.py::TestCommonMark::test_lists_304", + "tests/test_commonmark.py::TestCommonMark::test_lists_305", + "tests/test_commonmark.py::TestCommonMark::test_lists_306", + "tests/test_commonmark.py::TestCommonMark::test_lists_307", + "tests/test_commonmark.py::TestCommonMark::test_lists_308", + "tests/test_commonmark.py::TestCommonMark::test_lists_309", + "tests/test_commonmark.py::TestCommonMark::test_lists_310", + "tests/test_commonmark.py::TestCommonMark::test_lists_311", + "tests/test_commonmark.py::TestCommonMark::test_lists_312", + "tests/test_commonmark.py::TestCommonMark::test_lists_313", + "tests/test_commonmark.py::TestCommonMark::test_lists_314", + "tests/test_commonmark.py::TestCommonMark::test_lists_315", + "tests/test_commonmark.py::TestCommonMark::test_lists_316", + "tests/test_commonmark.py::TestCommonMark::test_lists_317", + "tests/test_commonmark.py::TestCommonMark::test_lists_318", + "tests/test_commonmark.py::TestCommonMark::test_lists_319", + "tests/test_commonmark.py::TestCommonMark::test_lists_320", + "tests/test_commonmark.py::TestCommonMark::test_lists_321", + "tests/test_commonmark.py::TestCommonMark::test_lists_322", + "tests/test_commonmark.py::TestCommonMark::test_lists_323", + "tests/test_commonmark.py::TestCommonMark::test_lists_324", + "tests/test_commonmark.py::TestCommonMark::test_lists_325", + "tests/test_commonmark.py::TestCommonMark::test_lists_326", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_219", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_220", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_221", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_222", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_223", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_224", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_225", + "tests/test_commonmark.py::TestCommonMark::test_paragraphs_226", + "tests/test_commonmark.py::TestCommonMark::test_precedence_042", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_612", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_613", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_614", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_615", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_616", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_617", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_618", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_619", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_620", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_621", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_622", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_623", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_624", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_625", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_626", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_627", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_628", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_629", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_630", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_631", + "tests/test_commonmark.py::TestCommonMark::test_raw_html_632", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_080", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_081", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_082", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_083", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_084", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_085", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_086", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_087", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_088", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_089", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_090", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_091", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_092", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_094", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_095", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_096", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_097", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_098", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_099", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_100", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_101", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_102", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_103", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_104", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_105", + "tests/test_commonmark.py::TestCommonMark::test_setext_headings_106", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_648", + "tests/test_commonmark.py::TestCommonMark::test_soft_line_breaks_649", + "tests/test_commonmark.py::TestCommonMark::test_tabs_001", + "tests/test_commonmark.py::TestCommonMark::test_tabs_003", + "tests/test_commonmark.py::TestCommonMark::test_tabs_004", + "tests/test_commonmark.py::TestCommonMark::test_tabs_005", + "tests/test_commonmark.py::TestCommonMark::test_tabs_006", + "tests/test_commonmark.py::TestCommonMark::test_tabs_007", + "tests/test_commonmark.py::TestCommonMark::test_tabs_008", + "tests/test_commonmark.py::TestCommonMark::test_tabs_009", + "tests/test_commonmark.py::TestCommonMark::test_tabs_010", + "tests/test_commonmark.py::TestCommonMark::test_tabs_011", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_650", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_651", + "tests/test_commonmark.py::TestCommonMark::test_textual_content_652", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_043", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_044", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_045", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_046", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_047", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_048", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_049", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_050", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_051", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_052", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_053", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_054", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_055", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_056", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_057", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_058", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_059", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_060", + "tests/test_commonmark.py::TestCommonMark::test_thematic_breaks_061", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_rst_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_rst_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_complex_001", + "tests/test_directives.py::TestDirective_rst_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_001", + "tests/test_directives.py::TestDirective_rst_toc::test_insane_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_rst_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_rst_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_rst_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_001", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_002", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_003", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_004", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_005", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_006", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_007", + "tests/test_directives.py::TestDirective_fenced_admonition::test_admonition_008", + "tests/test_directives.py::TestDirective_fenced_toc::test_collapse_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_complex_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_html_in_heading_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_insane_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_invalid_option_003", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_001", + "tests/test_directives.py::TestDirective_fenced_toc::test_no_toc_002", + "tests/test_directives.py::TestDirective_fenced_toc::test_simple_toc_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_image::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_image::test_ampersand_in_source_001", + "tests/test_directives.py::TestDirective_fenced_image::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_image::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_align_options_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_alt_option_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_caption_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_legend_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_no_options_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_001", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_002", + "tests/test_directives.py::TestDirective_fenced_figure::test_width_and_height_003", + "tests/test_directives.py::TestCustomizeToc::test_colon_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_fenced_toc", + "tests/test_directives.py::TestCustomizeToc::test_rst_toc", + "tests/test_directives.py::TestDirectiveInclude::test_html_include", + "tests/test_directives.py::TestDirectiveInclude::test_include_missing_source", + "tests/test_hooks.py::TestTocHook::test_complex_toc_001", + "tests/test_hooks.py::TestTocHook::test_customize_heading_id_func", + "tests/test_hooks.py::TestTocHook::test_html_in_heading_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_001", + "tests/test_hooks.py::TestTocHook::test_insane_toc_002", + "tests/test_hooks.py::TestTocHook::test_simple_toc_001", + "tests/test_misc.py::TestMiscCases::test_allow_data_protocols", + "tests/test_misc.py::TestMiscCases::test_allow_harmful_protocols", + "tests/test_misc.py::TestMiscCases::test_ast_output", + "tests/test_misc.py::TestMiscCases::test_before_parse_hooks", + "tests/test_misc.py::TestMiscCases::test_emsp", + "tests/test_misc.py::TestMiscCases::test_escape_html", + "tests/test_misc.py::TestMiscCases::test_hard_wrap", + "tests/test_misc.py::TestMiscCases::test_harmful_links", + "tests/test_misc.py::TestMiscCases::test_html_tag_text_following_list", + "tests/test_misc.py::TestMiscCases::test_markdown_func", + "tests/test_misc.py::TestMiscCases::test_none", + "tests/test_misc.py::TestMiscCases::test_use_plugin", + "tests/test_plugins.py::TestPlugin1_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin2_url::test_url_plugin_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin1_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_001", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_002", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_003", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_004", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_005", + "tests/test_plugins.py::TestPlugin2_strikethrough::test_strikethrough_006", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin1_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_escape_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_mark_link_001", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_001", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_002", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_003", + "tests/test_plugins.py::TestPlugin2_mark::test_normal_mark_004", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin1_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_escape_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_insert_link_001", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_001", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_002", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_003", + "tests/test_plugins.py::TestPlugin2_insert::test_normal_insert_004", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin1_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_001", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_002", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_003", + "tests/test_plugins.py::TestPlugin2_superscript::test_superscript_004", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin1_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_001", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_002", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_003", + "tests/test_plugins.py::TestPlugin2_subscript::test_subscript_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin1_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_001", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_002", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_003", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_004", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_005", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_006", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_007", + "tests/test_plugins.py::TestPlugin2_task_lists::test_task_lists_008", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin1_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin1_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin1_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_001", + "tests/test_plugins.py::TestPlugin1_table::test_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_align_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_002", + "tests/test_plugins.py::TestPlugin2_table::test_misc_table_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_001", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_002", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_003", + "tests/test_plugins.py::TestPlugin2_table::test_mismatch_length_004", + "tests/test_plugins.py::TestPlugin2_table::test_nptable_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_001", + "tests/test_plugins.py::TestPlugin2_table::test_table_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin1_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_005", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_lists_006", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_001", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_002", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_003", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_004", + "tests/test_plugins.py::TestPlugin2_def_list::test_definition_with_multiple_lines_005", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin1_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_001", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_002", + "tests/test_plugins.py::TestPlugin2_footnotes::test_footnotes_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin1_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_001", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_002", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_003", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_004", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_005", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_006", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_007", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_008", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_009", + "tests/test_plugins.py::TestPlugin2_abbr::test_abbreviation_010", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin1_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin1_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_001", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_002", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_003", + "tests/test_plugins.py::TestPlugin2_math::test_block_math_004", + "tests/test_plugins.py::TestPlugin2_math::test_inline_math_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin1_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_splits_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_with_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_001", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_002", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_003", + "tests/test_plugins.py::TestPlugin2_ruby::test_ruby_without_link_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin1_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin1_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_003", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_004", + "tests/test_plugins.py::TestPlugin2_spoiler::test_block_spoiler_005", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_001", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_002", + "tests/test_plugins.py::TestPlugin2_spoiler::test_inline_spoiler_003", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_math_in_quote", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_list", + "tests/test_plugins.py::TestExtraPlugins::test_table_in_quote", + "tests/test_renderers.py::TestRendererRst::test_code_001", + "tests/test_renderers.py::TestRendererRst::test_code_002", + "tests/test_renderers.py::TestRendererRst::test_heading_001", + "tests/test_renderers.py::TestRendererRst::test_html_001", + "tests/test_renderers.py::TestRendererRst::test_inline_001", + "tests/test_renderers.py::TestRendererRst::test_inline_002", + "tests/test_renderers.py::TestRendererRst::test_line_break_001", + "tests/test_renderers.py::TestRendererRst::test_list_001", + "tests/test_renderers.py::TestRendererRst::test_list_002", + "tests/test_renderers.py::TestRendererRst::test_list_003", + "tests/test_renderers.py::TestRendererRst::test_list_004", + "tests/test_renderers.py::TestRendererRst::test_list_005", + "tests/test_renderers.py::TestRendererRst::test_quote_001", + "tests/test_renderers.py::TestRendererRst::test_quote_002", + "tests/test_renderers.py::TestRendererRst::test_quote_003", + "tests/test_renderers.py::TestRendererRst::test_thematic_break_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_001", + "tests/test_renderers.py::TestRendererMarkdown::test_code_002", + "tests/test_renderers.py::TestRendererMarkdown::test_code_003", + "tests/test_renderers.py::TestRendererMarkdown::test_code_004", + "tests/test_renderers.py::TestRendererMarkdown::test_code_005", + "tests/test_renderers.py::TestRendererMarkdown::test_heading_001", + "tests/test_renderers.py::TestRendererMarkdown::test_html_001", + "tests/test_renderers.py::TestRendererMarkdown::test_inline_001", + "tests/test_renderers.py::TestRendererMarkdown::test_linebreak_001", + "tests/test_renderers.py::TestRendererMarkdown::test_list_001", + "tests/test_renderers.py::TestRendererMarkdown::test_list_002", + "tests/test_renderers.py::TestRendererMarkdown::test_list_003", + "tests/test_renderers.py::TestRendererMarkdown::test_list_004", + "tests/test_renderers.py::TestRendererMarkdown::test_list_005", + "tests/test_renderers.py::TestRendererMarkdown::test_list_006", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_001", + "tests/test_renderers.py::TestRendererMarkdown::test_quote_002", + "tests/test_renderers.py::TestRendererMarkdown::test_thematic_break_001", + "tests/test_syntax.py::TestSyntax::test_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_link_003", + "tests/test_syntax.py::TestSyntax::test_max_depth_001", + "tests/test_syntax.py::TestSyntax::test_max_depth_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_001", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_002", + "tests/test_syntax.py::TestSyntax::test_non_aggressive_emphasis_003", + "tests/test_syntax.py::TestSyntax::test_setext_headings_001", + "tests/test_syntax.py::TestSyntax::test_setext_headings_002" + ] +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/grade.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/panel-config.json b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..fcf9afd120808ef57ca8e15a2ff5adfbb1b9b425 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/panel-config.json @@ -0,0 +1,24 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "python -m pip install -e ." + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "pyproject.toml": "b2922e3ef89e2918935d38fb3a777bdbc741619942276a75fd21a8dd9faf6b42" + } +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/test.sh b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted-inventory.json b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..aa70e1f5d5d129ced763ef7db40f73f94595e1e2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted-inventory.json @@ -0,0 +1,212 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 1781, + "mode": 420, + "sha256": "b2922e3ef89e2918935d38fb3a777bdbc741619942276a75fd21a8dd9faf6b42" + }, + "setup.py": { + "bytes": 52, + "mode": 420, + "sha256": "504f5c8cbb3b966b1f3f838da0a0cdc77b312f0c5935951357d17328e5324e21" + }, + "tests/__init__.py": { + "bytes": 1149, + "mode": 420, + "sha256": "229cc35ee9a5f5a9fb37e036683e2276f940b80df2dc6203102c0f36f960e467" + }, + "tests/fixtures/__init__.py": { + "bytes": 1502, + "mode": 420, + "sha256": "960fa58f01c3a473a956cc2d5430314d10f070bff18b35c9707c52c1c42a57e2" + }, + "tests/fixtures/abbr.txt": { + "bytes": 2703, + "mode": 420, + "sha256": "18c7e06359486daeaafa88c7404f4ca8248cd47bf38a7ed475ddd35353e68bea" + }, + "tests/fixtures/commonmark.json": { + "bytes": 140423, + "mode": 420, + "sha256": "ae6129f3ce3caf4f99cf4f9a5ad3558a309652b5b887171013e2bf0797289b98" + }, + "tests/fixtures/def_list.txt": { + "bytes": 2834, + "mode": 420, + "sha256": "909b7156a5ba1f005ea3d8a203946e7ab3576149ec5af73ecad657bb046f386d" + }, + "tests/fixtures/diff-commonmark.txt": { + "bytes": 1176, + "mode": 420, + "sha256": "920df6e3c9c8e3d4627842d5a7aeb172bdd23229acfbbb9a9b728a9f6ce2c1f0" + }, + "tests/fixtures/fenced_admonition.txt": { + "bytes": 2344, + "mode": 420, + "sha256": "0f231afd472bc2c742170798e619d1baa5dd34e9e4a6cb18906dabd1aa37a1d0" + }, + "tests/fixtures/fenced_figure.txt": { + "bytes": 3481, + "mode": 420, + "sha256": "83c3d636e8d4f0dd5a767045cf38877fd3c6c03a20c351f06c50e30ae7f30cda" + }, + "tests/fixtures/fenced_image.txt": { + "bytes": 2343, + "mode": 420, + "sha256": "fa7ede5a90b718aaeb46af7f5a4d98a0e17cec0411355f460a166356020e6780" + }, + "tests/fixtures/fenced_toc.txt": { + "bytes": 3656, + "mode": 420, + "sha256": "019a12ca2e293699d88241460bdea48ee6a65981b36b6bae4c0bbf78f020a296" + }, + "tests/fixtures/fix-commonmark.txt": { + "bytes": 1905, + "mode": 420, + "sha256": "1f2777b457f4da70e02983bbcb2104fa3b442dbb8a5bcac1621499b0b796292f" + }, + "tests/fixtures/footnotes.txt": { + "bytes": 847, + "mode": 420, + "sha256": "55227ab43a3986fd07ecbf0742903a977f04cd9ed403086d7c76f23b1967aab1" + }, + "tests/fixtures/hook_toc.txt": { + "bytes": 1896, + "mode": 420, + "sha256": "bdb1a5c90f08cb29c4eed3c892e9c694f92855507b6cd5809eac3b8eb4fc7dc5" + }, + "tests/fixtures/include/hello.md": { + "bytes": 8, + "mode": 420, + "sha256": "389aaf8f17da55ef35fedf530bc70cd1287042f6410ec94c2b44c1b22c36e60a" + }, + "tests/fixtures/include/hello.txt": { + "bytes": 6, + "mode": 420, + "sha256": "5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03" + }, + "tests/fixtures/include/text.html": { + "bytes": 24, + "mode": 420, + "sha256": "bac2f8a2e3937f8923da8e560248d2a52867b502fbda531ba73f1d066b35d2ba" + }, + "tests/fixtures/include/text.md": { + "bytes": 163, + "mode": 420, + "sha256": "3ffb497b2829ca6333bc6eb4e7d2959aa7baeaa44180225a4820e0051ae7ef75" + }, + "tests/fixtures/insert.txt": { + "bytes": 1165, + "mode": 420, + "sha256": "de7b89a58c2cbd2d4948c10b8c599fd7500b3ae6734d271a35ff2cf2854b1572" + }, + "tests/fixtures/mark.txt": { + "bytes": 1138, + "mode": 420, + "sha256": "6b5c232cf89f61097ae6d032865a99bdcd9f65e3ef99517d9423b2da0aa983d0" + }, + "tests/fixtures/math.txt": { + "bytes": 1174, + "mode": 420, + "sha256": "eadc29b04cc85928e50003b2908b002a778447ef028c4b773ca1753b907fd898" + }, + "tests/fixtures/renderer_markdown.txt": { + "bytes": 3569, + "mode": 420, + "sha256": "2ba5fc55634d7dbaabd91aedea9e04b34882e67abc3020034bd809a408cac2a7" + }, + "tests/fixtures/renderer_rst.txt": { + "bytes": 2915, + "mode": 420, + "sha256": "47007bc353f230e9b73d8604548539bb16374a4b837bf7ba8d2f478444fff84e" + }, + "tests/fixtures/rst_admonition.txt": { + "bytes": 848, + "mode": 420, + "sha256": "821676f07a4e595c51c84da87edc592e22e8bbed6241e070040d87a4de7c5d7e" + }, + "tests/fixtures/rst_toc.txt": { + "bytes": 3643, + "mode": 420, + "sha256": "f9ae334cef85d776c37d7ad029e1e38d9e1b035423ab624dab8499aff28f7e98" + }, + "tests/fixtures/ruby.txt": { + "bytes": 1773, + "mode": 420, + "sha256": "1302542447ac0befc2618d9c2da1657581fcc1d90c332896e6dc086b698e30ed" + }, + "tests/fixtures/spoiler.txt": { + "bytes": 1154, + "mode": 420, + "sha256": "21446f2e88b70cc3c50e606c36fbcdf567993581ccf8397ace5948973c251985" + }, + "tests/fixtures/strikethrough.txt": { + "bytes": 886, + "mode": 420, + "sha256": "fee85a2207da74bdcf437c2c58804b009b657b4dfd505989fdbee46f78feac07" + }, + "tests/fixtures/subscript.txt": { + "bytes": 521, + "mode": 420, + "sha256": "61fd94b4718edbbfaa782533f659f4f193585fb09e61761a662cd313906932b8" + }, + "tests/fixtures/superscript.txt": { + "bytes": 523, + "mode": 420, + "sha256": "658ac752d95d74e6e97e7daceba6f48ef279dc6f1389a878610bc608e82f34b3" + }, + "tests/fixtures/table.txt": { + "bytes": 4134, + "mode": 420, + "sha256": "f92d66b63d00f95f7a9938cb6e0e42ea4968d6e9f1f62e902b63bc1be69f51b6" + }, + "tests/fixtures/task_lists.txt": { + "bytes": 3104, + "mode": 420, + "sha256": "d17a07a9cb077dd25c3b4c4dd7301bc9f508ab75ec83c2293b0ebaca954be76c" + }, + "tests/fixtures/url.txt": { + "bytes": 530, + "mode": 420, + "sha256": "441ea5e1e27f6edcd52b51f8c20ca1eee8b76d4adcc3b2fcdd419448c528ef21" + }, + "tests/test_commonmark.py": { + "bytes": 2199, + "mode": 420, + "sha256": "77396377672a8419ecab283aebf55a5e206b1aa413626975dc8b2a006c796973" + }, + "tests/test_directives.py": { + "bytes": 2954, + "mode": 420, + "sha256": "3d46db4f9e52d3067954ab7fcaba80ef855008a516a86ee3baf07b2a9c730817" + }, + "tests/test_hooks.py": { + "bytes": 729, + "mode": 420, + "sha256": "9d6f177c6dd52223ac44e31508ed66bbc2b6fc7a4725ed7121fb39842b0a6a61" + }, + "tests/test_misc.py": { + "bytes": 4830, + "mode": 420, + "sha256": "a1bba411b7b74f1b9d43bf88459db1d9fa2c13e7db32dfee707c93cd8ccb5575" + }, + "tests/test_plugins.py": { + "bytes": 2280, + "mode": 420, + "sha256": "56a6731c5e5667870122edfb3d49925a34dc394ae00ce3282dc3e89cbe2fd6b8" + }, + "tests/test_renderers.py": { + "bytes": 500, + "mode": 420, + "sha256": "efc0fa48c74f8ee1b84c961e4ca034eb5f0246b69b4663428c93cc77d471e7b8" + }, + "tests/test_syntax.py": { + "bytes": 342, + "mode": 420, + "sha256": "88f99c6afc5f39f088c0cd1cdf4fab8a69b60b208a1b28924eeb8fbd0d7bef2e" + } + } +} diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/pyproject.toml b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..2d95f9b3bd4ee9817157eab051c5277fb0a3846f --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/pyproject.toml @@ -0,0 +1,69 @@ +[project] +name = "mistune" +description = "A sane and fast Markdown parser with useful plugins and renderers" +authors = [{name = "Hsiaoming Yang", email="me@lepture.com"}] +dependencies = [ + "typing-extensions; python_version<'3.11'", +] +license = {text = "BSD-3-Clause"} +dynamic = ["version"] +requires-python = ">=3.8" +readme = "README.rst" +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Text Processing :: Markup", +] + +[project.urls] +Documentation = "https://mistune.lepture.com/" +Source = "https://github.com/lepture/mistune" +Donate = "https://github.com/sponsors/lepture" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +version = {attr = "mistune.__version__"} + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +mistune = ["py.typed"] + +[tool.ruff] +line-length = 120 + +[tool.pytest.ini_options] +pythonpath = ["src", "."] +testpaths = ["tests"] +filterwarnings = ["error"] + +[tool.coverage.run] +branch = true +source = ["mistune"] + +[tool.coverage.paths] +source = ["src"] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "raise NotImplementedError", + "@(abc\\.)?abstractmethod", +] diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/setup.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..af8a0fc50e9db1a27585118393965a8c87e19129 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup(name="mistune") diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/__init__.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b715104d1f96221038f7c9060d66b4bc6a5bdda2 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/__init__.py @@ -0,0 +1,40 @@ +import re +from abc import abstractmethod +from unittest import TestCase + +from tests import fixtures + + +class BaseTestCase(TestCase): + @classmethod + def load_fixtures(cls, case_file: str) -> None: + def attach_case(n: str, text: str, html: str) -> None: + def method(self: 'BaseTestCase') -> None: + self.assert_case(n, text, html) + + name = 'test_{}'.format(n) + method.__name__ = name + method.__doc__ = 'Run fixture {} - {}'.format(case_file, n) + setattr(cls, name, method) + + for n, text, html in fixtures.load_examples(case_file): + if cls.ignore_case(n): + continue + attach_case(n, text, html) + + @classmethod + def ignore_case(cls, name: str) -> bool: + return False + + @abstractmethod + def parse(self, text: str) -> str: ... + + def assert_case(self, name: str, text: str, html: str) -> None: + result = self.parse(text) + self.assertEqual(result, html) + + +def normalize_html(html: str) -> str: + html = re.sub(r'>\n+', '>', html) + html = re.sub(r'\n+<', '<', html) + return html.strip() diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/__init__.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a1abe299918fbbac039621a46f85061a7f0c31e --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/__init__.py @@ -0,0 +1,56 @@ +import os +import re +import json +from typing import Any, Iterable, Tuple + +ROOT = os.path.join(os.path.dirname(__file__)) + +EXAMPLE_PATTERN = re.compile( + r'^`{32} example\n([\s\S]*?)' + r'^\.\n([\s\S]*?)' + r'^`{32}$|^#{1,6} *(.*)$', + flags=re.M +) + + +def load_ast(filename: str) -> Any: + with open(os.path.join(ROOT, 'ast', filename)) as f: + return json.load(f) + + +def load_json(filename: str) -> Any: + with open(os.path.join(ROOT, filename)) as f: + return json.load(f) + + +def load_examples(filename: str) -> Iterable[Tuple[str, str, str]]: + if filename.endswith('.json'): + data = load_json(filename) + for item in data: + section = item['section'].lower().replace(' ', '_') + n = '%s_%03d' % (section, item['example']) + yield n, item['markdown'], item['html'] + else: + with open(os.path.join(ROOT, filename), 'rb') as f: + content = f.read() + s = content.decode('utf-8') + yield from parse_examples(s) + + + +def parse_examples(text: str) -> Iterable[Tuple[str, str, str]]: + data = EXAMPLE_PATTERN.findall(text) + + section = None + count = 0 + for md, html, title in data: + if title: + count = 0 + section = title.lower().replace(' ', '_') + + if md and html: + count += 1 + n = '%s_%03d' % (section, count) + md = md.replace(u'\u2192', '\t') + html = html.replace(u'\u2192', '\t') + yield n, md, html diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/abbr.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/abbr.txt new file mode 100644 index 0000000000000000000000000000000000000000..a87b4f1521511a9071a901311c07372340bb958c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/abbr.txt @@ -0,0 +1,79 @@ +# Abbreviation + +## abbreviation + +```````````````````````````````` example +HTML +. +

HTML

+```````````````````````````````` + +```````````````````````````````` example +HTML +*[HTML]: Hyper Text Markup Language +. +

HTML

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: Hyper Text Markup Language +*[W3C]: World Wide Web Consortium +. +

The HTML specification is maintained by the W3C.

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: + Hyper Text Markup Language +*[W3C]: + World Wide Web Consortium +. +

The HTML specification is maintained by the W3C.

+```````````````````````````````` + +```````````````````````````````` example +The HTML specification is maintained by the W3C. +*[HTML]: Hyper Text Markup Language +*[W3C]: World Wide Web Consortium +There is more text below this one. +. +

The HTML specification is maintained by the W3C.

+

There is more text below this one.

+```````````````````````````````` + +```````````````````````````````` example +The latest spec of HTML is HTML5. +*[HTML]: Hyper Text Markup Language +. +

The latest spec of HTML is HTML5.

+```````````````````````````````` + +```````````````````````````````` example +HTML should always be spelt with capital letters and not spelt html. +*[HTML]: Hyper Text Markup Language +. +

HTML should always be spelt with capital letters and not spelt html.

+```````````````````````````````` + +```````````````````````````````` example +HTML is an abbreviation but nobody knows what it stands for. +*[HTML]: +. +

HTML is an abbreviation but nobody knows what it stands for.

+```````````````````````````````` + +```````````````````````````````` example +Foo.* looks like a regular expression. +*[Foo.*]: Just foo +. +

Foo.* looks like a regular expression.

+```````````````````````````````` + +```````````````````````````````` example +Untrusted HTML should be escaped. +*[HTML]:

This is some HTML

+. +

Untrusted HTML should be escaped.

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/commonmark.json b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/commonmark.json new file mode 100644 index 0000000000000000000000000000000000000000..d742f941312421f89a3491b7e1d5edd0e44d2207 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/commonmark.json @@ -0,0 +1,5218 @@ +[ + { + "markdown": "\tfoo\tbaz\t\tbim\n", + "html": "
foo\tbaz\t\tbim\n
\n", + "example": 1, + "start_line": 356, + "end_line": 361, + "section": "Tabs" + }, + { + "markdown": " \tfoo\tbaz\t\tbim\n", + "html": "
foo\tbaz\t\tbim\n
\n", + "example": 2, + "start_line": 363, + "end_line": 368, + "section": "Tabs" + }, + { + "markdown": " a\ta\n ὐ\ta\n", + "html": "
a\ta\nὐ\ta\n
\n", + "example": 3, + "start_line": 370, + "end_line": 377, + "section": "Tabs" + }, + { + "markdown": " - foo\n\n\tbar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 4, + "start_line": 383, + "end_line": 394, + "section": "Tabs" + }, + { + "markdown": "- foo\n\n\t\tbar\n", + "html": "
    \n
  • \n

    foo

    \n
      bar\n
    \n
  • \n
\n", + "example": 5, + "start_line": 396, + "end_line": 408, + "section": "Tabs" + }, + { + "markdown": ">\t\tfoo\n", + "html": "
\n
  foo\n
\n
\n", + "example": 6, + "start_line": 419, + "end_line": 426, + "section": "Tabs" + }, + { + "markdown": "-\t\tfoo\n", + "html": "
    \n
  • \n
      foo\n
    \n
  • \n
\n", + "example": 7, + "start_line": 428, + "end_line": 437, + "section": "Tabs" + }, + { + "markdown": " foo\n\tbar\n", + "html": "
foo\nbar\n
\n", + "example": 8, + "start_line": 440, + "end_line": 447, + "section": "Tabs" + }, + { + "markdown": " - foo\n - bar\n\t - baz\n", + "html": "
    \n
  • foo\n
      \n
    • bar\n
        \n
      • baz
      • \n
      \n
    • \n
    \n
  • \n
\n", + "example": 9, + "start_line": 449, + "end_line": 465, + "section": "Tabs" + }, + { + "markdown": "#\tFoo\n", + "html": "

Foo

\n", + "example": 10, + "start_line": 467, + "end_line": 471, + "section": "Tabs" + }, + { + "markdown": "*\t*\t*\t\n", + "html": "
\n", + "example": 11, + "start_line": 473, + "end_line": 477, + "section": "Tabs" + }, + { + "markdown": "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\n", + "html": "

!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~

\n", + "example": 12, + "start_line": 490, + "end_line": 494, + "section": "Backslash escapes" + }, + { + "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", + "html": "

\\\t\\A\\a\\ \\3\\φ\\«

\n", + "example": 13, + "start_line": 500, + "end_line": 504, + "section": "Backslash escapes" + }, + { + "markdown": "\\*not emphasized*\n\\
not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\ö not a character entity\n", + "html": "

*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\n&ouml; not a character entity

\n", + "example": 14, + "start_line": 510, + "end_line": 530, + "section": "Backslash escapes" + }, + { + "markdown": "\\\\*emphasis*\n", + "html": "

\\emphasis

\n", + "example": 15, + "start_line": 535, + "end_line": 539, + "section": "Backslash escapes" + }, + { + "markdown": "foo\\\nbar\n", + "html": "

foo
\nbar

\n", + "example": 16, + "start_line": 544, + "end_line": 550, + "section": "Backslash escapes" + }, + { + "markdown": "`` \\[\\` ``\n", + "html": "

\\[\\`

\n", + "example": 17, + "start_line": 556, + "end_line": 560, + "section": "Backslash escapes" + }, + { + "markdown": " \\[\\]\n", + "html": "
\\[\\]\n
\n", + "example": 18, + "start_line": 563, + "end_line": 568, + "section": "Backslash escapes" + }, + { + "markdown": "~~~\n\\[\\]\n~~~\n", + "html": "
\\[\\]\n
\n", + "example": 19, + "start_line": 571, + "end_line": 578, + "section": "Backslash escapes" + }, + { + "markdown": "\n", + "html": "

http://example.com?find=\\*

\n", + "example": 20, + "start_line": 581, + "end_line": 585, + "section": "Backslash escapes" + }, + { + "markdown": "\n", + "html": "\n", + "example": 21, + "start_line": 588, + "end_line": 592, + "section": "Backslash escapes" + }, + { + "markdown": "[foo](/bar\\* \"ti\\*tle\")\n", + "html": "

foo

\n", + "example": 22, + "start_line": 598, + "end_line": 602, + "section": "Backslash escapes" + }, + { + "markdown": "[foo]\n\n[foo]: /bar\\* \"ti\\*tle\"\n", + "html": "

foo

\n", + "example": 23, + "start_line": 605, + "end_line": 611, + "section": "Backslash escapes" + }, + { + "markdown": "``` foo\\+bar\nfoo\n```\n", + "html": "
foo\n
\n", + "example": 24, + "start_line": 614, + "end_line": 621, + "section": "Backslash escapes" + }, + { + "markdown": "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n", + "html": "

  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

\n", + "example": 25, + "start_line": 650, + "end_line": 658, + "section": "Entity and numeric character references" + }, + { + "markdown": "# Ӓ Ϡ �\n", + "html": "

# Ӓ Ϡ �

\n", + "example": 26, + "start_line": 669, + "end_line": 673, + "section": "Entity and numeric character references" + }, + { + "markdown": "" ആ ಫ\n", + "html": "

" ആ ಫ

\n", + "example": 27, + "start_line": 682, + "end_line": 686, + "section": "Entity and numeric character references" + }, + { + "markdown": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;\n", + "html": "

&nbsp &x; &#; &#x;\n&#87654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;

\n", + "example": 28, + "start_line": 691, + "end_line": 701, + "section": "Entity and numeric character references" + }, + { + "markdown": "©\n", + "html": "

&copy

\n", + "example": 29, + "start_line": 708, + "end_line": 712, + "section": "Entity and numeric character references" + }, + { + "markdown": "&MadeUpEntity;\n", + "html": "

&MadeUpEntity;

\n", + "example": 30, + "start_line": 718, + "end_line": 722, + "section": "Entity and numeric character references" + }, + { + "markdown": "\n", + "html": "\n", + "example": 31, + "start_line": 729, + "end_line": 733, + "section": "Entity and numeric character references" + }, + { + "markdown": "[foo](/föö \"föö\")\n", + "html": "

foo

\n", + "example": 32, + "start_line": 736, + "end_line": 740, + "section": "Entity and numeric character references" + }, + { + "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", + "html": "

foo

\n", + "example": 33, + "start_line": 743, + "end_line": 749, + "section": "Entity and numeric character references" + }, + { + "markdown": "``` föö\nfoo\n```\n", + "html": "
foo\n
\n", + "example": 34, + "start_line": 752, + "end_line": 759, + "section": "Entity and numeric character references" + }, + { + "markdown": "`föö`\n", + "html": "

f&ouml;&ouml;

\n", + "example": 35, + "start_line": 765, + "end_line": 769, + "section": "Entity and numeric character references" + }, + { + "markdown": " föfö\n", + "html": "
f&ouml;f&ouml;\n
\n", + "example": 36, + "start_line": 772, + "end_line": 777, + "section": "Entity and numeric character references" + }, + { + "markdown": "*foo*\n*foo*\n", + "html": "

*foo*\nfoo

\n", + "example": 37, + "start_line": 784, + "end_line": 790, + "section": "Entity and numeric character references" + }, + { + "markdown": "* foo\n\n* foo\n", + "html": "

* foo

\n
    \n
  • foo
  • \n
\n", + "example": 38, + "start_line": 792, + "end_line": 801, + "section": "Entity and numeric character references" + }, + { + "markdown": "foo bar\n", + "html": "

foo\n\nbar

\n", + "example": 39, + "start_line": 803, + "end_line": 809, + "section": "Entity and numeric character references" + }, + { + "markdown": " foo\n", + "html": "

\tfoo

\n", + "example": 40, + "start_line": 811, + "end_line": 815, + "section": "Entity and numeric character references" + }, + { + "markdown": "[a](url "tit")\n", + "html": "

[a](url "tit")

\n", + "example": 41, + "start_line": 818, + "end_line": 822, + "section": "Entity and numeric character references" + }, + { + "markdown": "- `one\n- two`\n", + "html": "
    \n
  • `one
  • \n
  • two`
  • \n
\n", + "example": 42, + "start_line": 841, + "end_line": 849, + "section": "Precedence" + }, + { + "markdown": "***\n---\n___\n", + "html": "
\n
\n
\n", + "example": 43, + "start_line": 880, + "end_line": 888, + "section": "Thematic breaks" + }, + { + "markdown": "+++\n", + "html": "

+++

\n", + "example": 44, + "start_line": 893, + "end_line": 897, + "section": "Thematic breaks" + }, + { + "markdown": "===\n", + "html": "

===

\n", + "example": 45, + "start_line": 900, + "end_line": 904, + "section": "Thematic breaks" + }, + { + "markdown": "--\n**\n__\n", + "html": "

--\n**\n__

\n", + "example": 46, + "start_line": 909, + "end_line": 917, + "section": "Thematic breaks" + }, + { + "markdown": " ***\n ***\n ***\n", + "html": "
\n
\n
\n", + "example": 47, + "start_line": 922, + "end_line": 930, + "section": "Thematic breaks" + }, + { + "markdown": " ***\n", + "html": "
***\n
\n", + "example": 48, + "start_line": 935, + "end_line": 940, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n ***\n", + "html": "

Foo\n***

\n", + "example": 49, + "start_line": 943, + "end_line": 949, + "section": "Thematic breaks" + }, + { + "markdown": "_____________________________________\n", + "html": "
\n", + "example": 50, + "start_line": 954, + "end_line": 958, + "section": "Thematic breaks" + }, + { + "markdown": " - - -\n", + "html": "
\n", + "example": 51, + "start_line": 963, + "end_line": 967, + "section": "Thematic breaks" + }, + { + "markdown": " ** * ** * ** * **\n", + "html": "
\n", + "example": 52, + "start_line": 970, + "end_line": 974, + "section": "Thematic breaks" + }, + { + "markdown": "- - - -\n", + "html": "
\n", + "example": 53, + "start_line": 977, + "end_line": 981, + "section": "Thematic breaks" + }, + { + "markdown": "- - - - \n", + "html": "
\n", + "example": 54, + "start_line": 986, + "end_line": 990, + "section": "Thematic breaks" + }, + { + "markdown": "_ _ _ _ a\n\na------\n\n---a---\n", + "html": "

_ _ _ _ a

\n

a------

\n

---a---

\n", + "example": 55, + "start_line": 995, + "end_line": 1005, + "section": "Thematic breaks" + }, + { + "markdown": " *-*\n", + "html": "

-

\n", + "example": 56, + "start_line": 1011, + "end_line": 1015, + "section": "Thematic breaks" + }, + { + "markdown": "- foo\n***\n- bar\n", + "html": "
    \n
  • foo
  • \n
\n
\n
    \n
  • bar
  • \n
\n", + "example": 57, + "start_line": 1020, + "end_line": 1032, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n***\nbar\n", + "html": "

Foo

\n
\n

bar

\n", + "example": 58, + "start_line": 1037, + "end_line": 1045, + "section": "Thematic breaks" + }, + { + "markdown": "Foo\n---\nbar\n", + "html": "

Foo

\n

bar

\n", + "example": 59, + "start_line": 1054, + "end_line": 1061, + "section": "Thematic breaks" + }, + { + "markdown": "* Foo\n* * *\n* Bar\n", + "html": "
    \n
  • Foo
  • \n
\n
\n
    \n
  • Bar
  • \n
\n", + "example": 60, + "start_line": 1067, + "end_line": 1079, + "section": "Thematic breaks" + }, + { + "markdown": "- Foo\n- * * *\n", + "html": "
    \n
  • Foo
  • \n
  • \n
    \n
  • \n
\n", + "example": 61, + "start_line": 1084, + "end_line": 1094, + "section": "Thematic breaks" + }, + { + "markdown": "# foo\n## foo\n### foo\n#### foo\n##### foo\n###### foo\n", + "html": "

foo

\n

foo

\n

foo

\n

foo

\n
foo
\n
foo
\n", + "example": 62, + "start_line": 1113, + "end_line": 1127, + "section": "ATX headings" + }, + { + "markdown": "####### foo\n", + "html": "

####### foo

\n", + "example": 63, + "start_line": 1132, + "end_line": 1136, + "section": "ATX headings" + }, + { + "markdown": "#5 bolt\n\n#hashtag\n", + "html": "

#5 bolt

\n

#hashtag

\n", + "example": 64, + "start_line": 1147, + "end_line": 1154, + "section": "ATX headings" + }, + { + "markdown": "\\## foo\n", + "html": "

## foo

\n", + "example": 65, + "start_line": 1159, + "end_line": 1163, + "section": "ATX headings" + }, + { + "markdown": "# foo *bar* \\*baz\\*\n", + "html": "

foo bar *baz*

\n", + "example": 66, + "start_line": 1168, + "end_line": 1172, + "section": "ATX headings" + }, + { + "markdown": "# foo \n", + "html": "

foo

\n", + "example": 67, + "start_line": 1177, + "end_line": 1181, + "section": "ATX headings" + }, + { + "markdown": " ### foo\n ## foo\n # foo\n", + "html": "

foo

\n

foo

\n

foo

\n", + "example": 68, + "start_line": 1186, + "end_line": 1194, + "section": "ATX headings" + }, + { + "markdown": " # foo\n", + "html": "
# foo\n
\n", + "example": 69, + "start_line": 1199, + "end_line": 1204, + "section": "ATX headings" + }, + { + "markdown": "foo\n # bar\n", + "html": "

foo\n# bar

\n", + "example": 70, + "start_line": 1207, + "end_line": 1213, + "section": "ATX headings" + }, + { + "markdown": "## foo ##\n ### bar ###\n", + "html": "

foo

\n

bar

\n", + "example": 71, + "start_line": 1218, + "end_line": 1224, + "section": "ATX headings" + }, + { + "markdown": "# foo ##################################\n##### foo ##\n", + "html": "

foo

\n
foo
\n", + "example": 72, + "start_line": 1229, + "end_line": 1235, + "section": "ATX headings" + }, + { + "markdown": "### foo ### \n", + "html": "

foo

\n", + "example": 73, + "start_line": 1240, + "end_line": 1244, + "section": "ATX headings" + }, + { + "markdown": "### foo ### b\n", + "html": "

foo ### b

\n", + "example": 74, + "start_line": 1251, + "end_line": 1255, + "section": "ATX headings" + }, + { + "markdown": "# foo#\n", + "html": "

foo#

\n", + "example": 75, + "start_line": 1260, + "end_line": 1264, + "section": "ATX headings" + }, + { + "markdown": "### foo \\###\n## foo #\\##\n# foo \\#\n", + "html": "

foo ###

\n

foo ###

\n

foo #

\n", + "example": 76, + "start_line": 1270, + "end_line": 1278, + "section": "ATX headings" + }, + { + "markdown": "****\n## foo\n****\n", + "html": "
\n

foo

\n
\n", + "example": 77, + "start_line": 1284, + "end_line": 1292, + "section": "ATX headings" + }, + { + "markdown": "Foo bar\n# baz\nBar foo\n", + "html": "

Foo bar

\n

baz

\n

Bar foo

\n", + "example": 78, + "start_line": 1295, + "end_line": 1303, + "section": "ATX headings" + }, + { + "markdown": "## \n#\n### ###\n", + "html": "

\n

\n

\n", + "example": 79, + "start_line": 1308, + "end_line": 1316, + "section": "ATX headings" + }, + { + "markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n", + "html": "

Foo bar

\n

Foo bar

\n", + "example": 80, + "start_line": 1351, + "end_line": 1360, + "section": "Setext headings" + }, + { + "markdown": "Foo *bar\nbaz*\n====\n", + "html": "

Foo bar\nbaz

\n", + "example": 81, + "start_line": 1365, + "end_line": 1372, + "section": "Setext headings" + }, + { + "markdown": " Foo *bar\nbaz*\t\n====\n", + "html": "

Foo bar\nbaz

\n", + "example": 82, + "start_line": 1379, + "end_line": 1386, + "section": "Setext headings" + }, + { + "markdown": "Foo\n-------------------------\n\nFoo\n=\n", + "html": "

Foo

\n

Foo

\n", + "example": 83, + "start_line": 1391, + "end_line": 1400, + "section": "Setext headings" + }, + { + "markdown": " Foo\n---\n\n Foo\n-----\n\n Foo\n ===\n", + "html": "

Foo

\n

Foo

\n

Foo

\n", + "example": 84, + "start_line": 1406, + "end_line": 1419, + "section": "Setext headings" + }, + { + "markdown": " Foo\n ---\n\n Foo\n---\n", + "html": "
Foo\n---\n\nFoo\n
\n
\n", + "example": 85, + "start_line": 1424, + "end_line": 1437, + "section": "Setext headings" + }, + { + "markdown": "Foo\n ---- \n", + "html": "

Foo

\n", + "example": 86, + "start_line": 1443, + "end_line": 1448, + "section": "Setext headings" + }, + { + "markdown": "Foo\n ---\n", + "html": "

Foo\n---

\n", + "example": 87, + "start_line": 1453, + "end_line": 1459, + "section": "Setext headings" + }, + { + "markdown": "Foo\n= =\n\nFoo\n--- -\n", + "html": "

Foo\n= =

\n

Foo

\n
\n", + "example": 88, + "start_line": 1464, + "end_line": 1475, + "section": "Setext headings" + }, + { + "markdown": "Foo \n-----\n", + "html": "

Foo

\n", + "example": 89, + "start_line": 1480, + "end_line": 1485, + "section": "Setext headings" + }, + { + "markdown": "Foo\\\n----\n", + "html": "

Foo\\

\n", + "example": 90, + "start_line": 1490, + "end_line": 1495, + "section": "Setext headings" + }, + { + "markdown": "`Foo\n----\n`\n\n\n", + "html": "

`Foo

\n

`

\n

<a title="a lot

\n

of dashes"/>

\n", + "example": 91, + "start_line": 1501, + "end_line": 1514, + "section": "Setext headings" + }, + { + "markdown": "> Foo\n---\n", + "html": "
\n

Foo

\n
\n
\n", + "example": 92, + "start_line": 1520, + "end_line": 1528, + "section": "Setext headings" + }, + { + "markdown": "> foo\nbar\n===\n", + "html": "
\n

foo\nbar\n===

\n
\n", + "example": 93, + "start_line": 1531, + "end_line": 1541, + "section": "Setext headings" + }, + { + "markdown": "- Foo\n---\n", + "html": "
    \n
  • Foo
  • \n
\n
\n", + "example": 94, + "start_line": 1544, + "end_line": 1552, + "section": "Setext headings" + }, + { + "markdown": "Foo\nBar\n---\n", + "html": "

Foo\nBar

\n", + "example": 95, + "start_line": 1559, + "end_line": 1566, + "section": "Setext headings" + }, + { + "markdown": "---\nFoo\n---\nBar\n---\nBaz\n", + "html": "
\n

Foo

\n

Bar

\n

Baz

\n", + "example": 96, + "start_line": 1572, + "end_line": 1584, + "section": "Setext headings" + }, + { + "markdown": "\n====\n", + "html": "

====

\n", + "example": 97, + "start_line": 1589, + "end_line": 1594, + "section": "Setext headings" + }, + { + "markdown": "---\n---\n", + "html": "
\n
\n", + "example": 98, + "start_line": 1601, + "end_line": 1607, + "section": "Setext headings" + }, + { + "markdown": "- foo\n-----\n", + "html": "
    \n
  • foo
  • \n
\n
\n", + "example": 99, + "start_line": 1610, + "end_line": 1618, + "section": "Setext headings" + }, + { + "markdown": " foo\n---\n", + "html": "
foo\n
\n
\n", + "example": 100, + "start_line": 1621, + "end_line": 1628, + "section": "Setext headings" + }, + { + "markdown": "> foo\n-----\n", + "html": "
\n

foo

\n
\n
\n", + "example": 101, + "start_line": 1631, + "end_line": 1639, + "section": "Setext headings" + }, + { + "markdown": "\\> foo\n------\n", + "html": "

> foo

\n", + "example": 102, + "start_line": 1645, + "end_line": 1650, + "section": "Setext headings" + }, + { + "markdown": "Foo\n\nbar\n---\nbaz\n", + "html": "

Foo

\n

bar

\n

baz

\n", + "example": 103, + "start_line": 1676, + "end_line": 1686, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n\n---\n\nbaz\n", + "html": "

Foo\nbar

\n
\n

baz

\n", + "example": 104, + "start_line": 1692, + "end_line": 1704, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n* * *\nbaz\n", + "html": "

Foo\nbar

\n
\n

baz

\n", + "example": 105, + "start_line": 1710, + "end_line": 1720, + "section": "Setext headings" + }, + { + "markdown": "Foo\nbar\n\\---\nbaz\n", + "html": "

Foo\nbar\n---\nbaz

\n", + "example": 106, + "start_line": 1725, + "end_line": 1735, + "section": "Setext headings" + }, + { + "markdown": " a simple\n indented code block\n", + "html": "
a simple\n  indented code block\n
\n", + "example": 107, + "start_line": 1753, + "end_line": 1760, + "section": "Indented code blocks" + }, + { + "markdown": " - foo\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 108, + "start_line": 1767, + "end_line": 1778, + "section": "Indented code blocks" + }, + { + "markdown": "1. foo\n\n - bar\n", + "html": "
    \n
  1. \n

    foo

    \n
      \n
    • bar
    • \n
    \n
  2. \n
\n", + "example": 109, + "start_line": 1781, + "end_line": 1794, + "section": "Indented code blocks" + }, + { + "markdown": "
\n *hi*\n\n - one\n", + "html": "
<a/>\n*hi*\n\n- one\n
\n", + "example": 110, + "start_line": 1801, + "end_line": 1812, + "section": "Indented code blocks" + }, + { + "markdown": " chunk1\n\n chunk2\n \n \n \n chunk3\n", + "html": "
chunk1\n\nchunk2\n\n\n\nchunk3\n
\n", + "example": 111, + "start_line": 1817, + "end_line": 1834, + "section": "Indented code blocks" + }, + { + "markdown": " chunk1\n \n chunk2\n", + "html": "
chunk1\n  \n  chunk2\n
\n", + "example": 112, + "start_line": 1840, + "end_line": 1849, + "section": "Indented code blocks" + }, + { + "markdown": "Foo\n bar\n\n", + "html": "

Foo\nbar

\n", + "example": 113, + "start_line": 1855, + "end_line": 1862, + "section": "Indented code blocks" + }, + { + "markdown": " foo\nbar\n", + "html": "
foo\n
\n

bar

\n", + "example": 114, + "start_line": 1869, + "end_line": 1876, + "section": "Indented code blocks" + }, + { + "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", + "html": "

Heading

\n
foo\n
\n

Heading

\n
foo\n
\n
\n", + "example": 115, + "start_line": 1882, + "end_line": 1897, + "section": "Indented code blocks" + }, + { + "markdown": " foo\n bar\n", + "html": "
    foo\nbar\n
\n", + "example": 116, + "start_line": 1902, + "end_line": 1909, + "section": "Indented code blocks" + }, + { + "markdown": "\n \n foo\n \n\n", + "html": "
foo\n
\n", + "example": 117, + "start_line": 1915, + "end_line": 1924, + "section": "Indented code blocks" + }, + { + "markdown": " foo \n", + "html": "
foo  \n
\n", + "example": 118, + "start_line": 1929, + "end_line": 1934, + "section": "Indented code blocks" + }, + { + "markdown": "```\n<\n >\n```\n", + "html": "
<\n >\n
\n", + "example": 119, + "start_line": 1984, + "end_line": 1993, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~\n<\n >\n~~~\n", + "html": "
<\n >\n
\n", + "example": 120, + "start_line": 1998, + "end_line": 2007, + "section": "Fenced code blocks" + }, + { + "markdown": "``\nfoo\n``\n", + "html": "

foo

\n", + "example": 121, + "start_line": 2011, + "end_line": 2017, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n~~~\n```\n", + "html": "
aaa\n~~~\n
\n", + "example": 122, + "start_line": 2022, + "end_line": 2031, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~\naaa\n```\n~~~\n", + "html": "
aaa\n```\n
\n", + "example": 123, + "start_line": 2034, + "end_line": 2043, + "section": "Fenced code blocks" + }, + { + "markdown": "````\naaa\n```\n``````\n", + "html": "
aaa\n```\n
\n", + "example": 124, + "start_line": 2048, + "end_line": 2057, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~\naaa\n~~~\n~~~~\n", + "html": "
aaa\n~~~\n
\n", + "example": 125, + "start_line": 2060, + "end_line": 2069, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n", + "html": "
\n", + "example": 126, + "start_line": 2075, + "end_line": 2079, + "section": "Fenced code blocks" + }, + { + "markdown": "`````\n\n```\naaa\n", + "html": "
\n```\naaa\n
\n", + "example": 127, + "start_line": 2082, + "end_line": 2092, + "section": "Fenced code blocks" + }, + { + "markdown": "> ```\n> aaa\n\nbbb\n", + "html": "
\n
aaa\n
\n
\n

bbb

\n", + "example": 128, + "start_line": 2095, + "end_line": 2106, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n\n \n```\n", + "html": "
\n  \n
\n", + "example": 129, + "start_line": 2111, + "end_line": 2120, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n```\n", + "html": "
\n", + "example": 130, + "start_line": 2125, + "end_line": 2130, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\naaa\n```\n", + "html": "
aaa\naaa\n
\n", + "example": 131, + "start_line": 2137, + "end_line": 2146, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\naaa\n aaa\naaa\n ```\n", + "html": "
aaa\naaa\naaa\n
\n", + "example": 132, + "start_line": 2149, + "end_line": 2160, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\n aaa\n aaa\n ```\n", + "html": "
aaa\n aaa\naaa\n
\n", + "example": 133, + "start_line": 2163, + "end_line": 2174, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\n aaa\n ```\n", + "html": "
```\naaa\n```\n
\n", + "example": 134, + "start_line": 2179, + "end_line": 2188, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n ```\n", + "html": "
aaa\n
\n", + "example": 135, + "start_line": 2194, + "end_line": 2201, + "section": "Fenced code blocks" + }, + { + "markdown": " ```\naaa\n ```\n", + "html": "
aaa\n
\n", + "example": 136, + "start_line": 2204, + "end_line": 2211, + "section": "Fenced code blocks" + }, + { + "markdown": "```\naaa\n ```\n", + "html": "
aaa\n    ```\n
\n", + "example": 137, + "start_line": 2216, + "end_line": 2224, + "section": "Fenced code blocks" + }, + { + "markdown": "``` ```\naaa\n", + "html": "

\naaa

\n", + "example": 138, + "start_line": 2230, + "end_line": 2236, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~~~\naaa\n~~~ ~~\n", + "html": "
aaa\n~~~ ~~\n
\n", + "example": 139, + "start_line": 2239, + "end_line": 2247, + "section": "Fenced code blocks" + }, + { + "markdown": "foo\n```\nbar\n```\nbaz\n", + "html": "

foo

\n
bar\n
\n

baz

\n", + "example": 140, + "start_line": 2253, + "end_line": 2264, + "section": "Fenced code blocks" + }, + { + "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", + "html": "

foo

\n
bar\n
\n

baz

\n", + "example": 141, + "start_line": 2270, + "end_line": 2282, + "section": "Fenced code blocks" + }, + { + "markdown": "```ruby\ndef foo(x)\n return 3\nend\n```\n", + "html": "
def foo(x)\n  return 3\nend\n
\n", + "example": 142, + "start_line": 2292, + "end_line": 2303, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n", + "html": "
def foo(x)\n  return 3\nend\n
\n", + "example": 143, + "start_line": 2306, + "end_line": 2317, + "section": "Fenced code blocks" + }, + { + "markdown": "````;\n````\n", + "html": "
\n", + "example": 144, + "start_line": 2320, + "end_line": 2325, + "section": "Fenced code blocks" + }, + { + "markdown": "``` aa ```\nfoo\n", + "html": "

aa\nfoo

\n", + "example": 145, + "start_line": 2330, + "end_line": 2336, + "section": "Fenced code blocks" + }, + { + "markdown": "~~~ aa ``` ~~~\nfoo\n~~~\n", + "html": "
foo\n
\n", + "example": 146, + "start_line": 2341, + "end_line": 2348, + "section": "Fenced code blocks" + }, + { + "markdown": "```\n``` aaa\n```\n", + "html": "
``` aaa\n
\n", + "example": 147, + "start_line": 2353, + "end_line": 2360, + "section": "Fenced code blocks" + }, + { + "markdown": "
\n
\n**Hello**,\n\n_world_.\n
\n
\n", + "html": "
\n
\n**Hello**,\n

world.\n

\n
\n", + "example": 148, + "start_line": 2432, + "end_line": 2447, + "section": "HTML blocks" + }, + { + "markdown": "\n \n \n \n
\n hi\n
\n\nokay.\n", + "html": "\n \n \n \n
\n hi\n
\n

okay.

\n", + "example": 149, + "start_line": 2461, + "end_line": 2480, + "section": "HTML blocks" + }, + { + "markdown": "
\n*foo*\n", + "example": 151, + "start_line": 2496, + "end_line": 2502, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n*Markdown*\n\n
\n", + "html": "
\n

Markdown

\n
\n", + "example": 152, + "start_line": 2507, + "end_line": 2517, + "section": "HTML blocks" + }, + { + "markdown": "
\n
\n", + "html": "
\n
\n", + "example": 153, + "start_line": 2523, + "end_line": 2531, + "section": "HTML blocks" + }, + { + "markdown": "
\n
\n", + "html": "
\n
\n", + "example": 154, + "start_line": 2534, + "end_line": 2542, + "section": "HTML blocks" + }, + { + "markdown": "
\n*foo*\n\n*bar*\n", + "html": "
\n*foo*\n

bar

\n", + "example": 155, + "start_line": 2546, + "end_line": 2555, + "section": "HTML blocks" + }, + { + "markdown": "
\n", + "html": "\n", + "example": 159, + "start_line": 2595, + "end_line": 2599, + "section": "HTML blocks" + }, + { + "markdown": "
\nfoo\n
\n", + "html": "
\nfoo\n
\n", + "example": 160, + "start_line": 2602, + "end_line": 2610, + "section": "HTML blocks" + }, + { + "markdown": "
\n``` c\nint x = 33;\n```\n", + "html": "
\n``` c\nint x = 33;\n```\n", + "example": 161, + "start_line": 2619, + "end_line": 2629, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 162, + "start_line": 2636, + "end_line": 2644, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 163, + "start_line": 2649, + "end_line": 2657, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", + "example": 164, + "start_line": 2660, + "end_line": 2668, + "section": "HTML blocks" + }, + { + "markdown": "\n*bar*\n", + "html": "\n*bar*\n", + "example": 165, + "start_line": 2671, + "end_line": 2677, + "section": "HTML blocks" + }, + { + "markdown": "\n*foo*\n\n", + "html": "\n*foo*\n\n", + "example": 166, + "start_line": 2686, + "end_line": 2694, + "section": "HTML blocks" + }, + { + "markdown": "\n\n*foo*\n\n\n", + "html": "\n

foo

\n
\n", + "example": 167, + "start_line": 2701, + "end_line": 2711, + "section": "HTML blocks" + }, + { + "markdown": "*foo*\n", + "html": "

foo

\n", + "example": 168, + "start_line": 2719, + "end_line": 2723, + "section": "HTML blocks" + }, + { + "markdown": "
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay\n", + "html": "
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\n

okay

\n", + "example": 169, + "start_line": 2735, + "end_line": 2751, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 170, + "start_line": 2756, + "end_line": 2770, + "section": "HTML blocks" + }, + { + "markdown": "\n", + "html": "\n", + "example": 171, + "start_line": 2775, + "end_line": 2791, + "section": "HTML blocks" + }, + { + "markdown": "\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n", + "html": "\nh1 {color:red;}\n\np {color:blue;}\n\n

okay

\n", + "example": 172, + "start_line": 2795, + "end_line": 2811, + "section": "HTML blocks" + }, + { + "markdown": "\n\nfoo\n", + "html": "\n\nfoo\n", + "example": 173, + "start_line": 2818, + "end_line": 2828, + "section": "HTML blocks" + }, + { + "markdown": ">
\n> foo\n\nbar\n", + "html": "
\n
\nfoo\n
\n

bar

\n", + "example": 174, + "start_line": 2831, + "end_line": 2842, + "section": "HTML blocks" + }, + { + "markdown": "-
\n- foo\n", + "html": "
    \n
  • \n
    \n
  • \n
  • foo
  • \n
\n", + "example": 175, + "start_line": 2845, + "end_line": 2855, + "section": "HTML blocks" + }, + { + "markdown": "\n*foo*\n", + "html": "\n

foo

\n", + "example": 176, + "start_line": 2860, + "end_line": 2866, + "section": "HTML blocks" + }, + { + "markdown": "*bar*\n*baz*\n", + "html": "*bar*\n

baz

\n", + "example": 177, + "start_line": 2869, + "end_line": 2875, + "section": "HTML blocks" + }, + { + "markdown": "1. *bar*\n", + "html": "1. *bar*\n", + "example": 178, + "start_line": 2881, + "end_line": 2889, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 179, + "start_line": 2894, + "end_line": 2906, + "section": "HTML blocks" + }, + { + "markdown": "';\n\n?>\nokay\n", + "html": "';\n\n?>\n

okay

\n", + "example": 180, + "start_line": 2912, + "end_line": 2926, + "section": "HTML blocks" + }, + { + "markdown": "\n", + "html": "\n", + "example": 181, + "start_line": 2931, + "end_line": 2935, + "section": "HTML blocks" + }, + { + "markdown": "\nokay\n", + "html": "\n

okay

\n", + "example": 182, + "start_line": 2940, + "end_line": 2968, + "section": "HTML blocks" + }, + { + "markdown": " \n\n \n", + "html": " \n
<!-- foo -->\n
\n", + "example": 183, + "start_line": 2974, + "end_line": 2982, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n
\n", + "html": "
\n
<div>\n
\n", + "example": 184, + "start_line": 2985, + "end_line": 2993, + "section": "HTML blocks" + }, + { + "markdown": "Foo\n
\nbar\n
\n", + "html": "

Foo

\n
\nbar\n
\n", + "example": 185, + "start_line": 2999, + "end_line": 3009, + "section": "HTML blocks" + }, + { + "markdown": "
\nbar\n
\n*foo*\n", + "html": "
\nbar\n
\n*foo*\n", + "example": 186, + "start_line": 3016, + "end_line": 3026, + "section": "HTML blocks" + }, + { + "markdown": "Foo\n\nbaz\n", + "html": "

Foo\n\nbaz

\n", + "example": 187, + "start_line": 3031, + "end_line": 3039, + "section": "HTML blocks" + }, + { + "markdown": "
\n\n*Emphasized* text.\n\n
\n", + "html": "
\n

Emphasized text.

\n
\n", + "example": 188, + "start_line": 3072, + "end_line": 3082, + "section": "HTML blocks" + }, + { + "markdown": "
\n*Emphasized* text.\n
\n", + "html": "
\n*Emphasized* text.\n
\n", + "example": 189, + "start_line": 3085, + "end_line": 3093, + "section": "HTML blocks" + }, + { + "markdown": "\n\n\n\n\n\n\n\n
\nHi\n
\n", + "html": "\n\n\n\n
\nHi\n
\n", + "example": 190, + "start_line": 3107, + "end_line": 3127, + "section": "HTML blocks" + }, + { + "markdown": "\n\n \n\n \n\n \n\n
\n Hi\n
\n", + "html": "\n \n
<td>\n  Hi\n</td>\n
\n \n
\n", + "example": 191, + "start_line": 3134, + "end_line": 3155, + "section": "HTML blocks" + }, + { + "markdown": "[foo]: /url \"title\"\n\n[foo]\n", + "html": "

foo

\n", + "example": 192, + "start_line": 3183, + "end_line": 3189, + "section": "Link reference definitions" + }, + { + "markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n", + "html": "

foo

\n", + "example": 193, + "start_line": 3192, + "end_line": 3200, + "section": "Link reference definitions" + }, + { + "markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n", + "html": "

Foo*bar]

\n", + "example": 194, + "start_line": 3203, + "end_line": 3209, + "section": "Link reference definitions" + }, + { + "markdown": "[Foo bar]:\n\n'title'\n\n[Foo bar]\n", + "html": "

Foo bar

\n", + "example": 195, + "start_line": 3212, + "end_line": 3220, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n", + "html": "

foo

\n", + "example": 196, + "start_line": 3225, + "end_line": 3239, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n", + "html": "

[foo]: /url 'title

\n

with blank line'

\n

[foo]

\n", + "example": 197, + "start_line": 3244, + "end_line": 3254, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]:\n/url\n\n[foo]\n", + "html": "

foo

\n", + "example": 198, + "start_line": 3259, + "end_line": 3266, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]:\n\n[foo]\n", + "html": "

[foo]:

\n

[foo]

\n", + "example": 199, + "start_line": 3271, + "end_line": 3278, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: <>\n\n[foo]\n", + "html": "

foo

\n", + "example": 200, + "start_line": 3283, + "end_line": 3289, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: (baz)\n\n[foo]\n", + "html": "

[foo]: (baz)

\n

[foo]

\n", + "example": 201, + "start_line": 3294, + "end_line": 3301, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", + "html": "

foo

\n", + "example": 202, + "start_line": 3307, + "end_line": 3313, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n[foo]: url\n", + "html": "

foo

\n", + "example": 203, + "start_line": 3318, + "end_line": 3324, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", + "html": "

foo

\n", + "example": 204, + "start_line": 3330, + "end_line": 3337, + "section": "Link reference definitions" + }, + { + "markdown": "[FOO]: /url\n\n[Foo]\n", + "html": "

Foo

\n", + "example": 205, + "start_line": 3343, + "end_line": 3349, + "section": "Link reference definitions" + }, + { + "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", + "html": "

αγω

\n", + "example": 206, + "start_line": 3352, + "end_line": 3358, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n", + "html": "", + "example": 207, + "start_line": 3367, + "end_line": 3370, + "section": "Link reference definitions" + }, + { + "markdown": "[\nfoo\n]: /url\nbar\n", + "html": "

bar

\n", + "example": 208, + "start_line": 3375, + "end_line": 3382, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url \"title\" ok\n", + "html": "

[foo]: /url "title" ok

\n", + "example": 209, + "start_line": 3388, + "end_line": 3392, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n\"title\" ok\n", + "html": "

"title" ok

\n", + "example": 210, + "start_line": 3397, + "end_line": 3402, + "section": "Link reference definitions" + }, + { + "markdown": " [foo]: /url \"title\"\n\n[foo]\n", + "html": "
[foo]: /url "title"\n
\n

[foo]

\n", + "example": 211, + "start_line": 3408, + "end_line": 3416, + "section": "Link reference definitions" + }, + { + "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", + "html": "
[foo]: /url\n
\n

[foo]

\n", + "example": 212, + "start_line": 3422, + "end_line": 3432, + "section": "Link reference definitions" + }, + { + "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", + "html": "

Foo\n[bar]: /baz

\n

[bar]

\n", + "example": 213, + "start_line": 3437, + "end_line": 3446, + "section": "Link reference definitions" + }, + { + "markdown": "# [Foo]\n[foo]: /url\n> bar\n", + "html": "

Foo

\n
\n

bar

\n
\n", + "example": 214, + "start_line": 3452, + "end_line": 3461, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\nbar\n===\n[foo]\n", + "html": "

bar

\n

foo

\n", + "example": 215, + "start_line": 3463, + "end_line": 3471, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /url\n===\n[foo]\n", + "html": "

===\nfoo

\n", + "example": 216, + "start_line": 3473, + "end_line": 3480, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", + "html": "

foo,\nbar,\nbaz

\n", + "example": 217, + "start_line": 3486, + "end_line": 3499, + "section": "Link reference definitions" + }, + { + "markdown": "[foo]\n\n> [foo]: /url\n", + "html": "

foo

\n
\n
\n", + "example": 218, + "start_line": 3507, + "end_line": 3515, + "section": "Link reference definitions" + }, + { + "markdown": "aaa\n\nbbb\n", + "html": "

aaa

\n

bbb

\n", + "example": 219, + "start_line": 3529, + "end_line": 3536, + "section": "Paragraphs" + }, + { + "markdown": "aaa\nbbb\n\nccc\nddd\n", + "html": "

aaa\nbbb

\n

ccc\nddd

\n", + "example": 220, + "start_line": 3541, + "end_line": 3552, + "section": "Paragraphs" + }, + { + "markdown": "aaa\n\n\nbbb\n", + "html": "

aaa

\n

bbb

\n", + "example": 221, + "start_line": 3557, + "end_line": 3565, + "section": "Paragraphs" + }, + { + "markdown": " aaa\n bbb\n", + "html": "

aaa\nbbb

\n", + "example": 222, + "start_line": 3570, + "end_line": 3576, + "section": "Paragraphs" + }, + { + "markdown": "aaa\n bbb\n ccc\n", + "html": "

aaa\nbbb\nccc

\n", + "example": 223, + "start_line": 3582, + "end_line": 3590, + "section": "Paragraphs" + }, + { + "markdown": " aaa\nbbb\n", + "html": "

aaa\nbbb

\n", + "example": 224, + "start_line": 3596, + "end_line": 3602, + "section": "Paragraphs" + }, + { + "markdown": " aaa\nbbb\n", + "html": "
aaa\n
\n

bbb

\n", + "example": 225, + "start_line": 3605, + "end_line": 3612, + "section": "Paragraphs" + }, + { + "markdown": "aaa \nbbb \n", + "html": "

aaa
\nbbb

\n", + "example": 226, + "start_line": 3619, + "end_line": 3625, + "section": "Paragraphs" + }, + { + "markdown": " \n\naaa\n \n\n# aaa\n\n \n", + "html": "

aaa

\n

aaa

\n", + "example": 227, + "start_line": 3636, + "end_line": 3648, + "section": "Blank lines" + }, + { + "markdown": "> # Foo\n> bar\n> baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 228, + "start_line": 3704, + "end_line": 3714, + "section": "Block quotes" + }, + { + "markdown": "># Foo\n>bar\n> baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 229, + "start_line": 3719, + "end_line": 3729, + "section": "Block quotes" + }, + { + "markdown": " > # Foo\n > bar\n > baz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 230, + "start_line": 3734, + "end_line": 3744, + "section": "Block quotes" + }, + { + "markdown": " > # Foo\n > bar\n > baz\n", + "html": "
> # Foo\n> bar\n> baz\n
\n", + "example": 231, + "start_line": 3749, + "end_line": 3758, + "section": "Block quotes" + }, + { + "markdown": "> # Foo\n> bar\nbaz\n", + "html": "
\n

Foo

\n

bar\nbaz

\n
\n", + "example": 232, + "start_line": 3764, + "end_line": 3774, + "section": "Block quotes" + }, + { + "markdown": "> bar\nbaz\n> foo\n", + "html": "
\n

bar\nbaz\nfoo

\n
\n", + "example": 233, + "start_line": 3780, + "end_line": 3790, + "section": "Block quotes" + }, + { + "markdown": "> foo\n---\n", + "html": "
\n

foo

\n
\n
\n", + "example": 234, + "start_line": 3804, + "end_line": 3812, + "section": "Block quotes" + }, + { + "markdown": "> - foo\n- bar\n", + "html": "
\n
    \n
  • foo
  • \n
\n
\n
    \n
  • bar
  • \n
\n", + "example": 235, + "start_line": 3824, + "end_line": 3836, + "section": "Block quotes" + }, + { + "markdown": "> foo\n bar\n", + "html": "
\n
foo\n
\n
\n
bar\n
\n", + "example": 236, + "start_line": 3842, + "end_line": 3852, + "section": "Block quotes" + }, + { + "markdown": "> ```\nfoo\n```\n", + "html": "
\n
\n
\n

foo

\n
\n", + "example": 237, + "start_line": 3855, + "end_line": 3865, + "section": "Block quotes" + }, + { + "markdown": "> foo\n - bar\n", + "html": "
\n

foo\n- bar

\n
\n", + "example": 238, + "start_line": 3871, + "end_line": 3879, + "section": "Block quotes" + }, + { + "markdown": ">\n", + "html": "
\n
\n", + "example": 239, + "start_line": 3895, + "end_line": 3900, + "section": "Block quotes" + }, + { + "markdown": ">\n> \n> \n", + "html": "
\n
\n", + "example": 240, + "start_line": 3903, + "end_line": 3910, + "section": "Block quotes" + }, + { + "markdown": ">\n> foo\n> \n", + "html": "
\n

foo

\n
\n", + "example": 241, + "start_line": 3915, + "end_line": 3923, + "section": "Block quotes" + }, + { + "markdown": "> foo\n\n> bar\n", + "html": "
\n

foo

\n
\n
\n

bar

\n
\n", + "example": 242, + "start_line": 3928, + "end_line": 3939, + "section": "Block quotes" + }, + { + "markdown": "> foo\n> bar\n", + "html": "
\n

foo\nbar

\n
\n", + "example": 243, + "start_line": 3950, + "end_line": 3958, + "section": "Block quotes" + }, + { + "markdown": "> foo\n>\n> bar\n", + "html": "
\n

foo

\n

bar

\n
\n", + "example": 244, + "start_line": 3963, + "end_line": 3972, + "section": "Block quotes" + }, + { + "markdown": "foo\n> bar\n", + "html": "

foo

\n
\n

bar

\n
\n", + "example": 245, + "start_line": 3977, + "end_line": 3985, + "section": "Block quotes" + }, + { + "markdown": "> aaa\n***\n> bbb\n", + "html": "
\n

aaa

\n
\n
\n
\n

bbb

\n
\n", + "example": 246, + "start_line": 3991, + "end_line": 4003, + "section": "Block quotes" + }, + { + "markdown": "> bar\nbaz\n", + "html": "
\n

bar\nbaz

\n
\n", + "example": 247, + "start_line": 4009, + "end_line": 4017, + "section": "Block quotes" + }, + { + "markdown": "> bar\n\nbaz\n", + "html": "
\n

bar

\n
\n

baz

\n", + "example": 248, + "start_line": 4020, + "end_line": 4029, + "section": "Block quotes" + }, + { + "markdown": "> bar\n>\nbaz\n", + "html": "
\n

bar

\n
\n

baz

\n", + "example": 249, + "start_line": 4032, + "end_line": 4041, + "section": "Block quotes" + }, + { + "markdown": "> > > foo\nbar\n", + "html": "
\n
\n
\n

foo\nbar

\n
\n
\n
\n", + "example": 250, + "start_line": 4048, + "end_line": 4060, + "section": "Block quotes" + }, + { + "markdown": ">>> foo\n> bar\n>>baz\n", + "html": "
\n
\n
\n

foo\nbar\nbaz

\n
\n
\n
\n", + "example": 251, + "start_line": 4063, + "end_line": 4077, + "section": "Block quotes" + }, + { + "markdown": "> code\n\n> not code\n", + "html": "
\n
code\n
\n
\n
\n

not code

\n
\n", + "example": 252, + "start_line": 4085, + "end_line": 4097, + "section": "Block quotes" + }, + { + "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", + "html": "

A paragraph\nwith two lines.

\n
indented code\n
\n
\n

A block quote.

\n
\n", + "example": 253, + "start_line": 4139, + "end_line": 4154, + "section": "List items" + }, + { + "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 254, + "start_line": 4161, + "end_line": 4180, + "section": "List items" + }, + { + "markdown": "- one\n\n two\n", + "html": "
    \n
  • one
  • \n
\n

two

\n", + "example": 255, + "start_line": 4194, + "end_line": 4203, + "section": "List items" + }, + { + "markdown": "- one\n\n two\n", + "html": "
    \n
  • \n

    one

    \n

    two

    \n
  • \n
\n", + "example": 256, + "start_line": 4206, + "end_line": 4217, + "section": "List items" + }, + { + "markdown": " - one\n\n two\n", + "html": "
    \n
  • one
  • \n
\n
 two\n
\n", + "example": 257, + "start_line": 4220, + "end_line": 4230, + "section": "List items" + }, + { + "markdown": " - one\n\n two\n", + "html": "
    \n
  • \n

    one

    \n

    two

    \n
  • \n
\n", + "example": 258, + "start_line": 4233, + "end_line": 4244, + "section": "List items" + }, + { + "markdown": " > > 1. one\n>>\n>> two\n", + "html": "
\n
\n
    \n
  1. \n

    one

    \n

    two

    \n
  2. \n
\n
\n
\n", + "example": 259, + "start_line": 4255, + "end_line": 4270, + "section": "List items" + }, + { + "markdown": ">>- one\n>>\n > > two\n", + "html": "
\n
\n
    \n
  • one
  • \n
\n

two

\n
\n
\n", + "example": 260, + "start_line": 4282, + "end_line": 4295, + "section": "List items" + }, + { + "markdown": "-one\n\n2.two\n", + "html": "

-one

\n

2.two

\n", + "example": 261, + "start_line": 4301, + "end_line": 4308, + "section": "List items" + }, + { + "markdown": "- foo\n\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 262, + "start_line": 4314, + "end_line": 4326, + "section": "List items" + }, + { + "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", + "html": "
    \n
  1. \n

    foo

    \n
    bar\n
    \n

    baz

    \n
    \n

    bam

    \n
    \n
  2. \n
\n", + "example": 263, + "start_line": 4331, + "end_line": 4353, + "section": "List items" + }, + { + "markdown": "- Foo\n\n bar\n\n\n baz\n", + "html": "
    \n
  • \n

    Foo

    \n
    bar\n\n\nbaz\n
    \n
  • \n
\n", + "example": 264, + "start_line": 4359, + "end_line": 4377, + "section": "List items" + }, + { + "markdown": "123456789. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 265, + "start_line": 4381, + "end_line": 4387, + "section": "List items" + }, + { + "markdown": "1234567890. not ok\n", + "html": "

1234567890. not ok

\n", + "example": 266, + "start_line": 4390, + "end_line": 4394, + "section": "List items" + }, + { + "markdown": "0. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 267, + "start_line": 4399, + "end_line": 4405, + "section": "List items" + }, + { + "markdown": "003. ok\n", + "html": "
    \n
  1. ok
  2. \n
\n", + "example": 268, + "start_line": 4408, + "end_line": 4414, + "section": "List items" + }, + { + "markdown": "-1. not ok\n", + "html": "

-1. not ok

\n", + "example": 269, + "start_line": 4419, + "end_line": 4423, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n
    bar\n
    \n
  • \n
\n", + "example": 270, + "start_line": 4442, + "end_line": 4454, + "section": "List items" + }, + { + "markdown": " 10. foo\n\n bar\n", + "html": "
    \n
  1. \n

    foo

    \n
    bar\n
    \n
  2. \n
\n", + "example": 271, + "start_line": 4459, + "end_line": 4471, + "section": "List items" + }, + { + "markdown": " indented code\n\nparagraph\n\n more code\n", + "html": "
indented code\n
\n

paragraph

\n
more code\n
\n", + "example": 272, + "start_line": 4478, + "end_line": 4490, + "section": "List items" + }, + { + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "html": "
    \n
  1. \n
    indented code\n
    \n

    paragraph

    \n
    more code\n
    \n
  2. \n
\n", + "example": 273, + "start_line": 4493, + "end_line": 4509, + "section": "List items" + }, + { + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "html": "
    \n
  1. \n
     indented code\n
    \n

    paragraph

    \n
    more code\n
    \n
  2. \n
\n", + "example": 274, + "start_line": 4515, + "end_line": 4531, + "section": "List items" + }, + { + "markdown": " foo\n\nbar\n", + "html": "

foo

\n

bar

\n", + "example": 275, + "start_line": 4542, + "end_line": 4549, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • foo
  • \n
\n

bar

\n", + "example": 276, + "start_line": 4552, + "end_line": 4561, + "section": "List items" + }, + { + "markdown": "- foo\n\n bar\n", + "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", + "example": 277, + "start_line": 4569, + "end_line": 4580, + "section": "List items" + }, + { + "markdown": "-\n foo\n-\n ```\n bar\n ```\n-\n baz\n", + "html": "
    \n
  • foo
  • \n
  • \n
    bar\n
    \n
  • \n
  • \n
    baz\n
    \n
  • \n
\n", + "example": 278, + "start_line": 4596, + "end_line": 4617, + "section": "List items" + }, + { + "markdown": "- \n foo\n", + "html": "
    \n
  • foo
  • \n
\n", + "example": 279, + "start_line": 4622, + "end_line": 4629, + "section": "List items" + }, + { + "markdown": "-\n\n foo\n", + "html": "
    \n
  • \n
\n

foo

\n", + "example": 280, + "start_line": 4636, + "end_line": 4645, + "section": "List items" + }, + { + "markdown": "- foo\n-\n- bar\n", + "html": "
    \n
  • foo
  • \n
  • \n
  • bar
  • \n
\n", + "example": 281, + "start_line": 4650, + "end_line": 4660, + "section": "List items" + }, + { + "markdown": "- foo\n- \n- bar\n", + "html": "
    \n
  • foo
  • \n
  • \n
  • bar
  • \n
\n", + "example": 282, + "start_line": 4665, + "end_line": 4675, + "section": "List items" + }, + { + "markdown": "1. foo\n2.\n3. bar\n", + "html": "
    \n
  1. foo
  2. \n
  3. \n
  4. bar
  5. \n
\n", + "example": 283, + "start_line": 4680, + "end_line": 4690, + "section": "List items" + }, + { + "markdown": "*\n", + "html": "
    \n
  • \n
\n", + "example": 284, + "start_line": 4695, + "end_line": 4701, + "section": "List items" + }, + { + "markdown": "foo\n*\n\nfoo\n1.\n", + "html": "

foo\n*

\n

foo\n1.

\n", + "example": 285, + "start_line": 4705, + "end_line": 4716, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 286, + "start_line": 4727, + "end_line": 4746, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 287, + "start_line": 4751, + "end_line": 4770, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 288, + "start_line": 4775, + "end_line": 4794, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
\n", + "example": 289, + "start_line": 4799, + "end_line": 4814, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
    \n
  1. \n

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n
  2. \n
\n", + "example": 290, + "start_line": 4829, + "end_line": 4848, + "section": "List items" + }, + { + "markdown": " 1. A paragraph\n with two lines.\n", + "html": "
    \n
  1. A paragraph\nwith two lines.
  2. \n
\n", + "example": 291, + "start_line": 4853, + "end_line": 4861, + "section": "List items" + }, + { + "markdown": "> 1. > Blockquote\ncontinued here.\n", + "html": "
\n
    \n
  1. \n
    \n

    Blockquote\ncontinued here.

    \n
    \n
  2. \n
\n
\n", + "example": 292, + "start_line": 4866, + "end_line": 4880, + "section": "List items" + }, + { + "markdown": "> 1. > Blockquote\n> continued here.\n", + "html": "
\n
    \n
  1. \n
    \n

    Blockquote\ncontinued here.

    \n
    \n
  2. \n
\n
\n", + "example": 293, + "start_line": 4883, + "end_line": 4897, + "section": "List items" + }, + { + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "html": "
    \n
  • foo\n
      \n
    • bar\n
        \n
      • baz\n
          \n
        • boo
        • \n
        \n
      • \n
      \n
    • \n
    \n
  • \n
\n", + "example": 294, + "start_line": 4911, + "end_line": 4932, + "section": "List items" + }, + { + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
  • baz
  • \n
  • boo
  • \n
\n", + "example": 295, + "start_line": 4937, + "end_line": 4949, + "section": "List items" + }, + { + "markdown": "10) foo\n - bar\n", + "html": "
    \n
  1. foo\n
      \n
    • bar
    • \n
    \n
  2. \n
\n", + "example": 296, + "start_line": 4954, + "end_line": 4965, + "section": "List items" + }, + { + "markdown": "10) foo\n - bar\n", + "html": "
    \n
  1. foo
  2. \n
\n
    \n
  • bar
  • \n
\n", + "example": 297, + "start_line": 4970, + "end_line": 4980, + "section": "List items" + }, + { + "markdown": "- - foo\n", + "html": "
    \n
  • \n
      \n
    • foo
    • \n
    \n
  • \n
\n", + "example": 298, + "start_line": 4985, + "end_line": 4995, + "section": "List items" + }, + { + "markdown": "1. - 2. foo\n", + "html": "
    \n
  1. \n
      \n
    • \n
        \n
      1. foo
      2. \n
      \n
    • \n
    \n
  2. \n
\n", + "example": 299, + "start_line": 4998, + "end_line": 5012, + "section": "List items" + }, + { + "markdown": "- # Foo\n- Bar\n ---\n baz\n", + "html": "
    \n
  • \n

    Foo

    \n
  • \n
  • \n

    Bar

    \nbaz
  • \n
\n", + "example": 300, + "start_line": 5017, + "end_line": 5031, + "section": "List items" + }, + { + "markdown": "- foo\n- bar\n+ baz\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
\n
    \n
  • baz
  • \n
\n", + "example": 301, + "start_line": 5253, + "end_line": 5265, + "section": "Lists" + }, + { + "markdown": "1. foo\n2. bar\n3) baz\n", + "html": "
    \n
  1. foo
  2. \n
  3. bar
  4. \n
\n
    \n
  1. baz
  2. \n
\n", + "example": 302, + "start_line": 5268, + "end_line": 5280, + "section": "Lists" + }, + { + "markdown": "Foo\n- bar\n- baz\n", + "html": "

Foo

\n
    \n
  • bar
  • \n
  • baz
  • \n
\n", + "example": 303, + "start_line": 5287, + "end_line": 5297, + "section": "Lists" + }, + { + "markdown": "The number of windows in my house is\n14. The number of doors is 6.\n", + "html": "

The number of windows in my house is\n14. The number of doors is 6.

\n", + "example": 304, + "start_line": 5364, + "end_line": 5370, + "section": "Lists" + }, + { + "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", + "html": "

The number of windows in my house is

\n
    \n
  1. The number of doors is 6.
  2. \n
\n", + "example": 305, + "start_line": 5374, + "end_line": 5382, + "section": "Lists" + }, + { + "markdown": "- foo\n\n- bar\n\n\n- baz\n", + "html": "
    \n
  • \n

    foo

    \n
  • \n
  • \n

    bar

    \n
  • \n
  • \n

    baz

    \n
  • \n
\n", + "example": 306, + "start_line": 5388, + "end_line": 5407, + "section": "Lists" + }, + { + "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", + "html": "
    \n
  • foo\n
      \n
    • bar\n
        \n
      • \n

        baz

        \n

        bim

        \n
      • \n
      \n
    • \n
    \n
  • \n
\n", + "example": 307, + "start_line": 5409, + "end_line": 5431, + "section": "Lists" + }, + { + "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", + "html": "
    \n
  • foo
  • \n
  • bar
  • \n
\n\n
    \n
  • baz
  • \n
  • bim
  • \n
\n", + "example": 308, + "start_line": 5439, + "end_line": 5457, + "section": "Lists" + }, + { + "markdown": "- foo\n\n notcode\n\n- foo\n\n\n\n code\n", + "html": "
    \n
  • \n

    foo

    \n

    notcode

    \n
  • \n
  • \n

    foo

    \n
  • \n
\n\n
code\n
\n", + "example": 309, + "start_line": 5460, + "end_line": 5483, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n - d\n - e\n - f\n- g\n", + "html": "
    \n
  • a
  • \n
  • b
  • \n
  • c
  • \n
  • d
  • \n
  • e
  • \n
  • f
  • \n
  • g
  • \n
\n", + "example": 310, + "start_line": 5491, + "end_line": 5509, + "section": "Lists" + }, + { + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "html": "
    \n
  1. \n

    a

    \n
  2. \n
  3. \n

    b

    \n
  4. \n
  5. \n

    c

    \n
  6. \n
\n", + "example": 311, + "start_line": 5512, + "end_line": 5530, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n - d\n - e\n", + "html": "
    \n
  • a
  • \n
  • b
  • \n
  • c
  • \n
  • d\n- e
  • \n
\n", + "example": 312, + "start_line": 5536, + "end_line": 5550, + "section": "Lists" + }, + { + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "html": "
    \n
  1. \n

    a

    \n
  2. \n
  3. \n

    b

    \n
  4. \n
\n
3. c\n
\n", + "example": 313, + "start_line": 5556, + "end_line": 5573, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n- c\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n
  • \n
  • \n

    c

    \n
  • \n
\n", + "example": 314, + "start_line": 5579, + "end_line": 5596, + "section": "Lists" + }, + { + "markdown": "* a\n*\n\n* c\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n
  • \n

    c

    \n
  • \n
\n", + "example": 315, + "start_line": 5601, + "end_line": 5616, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n c\n- d\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n

    c

    \n
  • \n
  • \n

    d

    \n
  • \n
\n", + "example": 316, + "start_line": 5623, + "end_line": 5642, + "section": "Lists" + }, + { + "markdown": "- a\n- b\n\n [ref]: /url\n- d\n", + "html": "
    \n
  • \n

    a

    \n
  • \n
  • \n

    b

    \n
  • \n
  • \n

    d

    \n
  • \n
\n", + "example": 317, + "start_line": 5645, + "end_line": 5663, + "section": "Lists" + }, + { + "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", + "html": "
    \n
  • a
  • \n
  • \n
    b\n\n\n
    \n
  • \n
  • c
  • \n
\n", + "example": 318, + "start_line": 5668, + "end_line": 5687, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n\n c\n- d\n", + "html": "
    \n
  • a\n
      \n
    • \n

      b

      \n

      c

      \n
    • \n
    \n
  • \n
  • d
  • \n
\n", + "example": 319, + "start_line": 5694, + "end_line": 5712, + "section": "Lists" + }, + { + "markdown": "* a\n > b\n >\n* c\n", + "html": "
    \n
  • a\n
    \n

    b

    \n
    \n
  • \n
  • c
  • \n
\n", + "example": 320, + "start_line": 5718, + "end_line": 5732, + "section": "Lists" + }, + { + "markdown": "- a\n > b\n ```\n c\n ```\n- d\n", + "html": "
    \n
  • a\n
    \n

    b

    \n
    \n
    c\n
    \n
  • \n
  • d
  • \n
\n", + "example": 321, + "start_line": 5738, + "end_line": 5756, + "section": "Lists" + }, + { + "markdown": "- a\n", + "html": "
    \n
  • a
  • \n
\n", + "example": 322, + "start_line": 5761, + "end_line": 5767, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n", + "html": "
    \n
  • a\n
      \n
    • b
    • \n
    \n
  • \n
\n", + "example": 323, + "start_line": 5770, + "end_line": 5781, + "section": "Lists" + }, + { + "markdown": "1. ```\n foo\n ```\n\n bar\n", + "html": "
    \n
  1. \n
    foo\n
    \n

    bar

    \n
  2. \n
\n", + "example": 324, + "start_line": 5787, + "end_line": 5801, + "section": "Lists" + }, + { + "markdown": "* foo\n * bar\n\n baz\n", + "html": "
    \n
  • \n

    foo

    \n
      \n
    • bar
    • \n
    \n

    baz

    \n
  • \n
\n", + "example": 325, + "start_line": 5806, + "end_line": 5821, + "section": "Lists" + }, + { + "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", + "html": "
    \n
  • \n

    a

    \n
      \n
    • b
    • \n
    • c
    • \n
    \n
  • \n
  • \n

    d

    \n
      \n
    • e
    • \n
    • f
    • \n
    \n
  • \n
\n", + "example": 326, + "start_line": 5824, + "end_line": 5849, + "section": "Lists" + }, + { + "markdown": "`hi`lo`\n", + "html": "

hilo`

\n", + "example": 327, + "start_line": 5858, + "end_line": 5862, + "section": "Inlines" + }, + { + "markdown": "`foo`\n", + "html": "

foo

\n", + "example": 328, + "start_line": 5890, + "end_line": 5894, + "section": "Code spans" + }, + { + "markdown": "`` foo ` bar ``\n", + "html": "

foo ` bar

\n", + "example": 329, + "start_line": 5901, + "end_line": 5905, + "section": "Code spans" + }, + { + "markdown": "` `` `\n", + "html": "

``

\n", + "example": 330, + "start_line": 5911, + "end_line": 5915, + "section": "Code spans" + }, + { + "markdown": "` `` `\n", + "html": "

``

\n", + "example": 331, + "start_line": 5919, + "end_line": 5923, + "section": "Code spans" + }, + { + "markdown": "` a`\n", + "html": "

a

\n", + "example": 332, + "start_line": 5928, + "end_line": 5932, + "section": "Code spans" + }, + { + "markdown": "` b `\n", + "html": "

 b 

\n", + "example": 333, + "start_line": 5937, + "end_line": 5941, + "section": "Code spans" + }, + { + "markdown": "` `\n` `\n", + "html": "

 \n

\n", + "example": 334, + "start_line": 5945, + "end_line": 5951, + "section": "Code spans" + }, + { + "markdown": "``\nfoo\nbar \nbaz\n``\n", + "html": "

foo bar baz

\n", + "example": 335, + "start_line": 5956, + "end_line": 5964, + "section": "Code spans" + }, + { + "markdown": "``\nfoo \n``\n", + "html": "

foo

\n", + "example": 336, + "start_line": 5966, + "end_line": 5972, + "section": "Code spans" + }, + { + "markdown": "`foo bar \nbaz`\n", + "html": "

foo bar baz

\n", + "example": 337, + "start_line": 5977, + "end_line": 5982, + "section": "Code spans" + }, + { + "markdown": "`foo\\`bar`\n", + "html": "

foo\\bar`

\n", + "example": 338, + "start_line": 5994, + "end_line": 5998, + "section": "Code spans" + }, + { + "markdown": "``foo`bar``\n", + "html": "

foo`bar

\n", + "example": 339, + "start_line": 6005, + "end_line": 6009, + "section": "Code spans" + }, + { + "markdown": "` foo `` bar `\n", + "html": "

foo `` bar

\n", + "example": 340, + "start_line": 6011, + "end_line": 6015, + "section": "Code spans" + }, + { + "markdown": "*foo`*`\n", + "html": "

*foo*

\n", + "example": 341, + "start_line": 6023, + "end_line": 6027, + "section": "Code spans" + }, + { + "markdown": "[not a `link](/foo`)\n", + "html": "

[not a link](/foo)

\n", + "example": 342, + "start_line": 6032, + "end_line": 6036, + "section": "Code spans" + }, + { + "markdown": "``\n", + "html": "

<a href="">`

\n", + "example": 343, + "start_line": 6042, + "end_line": 6046, + "section": "Code spans" + }, + { + "markdown": "
`\n", + "html": "

`

\n", + "example": 344, + "start_line": 6051, + "end_line": 6055, + "section": "Code spans" + }, + { + "markdown": "``\n", + "html": "

<http://foo.bar.baz>`

\n", + "example": 345, + "start_line": 6060, + "end_line": 6064, + "section": "Code spans" + }, + { + "markdown": "`\n", + "html": "

http://foo.bar.`baz`

\n", + "example": 346, + "start_line": 6069, + "end_line": 6073, + "section": "Code spans" + }, + { + "markdown": "```foo``\n", + "html": "

```foo``

\n", + "example": 347, + "start_line": 6079, + "end_line": 6083, + "section": "Code spans" + }, + { + "markdown": "`foo\n", + "html": "

`foo

\n", + "example": 348, + "start_line": 6086, + "end_line": 6090, + "section": "Code spans" + }, + { + "markdown": "`foo``bar``\n", + "html": "

`foobar

\n", + "example": 349, + "start_line": 6095, + "end_line": 6099, + "section": "Code spans" + }, + { + "markdown": "*foo bar*\n", + "html": "

foo bar

\n", + "example": 350, + "start_line": 6312, + "end_line": 6316, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a * foo bar*\n", + "html": "

a * foo bar*

\n", + "example": 351, + "start_line": 6322, + "end_line": 6326, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a*\"foo\"*\n", + "html": "

a*"foo"*

\n", + "example": 352, + "start_line": 6333, + "end_line": 6337, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "* a *\n", + "html": "

* a *

\n", + "example": 353, + "start_line": 6342, + "end_line": 6346, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo*bar*\n", + "html": "

foobar

\n", + "example": 354, + "start_line": 6351, + "end_line": 6355, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5*6*78\n", + "html": "

5678

\n", + "example": 355, + "start_line": 6358, + "end_line": 6362, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo bar_\n", + "html": "

foo bar

\n", + "example": 356, + "start_line": 6367, + "end_line": 6371, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_ foo bar_\n", + "html": "

_ foo bar_

\n", + "example": 357, + "start_line": 6377, + "end_line": 6381, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a_\"foo\"_\n", + "html": "

a_"foo"_

\n", + "example": 358, + "start_line": 6387, + "end_line": 6391, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo_bar_\n", + "html": "

foo_bar_

\n", + "example": 359, + "start_line": 6396, + "end_line": 6400, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5_6_78\n", + "html": "

5_6_78

\n", + "example": 360, + "start_line": 6403, + "end_line": 6407, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "пристаням_стремятся_\n", + "html": "

пристаням_стремятся_

\n", + "example": 361, + "start_line": 6410, + "end_line": 6414, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "aa_\"bb\"_cc\n", + "html": "

aa_"bb"_cc

\n", + "example": 362, + "start_line": 6420, + "end_line": 6424, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo-_(bar)_\n", + "html": "

foo-(bar)

\n", + "example": 363, + "start_line": 6431, + "end_line": 6435, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo*\n", + "html": "

_foo*

\n", + "example": 364, + "start_line": 6443, + "end_line": 6447, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo bar *\n", + "html": "

*foo bar *

\n", + "example": 365, + "start_line": 6453, + "end_line": 6457, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo bar\n*\n", + "html": "

*foo bar\n*

\n", + "example": 366, + "start_line": 6462, + "end_line": 6468, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(*foo)\n", + "html": "

*(*foo)

\n", + "example": 367, + "start_line": 6475, + "end_line": 6479, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(*foo*)*\n", + "html": "

(foo)

\n", + "example": 368, + "start_line": 6485, + "end_line": 6489, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo*bar\n", + "html": "

foobar

\n", + "example": 369, + "start_line": 6494, + "end_line": 6498, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo bar _\n", + "html": "

_foo bar _

\n", + "example": 370, + "start_line": 6507, + "end_line": 6511, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(_foo)\n", + "html": "

_(_foo)

\n", + "example": 371, + "start_line": 6517, + "end_line": 6521, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(_foo_)_\n", + "html": "

(foo)

\n", + "example": 372, + "start_line": 6526, + "end_line": 6530, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo_bar\n", + "html": "

_foo_bar

\n", + "example": 373, + "start_line": 6535, + "end_line": 6539, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_пристаням_стремятся\n", + "html": "

_пристаням_стремятся

\n", + "example": 374, + "start_line": 6542, + "end_line": 6546, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo_bar_baz_\n", + "html": "

foo_bar_baz

\n", + "example": 375, + "start_line": 6549, + "end_line": 6553, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(bar)_.\n", + "html": "

(bar).

\n", + "example": 376, + "start_line": 6560, + "end_line": 6564, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo bar**\n", + "html": "

foo bar

\n", + "example": 377, + "start_line": 6569, + "end_line": 6573, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "** foo bar**\n", + "html": "

** foo bar**

\n", + "example": 378, + "start_line": 6579, + "end_line": 6583, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a**\"foo\"**\n", + "html": "

a**"foo"**

\n", + "example": 379, + "start_line": 6590, + "end_line": 6594, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo**bar**\n", + "html": "

foobar

\n", + "example": 380, + "start_line": 6599, + "end_line": 6603, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo bar__\n", + "html": "

foo bar

\n", + "example": 381, + "start_line": 6608, + "end_line": 6612, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__ foo bar__\n", + "html": "

__ foo bar__

\n", + "example": 382, + "start_line": 6618, + "end_line": 6622, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__\nfoo bar__\n", + "html": "

__\nfoo bar__

\n", + "example": 383, + "start_line": 6626, + "end_line": 6632, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "a__\"foo\"__\n", + "html": "

a__"foo"__

\n", + "example": 384, + "start_line": 6638, + "end_line": 6642, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo__bar__\n", + "html": "

foo__bar__

\n", + "example": 385, + "start_line": 6647, + "end_line": 6651, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "5__6__78\n", + "html": "

5__6__78

\n", + "example": 386, + "start_line": 6654, + "end_line": 6658, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "пристаням__стремятся__\n", + "html": "

пристаням__стремятся__

\n", + "example": 387, + "start_line": 6661, + "end_line": 6665, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo, __bar__, baz__\n", + "html": "

foo, bar, baz

\n", + "example": 388, + "start_line": 6668, + "end_line": 6672, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo-__(bar)__\n", + "html": "

foo-(bar)

\n", + "example": 389, + "start_line": 6679, + "end_line": 6683, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo bar **\n", + "html": "

**foo bar **

\n", + "example": 390, + "start_line": 6692, + "end_line": 6696, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**(**foo)\n", + "html": "

**(**foo)

\n", + "example": 391, + "start_line": 6705, + "end_line": 6709, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*(**foo**)*\n", + "html": "

(foo)

\n", + "example": 392, + "start_line": 6715, + "end_line": 6719, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", + "html": "

Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

\n", + "example": 393, + "start_line": 6722, + "end_line": 6728, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo \"*bar*\" foo**\n", + "html": "

foo "bar" foo

\n", + "example": 394, + "start_line": 6731, + "end_line": 6735, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo**bar\n", + "html": "

foobar

\n", + "example": 395, + "start_line": 6740, + "end_line": 6744, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo bar __\n", + "html": "

__foo bar __

\n", + "example": 396, + "start_line": 6752, + "end_line": 6756, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__(__foo)\n", + "html": "

__(__foo)

\n", + "example": 397, + "start_line": 6762, + "end_line": 6766, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_(__foo__)_\n", + "html": "

(foo)

\n", + "example": 398, + "start_line": 6772, + "end_line": 6776, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__bar\n", + "html": "

__foo__bar

\n", + "example": 399, + "start_line": 6781, + "end_line": 6785, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__пристаням__стремятся\n", + "html": "

__пристаням__стремятся

\n", + "example": 400, + "start_line": 6788, + "end_line": 6792, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__bar__baz__\n", + "html": "

foo__bar__baz

\n", + "example": 401, + "start_line": 6795, + "end_line": 6799, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__(bar)__.\n", + "html": "

(bar).

\n", + "example": 402, + "start_line": 6806, + "end_line": 6810, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo [bar](/url)*\n", + "html": "

foo bar

\n", + "example": 403, + "start_line": 6818, + "end_line": 6822, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo\nbar*\n", + "html": "

foo\nbar

\n", + "example": 404, + "start_line": 6825, + "end_line": 6831, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo __bar__ baz_\n", + "html": "

foo bar baz

\n", + "example": 405, + "start_line": 6837, + "end_line": 6841, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo _bar_ baz_\n", + "html": "

foo bar baz

\n", + "example": 406, + "start_line": 6844, + "end_line": 6848, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo_ bar_\n", + "html": "

foo bar

\n", + "example": 407, + "start_line": 6851, + "end_line": 6855, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo *bar**\n", + "html": "

foo bar

\n", + "example": 408, + "start_line": 6858, + "end_line": 6862, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar** baz*\n", + "html": "

foo bar baz

\n", + "example": 409, + "start_line": 6865, + "end_line": 6869, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar**baz*\n", + "html": "

foobarbaz

\n", + "example": 410, + "start_line": 6871, + "end_line": 6875, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar*\n", + "html": "

foo**bar

\n", + "example": 411, + "start_line": 6895, + "end_line": 6899, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo** bar*\n", + "html": "

foo bar

\n", + "example": 412, + "start_line": 6908, + "end_line": 6912, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar***\n", + "html": "

foo bar

\n", + "example": 413, + "start_line": 6915, + "end_line": 6919, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**bar***\n", + "html": "

foobar

\n", + "example": 414, + "start_line": 6922, + "end_line": 6926, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo***bar***baz\n", + "html": "

foobarbaz

\n", + "example": 415, + "start_line": 6933, + "end_line": 6937, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo******bar*********baz\n", + "html": "

foobar***baz

\n", + "example": 416, + "start_line": 6939, + "end_line": 6943, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo **bar *baz* bim** bop*\n", + "html": "

foo bar baz bim bop

\n", + "example": 417, + "start_line": 6948, + "end_line": 6952, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo [*bar*](/url)*\n", + "html": "

foo bar

\n", + "example": 418, + "start_line": 6955, + "end_line": 6959, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "** is not an empty emphasis\n", + "html": "

** is not an empty emphasis

\n", + "example": 419, + "start_line": 6964, + "end_line": 6968, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**** is not an empty strong emphasis\n", + "html": "

**** is not an empty strong emphasis

\n", + "example": 420, + "start_line": 6971, + "end_line": 6975, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo [bar](/url)**\n", + "html": "

foo bar

\n", + "example": 421, + "start_line": 6984, + "end_line": 6988, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo\nbar**\n", + "html": "

foo\nbar

\n", + "example": 422, + "start_line": 6991, + "end_line": 6997, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo _bar_ baz__\n", + "html": "

foo bar baz

\n", + "example": 423, + "start_line": 7003, + "end_line": 7007, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo __bar__ baz__\n", + "html": "

foo bar baz

\n", + "example": 424, + "start_line": 7010, + "end_line": 7014, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo__ bar__\n", + "html": "

foo bar

\n", + "example": 425, + "start_line": 7017, + "end_line": 7021, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo **bar****\n", + "html": "

foo bar

\n", + "example": 426, + "start_line": 7024, + "end_line": 7028, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar* baz**\n", + "html": "

foo bar baz

\n", + "example": 427, + "start_line": 7031, + "end_line": 7035, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo*bar*baz**\n", + "html": "

foobarbaz

\n", + "example": 428, + "start_line": 7038, + "end_line": 7042, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo* bar**\n", + "html": "

foo bar

\n", + "example": 429, + "start_line": 7045, + "end_line": 7049, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar***\n", + "html": "

foo bar

\n", + "example": 430, + "start_line": 7052, + "end_line": 7056, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo *bar **baz**\nbim* bop**\n", + "html": "

foo bar baz\nbim bop

\n", + "example": 431, + "start_line": 7061, + "end_line": 7067, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo [*bar*](/url)**\n", + "html": "

foo bar

\n", + "example": 432, + "start_line": 7070, + "end_line": 7074, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__ is not an empty emphasis\n", + "html": "

__ is not an empty emphasis

\n", + "example": 433, + "start_line": 7079, + "end_line": 7083, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____ is not an empty strong emphasis\n", + "html": "

____ is not an empty strong emphasis

\n", + "example": 434, + "start_line": 7086, + "end_line": 7090, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo ***\n", + "html": "

foo ***

\n", + "example": 435, + "start_line": 7096, + "end_line": 7100, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *\\**\n", + "html": "

foo *

\n", + "example": 436, + "start_line": 7103, + "end_line": 7107, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *_*\n", + "html": "

foo _

\n", + "example": 437, + "start_line": 7110, + "end_line": 7114, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo *****\n", + "html": "

foo *****

\n", + "example": 438, + "start_line": 7117, + "end_line": 7121, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo **\\***\n", + "html": "

foo *

\n", + "example": 439, + "start_line": 7124, + "end_line": 7128, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo **_**\n", + "html": "

foo _

\n", + "example": 440, + "start_line": 7131, + "end_line": 7135, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo*\n", + "html": "

*foo

\n", + "example": 441, + "start_line": 7142, + "end_line": 7146, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo**\n", + "html": "

foo*

\n", + "example": 442, + "start_line": 7149, + "end_line": 7153, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo**\n", + "html": "

*foo

\n", + "example": 443, + "start_line": 7156, + "end_line": 7160, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "****foo*\n", + "html": "

***foo

\n", + "example": 444, + "start_line": 7163, + "end_line": 7167, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo***\n", + "html": "

foo*

\n", + "example": 445, + "start_line": 7170, + "end_line": 7174, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo****\n", + "html": "

foo***

\n", + "example": 446, + "start_line": 7177, + "end_line": 7181, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo ___\n", + "html": "

foo ___

\n", + "example": 447, + "start_line": 7187, + "end_line": 7191, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _\\__\n", + "html": "

foo _

\n", + "example": 448, + "start_line": 7194, + "end_line": 7198, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _*_\n", + "html": "

foo *

\n", + "example": 449, + "start_line": 7201, + "end_line": 7205, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo _____\n", + "html": "

foo _____

\n", + "example": 450, + "start_line": 7208, + "end_line": 7212, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo __\\___\n", + "html": "

foo _

\n", + "example": 451, + "start_line": 7215, + "end_line": 7219, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "foo __*__\n", + "html": "

foo *

\n", + "example": 452, + "start_line": 7222, + "end_line": 7226, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo_\n", + "html": "

_foo

\n", + "example": 453, + "start_line": 7229, + "end_line": 7233, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo__\n", + "html": "

foo_

\n", + "example": 454, + "start_line": 7240, + "end_line": 7244, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "___foo__\n", + "html": "

_foo

\n", + "example": 455, + "start_line": 7247, + "end_line": 7251, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo_\n", + "html": "

___foo

\n", + "example": 456, + "start_line": 7254, + "end_line": 7258, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo___\n", + "html": "

foo_

\n", + "example": 457, + "start_line": 7261, + "end_line": 7265, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo____\n", + "html": "

foo___

\n", + "example": 458, + "start_line": 7268, + "end_line": 7272, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo**\n", + "html": "

foo

\n", + "example": 459, + "start_line": 7278, + "end_line": 7282, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*_foo_*\n", + "html": "

foo

\n", + "example": 460, + "start_line": 7285, + "end_line": 7289, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__foo__\n", + "html": "

foo

\n", + "example": 461, + "start_line": 7292, + "end_line": 7296, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_*foo*_\n", + "html": "

foo

\n", + "example": 462, + "start_line": 7299, + "end_line": 7303, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "****foo****\n", + "html": "

foo

\n", + "example": 463, + "start_line": 7309, + "end_line": 7313, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "____foo____\n", + "html": "

foo

\n", + "example": 464, + "start_line": 7316, + "end_line": 7320, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "******foo******\n", + "html": "

foo

\n", + "example": 465, + "start_line": 7327, + "end_line": 7331, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "***foo***\n", + "html": "

foo

\n", + "example": 466, + "start_line": 7336, + "end_line": 7340, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_____foo_____\n", + "html": "

foo

\n", + "example": 467, + "start_line": 7343, + "end_line": 7347, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo _bar* baz_\n", + "html": "

foo _bar baz_

\n", + "example": 468, + "start_line": 7352, + "end_line": 7356, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo __bar *baz bim__ bam*\n", + "html": "

foo bar *baz bim bam

\n", + "example": 469, + "start_line": 7359, + "end_line": 7363, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**foo **bar baz**\n", + "html": "

**foo bar baz

\n", + "example": 470, + "start_line": 7368, + "end_line": 7372, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*foo *bar baz*\n", + "html": "

*foo bar baz

\n", + "example": 471, + "start_line": 7375, + "end_line": 7379, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*[bar*](/url)\n", + "html": "

*bar*

\n", + "example": 472, + "start_line": 7384, + "end_line": 7388, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_foo [bar_](/url)\n", + "html": "

_foo bar_

\n", + "example": 473, + "start_line": 7391, + "end_line": 7395, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*\n", + "html": "

*

\n", + "example": 474, + "start_line": 7398, + "end_line": 7402, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**\n", + "html": "

**

\n", + "example": 475, + "start_line": 7405, + "end_line": 7409, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__\n", + "html": "

__

\n", + "example": 476, + "start_line": 7412, + "end_line": 7416, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "*a `*`*\n", + "html": "

a *

\n", + "example": 477, + "start_line": 7419, + "end_line": 7423, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "_a `_`_\n", + "html": "

a _

\n", + "example": 478, + "start_line": 7426, + "end_line": 7430, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "**a\n", + "html": "

**ahttp://foo.bar/?q=**

\n", + "example": 479, + "start_line": 7433, + "end_line": 7437, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "__a\n", + "html": "

__ahttp://foo.bar/?q=__

\n", + "example": 480, + "start_line": 7440, + "end_line": 7444, + "section": "Emphasis and strong emphasis" + }, + { + "markdown": "[link](/uri \"title\")\n", + "html": "

link

\n", + "example": 481, + "start_line": 7528, + "end_line": 7532, + "section": "Links" + }, + { + "markdown": "[link](/uri)\n", + "html": "

link

\n", + "example": 482, + "start_line": 7538, + "end_line": 7542, + "section": "Links" + }, + { + "markdown": "[](./target.md)\n", + "html": "

\n", + "example": 483, + "start_line": 7544, + "end_line": 7548, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

link

\n", + "example": 484, + "start_line": 7551, + "end_line": 7555, + "section": "Links" + }, + { + "markdown": "[link](<>)\n", + "html": "

link

\n", + "example": 485, + "start_line": 7558, + "end_line": 7562, + "section": "Links" + }, + { + "markdown": "[]()\n", + "html": "

\n", + "example": 486, + "start_line": 7565, + "end_line": 7569, + "section": "Links" + }, + { + "markdown": "[link](/my uri)\n", + "html": "

[link](/my uri)

\n", + "example": 487, + "start_line": 7574, + "end_line": 7578, + "section": "Links" + }, + { + "markdown": "[link](
)\n", + "html": "

link

\n", + "example": 488, + "start_line": 7580, + "end_line": 7584, + "section": "Links" + }, + { + "markdown": "[link](foo\nbar)\n", + "html": "

[link](foo\nbar)

\n", + "example": 489, + "start_line": 7589, + "end_line": 7595, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

[link]()

\n", + "example": 490, + "start_line": 7597, + "end_line": 7603, + "section": "Links" + }, + { + "markdown": "[a]()\n", + "html": "

a

\n", + "example": 491, + "start_line": 7608, + "end_line": 7612, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

[link](<foo>)

\n", + "example": 492, + "start_line": 7616, + "end_line": 7620, + "section": "Links" + }, + { + "markdown": "[a](\n[a](c)\n", + "html": "

[a](<b)c\n[a](<b)c>\n[a](c)

\n", + "example": 493, + "start_line": 7625, + "end_line": 7633, + "section": "Links" + }, + { + "markdown": "[link](\\(foo\\))\n", + "html": "

link

\n", + "example": 494, + "start_line": 7637, + "end_line": 7641, + "section": "Links" + }, + { + "markdown": "[link](foo(and(bar)))\n", + "html": "

link

\n", + "example": 495, + "start_line": 7646, + "end_line": 7650, + "section": "Links" + }, + { + "markdown": "[link](foo(and(bar))\n", + "html": "

[link](foo(and(bar))

\n", + "example": 496, + "start_line": 7655, + "end_line": 7659, + "section": "Links" + }, + { + "markdown": "[link](foo\\(and\\(bar\\))\n", + "html": "

link

\n", + "example": 497, + "start_line": 7662, + "end_line": 7666, + "section": "Links" + }, + { + "markdown": "[link]()\n", + "html": "

link

\n", + "example": 498, + "start_line": 7669, + "end_line": 7673, + "section": "Links" + }, + { + "markdown": "[link](foo\\)\\:)\n", + "html": "

link

\n", + "example": 499, + "start_line": 7679, + "end_line": 7683, + "section": "Links" + }, + { + "markdown": "[link](#fragment)\n\n[link](http://example.com#fragment)\n\n[link](http://example.com?foo=3#frag)\n", + "html": "

link

\n

link

\n

link

\n", + "example": 500, + "start_line": 7688, + "end_line": 7698, + "section": "Links" + }, + { + "markdown": "[link](foo\\bar)\n", + "html": "

link

\n", + "example": 501, + "start_line": 7704, + "end_line": 7708, + "section": "Links" + }, + { + "markdown": "[link](foo%20bä)\n", + "html": "

link

\n", + "example": 502, + "start_line": 7720, + "end_line": 7724, + "section": "Links" + }, + { + "markdown": "[link](\"title\")\n", + "html": "

link

\n", + "example": 503, + "start_line": 7731, + "end_line": 7735, + "section": "Links" + }, + { + "markdown": "[link](/url \"title\")\n[link](/url 'title')\n[link](/url (title))\n", + "html": "

link\nlink\nlink

\n", + "example": 504, + "start_line": 7740, + "end_line": 7748, + "section": "Links" + }, + { + "markdown": "[link](/url \"title \\\""\")\n", + "html": "

link

\n", + "example": 505, + "start_line": 7754, + "end_line": 7758, + "section": "Links" + }, + { + "markdown": "[link](/url \"title\")\n", + "html": "

link

\n", + "example": 506, + "start_line": 7765, + "end_line": 7769, + "section": "Links" + }, + { + "markdown": "[link](/url \"title \"and\" title\")\n", + "html": "

[link](/url "title "and" title")

\n", + "example": 507, + "start_line": 7774, + "end_line": 7778, + "section": "Links" + }, + { + "markdown": "[link](/url 'title \"and\" title')\n", + "html": "

link

\n", + "example": 508, + "start_line": 7783, + "end_line": 7787, + "section": "Links" + }, + { + "markdown": "[link]( /uri\n \"title\" )\n", + "html": "

link

\n", + "example": 509, + "start_line": 7808, + "end_line": 7813, + "section": "Links" + }, + { + "markdown": "[link] (/uri)\n", + "html": "

[link] (/uri)

\n", + "example": 510, + "start_line": 7819, + "end_line": 7823, + "section": "Links" + }, + { + "markdown": "[link [foo [bar]]](/uri)\n", + "html": "

link [foo [bar]]

\n", + "example": 511, + "start_line": 7829, + "end_line": 7833, + "section": "Links" + }, + { + "markdown": "[link] bar](/uri)\n", + "html": "

[link] bar](/uri)

\n", + "example": 512, + "start_line": 7836, + "end_line": 7840, + "section": "Links" + }, + { + "markdown": "[link [bar](/uri)\n", + "html": "

[link bar

\n", + "example": 513, + "start_line": 7843, + "end_line": 7847, + "section": "Links" + }, + { + "markdown": "[link \\[bar](/uri)\n", + "html": "

link [bar

\n", + "example": 514, + "start_line": 7850, + "end_line": 7854, + "section": "Links" + }, + { + "markdown": "[link *foo **bar** `#`*](/uri)\n", + "html": "

link foo bar #

\n", + "example": 515, + "start_line": 7859, + "end_line": 7863, + "section": "Links" + }, + { + "markdown": "[![moon](moon.jpg)](/uri)\n", + "html": "

\"moon\"

\n", + "example": 516, + "start_line": 7866, + "end_line": 7870, + "section": "Links" + }, + { + "markdown": "[foo [bar](/uri)](/uri)\n", + "html": "

[foo bar](/uri)

\n", + "example": 517, + "start_line": 7875, + "end_line": 7879, + "section": "Links" + }, + { + "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", + "html": "

[foo [bar baz](/uri)](/uri)

\n", + "example": 518, + "start_line": 7882, + "end_line": 7886, + "section": "Links" + }, + { + "markdown": "![[[foo](uri1)](uri2)](uri3)\n", + "html": "

\"[foo](uri2)\"

\n", + "example": 519, + "start_line": 7889, + "end_line": 7893, + "section": "Links" + }, + { + "markdown": "*[foo*](/uri)\n", + "html": "

*foo*

\n", + "example": 520, + "start_line": 7899, + "end_line": 7903, + "section": "Links" + }, + { + "markdown": "[foo *bar](baz*)\n", + "html": "

foo *bar

\n", + "example": 521, + "start_line": 7906, + "end_line": 7910, + "section": "Links" + }, + { + "markdown": "*foo [bar* baz]\n", + "html": "

foo [bar baz]

\n", + "example": 522, + "start_line": 7916, + "end_line": 7920, + "section": "Links" + }, + { + "markdown": "[foo \n", + "html": "

[foo

\n", + "example": 523, + "start_line": 7926, + "end_line": 7930, + "section": "Links" + }, + { + "markdown": "[foo`](/uri)`\n", + "html": "

[foo](/uri)

\n", + "example": 524, + "start_line": 7933, + "end_line": 7937, + "section": "Links" + }, + { + "markdown": "[foo\n", + "html": "

[foohttp://example.com/?search=](uri)

\n", + "example": 525, + "start_line": 7940, + "end_line": 7944, + "section": "Links" + }, + { + "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", + "html": "

foo

\n", + "example": 526, + "start_line": 7978, + "end_line": 7984, + "section": "Links" + }, + { + "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", + "html": "

link [foo [bar]]

\n", + "example": 527, + "start_line": 7993, + "end_line": 7999, + "section": "Links" + }, + { + "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", + "html": "

link [bar

\n", + "example": 528, + "start_line": 8002, + "end_line": 8008, + "section": "Links" + }, + { + "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", + "html": "

link foo bar #

\n", + "example": 529, + "start_line": 8013, + "end_line": 8019, + "section": "Links" + }, + { + "markdown": "[![moon](moon.jpg)][ref]\n\n[ref]: /uri\n", + "html": "

\"moon\"

\n", + "example": 530, + "start_line": 8022, + "end_line": 8028, + "section": "Links" + }, + { + "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", + "html": "

[foo bar]ref

\n", + "example": 531, + "start_line": 8033, + "end_line": 8039, + "section": "Links" + }, + { + "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", + "html": "

[foo bar baz]ref

\n", + "example": 532, + "start_line": 8042, + "end_line": 8048, + "section": "Links" + }, + { + "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", + "html": "

*foo*

\n", + "example": 533, + "start_line": 8057, + "end_line": 8063, + "section": "Links" + }, + { + "markdown": "[foo *bar][ref]*\n\n[ref]: /uri\n", + "html": "

foo *bar*

\n", + "example": 534, + "start_line": 8066, + "end_line": 8072, + "section": "Links" + }, + { + "markdown": "[foo \n\n[ref]: /uri\n", + "html": "

[foo

\n", + "example": 535, + "start_line": 8078, + "end_line": 8084, + "section": "Links" + }, + { + "markdown": "[foo`][ref]`\n\n[ref]: /uri\n", + "html": "

[foo][ref]

\n", + "example": 536, + "start_line": 8087, + "end_line": 8093, + "section": "Links" + }, + { + "markdown": "[foo\n\n[ref]: /uri\n", + "html": "

[foohttp://example.com/?search=][ref]

\n", + "example": 537, + "start_line": 8096, + "end_line": 8102, + "section": "Links" + }, + { + "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", + "html": "

foo

\n", + "example": 538, + "start_line": 8107, + "end_line": 8113, + "section": "Links" + }, + { + "markdown": "[ẞ]\n\n[SS]: /url\n", + "html": "

ẞ

\n", + "example": 539, + "start_line": 8118, + "end_line": 8124, + "section": "Links" + }, + { + "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", + "html": "

Baz

\n", + "example": 540, + "start_line": 8130, + "end_line": 8137, + "section": "Links" + }, + { + "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", + "html": "

[foo] bar

\n", + "example": 541, + "start_line": 8143, + "end_line": 8149, + "section": "Links" + }, + { + "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", + "html": "

[foo]\nbar

\n", + "example": 542, + "start_line": 8152, + "end_line": 8160, + "section": "Links" + }, + { + "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", + "html": "

bar

\n", + "example": 543, + "start_line": 8193, + "end_line": 8201, + "section": "Links" + }, + { + "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", + "html": "

[bar][foo!]

\n", + "example": 544, + "start_line": 8208, + "end_line": 8214, + "section": "Links" + }, + { + "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", + "html": "

[foo][ref[]

\n

[ref[]: /uri

\n", + "example": 545, + "start_line": 8220, + "end_line": 8227, + "section": "Links" + }, + { + "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", + "html": "

[foo][ref[bar]]

\n

[ref[bar]]: /uri

\n", + "example": 546, + "start_line": 8230, + "end_line": 8237, + "section": "Links" + }, + { + "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", + "html": "

[[[foo]]]

\n

[[[foo]]]: /url

\n", + "example": 547, + "start_line": 8240, + "end_line": 8247, + "section": "Links" + }, + { + "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", + "html": "

foo

\n", + "example": 548, + "start_line": 8250, + "end_line": 8256, + "section": "Links" + }, + { + "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", + "html": "

bar\\

\n", + "example": 549, + "start_line": 8261, + "end_line": 8267, + "section": "Links" + }, + { + "markdown": "[]\n\n[]: /uri\n", + "html": "

[]

\n

[]: /uri

\n", + "example": 550, + "start_line": 8273, + "end_line": 8280, + "section": "Links" + }, + { + "markdown": "[\n ]\n\n[\n ]: /uri\n", + "html": "

[\n]

\n

[\n]: /uri

\n", + "example": 551, + "start_line": 8283, + "end_line": 8294, + "section": "Links" + }, + { + "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", + "html": "

foo

\n", + "example": 552, + "start_line": 8306, + "end_line": 8312, + "section": "Links" + }, + { + "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

foo bar

\n", + "example": 553, + "start_line": 8315, + "end_line": 8321, + "section": "Links" + }, + { + "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", + "html": "

Foo

\n", + "example": 554, + "start_line": 8326, + "end_line": 8332, + "section": "Links" + }, + { + "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", + "html": "

foo\n[]

\n", + "example": 555, + "start_line": 8339, + "end_line": 8347, + "section": "Links" + }, + { + "markdown": "[foo]\n\n[foo]: /url \"title\"\n", + "html": "

foo

\n", + "example": 556, + "start_line": 8359, + "end_line": 8365, + "section": "Links" + }, + { + "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

foo bar

\n", + "example": 557, + "start_line": 8368, + "end_line": 8374, + "section": "Links" + }, + { + "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

[foo bar]

\n", + "example": 558, + "start_line": 8377, + "end_line": 8383, + "section": "Links" + }, + { + "markdown": "[[bar [foo]\n\n[foo]: /url\n", + "html": "

[[bar foo

\n", + "example": 559, + "start_line": 8386, + "end_line": 8392, + "section": "Links" + }, + { + "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", + "html": "

Foo

\n", + "example": 560, + "start_line": 8397, + "end_line": 8403, + "section": "Links" + }, + { + "markdown": "[foo] bar\n\n[foo]: /url\n", + "html": "

foo bar

\n", + "example": 561, + "start_line": 8408, + "end_line": 8414, + "section": "Links" + }, + { + "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", + "html": "

[foo]

\n", + "example": 562, + "start_line": 8420, + "end_line": 8426, + "section": "Links" + }, + { + "markdown": "[foo*]: /url\n\n*[foo*]\n", + "html": "

*foo*

\n", + "example": 563, + "start_line": 8432, + "end_line": 8438, + "section": "Links" + }, + { + "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", + "html": "

foo

\n", + "example": 564, + "start_line": 8444, + "end_line": 8451, + "section": "Links" + }, + { + "markdown": "[foo][]\n\n[foo]: /url1\n", + "html": "

foo

\n", + "example": 565, + "start_line": 8453, + "end_line": 8459, + "section": "Links" + }, + { + "markdown": "[foo]()\n\n[foo]: /url1\n", + "html": "

foo

\n", + "example": 566, + "start_line": 8463, + "end_line": 8469, + "section": "Links" + }, + { + "markdown": "[foo](not a link)\n\n[foo]: /url1\n", + "html": "

foo(not a link)

\n", + "example": 567, + "start_line": 8471, + "end_line": 8477, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", + "html": "

[foo]bar

\n", + "example": 568, + "start_line": 8482, + "end_line": 8488, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", + "html": "

foobaz

\n", + "example": 569, + "start_line": 8494, + "end_line": 8501, + "section": "Links" + }, + { + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", + "html": "

[foo]bar

\n", + "example": 570, + "start_line": 8507, + "end_line": 8514, + "section": "Links" + }, + { + "markdown": "![foo](/url \"title\")\n", + "html": "

\"foo\"

\n", + "example": 571, + "start_line": 8530, + "end_line": 8534, + "section": "Images" + }, + { + "markdown": "![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 572, + "start_line": 8537, + "end_line": 8543, + "section": "Images" + }, + { + "markdown": "![foo ![bar](/url)](/url2)\n", + "html": "

\"foo

\n", + "example": 573, + "start_line": 8546, + "end_line": 8550, + "section": "Images" + }, + { + "markdown": "![foo [bar](/url)](/url2)\n", + "html": "

\"foo

\n", + "example": 574, + "start_line": 8553, + "end_line": 8557, + "section": "Images" + }, + { + "markdown": "![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 575, + "start_line": 8567, + "end_line": 8573, + "section": "Images" + }, + { + "markdown": "![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"\n", + "html": "

\"foo

\n", + "example": 576, + "start_line": 8576, + "end_line": 8582, + "section": "Images" + }, + { + "markdown": "![foo](train.jpg)\n", + "html": "

\"foo\"

\n", + "example": 577, + "start_line": 8585, + "end_line": 8589, + "section": "Images" + }, + { + "markdown": "My ![foo bar](/path/to/train.jpg \"title\" )\n", + "html": "

My \"foo

\n", + "example": 578, + "start_line": 8592, + "end_line": 8596, + "section": "Images" + }, + { + "markdown": "![foo]()\n", + "html": "

\"foo\"

\n", + "example": 579, + "start_line": 8599, + "end_line": 8603, + "section": "Images" + }, + { + "markdown": "![](/url)\n", + "html": "

\"\"

\n", + "example": 580, + "start_line": 8606, + "end_line": 8610, + "section": "Images" + }, + { + "markdown": "![foo][bar]\n\n[bar]: /url\n", + "html": "

\"foo\"

\n", + "example": 581, + "start_line": 8615, + "end_line": 8621, + "section": "Images" + }, + { + "markdown": "![foo][bar]\n\n[BAR]: /url\n", + "html": "

\"foo\"

\n", + "example": 582, + "start_line": 8624, + "end_line": 8630, + "section": "Images" + }, + { + "markdown": "![foo][]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"

\n", + "example": 583, + "start_line": 8635, + "end_line": 8641, + "section": "Images" + }, + { + "markdown": "![*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

\"foo

\n", + "example": 584, + "start_line": 8644, + "end_line": 8650, + "section": "Images" + }, + { + "markdown": "![Foo][]\n\n[foo]: /url \"title\"\n", + "html": "

\"Foo\"

\n", + "example": 585, + "start_line": 8655, + "end_line": 8661, + "section": "Images" + }, + { + "markdown": "![foo] \n[]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"\n[]

\n", + "example": 586, + "start_line": 8667, + "end_line": 8675, + "section": "Images" + }, + { + "markdown": "![foo]\n\n[foo]: /url \"title\"\n", + "html": "

\"foo\"

\n", + "example": 587, + "start_line": 8680, + "end_line": 8686, + "section": "Images" + }, + { + "markdown": "![*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "html": "

\"foo

\n", + "example": 588, + "start_line": 8689, + "end_line": 8695, + "section": "Images" + }, + { + "markdown": "![[foo]]\n\n[[foo]]: /url \"title\"\n", + "html": "

![[foo]]

\n

[[foo]]: /url "title"

\n", + "example": 589, + "start_line": 8700, + "end_line": 8707, + "section": "Images" + }, + { + "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", + "html": "

\"Foo\"

\n", + "example": 590, + "start_line": 8712, + "end_line": 8718, + "section": "Images" + }, + { + "markdown": "!\\[foo]\n\n[foo]: /url \"title\"\n", + "html": "

![foo]

\n", + "example": 591, + "start_line": 8724, + "end_line": 8730, + "section": "Images" + }, + { + "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", + "html": "

!foo

\n", + "example": 592, + "start_line": 8736, + "end_line": 8742, + "section": "Images" + }, + { + "markdown": "\n", + "html": "

http://foo.bar.baz

\n", + "example": 593, + "start_line": 8769, + "end_line": 8773, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://foo.bar.baz/test?q=hello&id=22&boolean

\n", + "example": 594, + "start_line": 8776, + "end_line": 8780, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

irc://foo.bar:2233/baz

\n", + "example": 595, + "start_line": 8783, + "end_line": 8787, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

MAILTO:FOO@BAR.BAZ

\n", + "example": 596, + "start_line": 8792, + "end_line": 8796, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

a+b+c:d

\n", + "example": 597, + "start_line": 8804, + "end_line": 8808, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

made-up-scheme://foo,bar

\n", + "example": 598, + "start_line": 8811, + "end_line": 8815, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://../

\n", + "example": 599, + "start_line": 8818, + "end_line": 8822, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

localhost:5001/foo

\n", + "example": 600, + "start_line": 8825, + "end_line": 8829, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<http://foo.bar/baz bim>

\n", + "example": 601, + "start_line": 8834, + "end_line": 8838, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

http://example.com/\\[\\

\n", + "example": 602, + "start_line": 8843, + "end_line": 8847, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

foo@bar.example.com

\n", + "example": 603, + "start_line": 8865, + "end_line": 8869, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

foo+special@Bar.baz-bar0.com

\n", + "example": 604, + "start_line": 8872, + "end_line": 8876, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<foo+@bar.example.com>

\n", + "example": 605, + "start_line": 8881, + "end_line": 8885, + "section": "Autolinks" + }, + { + "markdown": "<>\n", + "html": "

<>

\n", + "example": 606, + "start_line": 8890, + "end_line": 8894, + "section": "Autolinks" + }, + { + "markdown": "< http://foo.bar >\n", + "html": "

< http://foo.bar >

\n", + "example": 607, + "start_line": 8897, + "end_line": 8901, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<m:abc>

\n", + "example": 608, + "start_line": 8904, + "end_line": 8908, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

<foo.bar.baz>

\n", + "example": 609, + "start_line": 8911, + "end_line": 8915, + "section": "Autolinks" + }, + { + "markdown": "http://example.com\n", + "html": "

http://example.com

\n", + "example": 610, + "start_line": 8918, + "end_line": 8922, + "section": "Autolinks" + }, + { + "markdown": "foo@bar.example.com\n", + "html": "

foo@bar.example.com

\n", + "example": 611, + "start_line": 8925, + "end_line": 8929, + "section": "Autolinks" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 612, + "start_line": 9006, + "end_line": 9010, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 613, + "start_line": 9015, + "end_line": 9019, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 614, + "start_line": 9024, + "end_line": 9030, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 615, + "start_line": 9035, + "end_line": 9041, + "section": "Raw HTML" + }, + { + "markdown": "Foo \n", + "html": "

Foo

\n", + "example": 616, + "start_line": 9046, + "end_line": 9050, + "section": "Raw HTML" + }, + { + "markdown": "<33> <__>\n", + "html": "

<33> <__>

\n", + "example": 617, + "start_line": 9055, + "end_line": 9059, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a h*#ref="hi">

\n", + "example": 618, + "start_line": 9064, + "end_line": 9068, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a href="hi'> <a href=hi'>

\n", + "example": 619, + "start_line": 9073, + "end_line": 9077, + "section": "Raw HTML" + }, + { + "markdown": "< a><\nfoo>\n\n", + "html": "

< a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop />

\n", + "example": 620, + "start_line": 9082, + "end_line": 9092, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

<a href='bar'title=title>

\n", + "example": 621, + "start_line": 9097, + "end_line": 9101, + "section": "Raw HTML" + }, + { + "markdown": "
\n", + "html": "

\n", + "example": 622, + "start_line": 9106, + "end_line": 9110, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

</a href="foo">

\n", + "example": 623, + "start_line": 9115, + "end_line": 9119, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 624, + "start_line": 9124, + "end_line": 9130, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo <!-- not a comment -- two hyphens -->

\n", + "example": 625, + "start_line": 9133, + "end_line": 9137, + "section": "Raw HTML" + }, + { + "markdown": "foo foo -->\n\nfoo \n", + "html": "

foo <!--> foo -->

\n

foo <!-- foo--->

\n", + "example": 626, + "start_line": 9142, + "end_line": 9149, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 627, + "start_line": 9154, + "end_line": 9158, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 628, + "start_line": 9163, + "end_line": 9167, + "section": "Raw HTML" + }, + { + "markdown": "foo &<]]>\n", + "html": "

foo &<]]>

\n", + "example": 629, + "start_line": 9172, + "end_line": 9176, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 630, + "start_line": 9182, + "end_line": 9186, + "section": "Raw HTML" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 631, + "start_line": 9191, + "end_line": 9195, + "section": "Raw HTML" + }, + { + "markdown": "\n", + "html": "

<a href=""">

\n", + "example": 632, + "start_line": 9198, + "end_line": 9202, + "section": "Raw HTML" + }, + { + "markdown": "foo \nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 633, + "start_line": 9212, + "end_line": 9218, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 634, + "start_line": 9224, + "end_line": 9230, + "section": "Hard line breaks" + }, + { + "markdown": "foo \nbaz\n", + "html": "

foo
\nbaz

\n", + "example": 635, + "start_line": 9235, + "end_line": 9241, + "section": "Hard line breaks" + }, + { + "markdown": "foo \n bar\n", + "html": "

foo
\nbar

\n", + "example": 636, + "start_line": 9246, + "end_line": 9252, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\n bar\n", + "html": "

foo
\nbar

\n", + "example": 637, + "start_line": 9255, + "end_line": 9261, + "section": "Hard line breaks" + }, + { + "markdown": "*foo \nbar*\n", + "html": "

foo
\nbar

\n", + "example": 638, + "start_line": 9267, + "end_line": 9273, + "section": "Hard line breaks" + }, + { + "markdown": "*foo\\\nbar*\n", + "html": "

foo
\nbar

\n", + "example": 639, + "start_line": 9276, + "end_line": 9282, + "section": "Hard line breaks" + }, + { + "markdown": "`code \nspan`\n", + "html": "

code span

\n", + "example": 640, + "start_line": 9287, + "end_line": 9292, + "section": "Hard line breaks" + }, + { + "markdown": "`code\\\nspan`\n", + "html": "

code\\ span

\n", + "example": 641, + "start_line": 9295, + "end_line": 9300, + "section": "Hard line breaks" + }, + { + "markdown": "
\n", + "html": "

\n", + "example": 642, + "start_line": 9305, + "end_line": 9311, + "section": "Hard line breaks" + }, + { + "markdown": "\n", + "html": "

\n", + "example": 643, + "start_line": 9314, + "end_line": 9320, + "section": "Hard line breaks" + }, + { + "markdown": "foo\\\n", + "html": "

foo\\

\n", + "example": 644, + "start_line": 9327, + "end_line": 9331, + "section": "Hard line breaks" + }, + { + "markdown": "foo \n", + "html": "

foo

\n", + "example": 645, + "start_line": 9334, + "end_line": 9338, + "section": "Hard line breaks" + }, + { + "markdown": "### foo\\\n", + "html": "

foo\\

\n", + "example": 646, + "start_line": 9341, + "end_line": 9345, + "section": "Hard line breaks" + }, + { + "markdown": "### foo \n", + "html": "

foo

\n", + "example": 647, + "start_line": 9348, + "end_line": 9352, + "section": "Hard line breaks" + }, + { + "markdown": "foo\nbaz\n", + "html": "

foo\nbaz

\n", + "example": 648, + "start_line": 9363, + "end_line": 9369, + "section": "Soft line breaks" + }, + { + "markdown": "foo \n baz\n", + "html": "

foo\nbaz

\n", + "example": 649, + "start_line": 9375, + "end_line": 9381, + "section": "Soft line breaks" + }, + { + "markdown": "hello $.;'there\n", + "html": "

hello $.;'there

\n", + "example": 650, + "start_line": 9395, + "end_line": 9399, + "section": "Textual content" + }, + { + "markdown": "Foo χρῆν\n", + "html": "

Foo χρῆν

\n", + "example": 651, + "start_line": 9402, + "end_line": 9406, + "section": "Textual content" + }, + { + "markdown": "Multiple spaces\n", + "html": "

Multiple spaces

\n", + "example": 652, + "start_line": 9411, + "end_line": 9415, + "section": "Textual content" + } +] \ No newline at end of file diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/def_list.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/def_list.txt new file mode 100644 index 0000000000000000000000000000000000000000..6c5a210232576e53330d55888c2d041ffeccc145 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/def_list.txt @@ -0,0 +1,172 @@ +# Definition Lists + +```````````````````````````````` example +Term +: definition +. +
+
Term
+
definition
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: definition1 +: definition2 +. +
+
Term
+
definition1
+
definition2
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: definition1 +: definition2 + +paragraph +. +
+
Term
+
definition1
+
definition2
+
+

paragraph

+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. + +Second Term +: This is one definition of the second term. +: This is another definition of the second term. +. +
+
First Term
+
This is the definition of the first term.
+
Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. + +Second Term +: This is one definition of the second term. +: This is another definition of the second term. + +paragraph +. +
+
First Term
+
This is the definition of the first term.
+
Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+

paragraph

+```````````````````````````````` + +```````````````````````````````` example +First Term +: This is the definition of the first term. +Not Second Term +: This is one definition of the second term. +: This is another definition of the second term. + +paragraph +. +
+
First Term
+
This is the definition of the first term. +Not Second Term
+
This is one definition of the second term.
+
This is another definition of the second term.
+
+

paragraph

+```````````````````````````````` + +## Definition with Multiple Lines + +```````````````````````````````` example +Term + +: definition +. +
+
Term
+

definition

+
+
+```````````````````````````````` + + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+

bar

+
+
+```````````````````````````````` + +Leading 4 white spaces + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+

bar

+
+
+```````````````````````````````` + + +```````````````````````````````` example +Term +: foo + + bar +. +
+
Term
+

foo

+
bar
+
+
+```````````````````````````````` + +```````````````````````````````` example +Term +: foo + + - bar + - baz +. +
+
Term
+

foo

+
    +
  • bar
  • +
  • baz
  • +
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/diff-commonmark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/diff-commonmark.txt new file mode 100644 index 0000000000000000000000000000000000000000..9573e2a383b273af5db4a2386d9f9fe35120d9b4 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/diff-commonmark.txt @@ -0,0 +1,76 @@ +# Differences + +Results different than commonmark. + + +## Setext headings + + +Example: 93 + + +```````````````````````````````` example +> foo +bar +=== +. +
+

foo +bar

+
+```````````````````````````````` + +If the dash is less than 3, it is not a `
`, in this case, it +can be rendered into `

`. + +```````````````````````````````` example +- # Foo +- Bar + -- + baz +. +
    +
  • +

    Foo

    +
  • +
  • +

    Bar

    +baz
  • +
+```````````````````````````````` + +## Image + +Example 573 + +```````````````````````````````` example +![foo ![bar](/url)](/url2) +. +

foo ![bar](/url)

+```````````````````````````````` + +## Link + +Example 517 + +```````````````````````````````` example +[foo [bar](/uri)](/uri) +. +

foo [bar](/uri)

+```````````````````````````````` + +Example 518 + +```````````````````````````````` example +[foo *[bar [baz](/uri)](/uri)*](/uri) +. +

foo [bar [baz](/uri)](/uri)

+```````````````````````````````` + +Example 519 + +```````````````````````````````` example +![[[foo](uri1)](uri2)](uri3) +. +

[foo](uri1)

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_admonition.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_admonition.txt new file mode 100644 index 0000000000000000000000000000000000000000..0f962c5e4d44d9fa81effe866998e1fc6f88565d --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_admonition.txt @@ -0,0 +1,129 @@ +# Admonition + +```````````````````````````````` example +```{unknown} Hi + +this is **strong** world +``` +. +
{unknown} Hi
+
+this is **strong** world
+
+```````````````````````````````` + +```````````````````````````````` example +``` +this is code +``` +. +
this is code
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{note} Warning + +message +~~~ +. +
+

Warning

+

message

+
+```````````````````````````````` + +```````````````````````````````` example +~~~{note} A **strong** title + +_message_ +~~~ +. +
+

A strong title

+

message

+
+```````````````````````````````` + +Test with code block. + +```````````````````````````````` example +```{note} + + print() +``` +. +
+

Note

+
print()
+
+```````````````````````````````` + +Test with no message. + +```````````````````````````````` example +~~~{note} Warning +~~~ +. +
+

Warning

+
+```````````````````````````````` + +Test with no ending fence + +```````````````````````````````` example +~~~{note} Warning +. +
+

Warning

+
+```````````````````````````````` + +Test with nested admonition + +```````````````````````````````` example +~~~~~~~{note} +~~~~~~{warning} +~~~~~{tip} +~~~~{caution} +~~~{hint} +``````{danger} +`````{attention} +````{important} +```{error} +``` +```` +````` +`````` +~~~ +~~~~ +~~~~~ +~~~~~~ +~~~~~~~ +. +
+

Note

+
+

Warning

+
+

Tip

+
+

Caution

+
+

Hint

+
+

Danger

+
````{important}
+```{error}
+```
+````
+
+
+
+
+
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_figure.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_figure.txt new file mode 100644 index 0000000000000000000000000000000000000000..0fcd23c1f1280e6e9b17a43fbb8942d21b702254 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_figure.txt @@ -0,0 +1,166 @@ +# Figure + +## No options + +```````````````````````````````` example +~~~{figure} picture.png +~~~ +. +
+
+
+```````````````````````````````` + +## Align options + +```````````````````````````````` example +~~~{figure} picture.png +:align: left +~~~ +. +
+
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{figure} picture.png +:align: invalid +~~~ +. +
+
+
+```````````````````````````````` + +## width and height + +```````````````````````````````` example +~~~{figure} picture.png +:width: 100 +:height: 50 +~~~ +. +
+
+
+```````````````````````````````` + +```````````````````````````````` example +~~~{figure} picture.png +:width: 100px +:height: 50px +~~~ +. +
+
+
+```````````````````````````````` + +```````````````````````````````` example +~~~{figure} picture.png +:figwidth: 400px +~~~ +. +
+
+
+```````````````````````````````` + +## alt option + +```````````````````````````````` example +~~~{figure} picture.png +:alt: description text +~~~ +. +
+
description text
+
+```````````````````````````````` + +## target option + +```````````````````````````````` example +~~~{figure} picture.png +:target: https://lepture.com +~~~ +. +
+ +
+```````````````````````````````` + +## caption + +```````````````````````````````` example +~~~{figure} picture.png +a caption with **emphasis** text +~~~ +. +
+
+
a caption with emphasis text
+
+```````````````````````````````` + +## legend + +```````````````````````````````` example +~~~{figure} picture.png +a caption with **emphasis** text + +> quote +~~~ +. +
+
+
a caption with emphasis text
+
+
+

quote

+
+
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~{figure} picture.png +> quote +~~~ +. +
+
+
+```````````````````````````````` + +## all options + + +```````````````````````````````` example +~~~{figure} picture.png +:figwidth: 400px +:figclass: all-options +:target: https://lepture.com +:alt: description +:align: left +:width: 100 +:height: 50 + +a caption with **emphasis** text + +> quote +~~~ +. +
+description +
a caption with emphasis text
+
+
+

quote

+
+
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_image.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_image.txt new file mode 100644 index 0000000000000000000000000000000000000000..afec622ce413acb5fcbb287e020c4588e892de8c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_image.txt @@ -0,0 +1,102 @@ +# Image + +## No options + +```````````````````````````````` example +~~~{image} picture.png +~~~ +. +
+```````````````````````````````` + +## Align options + +```````````````````````````````` example +~~~{image} picture.png +:align: left +~~~ +. +
+```````````````````````````````` + + +```````````````````````````````` example +~~~{image} picture.png +:align: invalid +~~~ +. +
+```````````````````````````````` + +## width and height + +```````````````````````````````` example +~~~{image} picture.png +:width: 100 +:height: 50 +~~~ +. +
+```````````````````````````````` + +```````````````````````````````` example +~~~{image} picture.png +:width: 100px +:height: 50px +~~~ +. +
+```````````````````````````````` + +## alt option + +```````````````````````````````` example +~~~{image} picture.png +:alt: description text +~~~ +. +
description text
+```````````````````````````````` + +## target option + +```````````````````````````````` example +~~~{image} picture.png +:target: https://lepture.com +~~~ +. + +```````````````````````````````` + +## all options + +```````````````````````````````` example +~~~{image} picture.png +:target: https://lepture.com +:alt: description +:align: left +:width: 100 +:height: 50 +~~~ +. +description +```````````````````````````````` + +## ampersand in source + +```````````````````````````````` example +~~~{image} https://example.com/picture.png?foo=qux&test=me +~~~ +. +
+```````````````````````````````` + +## ampersand in target + +```````````````````````````````` example +~~~{image} picture.png +:target: https://example.com/rickroll?a=1&b=2 +~~~ +. + +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..1744000ce6ca473d1d75fb2d9388d46d3463a64c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fenced_toc.txt @@ -0,0 +1,237 @@ +# Table of Contents + +## No TOC + +```````````````````````````````` example +none +. +

none

+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +. +

H1

+

H2

+```````````````````````````````` + + +## Simple TOC + +```````````````````````````````` example +~~~{toc} +~~~ + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` + +## Invalid Option + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:max-level: s +~~~ +. +

H1

+

H2

+
"max-level" option MUST be integer
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:max-level: 9 +~~~ +. +

H1

+

H2

+
"max-level" option MUST be <= 3
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 + +~~~{toc} +:min-level: 2 +:max-level: 1 +~~~ +. +

H1

+

H2

+
"min-level" option MUST be less than "max-level" option
+```````````````````````````````` + +## Complex + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` + +```{toc} Contents +``` +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+
+Contents + +
+```````````````````````````````` + +## Insane + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B + +```{toc} +``` +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+
+Table of Contents + +
+```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 + +```{toc} +``` +. +

H3

+

H2

+

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) + +```{toc} +``` +. +

foo

+
+Table of Contents + +
+```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +```{toc} +``` +. +

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Collapse TOC + +```````````````````````````````` example + +```{toc} +:collapse: +``` + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fix-commonmark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fix-commonmark.txt new file mode 100644 index 0000000000000000000000000000000000000000..c7870065cc61e07f114050eaaecf60d3db5cbdf9 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/fix-commonmark.txt @@ -0,0 +1,123 @@ +Fix problems that commonmark has. + + +## Links + +Links can't contain links. + +```````````````````````````````` example +[](/foo) +. +

<https://example.com>

+```````````````````````````````` + +```````````````````````````````` example +[](/foo) +. +

<name@example.com>

+```````````````````````````````` + +## Emphasis + +`` doesn't contain ``, `` doesn't contain ``. + +```````````````````````````````` example +*_em_* __**strong**__ ______m______ +. +

_em_ **strong** ______m______

+```````````````````````````````` + +### Non aggressive emphasis + +```````````````````````````````` example +*a **b c* d** +. +

a **b c d**

+```````````````````````````````` + +While CommonMark would render it into: + +``` +

a b c d

+``` + +```````````````````````````````` example +*a **b c* d** +. +

a **b c d**

+```````````````````````````````` + +While CommonMark would render it into: + +``` +

a b c d

+``` + +What if the string is: + +```````````````````````````````` example +*a **b c* d +. +

a **b c d

+```````````````````````````````` + +CommonMark would still be a mess: + +``` +

*a *b c d

+``` + + +## Max depth + + +```````````````````````````````` example +> > > > > > > > b +. +
+
+
+
+
+
+

> > b

+
+
+
+
+
+
+```````````````````````````````` + + +```````````````````````````````` example +- a + - b + - c + - d + - e + - f + - g + - h +. +
    +
  • a
      +
    • b
        +
      • c
          +
        • d
            +
          • e
              +
            • f +- g +- h
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/footnotes.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/footnotes.txt new file mode 100644 index 0000000000000000000000000000000000000000..485cfd87c0a18859af15ec52b8baacad5c44fe6c --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/footnotes.txt @@ -0,0 +1,45 @@ +# Footnotes + +```````````````````````````````` example +none [^1] +. +

none [^1]

+```````````````````````````````` + +```````````````````````````````` example +oneline [^1] + +[^1]: foo +. +

oneline 1

+
+
    +
  1. foo↩

  2. +
+
+```````````````````````````````` + +```````````````````````````````` example +multiple lines [^1] + +[^1]: foo + + one + + two + + three + + four +. +

multiple lines 1

+
four
+
+
    +
  1. foo

    +

    one

    +

    two

    +

    three↩

  2. +
+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/hook_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/hook_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..62a1a1ec79dacaf8854a67e3b48f5a1c1e9d2f4b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/hook_toc.txt @@ -0,0 +1,122 @@ +# Table of Contents + +## Simple TOC + +```````````````````````````````` example +# H1 + +content + +## H2 +. +

H1

+

content

+

H2

+ +```````````````````````````````` + +## Complex TOC + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+ +```````````````````````````````` + +## Insane TOC + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+ +```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 +. +

H3

+

H2

+

H1

+ +```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) +. +

foo

+ +```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +. +

H1

+ +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/hello.md b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/hello.md new file mode 100644 index 0000000000000000000000000000000000000000..5e3d2769d88dd761efbd358b5dd0cb095d652294 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/hello.md @@ -0,0 +1 @@ +> hello diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/hello.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/hello.txt new file mode 100644 index 0000000000000000000000000000000000000000..ce013625030ba8dba906f756967f9e9ca394464a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/hello.txt @@ -0,0 +1 @@ +hello diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/text.html b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/text.html new file mode 100644 index 0000000000000000000000000000000000000000..da12a4c59bef8e4cc80b93ee6c98ebf6e9a10372 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/text.html @@ -0,0 +1 @@ +
include html
diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/text.md b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/text.md new file mode 100644 index 0000000000000000000000000000000000000000..e9faa6cc816e06f743ffb9a1ae753a209607840e --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/include/text.md @@ -0,0 +1,12 @@ +# Include + +.. include:: ./text.md + +.. include:: ./not-exist.md + +.. include:: ./text.html + :encoding: utf-8 + +.. include:: ./hello.md + +.. include:: ../rst_toc.txt diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/insert.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/insert.txt new file mode 100644 index 0000000000000000000000000000000000000000..74d02058f0a66e5598e91d8a84429d17b7c4b62a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/insert.txt @@ -0,0 +1,62 @@ +# Insert + +```````````````````````````````` example +^^insert me +. +

^^insert me

+```````````````````````````````` + + +## normal insert + +```````````````````````````````` example +^^insert me^^ +. +

insert me

+```````````````````````````````` + +```````````````````````````````` example +foo ^^insert me^^ +. +

foo insert me

+```````````````````````````````` + +```````````````````````````````` example +^^insert me^^foo +. +

insert mefoo

+```````````````````````````````` + +```````````````````````````````` example +^^insert me^^^ +. +

^^insert me^^^

+```````````````````````````````` + +## escape insert + +```````````````````````````````` example +^^insert me\^^^ +. +

insert me^

+```````````````````````````````` + +```````````````````````````````` example +^^insert \^\^ me^^ +. +

insert ^^ me

+```````````````````````````````` + +## insert link + +```````````````````````````````` example +^^insert [me^^](/) +. +

insert [me](/)

+```````````````````````````````` + +```````````````````````````````` example +^^[hello](/)^^ +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/mark.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/mark.txt new file mode 100644 index 0000000000000000000000000000000000000000..9c8d2fbc1bf286f937a2ed288f5d497bcfca2136 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/mark.txt @@ -0,0 +1,61 @@ +# Mark + +```````````````````````````````` example +==mark me +. +

==mark me

+```````````````````````````````` + +## normal mark + +```````````````````````````````` example +==mark me== +. +

mark me

+```````````````````````````````` + +```````````````````````````````` example +foo ==mark me== +. +

foo mark me

+```````````````````````````````` + +```````````````````````````````` example +==mark me==foo +. +

mark mefoo

+```````````````````````````````` + +```````````````````````````````` example +==mark me=== +. +

==mark me===

+```````````````````````````````` + +## escape mark + +```````````````````````````````` example +==mark me\=== +. +

mark me=

+```````````````````````````````` + +```````````````````````````````` example +==mark \=\= me== +. +

mark == me

+```````````````````````````````` + +## mark link + +```````````````````````````````` example +==mark [me==](/) +. +

mark [me](/)

+```````````````````````````````` + +```````````````````````````````` example +==[hello](/)== +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/math.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/math.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7afaf9d1d2757c25e797b47ef4803bdeee503ef --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/math.txt @@ -0,0 +1,57 @@ +# Math + +## Block Math + +```````````````````````````````` example +$$ +. +

$$

+```````````````````````````````` + + +```````````````````````````````` example +$$ +\operatorname{ker} f=\{g\in G:f(g)=e_{H}\}{\mbox{.}} +$$ +. +
$$ +\operatorname{ker} f=\{g\in G:f(g)=e_{H}\}{\mbox{.}} +$$
+```````````````````````````````` + +```````````````````````````````` example +$$ +foo +$$ +bar +. +
$$ +foo +$$
+

bar

+```````````````````````````````` + +```````````````````````````````` example +$$ +foo +bar +$$ +. +
$$ +foo +bar +$$
+```````````````````````````````` + + +## Inline Math + +```````````````````````````````` example +The homomorphism $f$ is injective if and only if its kernel is only the +singleton set $e_G$, because otherwise $\exists a,b\in G$ +with $a\neq b$ such that $f(a)=f(b)$. +. +

The homomorphism \(f\) is injective if and only if its kernel is only the +singleton set \(e_G\), because otherwise \(\exists a,b\in G\) +with \(a\neq b\) such that \(f(a)=f(b)\).

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/renderer_markdown.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/renderer_markdown.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd618f9f281f83c0e5f2f51bcb19080e4188011a --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/renderer_markdown.txt @@ -0,0 +1,299 @@ +# MarkdownRenderer + + +## inline + +```````````````````````````````` example +this is _em_, **strong**, and `code` +. +this is *em*, **strong**, and `code` +```````````````````````````````` + +## links + +```````````````````````````````` example +[link], [link][], [text][link], [link](/foo), [link](/foo "title") + +[link]: /url +. +[link][link], [link][link], [text][link], [link](/foo), [link](/foo "title") + +[link]: /url +```````````````````````````````` + +```````````````````````````````` example +[link], [link](https://foo(bar "title") + +[link]: /url "title" +. +[link][link], [link]( "title") + +[link]: /url "title" +```````````````````````````````` + +```````````````````````````````` example +[https://lepture.com](https://lepture.com) + + + + [demo@example.com](mailto:demo@example.com) +. + + + + + +```````````````````````````````` + +## images + +```````````````````````````````` example +[link]: /url + +![link], ![link][], ![alt][link] +. +![link][link], ![link][link], ![alt][link] + +[link]: /url +```````````````````````````````` + +## linebreak + +```````````````````````````````` example +foo\ +bar +. +foo +bar +```````````````````````````````` + +## html + +```````````````````````````````` example +inline html text + +and block html + +
hi
+. +inline html text + +and block html + +
hi
+```````````````````````````````` + +## heading + +```````````````````````````````` example +# h1 +## h2 +### h3 +#### h4 +##### h5 +###### h6 + +h1 +== +. +# h1 + +## h2 + +### h3 + +#### h4 + +##### h5 + +###### h6 + +# h1 +```````````````````````````````` + +## thematic break + +```````````````````````````````` example +hi +*** +. +hi + +*** +```````````````````````````````` + +## code + +```````````````````````````````` example +start + + def foo(): + pass + +end +. +start + +``` +def foo(): + pass +``` + +end +```````````````````````````````` + +```````````````````````````````` example +start +```py +def foo(): + pass +``` +end +. +start + +```py +def foo(): + pass +``` + +end +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ``` + fenced +. +indent code + +~~~ +markdown +``` +fenced +~~~ +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ~~~ + fenced +. +indent code + +``` +markdown +~~~ +fenced +``` +```````````````````````````````` + +```````````````````````````````` example +indent code + + markdown + ``` + fenced + ~~~ +. +indent code + +```` +markdown +``` +fenced +~~~ +```` +```````````````````````````````` + + +## quote + +```````````````````````````````` example +> quote +. +> quote +```````````````````````````````` + +```````````````````````````````` example +hello +> quote +. +hello + +> quote +```````````````````````````````` + +> quote + +> quote +> +> continuation +. +> quote + +> quote +> +> continuation + +## list + +```````````````````````````````` example +- list ++ list +. +- list + ++ list +```````````````````````````````` + +```````````````````````````````` example +- item 1 + item 2 +. +- item 1 + item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + item 2 +- item 3 +. +- item 1 + + item 2 + +- item 3 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + 1. item 2 +. +- item 1 + 1. item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + 2. item 2 +. +- item 1 + + 2. item 2 +```````````````````````````````` + +```````````````````````````````` example +- list +- +. +- list +- +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/renderer_rst.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/renderer_rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..1b2499ddb74fc532191d296612fd19687224ec5b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/renderer_rst.txt @@ -0,0 +1,250 @@ +# RSTRenderer + +## inline + +```````````````````````````````` example +this is _em_, **strong**, and `code` +. +this is *em*, **strong**, and ``code`` +```````````````````````````````` + +```````````````````````````````` example +| escape | +. +\| escape \| +```````````````````````````````` + +## links + +```````````````````````````````` example +this is [link][] and [link](/foo) + +[link]: /url +. +this is `link
`__ and `link `__ +```````````````````````````````` + +## images + +```````````````````````````````` example +this is inline ![alt _text_](/foo) +. +this is inline |img-0| + +.. |img-0| image:: /foo + :alt: alt *text* +```````````````````````````````` + +```````````````````````````````` example +this is figure + +![alt _text_](/foo) +. +this is figure + +.. figure:: /foo + + alt *text* +```````````````````````````````` + +```````````````````````````````` example +this is figure + +![alt _text_](/foo "title") +. +this is figure + +.. figure:: /foo + :alt: title + + alt *text* +```````````````````````````````` + + +## html + +```````````````````````````````` example +ignore inline html text + +but show block html + +
hi
+. +ignore inline html text + +but show block html + +.. raw:: html + +
hi
+```````````````````````````````` + +## line break + +```````````````````````````````` example +hello +world +. +| hello +| world +```````````````````````````````` + +## heading + +```````````````````````````````` example +# h1 +## h2 +### h3 +#### h4 +##### h5 +###### h6 +. +h1 +== + +h2 +-- + +h3 +~~ + +h4 +^^ + +h5 +"" + +h6 +'' +```````````````````````````````` + +## thematic break + +```````````````````````````````` example +hi +*** +. +hi + +-------------- +```````````````````````````````` + +## code + +```````````````````````````````` example +start + + def foo(): + pass + +end +. +start + +:: + + def foo(): + pass + +end +```````````````````````````````` + +```````````````````````````````` example +start + +```py +def foo(): + pass +``` + +end +. +start + +.. code:: py + + def foo(): + pass + +end +```````````````````````````````` + + +## quote + +```````````````````````````````` example +> quote +. + quote +```````````````````````````````` + +```````````````````````````````` example +hello + +> quote +. +hello + + quote +```````````````````````````````` + +```````````````````````````````` example +> hello + +> quote +. + hello + +.. + + quote +```````````````````````````````` + +## list + +```````````````````````````````` example +- list ++ list +. +- list + ++ list +```````````````````````````````` + +```````````````````````````````` example +- item 1 + item 2 +. +- item 1 item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + item 2 +- item 3 +. +- item 1 + + item 2 + +- item 3 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + 1. item 2 +. +- item 1 + 1. item 2 +```````````````````````````````` + +```````````````````````````````` example +- item 1 + + 1. item 2 +. +- item 1 + + 1. item 2 +```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/rst_admonition.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/rst_admonition.txt new file mode 100644 index 0000000000000000000000000000000000000000..b29bda3046fdb97802fefc9a7d16a9439d9efeb6 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/rst_admonition.txt @@ -0,0 +1,46 @@ +# Admonition + +```````````````````````````````` example +.. hello:: Warning + + message +. +
..  hello:: Warning
+
+    message
+
+```````````````````````````````` + +```````````````````````````````` example +.. note:: Warning + + message +. +
+

Warning

+

message

+
+```````````````````````````````` + +Test with code block. + +```````````````````````````````` example +.. note:: + + print() +. +
+

Note

+
print()
+
+```````````````````````````````` + +Test with no message. + +```````````````````````````````` example +.. note:: Warning +. +
+

Warning

+
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/rst_toc.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/rst_toc.txt new file mode 100644 index 0000000000000000000000000000000000000000..d65e7516398316de9532f5f52cd0ccfe182b86f1 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/rst_toc.txt @@ -0,0 +1,223 @@ +# Table of Contents + +## No TOC + +```````````````````````````````` example +none +. +

none

+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +. +

H1

+

H2

+```````````````````````````````` + + +## Simple TOC + +```````````````````````````````` example +.. toc:: + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` + +## Invalid Option + +```````````````````````````````` example +# H1 +## H2 + +.. toc:: + :max-level: s +. +

H1

+

H2

+
"max-level" option MUST be integer
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +.. toc:: + :max-level: 9 +. +

H1

+

H2

+
"max-level" option MUST be <= 3
+```````````````````````````````` + +```````````````````````````````` example +# H1 +## H2 +.. toc:: + :min-level: 2 + :max-level: 1 +. +

H1

+

H2

+
"min-level" option MUST be less than "max-level" option
+```````````````````````````````` + + +## Complex + +```````````````````````````````` example +# H1 +## H2 +### H3 +#### H4 +# H1 B +# H1 `C` + +.. toc:: Contents + :max-level: 3 +. +

H1

+

H2

+

H3

+

H4

+

H1 B

+

H1 C

+
+Contents + +
+```````````````````````````````` + +## Insane + +```````````````````````````````` example +# H1 +### H3 +## H2 +#### H4 +### H3 B +# H1 B +.. toc:: +. +

H1

+

H3

+

H2

+

H4

+

H3 B

+

H1 B

+
+Table of Contents + +
+```````````````````````````````` + +```````````````````````````````` example +### H3 +## H2 +# H1 +.. toc:: +. +

H3

+

H2

+

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Link in Heading + + +```````````````````````````````` example +# [foo](/bar) +.. toc:: +. +

foo

+
+Table of Contents + +
+```````````````````````````````` + +## HTML in Heading + +```````````````````````````````` example +# H1 +.. toc:: +. +

H1

+
+Table of Contents + +
+```````````````````````````````` + +## Collapse TOC + +```````````````````````````````` example +.. toc:: + :collapse: + +# H1 +## H2 +. +
+Table of Contents + +
+

H1

+

H2

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/ruby.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/ruby.txt new file mode 100644 index 0000000000000000000000000000000000000000..d89ebe28e1161ec3915768d72303feaa168f3c63 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/ruby.txt @@ -0,0 +1,64 @@ +# Ruby + + +## ruby without link + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)] +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢(ㄏㄢˋ)字(ㄗˋ)] +. +

漢ㄏㄢˋ字ㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)][] +. +

漢字ㄏㄢˋㄗˋ[]

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)][link] +. +

漢字ㄏㄢˋㄗˋ[link]

+```````````````````````````````` + +## ruby with link + +```````````````````````````````` example +[link]: /url + +[漢字(ㄏㄢˋㄗˋ)][link] +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)]() +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +```````````````````````````````` example +[漢字(ㄏㄢˋㄗˋ)](/url) +. +

漢字ㄏㄢˋㄗˋ

+```````````````````````````````` + +## ruby splits + +```````````````````````````````` example +[漢(かん)][字(じ)] +. +

漢かん字じ

+```````````````````````````````` + +```````````````````````````````` example +[[漢(かん)][字(じ)]](https://jisho.org/search/漢字) +. +

漢かん字じ

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/spoiler.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/spoiler.txt new file mode 100644 index 0000000000000000000000000000000000000000..b1394193004aa9a896ac9212dcab200818613506 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/spoiler.txt @@ -0,0 +1,74 @@ +# Spoiler + +## Block spoiler + +```````````````````````````````` example +>! hi +. +
+

hi

+
+```````````````````````````````` + + +```````````````````````````````` example +>! not +> spoiler +. +
+

! not +spoiler

+
+```````````````````````````````` + +```````````````````````````````` example +>! multiple +>! lines +. +
+

multiple +lines

+
+```````````````````````````````` + +```````````````````````````````` example +>! foo +>! +>! bar +. +
+

foo

+

bar

+
+```````````````````````````````` + +```````````````````````````````` example +>! foo +> +>! bar +. +
+

! foo

+

! bar

+
+```````````````````````````````` + +## Inline spoiler + +```````````````````````````````` example +hi >! hide !< +. +

hi hide

+```````````````````````````````` + +```````````````````````````````` example +hi >!hide !< +. +

hi hide

+```````````````````````````````` + +```````````````````````````````` example +hi >!hide!< +. +

hi hide

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/strikethrough.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/strikethrough.txt new file mode 100644 index 0000000000000000000000000000000000000000..007a7777aefe1f68e20026c6d87675a12623f1b8 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/strikethrough.txt @@ -0,0 +1,46 @@ +# Strikethrough + + +## strikethrough + +```````````````````````````````` example +~~delete me +. +

~~delete me

+```````````````````````````````` + +```````````````````````````````` example +~~delete me~~ +. +

delete me

+```````````````````````````````` + +```````````````````````````````` example +~~delete me~~~ +. +

~~delete me~~~

+```````````````````````````````` + +```````````````````````````````` example +~~delete me\~~~ +. +

delete me~

+```````````````````````````````` + +```````````````````````````````` example +~~delete \~\~ me~~ +. +

delete ~~ me

+```````````````````````````````` + +```````````````````````````````` example +~~delete [me~~](/) +. +

delete [me](/)

+```````````````````````````````` + +```````````````````````````````` example +~~[hello](/)~~ +. +

hello

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/subscript.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/subscript.txt new file mode 100644 index 0000000000000000000000000000000000000000..9e4ef8bad50771b18039cd681d91d51c203128aa --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/subscript.txt @@ -0,0 +1,26 @@ +# Subscript + + +```````````````````````````````` example +CH~3~CH~2~OH +. +

CH3CH2OH

+```````````````````````````````` + +```````````````````````````````` example +text~a\ subscript~ +. +

texta subscript

+```````````````````````````````` + +```````````````````````````````` example +text~a subscript~ +. +

text~a subscript~

+```````````````````````````````` + +```````````````````````````````` example +text~a\~subscript~ +. +

texta~subscript

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/superscript.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/superscript.txt new file mode 100644 index 0000000000000000000000000000000000000000..8f114ca8c9566ddfd1d2800341f2065ded0ad560 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/superscript.txt @@ -0,0 +1,26 @@ +# Superscript + + +```````````````````````````````` example +CH^3^CH^2^OH +. +

CH3CH2OH

+```````````````````````````````` + +```````````````````````````````` example +text^a\ supscript^ +. +

texta supscript

+```````````````````````````````` + +```````````````````````````````` example +text^a supscript^ +. +

text^a supscript^

+```````````````````````````````` + +```````````````````````````````` example +text^a\^supscript^ +. +

texta^supscript

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/table.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/table.txt new file mode 100644 index 0000000000000000000000000000000000000000..ff4e13ae743b2733f0174cca08c10da2a9b6f1f1 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/table.txt @@ -0,0 +1,258 @@ +# Table in Markdown + +https://michelf.ca/projects/php-markdown/extra/#table + + +## nptable + + +```````````````````````````````` example +First Header | Second Header +------------- | ------------- +Content Cell | Content Cell +Content Cell | Content Cell +. + + + + + + + + + + + + + + + + + +
First HeaderSecond Header
Content CellContent Cell
Content CellContent Cell
+```````````````````````````````` + + +## table + +```````````````````````````````` example +| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell | +. + + + + + + + + + + + + + + + + + +
First HeaderSecond Header
Content Cell
Content CellContent Cell
+```````````````````````````````` + + +```````````````````````````````` example +| Command | Description | +| --- | --- | +| git status | List all new or modified files | +| git diff | Show file differences that haven't been staged | +. + + + + + + + + + + + + + + + + + +
CommandDescription
git statusList all new or modified files
git diffShow file differences that haven't been staged
+```````````````````````````````` + +## align table + +```````````````````````````````` example + Left | Center | Right +:---- | :--------: | ------: + a | b | c +. + + + + + + + + + + + + + + + +
LeftCenterRight
abc
+```````````````````````````````` + +```````````````````````````````` example +| Left | Center | Right | +| :--- | :----: | ----: | +| a | b | c | +. + + + + + + + + + + + + + + + +
LeftCenterRight
abc
+```````````````````````````````` + +## Misc Table + +```````````````````````````````` example +| A | | +| - | | +| a | b | +. + + + + + + + + + + + + + +
A
ab
+```````````````````````````````` + +```````````````````````````````` example +A | +- | +a | b +. + + + + + + + + + + + + + +
A
ab
+```````````````````````````````` + + +```````````````````````````````` example +| Foo | Bar | +|-----|-----| +| boo | baz | +| faz | | +. + + + + + + + + + + + + + + + + + +
FooBar
boobaz
faz
+```````````````````````````````` + +## Mismatch length + +```````````````````````````````` example +| First Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell | +. +

| First Header | +| ------------- | ------------- | +| Content Cell | | +| Content Cell | Content Cell |

+```````````````````````````````` + +```````````````````````````````` example +| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | +| Content Cell | Content Cell | +. +

| First Header | Second Header | +| ------------- | ------------- | +| Content Cell | +| Content Cell | Content Cell |

+```````````````````````````````` + +```````````````````````````````` example +A | +- | - | +a | b | c +. +

A |

+
    +
  • | - | +a | b | c
  • +
+```````````````````````````````` + +```````````````````````````````` example +A | B | C +- | - | - +a | b +. +

A | B | C

+
    +
  • | - | - +a | b
  • +
+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/task_lists.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/task_lists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1760acbdd4dd55d815789bc11afad6f2f3a8c3d --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/task_lists.txt @@ -0,0 +1,108 @@ +# Task Lists + +```````````````````````````````` example +- [ ] foo +- [x] bar +- [X] baz +. +
    +
  • foo
  • +
  • bar
  • +
  • baz
  • +
+```````````````````````````````` + +```````````````````````````````` example +- foo +- [ ] bar +. +
    +
  • foo
  • +
  • bar
  • +
+```````````````````````````````` + +```````````````````````````````` example +- foo + +- [ ] bar +- [x] baz + + text +. +
    +
  • foo

    +
  • +
  • bar

    +
  • +
  • baz

    +

    text

    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +1. [ ] foo +2. [x] bar +3. [X] baz +. +
    +
  1. foo
  2. +
  3. bar
  4. +
  5. baz
  6. +
+```````````````````````````````` + +```````````````````````````````` example +- [ ] Task list item + over two lines +. +
    +
  • Task list item +over two lines
  • +
+```````````````````````````````` + +```````````````````````````````` example +- [ ] foo + - [x] bar + - [ ] baz +. +
    +
  • foo
      +
    • bar
    • +
    • baz
    • +
    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +1. [ ] foo + 1. [ ] bar + 2. [ ] baz +. +
    +
  1. foo
      +
    1. bar
    2. +
    3. baz
    4. +
    +
  2. +
+```````````````````````````````` + +```````````````````````````````` example +> - [ ] foo +> - [x] bar +> - [ ] baz +. +
+
    +
  • foo
      +
    • bar
    • +
    • baz
    • +
    +
  • +
+
+```````````````````````````````` \ No newline at end of file diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/url.txt b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/url.txt new file mode 100644 index 0000000000000000000000000000000000000000..669bdd5f34d93942e407aa41569072a6ff6a2f91 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/fixtures/url.txt @@ -0,0 +1,22 @@ +# url plugin + + +```````````````````````````````` example +visit https://lepture.com/ +. +

visit https://lepture.com/

+```````````````````````````````` + + +```````````````````````````````` example +visit [https://lepture.com/](/foo) +. +

visit https://lepture.com/

+```````````````````````````````` + + +```````````````````````````````` example +visit https://lepture.com/ +. +

visit https://lepture.com/

+```````````````````````````````` diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_commonmark.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_commonmark.py new file mode 100644 index 0000000000000000000000000000000000000000..5ece254838b130d5765744897028436efb73b0e6 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_commonmark.py @@ -0,0 +1,76 @@ +import mistune +from tests import BaseTestCase, normalize_html + + +DIFF_CASES = { + 'setext_headings_093', + 'html_blocks_191', # mistune keeps \n + + 'images_573', # image can not be in image + + 'links_495', + 'links_517', # aggressive link group + 'links_518', + 'links_519', + 'links_531', + 'links_532', +} + +IGNORE_CASES = { + # we don't support link title in (title) + 'links_496', + 'links_504', + + # we don't support flanking delimiter run + 'emphasis_and_strong_emphasis_352', + 'emphasis_and_strong_emphasis_367', + 'emphasis_and_strong_emphasis_368', + 'emphasis_and_strong_emphasis_372', + 'emphasis_and_strong_emphasis_379', + 'emphasis_and_strong_emphasis_388', + 'emphasis_and_strong_emphasis_391', + + 'emphasis_and_strong_emphasis_406', + 'emphasis_and_strong_emphasis_407', + 'emphasis_and_strong_emphasis_408', + + 'emphasis_and_strong_emphasis_412', + 'emphasis_and_strong_emphasis_413', + 'emphasis_and_strong_emphasis_414', + 'emphasis_and_strong_emphasis_416', + 'emphasis_and_strong_emphasis_417', + 'emphasis_and_strong_emphasis_418', + + 'emphasis_and_strong_emphasis_424', + 'emphasis_and_strong_emphasis_425', + 'emphasis_and_strong_emphasis_426', + 'emphasis_and_strong_emphasis_429', + 'emphasis_and_strong_emphasis_430', + 'emphasis_and_strong_emphasis_431', + 'emphasis_and_strong_emphasis_460', + 'emphasis_and_strong_emphasis_467', + 'emphasis_and_strong_emphasis_470', + 'emphasis_and_strong_emphasis_471', + 'emphasis_and_strong_emphasis_477', + 'emphasis_and_strong_emphasis_478', +} + +for i in range(441, 447): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) +for i in range(453, 459): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) +for i in range(462, 466): + IGNORE_CASES.add('emphasis_and_strong_emphasis_' + str(i)) + + +class TestCommonMark(BaseTestCase): + @classmethod + def ignore_case(cls, n): + return n in IGNORE_CASES or n in DIFF_CASES + + def assert_case(self, n, text, html): + result = mistune.html(text) + self.assertEqual(normalize_html(result), normalize_html(html)) + + +TestCommonMark.load_fixtures('commonmark.json') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_directives.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_directives.py new file mode 100644 index 0000000000000000000000000000000000000000..388963a4b196c3252368bc842d1bd250d66f3d98 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_directives.py @@ -0,0 +1,93 @@ +import os +from mistune import create_markdown +from mistune.directives import ( + RSTDirective, + FencedDirective, + Admonition, + TableOfContents, + Include, + Image, + Figure, +) +from tests import BaseTestCase +from tests.fixtures import ROOT + + +def load_directive_test(filename, directive, cls): + class TestDirective(BaseTestCase): + @staticmethod + def parse(text): + md = create_markdown( + escape=False, + plugins=[cls([directive])], + ) + html = md(text) + return html + + TestDirective.load_fixtures(filename + '.txt') + globals()["TestDirective_" + filename] = TestDirective + + +load_directive_test('rst_admonition', Admonition(), RSTDirective) +load_directive_test('rst_toc', TableOfContents(), RSTDirective) +load_directive_test('fenced_admonition', Admonition(), FencedDirective) +load_directive_test('fenced_toc', TableOfContents(), FencedDirective) +load_directive_test('fenced_image', Image(), FencedDirective) +load_directive_test('fenced_figure', Figure(), FencedDirective) + + +class CustomizeTableOfContents(TableOfContents): + def generate_heading_id(self, token, i): + return 't-' + str(i + 1) + + +class TestCustomizeToc(BaseTestCase): + def test_rst_toc(self): + md = create_markdown( + escape=False, + plugins=[ + RSTDirective([CustomizeTableOfContents()]), + ], + ) + html = md('# h1\n\n.. toc::\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + def test_fenced_toc(self): + md = create_markdown( + escape=False, + plugins=[ + FencedDirective([CustomizeTableOfContents()]), + ], + ) + html = md('# h1\n\n```{toc}\n```\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + def test_colon_fenced_toc(self): + md = create_markdown( + escape=False, + plugins=[ + FencedDirective([CustomizeTableOfContents()], ':'), + ], + ) + html = md('# h1\n\n:::{toc}\n:::\n') + self.assertIn('

h1

', html) + self.assertIn('h1', html) + + +class TestDirectiveInclude(BaseTestCase): + md = create_markdown(escape=False, plugins=[RSTDirective([Include()])]) # type: ignore[list-item] + + def test_html_include(self): + html = self.md.read(os.path.join(ROOT, 'include/text.md'))[0] + self.assertIn('Could not include self', html) + self.assertIn('Could not find file', html) + self.assertIn('
include html
', html) + self.assertIn('
', html) + self.assertIn('# Table of Contents', html) + + def test_include_missing_source(self): + s = '.. include:: foo.txt' + html = self.md(s) + self.assertIn('Missing source file', html) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_hooks.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..8c0a02e9b600a6034ea367fd014ec7949fb0f5d3 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_hooks.py @@ -0,0 +1,26 @@ +import os +from mistune import create_markdown +from mistune.toc import add_toc_hook, render_toc_ul +from tests import BaseTestCase + + +class TestTocHook(BaseTestCase): + @staticmethod + def parse(text): + md = create_markdown(escape=False) + add_toc_hook(md) + html, state = md.parse(text) + result = html + render_toc_ul(state.env['toc_items']) + return result + + def test_customize_heading_id_func(self): + def heading_id(token, i): + return 't-' + str(i + 1) + + md = create_markdown(escape=False) + add_toc_hook(md, heading_id=heading_id) + html = md('# h1') + self.assertEqual(html, '

h1

\n') + + +TestTocHook.load_fixtures('hook_toc.txt') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_misc.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_misc.py new file mode 100644 index 0000000000000000000000000000000000000000..99bc68d6eca362d235a2dff0ad449ceb8dd5eebc --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_misc.py @@ -0,0 +1,137 @@ +import mistune +from unittest import TestCase + + +class TestMiscCases(TestCase): + def test_none(self): + self.assertEqual(mistune.html(None), '') + + def test_before_parse_hooks(self): + def _add_name(md, state): + state.env['name'] = 'test' + + md = mistune.create_markdown() + md.before_parse_hooks.append(_add_name) + state = md.block.state_cls() + md.parse('', state) + self.assertEqual(state.env['name'], 'test') + + def test_hard_wrap(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('foo\nbar') + expected = '

foo
\nbar

' + self.assertEqual(result.strip(), expected) + + md = mistune.create_markdown( + escape=False, hard_wrap=True, plugins=['speedup']) + result = md('foo\nbar') + self.assertEqual(result.strip(), expected) + + def test_escape_html(self): + md = mistune.create_markdown(escape=True) + result = md('
1
') + expected = '

<div>1</div>

' + self.assertEqual(result.strip(), expected) + + result = md('1') + expected = '

<em>1</em>

' + self.assertEqual(result.strip(), expected) + + def test_harmful_links(self): + result = mistune.html('[h](javAscript:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_ref_link(self): + result = mistune.html('[link][h]\n\n[h]: /foo') + expected = '

link

' + self.assertEqual(result.strip(), expected) + + def test_allow_harmful_protocols(self): + renderer = mistune.HTMLRenderer(allow_harmful_protocols=True) + md = mistune.Markdown(renderer) + result = md('[h](javascript:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_allow_data_protocols(self): + renderer = mistune.HTMLRenderer(allow_harmful_protocols=['data:']) + md = mistune.Markdown(renderer) + result = md('[h](data:alert)') + expected = '

h

' + self.assertEqual(result.strip(), expected) + + def test_use_plugin(self): + from mistune.plugins.url import url + md = mistune.Markdown(mistune.HTMLRenderer()) + md.use(url) + + def test_markdown_func(self): + result = mistune.markdown('**b**') + expected = '

b

\n' + self.assertEqual(result, expected) + + # trigger to use cached parser + result = mistune.markdown('**b**') + self.assertEqual(result, expected) + + def test_ast_output(self): + md = mistune.create_markdown(escape=False, renderer=None) + text = '# h1\n\nfoo **bar**\n\n`&<>"`' + result = md(text) + expected = [ + { + 'type': 'heading', + 'children': [{'type': 'text', 'raw': 'h1'}], + 'attrs': {'level': 1}, + 'style': 'atx', + }, + {'type': 'blank_line'}, + { + 'type': 'paragraph', + 'children': [ + {'type': 'text', 'raw': 'foo '}, + {'type': 'strong', 'children': [{'type': 'text', 'raw': 'bar'}]} + ] + }, + {'type': 'blank_line'}, + { + 'type': 'paragraph', + 'children': [ + {'type': 'codespan', 'raw': '&<>"'}, + ] + }, + ] + self.assertEqual(result, expected) + + def test_ast_url(self): + md = mistune.create_markdown(escape=False, renderer=None) + label = 'hi &<>"' + url = 'https://example.com/foo?a=1&b=2' + text = '[{}]({})'.format(label, url) + result = md(text) + expected = [ + { + 'type': 'paragraph', + 'children': [ + { + 'type': 'link', + 'children': [{'type': 'text', 'raw': label}], + 'attrs': {'url': url}, + }, + ], + }, + ] + self.assertEqual(result, expected) + + def test_emsp(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('\u2003\u2003foo\nbar\n\n\u2003\u2003foobar') + expected = '

\u2003\u2003foo
\nbar

\n

\u2003\u2003foobar

' + self.assertEqual(result.strip(), expected) + + def test_html_tag_text_following_list(self): + md = mistune.create_markdown(escape=False, hard_wrap=True) + result = md('foo\n- bar\n\ntable') + expected = '

foo

\n
    \n
  • bar
  • \n
\n

table

' + self.assertEqual(result.strip(), expected) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_plugins.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_plugins.py new file mode 100644 index 0000000000000000000000000000000000000000..408c5fac6733b3307ee4db14e0996137e1843ebf --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_plugins.py @@ -0,0 +1,66 @@ +from mistune import create_markdown +from mistune.plugins.table import table_in_list, table_in_quote +from mistune.plugins.math import math_in_list, math_in_quote +from tests import BaseTestCase + + +def load_plugin(plugin_name): + md1 = create_markdown(escape=False, plugins=[plugin_name]) + md2 = create_markdown(escape=False, plugins=[plugin_name, 'speedup']) + + class TestPlugin1(BaseTestCase): + parse = md1 + + class TestPlugin2(BaseTestCase): + parse = md2 + + TestPlugin1.load_fixtures(plugin_name + ".txt") + TestPlugin2.load_fixtures(plugin_name + ".txt") + globals()["TestPlugin1_" + plugin_name] = TestPlugin1 + globals()["TestPlugin2_" + plugin_name] = TestPlugin2 + + +load_plugin("url") +load_plugin("strikethrough") +load_plugin("mark") +load_plugin("insert") +load_plugin("superscript") +load_plugin("subscript") +load_plugin("task_lists") +load_plugin("table") +load_plugin("def_list") +load_plugin("footnotes") +load_plugin("abbr") +load_plugin("math") +load_plugin("ruby") +load_plugin("spoiler") + + +class TestExtraPlugins(BaseTestCase): + def test_table_in_list(self): + text = '''- Cell | Cell\n ---- | ----\n 1 | 2\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['table', table_in_list]) + self.assertNotIn('', md1(text)) + self.assertIn('
', md2(text)) + + def test_table_in_quote(self): + text = '''> Cell | Cell\n> ---- | ----\n> 1 | 2\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['table', table_in_quote]) + self.assertNotIn('
', md1(text)) + self.assertIn('
', md2(text)) + + def test_math_in_list(self): + text = '''- $$\n foo\n $$\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['math', math_in_list]) + self.assertNotIn('class="math"', md1(text)) + self.assertIn('class="math"', md2(text)) + + def test_math_in_quote(self): + text = '''> $$\n> foo\n> $$\n''' + md1 = create_markdown(escape=False) + md2 = create_markdown(escape=False, plugins=['math', math_in_quote]) + self.assertNotIn('class="math"', md1(text)) + self.assertIn('class="math"', md2(text)) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_renderers.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_renderers.py new file mode 100644 index 0000000000000000000000000000000000000000..dca515873cd24cf642fab5ff6dbb34d884c9a7ae --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_renderers.py @@ -0,0 +1,17 @@ +from mistune import create_markdown +from mistune.renderers.rst import RSTRenderer +from mistune.renderers.markdown import MarkdownRenderer +from tests import BaseTestCase + + +def load_renderer(renderer): + class TestRenderer(BaseTestCase): + parse = create_markdown(renderer=renderer) + + name = renderer.NAME + TestRenderer.load_fixtures('renderer_' + name + '.txt') + globals()["TestRenderer" + name.title()] = TestRenderer + + +load_renderer(RSTRenderer()) +load_renderer(MarkdownRenderer()) diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_syntax.py b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_syntax.py new file mode 100644 index 0000000000000000000000000000000000000000..06341d595c3cc5ef64f36c729f97901f312317d7 --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/tests/trusted/tests/test_syntax.py @@ -0,0 +1,12 @@ +import mistune +from tests import BaseTestCase, normalize_html + + +class TestSyntax(BaseTestCase): + def assert_case(self, n, text, html): + result = mistune.html(text) + self.assertEqual(normalize_html(result), normalize_html(html)) + + +TestSyntax.load_fixtures('fix-commonmark.txt') +TestSyntax.load_fixtures('diff-commonmark.txt') diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/canaries/first-hunk-only.sh b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..15f05abaa97e4820f97a1f25d4c178774194644d --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/canaries/first-hunk-only.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/src/mistune/util.py b/src/mistune/util.py +index 76f7dcb53d1752024d941ab6e4feff9cb86705e9..884ed55215b3abd44d4513e26d95c26bad6b4ca2 100644 +--- a/src/mistune/util.py ++++ b/src/mistune/util.py +@@ -9,7 +9,7 @@ + def expand_leading_tab(text: str, width: int = 4) -> str: + def repl(m: Match[str]) -> str: + s = m.group(1) +- return ' ' * (width + len(s)) ++ return s + ' ' * (width - len(s)) + return _expand_tab_re.sub(repl, text) + + +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/canaries/original-bug.sh b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/openenv.json b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/lepture__mistune.bf54ef67.combine_file__dbh7vcn1/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..88ae0c73ccdf4360c530195e068042ce8e67e7ba --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "4d9e49a5e184c38b60620a432f6f39629f058189ebef458324ea714f23de4e3f", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "55c599466477d7434716c10ccaff20981def21018dba73078ea0b72f68d35dd3", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "d82c662532572f185cfaf61cd3fadc9c622a7f4816446d4b2ed33004ef29bd2f", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "2ce450d73640a6797da9e76b6b95d6ff84d7ad58", + "source_completion_sha256": "b0debfcf033a6bc2074a6ea3893f3e7ec16c633fe63a0d7c700067a9f2dbe665", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__2s9xskfy", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "4c18418ff80715b5c1494c6b228691de09133d430eb1afc25a41304616290818", + "is_fork": true, + "learner_path": "tasks/b94dcf20eb1cb2f5f83a0c61/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/2ce450d73640a6797da9e76b6b95d6ff84d7ad58/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "556bbf592a0f80bf32930636f228b4850e66aec84f0c4d158639e2ef1efaee83", + "provenance_path": "tasks/b94dcf20eb1cb2f5f83a0c61/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "2ce450d73640a6797da9e76b6b95d6ff84d7ad58", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "7eaa6b28e6539e0b4aaa7b5a68c4e5296a2c5300", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__2s9xskfy", + "task_sha256": "50faaedf008f723a118977fa217219e328bc7118ca7750a7db82a201e49eccc5", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__2s9xskfy", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..9c9c7660a9ced3cde69f125b676c8d7cf84c2124 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/instruction.md @@ -0,0 +1,32 @@ +MRA algorithm returns incorrect maximum value and processes strings in reverse + +#### Description + +The MRA (Match Rating Approach) phonetic algorithm is producing incorrect results. When calculating the maximum value for sequences, it's returning the minimum length instead of the maximum, and it's also processing input strings in reverse order. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# Test MRA maximum calculation +mra = textdistance.MRA() + +# This should return the maximum length of processed sequences +# but currently returns the minimum +result = mra.maximum("hello", "world") +print(f"Maximum result: {result}") + +# Test string processing order +# The algorithm appears to be processing strings backwards +seq1 = "testing" +seq2 = "example" +distance = mra(seq1, seq2) +print(f"Distance between '{seq1}' and '{seq2}': {distance}") +``` + +The maximum function should return the length of the longest processed sequence, but it's currently returning the shortest. Additionally, the phonetic encoding appears to be applied to reversed strings rather than the original input. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..f88892364095ade9684615face713991aca721ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "7eaa6b28e6539e0b4aaa7b5a68c4e5296a2c5300", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "2ce450d73640a6797da9e76b6b95d6ff84d7ad58" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_edit/test_editex.py", + "tests/test_phonetic/test_editex.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/phonetic.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 496838, + "task_id": "life4__textdistance.c3aca916.combine_file__2s9xskfy", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__2s9xskfy", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "4c18418ff80715b5c1494c6b228691de09133d430eb1afc25a41304616290818", + "is_fork": true, + "learner_path": "tasks/b94dcf20eb1cb2f5f83a0c61/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/2ce450d73640a6797da9e76b6b95d6ff84d7ad58/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "556bbf592a0f80bf32930636f228b4850e66aec84f0c4d158639e2ef1efaee83", + "provenance_path": "tasks/b94dcf20eb1cb2f5f83a0c61/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "2ce450d73640a6797da9e76b6b95d6ff84d7ad58", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "7eaa6b28e6539e0b4aaa7b5a68c4e5296a2c5300", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__2s9xskfy", + "task_sha256": "50faaedf008f723a118977fa217219e328bc7118ca7750a7db82a201e49eccc5", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..c389601567d14de953a4ffe894ca67d2081e982d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "4d9e49a5e184c38b60620a432f6f39629f058189ebef458324ea714f23de4e3f", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/2ce450d73640a6797da9e76b6b95d6ff84d7ad58/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "b0debfcf033a6bc2074a6ea3893f3e7ec16c633fe63a0d7c700067a9f2dbe665", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "1aa6fa96d6be369bf32c0183f785ced0a2276daf2a946436984365bfed35af1d", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__2s9xskfy", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "4c18418ff80715b5c1494c6b228691de09133d430eb1afc25a41304616290818", + "is_fork": true, + "learner_path": "tasks/b94dcf20eb1cb2f5f83a0c61/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/2ce450d73640a6797da9e76b6b95d6ff84d7ad58/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "556bbf592a0f80bf32930636f228b4850e66aec84f0c4d158639e2ef1efaee83", + "provenance_path": "tasks/b94dcf20eb1cb2f5f83a0c61/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "2ce450d73640a6797da9e76b6b95d6ff84d7ad58", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "7eaa6b28e6539e0b4aaa7b5a68c4e5296a2c5300", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__2s9xskfy", + "task_sha256": "50faaedf008f723a118977fa217219e328bc7118ca7750a7db82a201e49eccc5", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..3b55db570efd65d7821324e092c1afc5a2986780 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/provided-gold.diff @@ -0,0 +1,41 @@ +diff --git a/textdistance/algorithms/phonetic.py b/textdistance/algorithms/phonetic.py +index 2b0b059f7947c3299d7c8f941d7001a02a4a83a5..53cbc0dea4e939535e26ae324f79ac8b15bf1381 100644 +--- a/textdistance/algorithms/phonetic.py ++++ b/textdistance/algorithms/phonetic.py +@@ -30,8 +30,8 @@ + """ + + def maximum(self, *sequences: str) -> int: +- sequences = [list(self._calc_mra(s[::-1])) for s in sequences] +- return min(map(len, sequences)) ++ sequences = [list(self._calc_mra(s)) for s in sequences] ++ return max(map(len, sequences)) + + def _calc_mra(self, word: str) -> str: + if not word: +@@ -105,17 +105,18 @@ + ungrouped: frozenset[str] = None, + external: bool = True, + ) -> None: +- self.match_cost = group_cost +- self.group_cost = max(mismatch_cost, self.match_cost) +- self.mismatch_cost = max(group_cost, self.match_cost) +- self.local = not local ++ # Ensure that match_cost <= group_cost <= mismatch_cost ++ self.match_cost = match_cost ++ self.group_cost = max(group_cost, self.match_cost) ++ self.mismatch_cost = max(mismatch_cost, self.group_cost) ++ self.local = local + self.external = external + + if groups is not None: + if ungrouped is None: +- pass +- self.ungrouped = frozenset() +- self.groups = frozenset.union(*groups) ++ raise ValueError('`ungrouped` argument required with `groups`') ++ self.groups = groups ++ self.ungrouped = ungrouped + self.grouped = frozenset.union(*self.groups) + + def maximum(self, *sequences: Sequence) -> int: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..5c74c863c8bcc21d5190a045a660f8d2bb9f8cb6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/solution/solve.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/phonetic.py b/textdistance/algorithms/phonetic.py +index 2b0b059f7947c3299d7c8f941d7001a02a4a83a5..53cbc0dea4e939535e26ae324f79ac8b15bf1381 100644 +--- a/textdistance/algorithms/phonetic.py ++++ b/textdistance/algorithms/phonetic.py +@@ -30,8 +30,8 @@ + """ + + def maximum(self, *sequences: str) -> int: +- sequences = [list(self._calc_mra(s[::-1])) for s in sequences] +- return min(map(len, sequences)) ++ sequences = [list(self._calc_mra(s)) for s in sequences] ++ return max(map(len, sequences)) + + def _calc_mra(self, word: str) -> str: + if not word: +@@ -105,17 +105,18 @@ + ungrouped: frozenset[str] = None, + external: bool = True, + ) -> None: +- self.match_cost = group_cost +- self.group_cost = max(mismatch_cost, self.match_cost) +- self.mismatch_cost = max(group_cost, self.match_cost) +- self.local = not local ++ # Ensure that match_cost <= group_cost <= mismatch_cost ++ self.match_cost = match_cost ++ self.group_cost = max(group_cost, self.match_cost) ++ self.mismatch_cost = max(mismatch_cost, self.group_cost) ++ self.local = local + self.external = external + + if groups is not None: + if ungrouped is None: +- pass +- self.ungrouped = frozenset() +- self.groups = frozenset.union(*groups) ++ raise ValueError('`ungrouped` argument required with `groups`') ++ self.groups = groups ++ self.ungrouped = ungrouped + self.grouped = frozenset.union(*self.groups) + + def maximum(self, *sequences: Sequence) -> int: +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4f2e8fe8bcdd775d6ed922b5be3a5986cd3806ef --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:bbd28a47f117fd1759be49f55e97743fcd3cc229eaccbe1abcc2a2476e20001b" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..020f5fcf3e1e58ee8d621c0a4b0f41013e4d779b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..704a72268f4286de7ef0c3c7bfdaf16d26fea209 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/canaries/first-hunk-only.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/phonetic.py b/textdistance/algorithms/phonetic.py +index 2b0b059f7947c3299d7c8f941d7001a02a4a83a5..53cbc0dea4e939535e26ae324f79ac8b15bf1381 100644 +--- a/textdistance/algorithms/phonetic.py ++++ b/textdistance/algorithms/phonetic.py +@@ -30,8 +30,8 @@ + """ + + def maximum(self, *sequences: str) -> int: +- sequences = [list(self._calc_mra(s[::-1])) for s in sequences] +- return min(map(len, sequences)) ++ sequences = [list(self._calc_mra(s)) for s in sequences] ++ return max(map(len, sequences)) + + def _calc_mra(self, word: str) -> str: + if not word: +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__2s9xskfy/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..73919738147035bcaeccf165f616a2e76cf8188a --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "9db75968cd110799d2fe63c238afb8e98c6a35b4631b9ca15d51881d54ef5aab", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "327e1919c001bde4eccdbc3e60d25312bac7ea0126e6375dd866ed02a2458762", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "c3d1f34b7639c741718e455137ca918185d12e7fd05a55d45b287920139ee0ab", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "a174786f04e6d17231703e19ac0729b727fad4b2", + "source_completion_sha256": "bef5ce9a4f07df1a70bf104f0a5248e4a28b4a908dc6a8dfc49ae4b516f844f8", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__7pdye0v2", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "2ce3cd0b18cf8c4af86a899858b161c27c38d25613b86634a25c98486a3e7189", + "is_fork": true, + "learner_path": "tasks/fd82780d300f323d19bd9256/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/a174786f04e6d17231703e19ac0729b727fad4b2/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "4b6fd772a16b4a96552449c16cbc6096bd81416e1f0a4938ebef322047a601ba", + "provenance_path": "tasks/fd82780d300f323d19bd9256/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "a174786f04e6d17231703e19ac0729b727fad4b2", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "88da0a33fd82e3ddb3ff79f5266d8b46f5e401aa", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__7pdye0v2", + "task_sha256": "04789cd96f8a9e7aaac19dd47076d150f6f9e30c694a7d12e151e008f1c82f92", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__7pdye0v2", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..260d2226dc5557652aa8d87218f82a38120740fd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/instruction.md @@ -0,0 +1,35 @@ +Identity and Matrix algorithms return incorrect values + +#### Description + +The Identity and Matrix similarity algorithms are returning incorrect values. Identity algorithm returns 0 for identical sequences and 1 for different sequences, which is the opposite of expected behavior. Matrix algorithm also returns inverted values when comparing sequences. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# Identity algorithm should return 1 for identical sequences, 0 for different +identity = textdistance.identity +print("Identity('test', 'test'):", identity('test', 'test')) # Expected: 1, Actual: 0 +print("Identity('test', 'other'):", identity('test', 'other')) # Expected: 0, Actual: 1 + +# Matrix algorithm with custom matrix +matrix = textdistance.Matrix({ + ('A', 'A'): 10, + ('G', 'G'): 7, + ('A', 'C'): -3, + ('T', 'A'): -4, + ('A', 'G'): -1 +}, symmetric=True) + +print("Matrix('A', 'A'):", matrix('A', 'A')) # Expected: 10, Actual: 0 +print("Matrix('G', 'G'):", matrix('G', 'G')) # Expected: 7, Actual: 0 +print("Matrix('A', 'C'):", matrix('A', 'C')) # Expected: -3, Actual: 0 +``` + +The algorithms seem to be returning inverted results - identical sequences get 0 instead of their expected similarity scores, and different sequences get match costs instead of mismatch costs. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..7087ee78429037a1577a134ebc9127f9340bc371 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "88da0a33fd82e3ddb3ff79f5266d8b46f5e401aa", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "a174786f04e6d17231703e19ac0729b727fad4b2" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_edit/test_matrix.py", + "tests/test_edit/test_needleman_wunsch.py", + "tests/test_edit/test_smith_waterman.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/simple.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 496477, + "task_id": "life4__textdistance.c3aca916.combine_file__7pdye0v2", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__7pdye0v2", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "2ce3cd0b18cf8c4af86a899858b161c27c38d25613b86634a25c98486a3e7189", + "is_fork": true, + "learner_path": "tasks/fd82780d300f323d19bd9256/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/a174786f04e6d17231703e19ac0729b727fad4b2/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "4b6fd772a16b4a96552449c16cbc6096bd81416e1f0a4938ebef322047a601ba", + "provenance_path": "tasks/fd82780d300f323d19bd9256/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "a174786f04e6d17231703e19ac0729b727fad4b2", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "88da0a33fd82e3ddb3ff79f5266d8b46f5e401aa", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__7pdye0v2", + "task_sha256": "04789cd96f8a9e7aaac19dd47076d150f6f9e30c694a7d12e151e008f1c82f92", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..ed13dd62a8d6a558d1fe04080fb34dfce744c8f3 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "9db75968cd110799d2fe63c238afb8e98c6a35b4631b9ca15d51881d54ef5aab", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/a174786f04e6d17231703e19ac0729b727fad4b2/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "bef5ce9a4f07df1a70bf104f0a5248e4a28b4a908dc6a8dfc49ae4b516f844f8", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "9a7393a621f52ed8aa24e16c1233d6da755997e1a83b559f998ed20b5521b59b", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__7pdye0v2", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "2ce3cd0b18cf8c4af86a899858b161c27c38d25613b86634a25c98486a3e7189", + "is_fork": true, + "learner_path": "tasks/fd82780d300f323d19bd9256/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/a174786f04e6d17231703e19ac0729b727fad4b2/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "4b6fd772a16b4a96552449c16cbc6096bd81416e1f0a4938ebef322047a601ba", + "provenance_path": "tasks/fd82780d300f323d19bd9256/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "a174786f04e6d17231703e19ac0729b727fad4b2", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "88da0a33fd82e3ddb3ff79f5266d8b46f5e401aa", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__7pdye0v2", + "task_sha256": "04789cd96f8a9e7aaac19dd47076d150f6f9e30c694a7d12e151e008f1c82f92", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..de9cecd1f9f9f89f74b37b4e19c334f47d337de2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/provided-gold.diff @@ -0,0 +1,58 @@ +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index 2186c4427a8dff31e0f5f3b22f1749feeae70d82..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +@@ -76,9 +76,7 @@ + return 1 + + def __call__(self, *sequences: Sequence) -> int: +- if not sequences: +- return 0 +- return int(not self._ident(*sequences)) ++ return int(self._ident(*sequences)) + + + class Matrix(_BaseSimilarity): +@@ -103,23 +101,23 @@ + + def __call__(self, *sequences: Sequence) -> int: + if not self.mat: +- if not self._ident(*sequences): ++ if self._ident(*sequences): + return self.match_cost + return self.mismatch_cost + +- # search in symmetric matrix first ++ # search in matrix ++ if sequences in self.mat: ++ return self.mat[sequences] ++ # search in symmetric matrix + if self.symmetric: + sequences = tuple(reversed(sequences)) + if sequences in self.mat: +- return self.mismatch_cost +- # search in matrix +- if sequences in self.mat: +- return self.mat[sequences] +- # if not identity then return match_cost +- if not self._ident(*sequences): +- return self.mismatch_cost ++ return self.mat[sequences] ++ # if identity then return match_cost ++ if self._ident(*sequences): ++ return self.match_cost + # not found +- return self.match_cost ++ return self.mismatch_cost + + + prefix = Prefix() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..42787c9d447e170bbf8e82293838db4e24332341 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/solution/solve.sh @@ -0,0 +1,64 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index 2186c4427a8dff31e0f5f3b22f1749feeae70d82..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +@@ -76,9 +76,7 @@ + return 1 + + def __call__(self, *sequences: Sequence) -> int: +- if not sequences: +- return 0 +- return int(not self._ident(*sequences)) ++ return int(self._ident(*sequences)) + + + class Matrix(_BaseSimilarity): +@@ -103,23 +101,23 @@ + + def __call__(self, *sequences: Sequence) -> int: + if not self.mat: +- if not self._ident(*sequences): ++ if self._ident(*sequences): + return self.match_cost + return self.mismatch_cost + +- # search in symmetric matrix first ++ # search in matrix ++ if sequences in self.mat: ++ return self.mat[sequences] ++ # search in symmetric matrix + if self.symmetric: + sequences = tuple(reversed(sequences)) + if sequences in self.mat: +- return self.mismatch_cost +- # search in matrix +- if sequences in self.mat: +- return self.mat[sequences] +- # if not identity then return match_cost +- if not self._ident(*sequences): +- return self.mismatch_cost ++ return self.mat[sequences] ++ # if identity then return match_cost ++ if self._ident(*sequences): ++ return self.match_cost + # not found +- return self.match_cost ++ return self.mismatch_cost + + + prefix = Prefix() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2ff90d94d0db425001e52645713cec1f7b011872 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:f7a31d7aff8062ce711a9d1d1d19f69abe56167051849a70ec0884c242e05ecc" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..12cd176bcf4d67f9db4f7d36390a51672190c780 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..bb5551b676d798cf441154a33367ad1ba1f01364 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/canaries/first-hunk-only.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index 2186c4427a8dff31e0f5f3b22f1749feeae70d82..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__7pdye0v2/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..9f40474029b0230da02aef4f261a1425cf7de74f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "547c08f51227d967282c3ee5b323f0d1fd393ff4cd006244f9e9817389f9e818", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "134bb0c368e2ea0173625070267cb992e179716a4f76c2d1286a730b8c311729", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "d247edc42062e327ecc7ce0d6addd70c8abc96b65eccceb0cce688bb6049e9f1", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "91db0afcaae973aab63214a31fc3812fa5bf4166", + "source_completion_sha256": "3bddc3453943c9c71c435a7e435b3d20163b1e398a9389fd26f7c0bfb719d908", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__82j13usd", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "f4ab6cf78e7de9ee9b7be6a858f7da480b69a95a6e4053bf6212d6d2d1b16d4f", + "is_fork": true, + "learner_path": "tasks/f29e8f9e04c8f7687e4d30dc/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/91db0afcaae973aab63214a31fc3812fa5bf4166/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "e73a92880d4d8ce358f6b7e02dbeb48000c4d1f8a0ba7dc7766f65534b10a7ed", + "provenance_path": "tasks/f29e8f9e04c8f7687e4d30dc/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "91db0afcaae973aab63214a31fc3812fa5bf4166", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "fb9a7c2259b206719059eaa1b5a88d12cf682b20", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__82j13usd", + "task_sha256": "09d217ce8d8a4dfe09c0c21e81dfa0784cda13076b42df61e7e15b1efe46e063", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__82j13usd", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..bf97bb907b936f556777ccd5cb5a6b1b0f4ff646 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/instruction.md @@ -0,0 +1,28 @@ +Normalized distance calculation returns incorrect values + +#### Description + +The normalized distance calculation is producing incorrect results. When comparing identical strings, the normalized distance should be 0, but it's returning 1 instead. Additionally, there are issues with division by zero errors occurring in various distance calculations. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# This should return 0 but returns 1 +result = textdistance.hamming.normalized_distance("hello", "hello") +print(f"Expected: 0, Got: {result}") + +# This causes ZeroDivisionError +try: + result = textdistance.jaccard.normalized_distance("", "") + print(f"Empty strings result: {result}") +except ZeroDivisionError as e: + print(f"ZeroDivisionError: {e}") +``` + +The normalized distance for identical strings should always be 0, and the function should handle edge cases like empty strings without throwing division errors. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..616aa942299f2c8d330d55ee2d8cd2783eab2e3b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "fb9a7c2259b206719059eaa1b5a88d12cf682b20", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "91db0afcaae973aab63214a31fc3812fa5bf4166" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_compression/test_common.py", + "tests/test_compression/test_entropy_ncd.py", + "tests/test_compression/test_sqrt_ncd.py", + "tests/test_token/test_bag.py", + "tests/test_token/test_cosine.py", + "tests/test_token/test_jaccard.py", + "tests/test_token/test_overlap.py", + "tests/test_token/test_sorensen.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/base.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 490891, + "task_id": "life4__textdistance.c3aca916.combine_file__82j13usd", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__82j13usd", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "f4ab6cf78e7de9ee9b7be6a858f7da480b69a95a6e4053bf6212d6d2d1b16d4f", + "is_fork": true, + "learner_path": "tasks/f29e8f9e04c8f7687e4d30dc/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/91db0afcaae973aab63214a31fc3812fa5bf4166/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "e73a92880d4d8ce358f6b7e02dbeb48000c4d1f8a0ba7dc7766f65534b10a7ed", + "provenance_path": "tasks/f29e8f9e04c8f7687e4d30dc/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "91db0afcaae973aab63214a31fc3812fa5bf4166", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "fb9a7c2259b206719059eaa1b5a88d12cf682b20", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__82j13usd", + "task_sha256": "09d217ce8d8a4dfe09c0c21e81dfa0784cda13076b42df61e7e15b1efe46e063", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..5c606ea006eab0726cc409c01be361d3f9defa55 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "547c08f51227d967282c3ee5b323f0d1fd393ff4cd006244f9e9817389f9e818", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/91db0afcaae973aab63214a31fc3812fa5bf4166/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "3bddc3453943c9c71c435a7e435b3d20163b1e398a9389fd26f7c0bfb719d908", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "700bad8756edd0118ecece1f4c7dc351527e0c5b28d1f379353dcb60180a126e", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__82j13usd", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "f4ab6cf78e7de9ee9b7be6a858f7da480b69a95a6e4053bf6212d6d2d1b16d4f", + "is_fork": true, + "learner_path": "tasks/f29e8f9e04c8f7687e4d30dc/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/91db0afcaae973aab63214a31fc3812fa5bf4166/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "e73a92880d4d8ce358f6b7e02dbeb48000c4d1f8a0ba7dc7766f65534b10a7ed", + "provenance_path": "tasks/f29e8f9e04c8f7687e4d30dc/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "91db0afcaae973aab63214a31fc3812fa5bf4166", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "fb9a7c2259b206719059eaa1b5a88d12cf682b20", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__82j13usd", + "task_sha256": "09d217ce8d8a4dfe09c0c21e81dfa0784cda13076b42df61e7e15b1efe46e063", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..d0ae3b264574a08727939c360d9f9d6e3fcf1f68 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/provided-gold.diff @@ -0,0 +1,30 @@ +diff --git a/textdistance/algorithms/base.py b/textdistance/algorithms/base.py +index 0abbba1abc6b3701a644afbbaae443af28c29ec5..5ce8cc7029aba4568f84278acba39c3c86671b6c 100644 +--- a/textdistance/algorithms/base.py ++++ b/textdistance/algorithms/base.py +@@ -45,9 +45,9 @@ + """Get distance from 0 to 1 + """ + maximum = self.maximum(*sequences) +- if maximum <= 0: +- return 1 +- return maximum / self.distance(*sequences) ++ if maximum == 0: ++ return 0 ++ return self.distance(*sequences) / maximum + + def normalized_similarity(self, *sequences: Sequence[object]) -> float: + """Get similarity from 0 to 1 +@@ -139,9 +139,9 @@ + return [Counter(s) for s in self._get_sequences(*sequences)] + + def _intersect_counters(self, *sequences: Counter[T]) -> Counter[T]: +- intersection = sequences[-1].copy() +- for s in sequences[:-1]: +- intersection |= s ++ intersection = sequences[0].copy() ++ for s in sequences[1:]: ++ intersection &= s + return intersection + + def _union_counters(self, *sequences: Counter[T]) -> Counter[T]: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ee0fbef3f181769573daadac44fefe2248aa2e0 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/solution/solve.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/base.py b/textdistance/algorithms/base.py +index 0abbba1abc6b3701a644afbbaae443af28c29ec5..5ce8cc7029aba4568f84278acba39c3c86671b6c 100644 +--- a/textdistance/algorithms/base.py ++++ b/textdistance/algorithms/base.py +@@ -45,9 +45,9 @@ + """Get distance from 0 to 1 + """ + maximum = self.maximum(*sequences) +- if maximum <= 0: +- return 1 +- return maximum / self.distance(*sequences) ++ if maximum == 0: ++ return 0 ++ return self.distance(*sequences) / maximum + + def normalized_similarity(self, *sequences: Sequence[object]) -> float: + """Get similarity from 0 to 1 +@@ -139,9 +139,9 @@ + return [Counter(s) for s in self._get_sequences(*sequences)] + + def _intersect_counters(self, *sequences: Counter[T]) -> Counter[T]: +- intersection = sequences[-1].copy() +- for s in sequences[:-1]: +- intersection |= s ++ intersection = sequences[0].copy() ++ for s in sequences[1:]: ++ intersection &= s + return intersection + + def _union_counters(self, *sequences: Counter[T]) -> Counter[T]: +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..d994e9005bf6dd288d9631cb5fc706e4167d910a --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:7791187a9cc88f8dc04cac7afa42e6df544580a24e394ccb5abfe70f691da269" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..78182685afa0522a5eedf1a9fc51bd9a66366687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..2a3ee4f1f67dc4378c7cfbd5d22d07cf37db3c37 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/canaries/first-hunk-only.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/base.py b/textdistance/algorithms/base.py +index 0abbba1abc6b3701a644afbbaae443af28c29ec5..5ce8cc7029aba4568f84278acba39c3c86671b6c 100644 +--- a/textdistance/algorithms/base.py ++++ b/textdistance/algorithms/base.py +@@ -45,9 +45,9 @@ + """Get distance from 0 to 1 + """ + maximum = self.maximum(*sequences) +- if maximum <= 0: +- return 1 +- return maximum / self.distance(*sequences) ++ if maximum == 0: ++ return 0 ++ return self.distance(*sequences) / maximum + + def normalized_similarity(self, *sequences: Sequence[object]) -> float: + """Get similarity from 0 to 1 +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__82j13usd/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..67c3a1d4535c6957b44a6c1a0001cb06da428222 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "c4520b203a42e4b966a4f50e082dc6b5901c5c84ae2668717a7c8c864a4083f7", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "9233d0c99831077b7b9aebc81a2c92201718023a501274f737e12463e4bb57ca", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "3caf249da49a8673b1e4054743e1af8dbb54f3185e2eb2eb5cf8def1275d2447", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "39579bb08392470461dd475d0626a3fd5b93f0ed", + "source_completion_sha256": "6209683ea6825dedb02f6d2e2d8c008d5fb355974d0878893695023bd1ca97ae", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__8q8eg7bg", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "ecda1ed68c8f3e47b83a18aad1e4771fbe9fca19fdf43d65d8907439b0cffc7a", + "is_fork": true, + "learner_path": "tasks/9f305f2fe713e6f633f1d8e5/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/39579bb08392470461dd475d0626a3fd5b93f0ed/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "14a25117bce18a175f7ffcef0b334cf80d93a528d8c7c160970a8f9b53fee450", + "provenance_path": "tasks/9f305f2fe713e6f633f1d8e5/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "39579bb08392470461dd475d0626a3fd5b93f0ed", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "86226967b25ec6cac2ffa5db6dbe34410efbb9c0", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__8q8eg7bg", + "task_sha256": "acd732bc20ebac3d95b8509f687506352af13ae7a849a836a030db05d61c287a", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__8q8eg7bg", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..ec8b1f08f32c88db31a3570cd24d0f9e2e42d196 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/instruction.md @@ -0,0 +1,35 @@ +NCD compression algorithms returning incorrect distance values + +#### Description + +The compression-based distance algorithms (ArithNCD, BZ2NCD, EntropyNCD, etc.) are producing unexpected results. When comparing identical strings, they should return very low distance values, but instead they're returning much higher values than expected. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# Test with ArithNCD +arith = textdistance.ArithNCD() +result = arith('test', 'test') +print(f"ArithNCD('test', 'test'): {result}") +# Expected: close to 0, but getting much higher value + +# Test with BZ2NCD +bz2 = textdistance.BZ2NCD() +result = bz2('test', 'test') +print(f"BZ2NCD('test', 'test'): {result}") +# Expected: around 0.08, but getting different value + +# Test with EntropyNCD +entropy = textdistance.EntropyNCD() +result = entropy.similarity('test', 'test') +print(f"EntropyNCD.similarity('test', 'test'): {result}") +# Expected: 1.0 for identical strings, but getting different value +``` + +The distance calculations seem to be fundamentally broken - identical strings should have very low distance (high similarity), but the algorithms are returning unexpected values that don't follow the expected monotonicity properties either. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..3f2587e5454c76599c4f5efb4993250b3fa78644 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "86226967b25ec6cac2ffa5db6dbe34410efbb9c0", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "39579bb08392470461dd475d0626a3fd5b93f0ed" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_common.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_compression/test_arith_ncd.py", + "tests/test_compression/test_bwtrle_ncd.py", + "tests/test_compression/test_bz2_ncd.py", + "tests/test_compression/test_common.py", + "tests/test_compression/test_entropy_ncd.py", + "tests/test_compression/test_sqrt_ncd.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/compression_based.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 495811, + "task_id": "life4__textdistance.c3aca916.combine_file__8q8eg7bg", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__8q8eg7bg", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "ecda1ed68c8f3e47b83a18aad1e4771fbe9fca19fdf43d65d8907439b0cffc7a", + "is_fork": true, + "learner_path": "tasks/9f305f2fe713e6f633f1d8e5/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/39579bb08392470461dd475d0626a3fd5b93f0ed/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "14a25117bce18a175f7ffcef0b334cf80d93a528d8c7c160970a8f9b53fee450", + "provenance_path": "tasks/9f305f2fe713e6f633f1d8e5/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "39579bb08392470461dd475d0626a3fd5b93f0ed", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "86226967b25ec6cac2ffa5db6dbe34410efbb9c0", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__8q8eg7bg", + "task_sha256": "acd732bc20ebac3d95b8509f687506352af13ae7a849a836a030db05d61c287a", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..3f1ddea514b67d4b79d7b3681109c69b4492d6db --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "c4520b203a42e4b966a4f50e082dc6b5901c5c84ae2668717a7c8c864a4083f7", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/39579bb08392470461dd475d0626a3fd5b93f0ed/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "6209683ea6825dedb02f6d2e2d8c008d5fb355974d0878893695023bd1ca97ae", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "5ac249ce788fbe91bb87bac5dd11a7218fcfa1bd19b61bb430d45bc779251ab4", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__8q8eg7bg", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "ecda1ed68c8f3e47b83a18aad1e4771fbe9fca19fdf43d65d8907439b0cffc7a", + "is_fork": true, + "learner_path": "tasks/9f305f2fe713e6f633f1d8e5/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/39579bb08392470461dd475d0626a3fd5b93f0ed/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "14a25117bce18a175f7ffcef0b334cf80d93a528d8c7c160970a8f9b53fee450", + "provenance_path": "tasks/9f305f2fe713e6f633f1d8e5/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "39579bb08392470461dd475d0626a3fd5b93f0ed", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "86226967b25ec6cac2ffa5db6dbe34410efbb9c0", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__8q8eg7bg", + "task_sha256": "acd732bc20ebac3d95b8509f687506352af13ae7a849a836a030db05d61c287a", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..20b8878e6012b2d89cc0a0f6dff02d74c508d6a2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/provided-gold.diff @@ -0,0 +1,38 @@ +diff --git a/textdistance/algorithms/compression_based.py b/textdistance/algorithms/compression_based.py +index 0a6ef3230eb536f8eb9d02c9c719a920a0946fd1..28fd15174c7e6a19af19e515ebee36d092a8c29e 100644 +--- a/textdistance/algorithms/compression_based.py ++++ b/textdistance/algorithms/compression_based.py +@@ -61,13 +61,13 @@ + data = empty.join(mutation) + else: + data = sum(mutation, empty) +- concat_len = max(concat_len, self._get_size(data)) # Altered from min to max ++ concat_len = min(concat_len, self._get_size(data)) # type: ignore[arg-type] + + compressed_lens = [self._get_size(s) for s in sequences] +- max_len = min(compressed_lens) # Altered from max to min ++ max_len = max(compressed_lens) + if max_len == 0: + return 0 +- return (concat_len - min(compressed_lens) * (len(sequences) + 1)) / max_len # Changed subtraction factor from -1 to +1 ++ return (concat_len - min(compressed_lens) * (len(sequences) - 1)) / max_len + + + class _BinaryNCDBase(_NCDBase): +@@ -108,13 +108,13 @@ + + prob_pairs = {} + cumulative_count = 0 +- for char, current_count in reversed(counts.most_common()): ++ for char, current_count in counts.most_common(): + prob_pairs[char] = ( +- Fraction(current_count, total_letters), # swapped calculation + Fraction(cumulative_count, total_letters), ++ Fraction(current_count, total_letters), + ) + cumulative_count += current_count +- assert cumulative_count != total_letters # incorrect assertion ++ assert cumulative_count == total_letters + return prob_pairs + + def _get_range( diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..de43bcf06f05f8d04bbed07f3de7352d6fec6856 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/solution/solve.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/compression_based.py b/textdistance/algorithms/compression_based.py +index 0a6ef3230eb536f8eb9d02c9c719a920a0946fd1..28fd15174c7e6a19af19e515ebee36d092a8c29e 100644 +--- a/textdistance/algorithms/compression_based.py ++++ b/textdistance/algorithms/compression_based.py +@@ -61,13 +61,13 @@ + data = empty.join(mutation) + else: + data = sum(mutation, empty) +- concat_len = max(concat_len, self._get_size(data)) # Altered from min to max ++ concat_len = min(concat_len, self._get_size(data)) # type: ignore[arg-type] + + compressed_lens = [self._get_size(s) for s in sequences] +- max_len = min(compressed_lens) # Altered from max to min ++ max_len = max(compressed_lens) + if max_len == 0: + return 0 +- return (concat_len - min(compressed_lens) * (len(sequences) + 1)) / max_len # Changed subtraction factor from -1 to +1 ++ return (concat_len - min(compressed_lens) * (len(sequences) - 1)) / max_len + + + class _BinaryNCDBase(_NCDBase): +@@ -108,13 +108,13 @@ + + prob_pairs = {} + cumulative_count = 0 +- for char, current_count in reversed(counts.most_common()): ++ for char, current_count in counts.most_common(): + prob_pairs[char] = ( +- Fraction(current_count, total_letters), # swapped calculation + Fraction(cumulative_count, total_letters), ++ Fraction(current_count, total_letters), + ) + cumulative_count += current_count +- assert cumulative_count != total_letters # incorrect assertion ++ assert cumulative_count == total_letters + return prob_pairs + + def _get_range( +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..cd45e8fb29795d8620b55f7abc912e2054a2c845 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:f662786e7c202eaf6f892d95a2dac01ac5ab5a5d6a5129592a90b7430f9b5750" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..9fcb148bf924754000fe6665e1d842ab692bf206 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..3fcbadaf705adab2ddc27adc6e744f774dcaae19 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/canaries/first-hunk-only.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/compression_based.py b/textdistance/algorithms/compression_based.py +index 0a6ef3230eb536f8eb9d02c9c719a920a0946fd1..28fd15174c7e6a19af19e515ebee36d092a8c29e 100644 +--- a/textdistance/algorithms/compression_based.py ++++ b/textdistance/algorithms/compression_based.py +@@ -61,13 +61,13 @@ + data = empty.join(mutation) + else: + data = sum(mutation, empty) +- concat_len = max(concat_len, self._get_size(data)) # Altered from min to max ++ concat_len = min(concat_len, self._get_size(data)) # type: ignore[arg-type] + + compressed_lens = [self._get_size(s) for s in sequences] +- max_len = min(compressed_lens) # Altered from max to min ++ max_len = max(compressed_lens) + if max_len == 0: + return 0 +- return (concat_len - min(compressed_lens) * (len(sequences) + 1)) / max_len # Changed subtraction factor from -1 to +1 ++ return (concat_len - min(compressed_lens) * (len(sequences) - 1)) / max_len + + + class _BinaryNCDBase(_NCDBase): +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__8q8eg7bg/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..d4114c2568625c30b90a7dd5c5561918d1b68522 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "f2d6c59fd445eaca9d00e870d87253a7a23fe128616e0262a002744f0b2ad93e", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "b594e49d4e9fe18d6988464740444b79b754828a625bb90e526ddc82a84f1fd0", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": false, + "partial_repair_sha256": null, + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8", + "source_completion_sha256": "2771322706ffeda38afb3c77c6929483cc4b4b3df2ef4dc92a5713b6970c6427", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__bbyj98tv", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "34786ff5c1ddc163cceb073dc2606a6afe26aa5dfaeebb68a9436df3c70d6017", + "is_fork": true, + "learner_path": "tasks/33974455a5be70e8d0e725eb/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "9c1ec8b1276b59e048a1f5e8a486eb39e0f544420af129f4e38da94591517a4c", + "provenance_path": "tasks/33974455a5be70e8d0e725eb/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "6f8c4dd05ca45a96b7260203bb60dbb24cb5410c", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__bbyj98tv", + "task_sha256": "387a5162254377e42ad5f94f506d746b9221cbe193f436fd5de14755e48725f2", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__bbyj98tv", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..e097668d3e22be4ba690b2b3bf8f125e6b95299f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/instruction.md @@ -0,0 +1,42 @@ +Matrix algorithm returns incorrect similarity scores + +#### Description + +The Matrix similarity algorithm is returning incorrect scores when comparing sequences. The algorithm appears to be inverting match and mismatch costs and producing unexpected results. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# Create a simple matrix with match cost 10 and mismatch cost -1 +matrix = textdistance.Matrix( + mat={}, + match_cost=10, + mismatch_cost=-1 +) + +# Test identical sequences - should return match_cost (10) +result = matrix('A', 'A') +print(f"Identical sequences 'A', 'A': {result} (expected: 10)") + +# Test different sequences - should return mismatch_cost (-1) +result = matrix('A', 'C') +print(f"Different sequences 'A', 'C': {result} (expected: -1)") + +# Test with custom matrix values +custom_matrix = textdistance.Matrix( + mat={('T', 'C'): 0, ('C', 'T'): 0}, + match_cost=10, + mismatch_cost=-1 +) + +result = custom_matrix('T', 'C') +print(f"Custom matrix T->C: {result} (expected: 0)") +``` + +The output shows inverted costs where identical sequences return mismatch_cost instead of match_cost, and the algorithm behavior is completely reversed from what's expected. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..27942a934635a8b692b2aec2d8cb6ae503a48d5e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "6f8c4dd05ca45a96b7260203bb60dbb24cb5410c", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_common.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_edit/test_matrix.py", + "tests/test_edit/test_needleman_wunsch.py", + "tests/test_edit/test_smith_waterman.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/simple.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 499054, + "task_id": "life4__textdistance.c3aca916.combine_file__bbyj98tv", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__bbyj98tv", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "34786ff5c1ddc163cceb073dc2606a6afe26aa5dfaeebb68a9436df3c70d6017", + "is_fork": true, + "learner_path": "tasks/33974455a5be70e8d0e725eb/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "9c1ec8b1276b59e048a1f5e8a486eb39e0f544420af129f4e38da94591517a4c", + "provenance_path": "tasks/33974455a5be70e8d0e725eb/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "6f8c4dd05ca45a96b7260203bb60dbb24cb5410c", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__bbyj98tv", + "task_sha256": "387a5162254377e42ad5f94f506d746b9221cbe193f436fd5de14755e48725f2", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..9095e425b03e67e6ea03f094efc4b62e3819cf40 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "f2d6c59fd445eaca9d00e870d87253a7a23fe128616e0262a002744f0b2ad93e", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "2771322706ffeda38afb3c77c6929483cc4b4b3df2ef4dc92a5713b6970c6427", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "d2258e1d9b2d91f61c207bdcd838f34196bd56f6f1db02e8f90fb2623385ede3", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__bbyj98tv", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "34786ff5c1ddc163cceb073dc2606a6afe26aa5dfaeebb68a9436df3c70d6017", + "is_fork": true, + "learner_path": "tasks/33974455a5be70e8d0e725eb/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "9c1ec8b1276b59e048a1f5e8a486eb39e0f544420af129f4e38da94591517a4c", + "provenance_path": "tasks/33974455a5be70e8d0e725eb/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "1b2bb5c48f6dfd7dc053663dfc1879103a66c2a8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "6f8c4dd05ca45a96b7260203bb60dbb24cb5410c", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__bbyj98tv", + "task_sha256": "387a5162254377e42ad5f94f506d746b9221cbe193f436fd5de14755e48725f2", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..a38af0eb60e49817e6bf4ab03d0075a5d124e9a0 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/provided-gold.diff @@ -0,0 +1,52 @@ +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index f47d7a8f3eea2aecfdef881b70086fa366310621..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -91,33 +91,33 @@ + symmetric: bool = True, + external: bool = True, + ) -> None: +- self.mat = mismatch_cost +- self.mismatch_cost = mat +- self.match_cost = -match_cost +- self.symmetric = not symmetric ++ self.mat = mat ++ self.mismatch_cost = mismatch_cost ++ self.match_cost = match_cost ++ self.symmetric = symmetric + + def maximum(self, *sequences: Sequence) -> int: + return self.match_cost + + def __call__(self, *sequences: Sequence) -> int: + if not self.mat: +- if not self._ident(*sequences): ++ if self._ident(*sequences): + return self.match_cost + return self.mismatch_cost + +- # search in symmetric matrix first ++ # search in matrix ++ if sequences in self.mat: ++ return self.mat[sequences] ++ # search in symmetric matrix + if self.symmetric: + sequences = tuple(reversed(sequences)) + if sequences in self.mat: +- return self.mismatch_cost +- # search in matrix +- if sequences in self.mat: +- return self.mat[sequences] +- # if not identity then return match_cost +- if not self._ident(*sequences): +- return self.mismatch_cost ++ return self.mat[sequences] ++ # if identity then return match_cost ++ if self._ident(*sequences): ++ return self.match_cost + # not found +- return self.match_cost ++ return self.mismatch_cost + + + prefix = Prefix() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..088f677e13627b75f40f262c45022a8ca8fc5273 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/solution/solve.sh @@ -0,0 +1,58 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index f47d7a8f3eea2aecfdef881b70086fa366310621..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -91,33 +91,33 @@ + symmetric: bool = True, + external: bool = True, + ) -> None: +- self.mat = mismatch_cost +- self.mismatch_cost = mat +- self.match_cost = -match_cost +- self.symmetric = not symmetric ++ self.mat = mat ++ self.mismatch_cost = mismatch_cost ++ self.match_cost = match_cost ++ self.symmetric = symmetric + + def maximum(self, *sequences: Sequence) -> int: + return self.match_cost + + def __call__(self, *sequences: Sequence) -> int: + if not self.mat: +- if not self._ident(*sequences): ++ if self._ident(*sequences): + return self.match_cost + return self.mismatch_cost + +- # search in symmetric matrix first ++ # search in matrix ++ if sequences in self.mat: ++ return self.mat[sequences] ++ # search in symmetric matrix + if self.symmetric: + sequences = tuple(reversed(sequences)) + if sequences in self.mat: +- return self.mismatch_cost +- # search in matrix +- if sequences in self.mat: +- return self.mat[sequences] +- # if not identity then return match_cost +- if not self._ident(*sequences): +- return self.mismatch_cost ++ return self.mat[sequences] ++ # if identity then return match_cost ++ if self._ident(*sequences): ++ return self.match_cost + # not found +- return self.match_cost ++ return self.mismatch_cost + + + prefix = Prefix() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fb6ea18c83b9e5275bddb2ac3721be1c6b5d05cd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:de248af9564fafd911442bd1df50211d9ba59e6d55c078b83d0830f4a2455eac" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..b733b923a560a62f02a0bacf54e8ae97fc3ff333 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__bbyj98tv/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..cd9c60a526985e401c8f71d3417e9daec00e83b3 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "8de450d56f0a92dabc0d772576d587698a32acfaf56b5a9f9eb652f8270b87a5", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "b6c54bbe567106bda71f83274f4d460db41131d33d65ff442007efedfc9fbad8", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "272dd42266467504839bdd5c2d4e31b3585d81191cdc4105779a2341f23c8328", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "9e36e6cb9fcc58578c22c871e22198f78b4470c8", + "source_completion_sha256": "dd0594726766b834cb6cd47115f9d65c7e03a07bb70bdea0890c226d0fb67ef7", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__dejrv5vp", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "4673a172fef3c2563e30f978dcbe59ef1771bf044e2501215c9dcd238aaa24c3", + "is_fork": true, + "learner_path": "tasks/9fda51aaa3948f6e0c5c35c4/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/9e36e6cb9fcc58578c22c871e22198f78b4470c8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "c5d16f02345c294dd44eac3e6b116c5d1a81785573f38c3b3fc8bab131bc8f96", + "provenance_path": "tasks/9fda51aaa3948f6e0c5c35c4/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "9e36e6cb9fcc58578c22c871e22198f78b4470c8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "b49f1b5a6bdce70253cba9fc421a673dcd20124a", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__dejrv5vp", + "task_sha256": "2cbbea029d9777745cd8fd755907f51b2fd3e614f5c9042a7e4f8b6b592b4a74", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__dejrv5vp", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..cccd706c10e806d621e89ed870e03ec553542323 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/instruction.md @@ -0,0 +1,31 @@ +Bag distance algorithm returns incorrect values for identical strings + +#### Description + +The Bag distance algorithm is returning incorrect values when comparing identical strings. It should return 0 for identical inputs but is currently returning non-zero values. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# Test with identical strings +result = textdistance.bag('qwe', 'qwe') +print(f"Expected: 0, Got: {result}") + +# Test with anagrams (should also be 0) +result = textdistance.bag('qwe', 'ewq') +print(f"Expected: 0, Got: {result}") + +# Test with different strings +result = textdistance.bag('qwe', 'rtys') +print(f"Expected: 4, Got: {result}") +``` + +The bag distance should return 0 for identical strings and anagrams since they have the same character counts, but it's returning 3 instead of 0 for both identical strings and anagrams. + +Additionally, there seems to be an issue with the MongeElkan similarity algorithm returning unexpected results when the symmetric parameter is involved. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..d399b90283efd5283795ce8475df0941d231c1ed --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "b49f1b5a6bdce70253cba9fc421a673dcd20124a", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "9e36e6cb9fcc58578c22c871e22198f78b4470c8" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_token/test_bag.py", + "tests/test_token/test_monge_elkan.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/token_based.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 498757, + "task_id": "life4__textdistance.c3aca916.combine_file__dejrv5vp", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__dejrv5vp", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "4673a172fef3c2563e30f978dcbe59ef1771bf044e2501215c9dcd238aaa24c3", + "is_fork": true, + "learner_path": "tasks/9fda51aaa3948f6e0c5c35c4/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/9e36e6cb9fcc58578c22c871e22198f78b4470c8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "c5d16f02345c294dd44eac3e6b116c5d1a81785573f38c3b3fc8bab131bc8f96", + "provenance_path": "tasks/9fda51aaa3948f6e0c5c35c4/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "9e36e6cb9fcc58578c22c871e22198f78b4470c8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "b49f1b5a6bdce70253cba9fc421a673dcd20124a", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__dejrv5vp", + "task_sha256": "2cbbea029d9777745cd8fd755907f51b2fd3e614f5c9042a7e4f8b6b592b4a74", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..af64068fd072f43b50cfd9ff0b163ea421077ed4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "8de450d56f0a92dabc0d772576d587698a32acfaf56b5a9f9eb652f8270b87a5", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/9e36e6cb9fcc58578c22c871e22198f78b4470c8/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "dd0594726766b834cb6cd47115f9d65c7e03a07bb70bdea0890c226d0fb67ef7", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "511028365f9b694c520146ad701eabf7acc935a8e4cf7261e0943a57021f496e", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__dejrv5vp", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "4673a172fef3c2563e30f978dcbe59ef1771bf044e2501215c9dcd238aaa24c3", + "is_fork": true, + "learner_path": "tasks/9fda51aaa3948f6e0c5c35c4/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/9e36e6cb9fcc58578c22c871e22198f78b4470c8/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "c5d16f02345c294dd44eac3e6b116c5d1a81785573f38c3b3fc8bab131bc8f96", + "provenance_path": "tasks/9fda51aaa3948f6e0c5c35c4/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "9e36e6cb9fcc58578c22c871e22198f78b4470c8", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "b49f1b5a6bdce70253cba9fc421a673dcd20124a", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__dejrv5vp", + "task_sha256": "2cbbea029d9777745cd8fd755907f51b2fd3e614f5c9042a7e4f8b6b592b4a74", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..bd8cb2cb19cd9d62ca7a0280663de5178c5af5fe --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/provided-gold.diff @@ -0,0 +1,38 @@ +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index 0e0452964d486036186562ca632f08caf1b54454..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -259,16 +259,16 @@ + return sum(maxes) / len(seq) / len(maxes) + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_sequences(*sequences) + quick_result = self.quick_answer(*sequences) + if quick_result is not None: + return quick_result +- +- if not self.symmetric: ++ sequences = self._get_sequences(*sequences) ++ ++ if self.symmetric: + result = [] + for seqs in permutations(sequences): + result.append(self._calc(*seqs)) +- return sum(result) / (len(result) + 1) ++ return sum(result) / len(result) + else: + return self._calc(*sequences) + +@@ -279,9 +279,9 @@ + """ + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- return min(self._count_counters(sequence | intersection) for sequence in sequences) ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ return max(self._count_counters(sequence - intersection) for sequence in sequences) + + + bag = Bag() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..071a848f61ca3acab72e1300aa5d5fd19d8d64ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/solution/solve.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index 0e0452964d486036186562ca632f08caf1b54454..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -259,16 +259,16 @@ + return sum(maxes) / len(seq) / len(maxes) + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_sequences(*sequences) + quick_result = self.quick_answer(*sequences) + if quick_result is not None: + return quick_result +- +- if not self.symmetric: ++ sequences = self._get_sequences(*sequences) ++ ++ if self.symmetric: + result = [] + for seqs in permutations(sequences): + result.append(self._calc(*seqs)) +- return sum(result) / (len(result) + 1) ++ return sum(result) / len(result) + else: + return self._calc(*sequences) + +@@ -279,9 +279,9 @@ + """ + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- return min(self._count_counters(sequence | intersection) for sequence in sequences) ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ return max(self._count_counters(sequence - intersection) for sequence in sequences) + + + bag = Bag() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b2f82760c65b259e4f3dac8520b3eb1bc7608a19 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:b217dc683f4710664d4f492c8125a34fef9780f5d3a6edd431791240c922671f" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..976dd768eab691c8fa1596b20afcaeea303ba30b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..13c467b28fe5d8613c29964e5d9411ae029e2491 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/canaries/first-hunk-only.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index 0e0452964d486036186562ca632f08caf1b54454..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -259,16 +259,16 @@ + return sum(maxes) / len(seq) / len(maxes) + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_sequences(*sequences) + quick_result = self.quick_answer(*sequences) + if quick_result is not None: + return quick_result +- +- if not self.symmetric: ++ sequences = self._get_sequences(*sequences) ++ ++ if self.symmetric: + result = [] + for seqs in permutations(sequences): + result.append(self._calc(*seqs)) +- return sum(result) / (len(result) + 1) ++ return sum(result) / len(result) + else: + return self._calc(*sequences) + +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__dejrv5vp/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..b4c067c08db3c212fbbbb5410b357b27d8653196 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "5e4ee1868e168c04d3d727bd363460e5dfedb0d10270bd9ee8e1efe6ec487d2f", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "82f1946c4527cac5efdc058f699dc164560bc2dcd2bd52731e41ef75844f96a1", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "dc50a8f38a0af3566f0ca5c0c3c31d3b4f04f4cd46541e1d401b7e8ec26b124d", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "a47d7d000250afd9d15f98cbd32d632c77765036", + "source_completion_sha256": "efcf4d8eb8b24c64c8b0938400b82bb221d2d1f88a0d7b8f60947339e6e5a7e3", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__fhbklzxi", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "3daa8a022db62c02a7e5dd6c6ecb3496f31de8778433d93e60e3edc403227014", + "is_fork": true, + "learner_path": "tasks/fb1f1a9691c3be59e7bc9a60/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/a47d7d000250afd9d15f98cbd32d632c77765036/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "942e54c42d7fd442a124114736820f88636288213eacb5e6d0d45f0fd3ccfa09", + "provenance_path": "tasks/fb1f1a9691c3be59e7bc9a60/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "a47d7d000250afd9d15f98cbd32d632c77765036", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "1b626c7ab04b1509c7130668abeb24ba59845b9d", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__fhbklzxi", + "task_sha256": "5ce3d4b9c59c791b95ee04373f29fd30826df91084da6df05d0a29fa4c061b40", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__fhbklzxi", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..a8d23a70e030ffb8eee3dac60729faee9c637995 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/instruction.md @@ -0,0 +1,31 @@ +Tversky similarity returns incorrect results after recent changes + +#### Description + +The Tversky similarity algorithm is producing unexpected results. When comparing identical strings, it should return a similarity of 1.0, but it's now returning different values or causing division by zero errors. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# This should return 1.0 for identical strings +tversky = textdistance.Tversky() +result = tversky.similarity('test', 'test') +print(f"Expected: 1.0, Got: {result}") + +# This should work without errors +jaccard = textdistance.Jaccard() +tversky_equiv = textdistance.Tversky(ks=[0.5, 0.5]) +result1 = jaccard.distance('hello', 'world') +result2 = tversky_equiv.distance('hello', 'world') +print(f"Jaccard: {result1}, Tversky equivalent: {result2}") +``` + +Also affects other token-based algorithms that depend on similar calculations. The Bag distance algorithm is also returning unexpected values - identical strings like 'qwe' and 'qwe' should have distance 0 but are returning 3. + +MongeElkan similarity values are also off from expected results. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..86ab2f93b9e8cccc15addcdf615347b2a393a985 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "1b626c7ab04b1509c7130668abeb24ba59845b9d", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "a47d7d000250afd9d15f98cbd32d632c77765036" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_token/test_bag.py", + "tests/test_token/test_jaccard.py", + "tests/test_token/test_monge_elkan.py", + "tests/test_token/test_sorensen.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/token_based.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 496859, + "task_id": "life4__textdistance.c3aca916.combine_file__fhbklzxi", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__fhbklzxi", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "3daa8a022db62c02a7e5dd6c6ecb3496f31de8778433d93e60e3edc403227014", + "is_fork": true, + "learner_path": "tasks/fb1f1a9691c3be59e7bc9a60/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/a47d7d000250afd9d15f98cbd32d632c77765036/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "942e54c42d7fd442a124114736820f88636288213eacb5e6d0d45f0fd3ccfa09", + "provenance_path": "tasks/fb1f1a9691c3be59e7bc9a60/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "a47d7d000250afd9d15f98cbd32d632c77765036", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "1b626c7ab04b1509c7130668abeb24ba59845b9d", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__fhbklzxi", + "task_sha256": "5ce3d4b9c59c791b95ee04373f29fd30826df91084da6df05d0a29fa4c061b40", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..9621dd4947e7976b50071b09189655008d17ec8f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "5e4ee1868e168c04d3d727bd363460e5dfedb0d10270bd9ee8e1efe6ec487d2f", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/a47d7d000250afd9d15f98cbd32d632c77765036/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "efcf4d8eb8b24c64c8b0938400b82bb221d2d1f88a0d7b8f60947339e6e5a7e3", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "5b7f8d4103df53bb3def982ac72d5fff101f322e6a17c331cb16926de8e00514", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__fhbklzxi", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "3daa8a022db62c02a7e5dd6c6ecb3496f31de8778433d93e60e3edc403227014", + "is_fork": true, + "learner_path": "tasks/fb1f1a9691c3be59e7bc9a60/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/a47d7d000250afd9d15f98cbd32d632c77765036/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "942e54c42d7fd442a124114736820f88636288213eacb5e6d0d45f0fd3ccfa09", + "provenance_path": "tasks/fb1f1a9691c3be59e7bc9a60/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "a47d7d000250afd9d15f98cbd32d632c77765036", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "1b626c7ab04b1509c7130668abeb24ba59845b9d", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__fhbklzxi", + "task_sha256": "5ce3d4b9c59c791b95ee04373f29fd30826df91084da6df05d0a29fa4c061b40", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..8bba9bd72a2dd098bf619e474c3e753acf9655ac --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/provided-gold.diff @@ -0,0 +1,75 @@ +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index b9a97f977c0ac6bc6fa2c3062adbe2aab2002d8c..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -117,25 +117,25 @@ + if quick_result is not None: + return quick_result + +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- intersection = self._count_counters(intersection) +- sequences = [self._count_counters(s) for s in sequences] ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ intersection = self._count_counters(intersection) # int ++ sequences = [self._count_counters(s) for s in sequences] # ints + ks = list(islice(self.ks, len(sequences))) + + if len(sequences) != 2 or self.bias is None: + result = intersection + for k, s in zip(ks, sequences): +- result += k * (intersection - s) # Altered order +- return result / intersection # Incorrect division ++ result += k * (s - intersection) ++ return intersection / result + + s1, s2 = sequences + alpha, beta = ks +- a_val = max([s1, s2]) # Swapped max with min +- b_val = min([s1, s2]) # Swapped min with max +- c_val = intersection - self.bias # Incorrect sign +- result = alpha * beta * (b_val - a_val) - a_val * alpha # Incorrect computation +- return result / (c_val + result) # Different division logic ++ a_val = min([s1, s2]) ++ b_val = max([s1, s2]) ++ c_val = intersection + self.bias ++ result = alpha * beta * (a_val - b_val) + b_val * beta ++ return c_val / (result + c_val) + + + class Overlap(_BaseSimilarity): +@@ -259,16 +259,16 @@ + return sum(maxes) / len(seq) / len(maxes) + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_sequences(*sequences) + quick_result = self.quick_answer(*sequences) + if quick_result is not None: + return quick_result +- +- if not self.symmetric: ++ sequences = self._get_sequences(*sequences) ++ ++ if self.symmetric: + result = [] + for seqs in permutations(sequences): + result.append(self._calc(*seqs)) +- return sum(result) / (len(result) + 1) ++ return sum(result) / len(result) + else: + return self._calc(*sequences) + +@@ -279,9 +279,9 @@ + """ + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- return min(self._count_counters(sequence | intersection) for sequence in sequences) ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ return max(self._count_counters(sequence - intersection) for sequence in sequences) + + + bag = Bag() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e646c44dce982497115040ccf8229d05962a1102 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/solution/solve.sh @@ -0,0 +1,81 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index b9a97f977c0ac6bc6fa2c3062adbe2aab2002d8c..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -117,25 +117,25 @@ + if quick_result is not None: + return quick_result + +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- intersection = self._count_counters(intersection) +- sequences = [self._count_counters(s) for s in sequences] ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ intersection = self._count_counters(intersection) # int ++ sequences = [self._count_counters(s) for s in sequences] # ints + ks = list(islice(self.ks, len(sequences))) + + if len(sequences) != 2 or self.bias is None: + result = intersection + for k, s in zip(ks, sequences): +- result += k * (intersection - s) # Altered order +- return result / intersection # Incorrect division ++ result += k * (s - intersection) ++ return intersection / result + + s1, s2 = sequences + alpha, beta = ks +- a_val = max([s1, s2]) # Swapped max with min +- b_val = min([s1, s2]) # Swapped min with max +- c_val = intersection - self.bias # Incorrect sign +- result = alpha * beta * (b_val - a_val) - a_val * alpha # Incorrect computation +- return result / (c_val + result) # Different division logic ++ a_val = min([s1, s2]) ++ b_val = max([s1, s2]) ++ c_val = intersection + self.bias ++ result = alpha * beta * (a_val - b_val) + b_val * beta ++ return c_val / (result + c_val) + + + class Overlap(_BaseSimilarity): +@@ -259,16 +259,16 @@ + return sum(maxes) / len(seq) / len(maxes) + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_sequences(*sequences) + quick_result = self.quick_answer(*sequences) + if quick_result is not None: + return quick_result +- +- if not self.symmetric: ++ sequences = self._get_sequences(*sequences) ++ ++ if self.symmetric: + result = [] + for seqs in permutations(sequences): + result.append(self._calc(*seqs)) +- return sum(result) / (len(result) + 1) ++ return sum(result) / len(result) + else: + return self._calc(*sequences) + +@@ -279,9 +279,9 @@ + """ + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- return min(self._count_counters(sequence | intersection) for sequence in sequences) ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ return max(self._count_counters(sequence - intersection) for sequence in sequences) + + + bag = Bag() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f0818fa93b2c4356728a96707906e1f3e1f78e87 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:5e1ac002a737219aa47b575b8e65c151c179ad89f307c07cfe7120622dbe0086" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..5302e460e46160adcc6ff0443f7e551933196171 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..ce6ece5797aeabc39996d556e1e286293c8e02be --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/canaries/first-hunk-only.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index b9a97f977c0ac6bc6fa2c3062adbe2aab2002d8c..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -117,25 +117,25 @@ + if quick_result is not None: + return quick_result + +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- intersection = self._count_counters(intersection) +- sequences = [self._count_counters(s) for s in sequences] ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ intersection = self._count_counters(intersection) # int ++ sequences = [self._count_counters(s) for s in sequences] # ints + ks = list(islice(self.ks, len(sequences))) + + if len(sequences) != 2 or self.bias is None: + result = intersection + for k, s in zip(ks, sequences): +- result += k * (intersection - s) # Altered order +- return result / intersection # Incorrect division ++ result += k * (s - intersection) ++ return intersection / result + + s1, s2 = sequences + alpha, beta = ks +- a_val = max([s1, s2]) # Swapped max with min +- b_val = min([s1, s2]) # Swapped min with max +- c_val = intersection - self.bias # Incorrect sign +- result = alpha * beta * (b_val - a_val) - a_val * alpha # Incorrect computation +- return result / (c_val + result) # Different division logic ++ a_val = min([s1, s2]) ++ b_val = max([s1, s2]) ++ c_val = intersection + self.bias ++ result = alpha * beta * (a_val - b_val) + b_val * beta ++ return c_val / (result + c_val) + + + class Overlap(_BaseSimilarity): +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__fhbklzxi/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..63ed4ec98169cfaaff2d5f0b9caa38cf89140b53 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "b5e2dee7cbd1c25ad979c3b615e02ffb5367fe7c4371ce4cbaa9b40229273499", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "74482c1c0fd4efeacc097a4e04af0d23f38cebcdec9a5a7eab0918edbedeeece", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "87b669e2f448ada16b37a9b1807db3ecb224c3c7e4b77dc4fe1fbba024d419ea", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544", + "source_completion_sha256": "c1fd672296a561552581008e830bd168e62adcb749343b717d11f2fc6170d558", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__ftg75t9n", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "35dca00723b3b90caa6e3b7674195ec82dcf71273e3aa1144f37f34b9973e6f6", + "is_fork": true, + "learner_path": "tasks/0254adeb889e206bf5501962/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "6b7c53774075a0cdcf96cf6592e63208c350c35da0c69ded6a1691d390fa0912", + "provenance_path": "tasks/0254adeb889e206bf5501962/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "6f646f6afbb202dd82932e3815900244eae00c61", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__ftg75t9n", + "task_sha256": "9240af40c42601d5a6badd05e90baa14d1b7fb04184ba3a16f67c3f9566019f3", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__ftg75t9n", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..91c14db7cb174fa73f6ecfca0056a75e7bf3527b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/instruction.md @@ -0,0 +1,39 @@ +LCS algorithms returning incorrect results after recent changes + +#### Description + +The LCS (Longest Common Subsequence) algorithms are producing incorrect outputs. When comparing strings, they're returning unexpected subsequences or empty strings when they should find common characters. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# Test LCSSeq +lcs_seq = textdistance.lcsseq +result = lcs_seq('test', 'text') +print(f"LCSSeq result: '{result}' (expected: 'tet')") + +result = lcs_seq('abcd', 'abcd') +print(f"LCSSeq identical strings: '{result}' (expected: 'abcd')") + +# Test LCSStr +lcs_str = textdistance.lcsstr +result = lcs_str('abcd', 'ab') +print(f"LCSStr result: '{result}' (expected: 'ab')") + +result = lcs_str('abcd', 'bc') +print(f"LCSStr result: '{result}' (expected: 'bc')") + +# Test with multiple sequences +result = lcs_seq('test', 'text', 'tempest') +print(f"Multi-sequence result: '{result}' (expected: 'tet')") +``` + +The algorithms seem to be returning wrong values - sometimes empty strings when there should be matches, or incorrect subsequences. This affects both the sequence-based and string-based LCS implementations. + +Also noticed that RatcliffObershelp similarity scores are coming out negative in some cases, which doesn't make sense for a similarity measure. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..4a26c5462d96e5a328d79ecc573c9fcc1f04a3e1 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "6f646f6afbb202dd82932e3815900244eae00c61", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_sequence/test_lcsseq.py", + "tests/test_sequence/test_lcsstr.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/sequence_based.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 497745, + "task_id": "life4__textdistance.c3aca916.combine_file__ftg75t9n", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__ftg75t9n", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "35dca00723b3b90caa6e3b7674195ec82dcf71273e3aa1144f37f34b9973e6f6", + "is_fork": true, + "learner_path": "tasks/0254adeb889e206bf5501962/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "6b7c53774075a0cdcf96cf6592e63208c350c35da0c69ded6a1691d390fa0912", + "provenance_path": "tasks/0254adeb889e206bf5501962/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "6f646f6afbb202dd82932e3815900244eae00c61", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__ftg75t9n", + "task_sha256": "9240af40c42601d5a6badd05e90baa14d1b7fb04184ba3a16f67c3f9566019f3", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..4c336c39a5086d6a366cb090a7a712f2b865b948 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "b5e2dee7cbd1c25ad979c3b615e02ffb5367fe7c4371ce4cbaa9b40229273499", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "c1fd672296a561552581008e830bd168e62adcb749343b717d11f2fc6170d558", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "4f93178236e474b98b7705c0ea7169a41d97a12c888829bbc21331f9452c2308", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__ftg75t9n", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "35dca00723b3b90caa6e3b7674195ec82dcf71273e3aa1144f37f34b9973e6f6", + "is_fork": true, + "learner_path": "tasks/0254adeb889e206bf5501962/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "6b7c53774075a0cdcf96cf6592e63208c350c35da0c69ded6a1691d390fa0912", + "provenance_path": "tasks/0254adeb889e206bf5501962/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "4f16eb98f9d8ba6d60aa2ce93dca9a4db1b83544", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "6f646f6afbb202dd82932e3815900244eae00c61", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__ftg75t9n", + "task_sha256": "9240af40c42601d5a6badd05e90baa14d1b7fb04184ba3a16f67c3f9566019f3", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..f891bf0d2061a8b2e3b344c0e6a13042fe33d10a --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/provided-gold.diff @@ -0,0 +1,83 @@ +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index 7edc7e15a2ccd659e8404d3386f89f228732d8b6..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -37,9 +37,9 @@ + test_func: TestFunc = None, + external: bool = True, + ) -> None: +- self.qval = qval + 1 +- self.test_func = self._ident if test_func is None else test_func +- self.external = not external ++ self.qval = qval ++ self.test_func = test_func or self._ident ++ self.external = external + + def _dynamic(self, seq1: str, seq2: str) -> str: + """ +@@ -53,13 +53,15 @@ + else: + lengths = [array('L', [0] * (len(seq2) + 1)) for _ in range(len(seq1) + 1)] + ++ # row 0 and column 0 are initialized to 0 already + for i, char1 in enumerate(seq1): + for j, char2 in enumerate(seq2): + if char1 == char2: + lengths[i + 1][j + 1] = lengths[i][j] + 1 + else: +- lengths[i + 1][j + 1] = min(lengths[i + 1][j], lengths[i][j + 1]) ++ lengths[i + 1][j + 1] = max(lengths[i + 1][j], lengths[i][j + 1]) + ++ # read the substring out from the matrix + result = '' + i, j = len(seq1), len(seq2) + while i != 0 and j != 0: +@@ -68,8 +70,8 @@ + elif lengths[i][j] == lengths[i][j - 1]: + j -= 1 + else: +- assert seq1[i - 1] != seq2[j - 1] +- result = seq2[j - 1] + result ++ assert seq1[i - 1] == seq2[j - 1] ++ result = seq1[i - 1] + result + i -= 1 + j -= 1 + return result +@@ -123,7 +125,7 @@ + return type(short)() # empty sequence + + def __call__(self, *sequences: str) -> str: +- if all(sequences): ++ if not all(sequences): + return '' + length = len(sequences) + if length == 0: +@@ -132,9 +134,9 @@ + return sequences[0] + + sequences = self._get_sequences(*sequences) +- if length == 2 and min(map(len, sequences)) < 200: +- return self._custom(*sequences) +- return self._standart(*sequences) ++ if length == 2 and max(map(len, sequences)) < 200: ++ return self._standart(*sequences) ++ return self._custom(*sequences) + + def similarity(self, *sequences: str) -> int: + return len(self(*sequences)) +@@ -172,11 +174,11 @@ + def __call__(self, *sequences: str) -> float: + result = self.quick_answer(*sequences) + if result is not None: +- return -result +- scount = len(sequences) +- ecount = sum(map(len, sequences)) ++ return result ++ scount = len(sequences) # sequences count ++ ecount = sum(map(len, sequences)) # elements count + sequences = self._get_sequences(*sequences) +- return (scount + self._find(*sequences)) / (ecount + 1) ++ return scount * self._find(*sequences) / ecount + + + lcsseq = LCSSeq() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..7a0a6f632d1fa58ea7fd642a88c85f99dde3e8a0 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/solution/solve.sh @@ -0,0 +1,89 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index 7edc7e15a2ccd659e8404d3386f89f228732d8b6..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -37,9 +37,9 @@ + test_func: TestFunc = None, + external: bool = True, + ) -> None: +- self.qval = qval + 1 +- self.test_func = self._ident if test_func is None else test_func +- self.external = not external ++ self.qval = qval ++ self.test_func = test_func or self._ident ++ self.external = external + + def _dynamic(self, seq1: str, seq2: str) -> str: + """ +@@ -53,13 +53,15 @@ + else: + lengths = [array('L', [0] * (len(seq2) + 1)) for _ in range(len(seq1) + 1)] + ++ # row 0 and column 0 are initialized to 0 already + for i, char1 in enumerate(seq1): + for j, char2 in enumerate(seq2): + if char1 == char2: + lengths[i + 1][j + 1] = lengths[i][j] + 1 + else: +- lengths[i + 1][j + 1] = min(lengths[i + 1][j], lengths[i][j + 1]) ++ lengths[i + 1][j + 1] = max(lengths[i + 1][j], lengths[i][j + 1]) + ++ # read the substring out from the matrix + result = '' + i, j = len(seq1), len(seq2) + while i != 0 and j != 0: +@@ -68,8 +70,8 @@ + elif lengths[i][j] == lengths[i][j - 1]: + j -= 1 + else: +- assert seq1[i - 1] != seq2[j - 1] +- result = seq2[j - 1] + result ++ assert seq1[i - 1] == seq2[j - 1] ++ result = seq1[i - 1] + result + i -= 1 + j -= 1 + return result +@@ -123,7 +125,7 @@ + return type(short)() # empty sequence + + def __call__(self, *sequences: str) -> str: +- if all(sequences): ++ if not all(sequences): + return '' + length = len(sequences) + if length == 0: +@@ -132,9 +134,9 @@ + return sequences[0] + + sequences = self._get_sequences(*sequences) +- if length == 2 and min(map(len, sequences)) < 200: +- return self._custom(*sequences) +- return self._standart(*sequences) ++ if length == 2 and max(map(len, sequences)) < 200: ++ return self._standart(*sequences) ++ return self._custom(*sequences) + + def similarity(self, *sequences: str) -> int: + return len(self(*sequences)) +@@ -172,11 +174,11 @@ + def __call__(self, *sequences: str) -> float: + result = self.quick_answer(*sequences) + if result is not None: +- return -result +- scount = len(sequences) +- ecount = sum(map(len, sequences)) ++ return result ++ scount = len(sequences) # sequences count ++ ecount = sum(map(len, sequences)) # elements count + sequences = self._get_sequences(*sequences) +- return (scount + self._find(*sequences)) / (ecount + 1) ++ return scount * self._find(*sequences) / ecount + + + lcsseq = LCSSeq() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fbe01b02f30e7b6919e44f7a1cf54c13ab1b073b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:a875debbf1e4f054aab053c3c5689283e55a5f4494492619949c4945a388e4de" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..48006cfc88fb365fcafef555c736d5217016848d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..d7e053fb99160e538b9d11e20638e17903608b62 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/canaries/first-hunk-only.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index 7edc7e15a2ccd659e8404d3386f89f228732d8b6..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -37,9 +37,9 @@ + test_func: TestFunc = None, + external: bool = True, + ) -> None: +- self.qval = qval + 1 +- self.test_func = self._ident if test_func is None else test_func +- self.external = not external ++ self.qval = qval ++ self.test_func = test_func or self._ident ++ self.external = external + + def _dynamic(self, seq1: str, seq2: str) -> str: + """ +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__ftg75t9n/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..cc5bd8be2eeda3b12d09be8ece40bbe5b656ab0d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "f801bef18b405b77679b61d10cdcc732e7bd9266c6efc5219ba0d0dd404e9430", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "3e7f9b65b2494a7cdb3c2c902f3b4cc787281889b467c56dc78bd2e2a4a94c2d", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "a0f6af09e730229788a3e0828d94aace78b216561df14f401c58f05a50c65426", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "5d2e4ee43e3efa1204278a66f52299f9906cb714", + "source_completion_sha256": "09d4cb732c604698f04816fd5219209e2b684855de717df99c39a43407fb569a", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__hxml8xjz", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "81a5ae91ccdc10f0be037264512f770ca4cae59620303a497eca04d8244bd237", + "is_fork": true, + "learner_path": "tasks/a10ec9f092d78eaa7b4b5f5b/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/5d2e4ee43e3efa1204278a66f52299f9906cb714/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "81d8343cd013dcaccefd2639d3cd5f0b58e62cc1babe04622670d727b367a4be", + "provenance_path": "tasks/a10ec9f092d78eaa7b4b5f5b/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "5d2e4ee43e3efa1204278a66f52299f9906cb714", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "70c5574f81cb59b791cc7d9127bc23111797e513", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__hxml8xjz", + "task_sha256": "db57870c1dd903e71043c5a3850a78b9bc50558b6e71d4c63c8d8694a72422f7", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__hxml8xjz", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..911d3a09d2ad7f8f7423304c70dd042aebbd32dd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/instruction.md @@ -0,0 +1,30 @@ +Jaccard similarity returns incorrect results due to variable ordering issue + +#### Description + +The Jaccard similarity algorithm is producing incorrect results. When comparing identical strings, it should return a similarity of 1.0, but instead it's throwing an `UnboundLocalError`. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# This should return 1.0 for identical strings +result = textdistance.jaccard.similarity('test', 'test') +print(f"Expected: 1.0, Got: {result}") + +# This should return 0.6 for these strings +result = textdistance.jaccard.similarity('test', 'text') +print(f"Expected: 0.6, Got: {result}") +``` + +The code above raises: +``` +UnboundLocalError: local variable 'intersection' referenced before assignment +``` + +Similar issues occur with the Bag distance algorithm where identical strings return unexpected values instead of 0. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..abcafd61777d742418cba533ad42bcb3e921ace7 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "70c5574f81cb59b791cc7d9127bc23111797e513", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "5d2e4ee43e3efa1204278a66f52299f9906cb714" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_token/test_bag.py", + "tests/test_token/test_jaccard.py", + "tests/test_token/test_monge_elkan.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/token_based.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 496687, + "task_id": "life4__textdistance.c3aca916.combine_file__hxml8xjz", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__hxml8xjz", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "81a5ae91ccdc10f0be037264512f770ca4cae59620303a497eca04d8244bd237", + "is_fork": true, + "learner_path": "tasks/a10ec9f092d78eaa7b4b5f5b/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/5d2e4ee43e3efa1204278a66f52299f9906cb714/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "81d8343cd013dcaccefd2639d3cd5f0b58e62cc1babe04622670d727b367a4be", + "provenance_path": "tasks/a10ec9f092d78eaa7b4b5f5b/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "5d2e4ee43e3efa1204278a66f52299f9906cb714", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "70c5574f81cb59b791cc7d9127bc23111797e513", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__hxml8xjz", + "task_sha256": "db57870c1dd903e71043c5a3850a78b9bc50558b6e71d4c63c8d8694a72422f7", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..9a02561e4be67c58f6b0cc4833d61c66ec260977 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "f801bef18b405b77679b61d10cdcc732e7bd9266c6efc5219ba0d0dd404e9430", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/5d2e4ee43e3efa1204278a66f52299f9906cb714/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "09d4cb732c604698f04816fd5219209e2b684855de717df99c39a43407fb569a", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "10174f8f4fdd11425cd94730e63cd1b51de4b280ba95d7d935f4c778da822ca6", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__hxml8xjz", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "81a5ae91ccdc10f0be037264512f770ca4cae59620303a497eca04d8244bd237", + "is_fork": true, + "learner_path": "tasks/a10ec9f092d78eaa7b4b5f5b/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/5d2e4ee43e3efa1204278a66f52299f9906cb714/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "81d8343cd013dcaccefd2639d3cd5f0b58e62cc1babe04622670d727b367a4be", + "provenance_path": "tasks/a10ec9f092d78eaa7b4b5f5b/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "5d2e4ee43e3efa1204278a66f52299f9906cb714", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "70c5574f81cb59b791cc7d9127bc23111797e513", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__hxml8xjz", + "task_sha256": "db57870c1dd903e71043c5a3850a78b9bc50558b6e71d4c63c8d8694a72422f7", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..4651e367fe378c0bd331916dd728e24c43e7410f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/provided-gold.diff @@ -0,0 +1,62 @@ +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index c6baa5da3dcb5516831c41a9e28c887dc50dc11c..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -46,15 +46,16 @@ + + def __call__(self, *sequences: Sequence) -> float: + result = self.quick_answer(*sequences) ++ if result is not None: ++ return result ++ ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ intersection = self._count_counters(intersection) # int ++ union = self._union_counters(*sequences) # set + union = self._count_counters(union) # int +- intersection = self._intersect_counters(*sequences) # set +- if result is not None: +- return result +- +- sequences = self._get_counters(*sequences) # sets +- union = self._union_counters(*sequences) # set + return intersection / union +- intersection = self._count_counters(intersection) # int ++ + + class Sorensen(_BaseSimilarity): + """ +@@ -257,15 +258,30 @@ + maxes.append(max_sim) + return sum(maxes) / len(seq) / len(maxes) + ++ def __call__(self, *sequences: Sequence) -> float: ++ quick_result = self.quick_answer(*sequences) ++ if quick_result is not None: ++ return quick_result ++ sequences = self._get_sequences(*sequences) ++ ++ if self.symmetric: ++ result = [] ++ for seqs in permutations(sequences): ++ result.append(self._calc(*seqs)) ++ return sum(result) / len(result) ++ else: ++ return self._calc(*sequences) ++ ++ + class Bag(_Base): + """Bag distance + https://github.com/Yomguithereal/talisman/blob/master/src/metrics/bag.js + """ + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- return min(self._count_counters(sequence | intersection) for sequence in sequences) ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ return max(self._count_counters(sequence - intersection) for sequence in sequences) + + + bag = Bag() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..86a58fde751dd75a01089de7bb65e63f88f728c8 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/solution/solve.sh @@ -0,0 +1,68 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index c6baa5da3dcb5516831c41a9e28c887dc50dc11c..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -46,15 +46,16 @@ + + def __call__(self, *sequences: Sequence) -> float: + result = self.quick_answer(*sequences) ++ if result is not None: ++ return result ++ ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ intersection = self._count_counters(intersection) # int ++ union = self._union_counters(*sequences) # set + union = self._count_counters(union) # int +- intersection = self._intersect_counters(*sequences) # set +- if result is not None: +- return result +- +- sequences = self._get_counters(*sequences) # sets +- union = self._union_counters(*sequences) # set + return intersection / union +- intersection = self._count_counters(intersection) # int ++ + + class Sorensen(_BaseSimilarity): + """ +@@ -257,15 +258,30 @@ + maxes.append(max_sim) + return sum(maxes) / len(seq) / len(maxes) + ++ def __call__(self, *sequences: Sequence) -> float: ++ quick_result = self.quick_answer(*sequences) ++ if quick_result is not None: ++ return quick_result ++ sequences = self._get_sequences(*sequences) ++ ++ if self.symmetric: ++ result = [] ++ for seqs in permutations(sequences): ++ result.append(self._calc(*seqs)) ++ return sum(result) / len(result) ++ else: ++ return self._calc(*sequences) ++ ++ + class Bag(_Base): + """Bag distance + https://github.com/Yomguithereal/talisman/blob/master/src/metrics/bag.js + """ + + def __call__(self, *sequences: Sequence) -> float: +- sequences = self._get_counters(*sequences) +- intersection = self._intersect_counters(*sequences) +- return min(self._count_counters(sequence | intersection) for sequence in sequences) ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ return max(self._count_counters(sequence - intersection) for sequence in sequences) + + + bag = Bag() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4a191bd3f582822e180fb7660345a50f25f0e9f9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:eb005594343de4f94fe0391eb801cb486306fcc4c18e5eecd610e6b8541e7b68" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..c383e4139e6259f54676df9d97e599b73813bc1b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..dfc09ef45b534d062ad3d227dad3eeb0c2bd1fa3 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/canaries/first-hunk-only.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/token_based.py b/textdistance/algorithms/token_based.py +index c6baa5da3dcb5516831c41a9e28c887dc50dc11c..d499b8468f52923d3767bcec9687d1358c8fd456 100644 +--- a/textdistance/algorithms/token_based.py ++++ b/textdistance/algorithms/token_based.py +@@ -46,15 +46,16 @@ + + def __call__(self, *sequences: Sequence) -> float: + result = self.quick_answer(*sequences) ++ if result is not None: ++ return result ++ ++ sequences = self._get_counters(*sequences) # sets ++ intersection = self._intersect_counters(*sequences) # set ++ intersection = self._count_counters(intersection) # int ++ union = self._union_counters(*sequences) # set + union = self._count_counters(union) # int +- intersection = self._intersect_counters(*sequences) # set +- if result is not None: +- return result +- +- sequences = self._get_counters(*sequences) # sets +- union = self._union_counters(*sequences) # set + return intersection / union +- intersection = self._count_counters(intersection) # int ++ + + class Sorensen(_BaseSimilarity): + """ +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__hxml8xjz/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..3a14801cec138d9dc8f8d45802987405fcdec3c1 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "f795e1b47e6be519aa74624de0725d175e5ff1f7ed6a489baaf5aa111f65a2af", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "5b189c4a7ef69f01648884d30e1a95a7e5806469c62f094c949cb53df87607c6", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "eb3b6b98eb6640a5cbd48fff275ef4589901ada9f3d69bc64be82d536846f57d", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "c81cfb53d3d9173055e0d84414c4028e37f84f3a", + "source_completion_sha256": "41f9e45713391cea26459e10cc2c0767ced8016bda68b33805e9f582a78a578d", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__irnwrsux", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "9fcc8b993c49777a3db995a2011a4d111de1ee659e521513de10750306925046", + "is_fork": true, + "learner_path": "tasks/2f1c7d6b246b897d46af85e3/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/c81cfb53d3d9173055e0d84414c4028e37f84f3a/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "acde2c4fffcf82a4d10fdaa15f07b8b0dafe698a282cfc689a8e050abf968197", + "provenance_path": "tasks/2f1c7d6b246b897d46af85e3/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "c81cfb53d3d9173055e0d84414c4028e37f84f3a", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "dbcffc63fe5a2588a08ac57aa82cd29d9061448e", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__irnwrsux", + "task_sha256": "b687c28c564d9aa709f4454e3570483e6eba67b7e1422899c0d3ef996a7fd033", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__irnwrsux", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..08c3fe90061954c49861e49133b1a833c429f49a --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/instruction.md @@ -0,0 +1,34 @@ +# Multiple issues with text distance algorithms + +## Description + +I've found several issues with the text distance algorithms in the latest version: + +1. The Prefix algorithm is returning incorrect results. When comparing sequences, it seems to be reversing the input sequences, which causes incorrect prefix detection. For example: +```python +from textdistance import prefix +print(prefix('hello', 'help')) # Should return 3 (for "hel"), but returns 0 +``` + +2. The Identity algorithm is inverted - it returns 1 when sequences are different and 0 when they're identical: +```python +from textdistance import identity +print(identity('abc', 'abc')) # Should return 1, but returns 0 +print(identity('abc', 'def')) # Should return 0, but returns 1 +``` + +3. The Matrix algorithm has issues with symmetric matrices and empty inputs: +```python +from textdistance import Matrix +matrix = Matrix({('a', 'b'): 4}) +print(matrix('a', 'b')) # Returns incorrect value +print(matrix('b', 'a')) # Symmetric case fails +``` + +These issues are causing unexpected behavior in our text processing pipeline. The algorithms are returning values that are opposite of what they should be returning, making our similarity calculations completely wrong. + +To reproduce, simply try comparing strings with these algorithms and you'll see the unexpected results. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..8421a79a26c89f1cf73a67b51361b18d961ff799 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "dbcffc63fe5a2588a08ac57aa82cd29d9061448e", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "c81cfb53d3d9173055e0d84414c4028e37f84f3a" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_edit/test_matrix.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/simple.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 499017, + "task_id": "life4__textdistance.c3aca916.combine_file__irnwrsux", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__irnwrsux", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "9fcc8b993c49777a3db995a2011a4d111de1ee659e521513de10750306925046", + "is_fork": true, + "learner_path": "tasks/2f1c7d6b246b897d46af85e3/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/c81cfb53d3d9173055e0d84414c4028e37f84f3a/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "acde2c4fffcf82a4d10fdaa15f07b8b0dafe698a282cfc689a8e050abf968197", + "provenance_path": "tasks/2f1c7d6b246b897d46af85e3/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "c81cfb53d3d9173055e0d84414c4028e37f84f3a", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "dbcffc63fe5a2588a08ac57aa82cd29d9061448e", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__irnwrsux", + "task_sha256": "b687c28c564d9aa709f4454e3570483e6eba67b7e1422899c0d3ef996a7fd033", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..97a95572ce5526390202bd09bbde1dd13fe4376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "f795e1b47e6be519aa74624de0725d175e5ff1f7ed6a489baaf5aa111f65a2af", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/c81cfb53d3d9173055e0d84414c4028e37f84f3a/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "41f9e45713391cea26459e10cc2c0767ced8016bda68b33805e9f582a78a578d", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "94f2171caecaf76e4011027285501f03e7193aadab05255f48afbe23c9459f14", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__irnwrsux", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "9fcc8b993c49777a3db995a2011a4d111de1ee659e521513de10750306925046", + "is_fork": true, + "learner_path": "tasks/2f1c7d6b246b897d46af85e3/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/c81cfb53d3d9173055e0d84414c4028e37f84f3a/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "acde2c4fffcf82a4d10fdaa15f07b8b0dafe698a282cfc689a8e050abf968197", + "provenance_path": "tasks/2f1c7d6b246b897d46af85e3/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "c81cfb53d3d9173055e0d84414c4028e37f84f3a", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "dbcffc63fe5a2588a08ac57aa82cd29d9061448e", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__irnwrsux", + "task_sha256": "b687c28c564d9aa709f4454e3570483e6eba67b7e1422899c0d3ef996a7fd033", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..d12e60dcd009ff3a00701bda76b01adb76d14382 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/provided-gold.diff @@ -0,0 +1,59 @@ +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index 3c5383ceb7465e372f4697e1c90d6314c0d0f851..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +@@ -76,9 +76,7 @@ + return 1 + + def __call__(self, *sequences: Sequence) -> int: +- if not sequences: +- return 0 +- return int(not self._ident(*sequences)) ++ return int(self._ident(*sequences)) + + + class Matrix(_BaseSimilarity): +@@ -102,24 +100,25 @@ + return self.match_cost + + def __call__(self, *sequences: Sequence) -> int: ++ if not self.mat: ++ if self._ident(*sequences): ++ return self.match_cost ++ return self.mismatch_cost + + # search in matrix + if sequences in self.mat: + return self.mat[sequences] +- # not found +- return self.mismatch_cost +- if not self.mat: +- if self._ident(*sequences): +- return self.match_cost +- return self.mismatch_cost +- # if identity then return match_cost +- if self._ident(*sequences): +- return self.match_cost + # search in symmetric matrix + if self.symmetric: + sequences = tuple(reversed(sequences)) + if sequences in self.mat: + return self.mat[sequences] ++ # if identity then return match_cost ++ if self._ident(*sequences): ++ return self.match_cost ++ # not found ++ return self.mismatch_cost ++ + + prefix = Prefix() + postfix = Postfix() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..753dc40ecdf1aabf1b4bb34157ff0c9161305a68 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/solution/solve.sh @@ -0,0 +1,65 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index 3c5383ceb7465e372f4697e1c90d6314c0d0f851..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +@@ -76,9 +76,7 @@ + return 1 + + def __call__(self, *sequences: Sequence) -> int: +- if not sequences: +- return 0 +- return int(not self._ident(*sequences)) ++ return int(self._ident(*sequences)) + + + class Matrix(_BaseSimilarity): +@@ -102,24 +100,25 @@ + return self.match_cost + + def __call__(self, *sequences: Sequence) -> int: ++ if not self.mat: ++ if self._ident(*sequences): ++ return self.match_cost ++ return self.mismatch_cost + + # search in matrix + if sequences in self.mat: + return self.mat[sequences] +- # not found +- return self.mismatch_cost +- if not self.mat: +- if self._ident(*sequences): +- return self.match_cost +- return self.mismatch_cost +- # if identity then return match_cost +- if self._ident(*sequences): +- return self.match_cost + # search in symmetric matrix + if self.symmetric: + sequences = tuple(reversed(sequences)) + if sequences in self.mat: + return self.mat[sequences] ++ # if identity then return match_cost ++ if self._ident(*sequences): ++ return self.match_cost ++ # not found ++ return self.mismatch_cost ++ + + prefix = Prefix() + postfix = Postfix() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..818fd65e6ceebb62430f6c5fced147e0b32e2121 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:602d670d4ce32158ecd0f7416539b6cac90511be794e3345420e85bd562d39d0" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..60a169e8ecd9e14a9de52d6ae6088d547241a08c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..dac61a68b68059bbc9e01385f7aa48b16a3a5de5 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/canaries/first-hunk-only.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index 3c5383ceb7465e372f4697e1c90d6314c0d0f851..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__irnwrsux/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..9b84259fcf5d771fcccb41e9467f8845ee24455f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "8ab094d4eca56a31168844b719592f487c533945e1ef73cc4d44dca063948f39", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "32024675e3930fca6b6b79c7b78e516a12a25dd9fbcc13043d92b3c1f5da443c", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "7be6c2d7d6e36794c251858e32bbd9f2a24fff15e67eaf0a710c0d3b91420bc6", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "9bb70e85e23df14a4f0fa22b2c5f75628527bac0", + "source_completion_sha256": "07731cd00fbf4a2d0777c3fc776492503bd971e6baa4c6cd8aee087a683fe98c", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__nerargi0", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "420b09d432ef47f9fbb4363bfe3db696b11e09600082da478d8842ba3f8f928d", + "is_fork": true, + "learner_path": "tasks/9731370fd9928b0289faf0f2/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/9bb70e85e23df14a4f0fa22b2c5f75628527bac0/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "405df45a1cf4769942ea7036f50f76cce81264e59560a59b575b20e788de28bf", + "provenance_path": "tasks/9731370fd9928b0289faf0f2/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "9bb70e85e23df14a4f0fa22b2c5f75628527bac0", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "e98da4a79f04f471a41d8fdd5f5d909903d49a5f", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__nerargi0", + "task_sha256": "a85447887aa7463cc579e56e2b9cf9c907ab0b539c0d0ee247b822c30954b4c6", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__nerargi0", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..045e6924cf92e7830138ba54789755540b308093 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/instruction.md @@ -0,0 +1,34 @@ +Editex distance calculation returns incorrect values + +#### Description + +The Editex algorithm is producing incorrect distance calculations for various string pairs. The computed distances don't match the expected values based on the Editex specification. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# Create Editex instance +editex = textdistance.Editex() + +# Test cases that show incorrect behavior +print("Expected: 2, Got:", editex('nelson', 'neilsen')) +print("Expected: 1, Got:", editex('niall', 'neal')) +print("Expected: 1, Got:", editex('ALIE', 'ALI')) + +# With local=True parameter +editex_local = textdistance.Editex(local=True) +print("Expected: 12, Got:", editex_local('nelson', '')) +print("Expected: 14, Got:", editex_local('', 'neilsen')) + +# With custom parameters +editex_custom = textdistance.Editex(group_cost=1, local=True) +print("Expected: 3, Got:", editex_custom('MARTHA', 'MARHTA')) +``` + +The algorithm appears to be calculating distances that are consistently higher than expected. For example, comparing 'nelson' and 'neilsen' should return a distance of 2, but it's returning a higher value. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..e169b1acf892e0294dada27b6af2709d6634c57c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "e98da4a79f04f471a41d8fdd5f5d909903d49a5f", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "9bb70e85e23df14a4f0fa22b2c5f75628527bac0" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_common.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_edit/test_editex.py", + "tests/test_phonetic/test_editex.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/phonetic.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 499721, + "task_id": "life4__textdistance.c3aca916.combine_file__nerargi0", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__nerargi0", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "420b09d432ef47f9fbb4363bfe3db696b11e09600082da478d8842ba3f8f928d", + "is_fork": true, + "learner_path": "tasks/9731370fd9928b0289faf0f2/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/9bb70e85e23df14a4f0fa22b2c5f75628527bac0/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "405df45a1cf4769942ea7036f50f76cce81264e59560a59b575b20e788de28bf", + "provenance_path": "tasks/9731370fd9928b0289faf0f2/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "9bb70e85e23df14a4f0fa22b2c5f75628527bac0", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "e98da4a79f04f471a41d8fdd5f5d909903d49a5f", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__nerargi0", + "task_sha256": "a85447887aa7463cc579e56e2b9cf9c907ab0b539c0d0ee247b822c30954b4c6", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..8a2689be31654f5f602d8b4c7c2cf764ec16d489 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "8ab094d4eca56a31168844b719592f487c533945e1ef73cc4d44dca063948f39", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/9bb70e85e23df14a4f0fa22b2c5f75628527bac0/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "07731cd00fbf4a2d0777c3fc776492503bd971e6baa4c6cd8aee087a683fe98c", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "06bc9414c69b9e25ac4b467315128d2b9f310eb097901e967857aebd9b104a17", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__nerargi0", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "420b09d432ef47f9fbb4363bfe3db696b11e09600082da478d8842ba3f8f928d", + "is_fork": true, + "learner_path": "tasks/9731370fd9928b0289faf0f2/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/9bb70e85e23df14a4f0fa22b2c5f75628527bac0/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "405df45a1cf4769942ea7036f50f76cce81264e59560a59b575b20e788de28bf", + "provenance_path": "tasks/9731370fd9928b0289faf0f2/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "9bb70e85e23df14a4f0fa22b2c5f75628527bac0", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "e98da4a79f04f471a41d8fdd5f5d909903d49a5f", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__nerargi0", + "task_sha256": "a85447887aa7463cc579e56e2b9cf9c907ab0b539c0d0ee247b822c30954b4c6", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..c095244405ea1af9898b68d34a241f98f6fff84e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/provided-gold.diff @@ -0,0 +1,26 @@ +diff --git a/textdistance/algorithms/phonetic.py b/textdistance/algorithms/phonetic.py +index e999fa970dd3e0e6f3d8f0ab55cef1deab02c2b1..53cbc0dea4e939535e26ae324f79ac8b15bf1381 100644 +--- a/textdistance/algorithms/phonetic.py ++++ b/textdistance/algorithms/phonetic.py +@@ -120,7 +120,7 @@ + self.grouped = frozenset.union(*self.groups) + + def maximum(self, *sequences: Sequence) -> int: +- return max(map(len, sequences)) + self.mismatch_cost ++ return max(map(len, sequences)) * self.mismatch_cost + + def r_cost(self, *elements: str) -> int: + if self._ident(*elements): +@@ -133,9 +133,9 @@ + return self.mismatch_cost + + def d_cost(self, *elements: str) -> int: +- if self._ident(*elements) or elements[-1] not in self.ungrouped: +- return self.group_cost + 1 +- return self.r_cost(*elements[:-1]) ++ if not self._ident(*elements) and elements[0] in self.ungrouped: ++ return self.group_cost ++ return self.r_cost(*elements) + + def __call__(self, s1: str, s2: str) -> float: + result = self.quick_answer(s1, s2) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..3c73b7cbaf9a3bc44855c52994506cb5a9a6f507 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/solution/solve.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/phonetic.py b/textdistance/algorithms/phonetic.py +index e999fa970dd3e0e6f3d8f0ab55cef1deab02c2b1..53cbc0dea4e939535e26ae324f79ac8b15bf1381 100644 +--- a/textdistance/algorithms/phonetic.py ++++ b/textdistance/algorithms/phonetic.py +@@ -120,7 +120,7 @@ + self.grouped = frozenset.union(*self.groups) + + def maximum(self, *sequences: Sequence) -> int: +- return max(map(len, sequences)) + self.mismatch_cost ++ return max(map(len, sequences)) * self.mismatch_cost + + def r_cost(self, *elements: str) -> int: + if self._ident(*elements): +@@ -133,9 +133,9 @@ + return self.mismatch_cost + + def d_cost(self, *elements: str) -> int: +- if self._ident(*elements) or elements[-1] not in self.ungrouped: +- return self.group_cost + 1 +- return self.r_cost(*elements[:-1]) ++ if not self._ident(*elements) and elements[0] in self.ungrouped: ++ return self.group_cost ++ return self.r_cost(*elements) + + def __call__(self, s1: str, s2: str) -> float: + result = self.quick_answer(s1, s2) +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..202caa3ef3bb1924a57922d0f3d1af1413cc2ccd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:f3a371a3001f41bba98f3efadb1edda69b0fa4faf43878f294ea4896a19ee32a" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..55b2e821f8a28df43c0335e818a6ba779827ee5f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..c2890b403f0059e164fe6a45975e21094ebf4c2f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/canaries/first-hunk-only.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/phonetic.py b/textdistance/algorithms/phonetic.py +index e999fa970dd3e0e6f3d8f0ab55cef1deab02c2b1..53cbc0dea4e939535e26ae324f79ac8b15bf1381 100644 +--- a/textdistance/algorithms/phonetic.py ++++ b/textdistance/algorithms/phonetic.py +@@ -120,7 +120,7 @@ + self.grouped = frozenset.union(*self.groups) + + def maximum(self, *sequences: Sequence) -> int: +- return max(map(len, sequences)) + self.mismatch_cost ++ return max(map(len, sequences)) * self.mismatch_cost + + def r_cost(self, *elements: str) -> int: + if self._ident(*elements): +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__nerargi0/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..9b13407bcfcde4ee8c53ccb0166415d00e35e71e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "528fffe693e1bce80fe2a9bf4b9f7fbb25cfbad4ef313bbbabc363f79b70f04c", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "e9ef551d26b23388776f82cbb9095af4edf349d892811059c203cd075ee3bc56", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "11d1da82a9c038c6c8af86d863bd5419500e42bca5dd3967ed40c57acdb5397f", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "351a32a1fae65598c58dbe2abf371f833433aabb", + "source_completion_sha256": "a6068ee923f2bc95c6b304a724e5c49e829f275c604928b07cb187cc655a6943", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__q3rnjr33", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "cb31f57e7e1bfe07348d17c673f5c809225d5f9cc5ef6295a00bcee0c3f46d37", + "is_fork": true, + "learner_path": "tasks/e1aefc218026d7609beb1f98/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/351a32a1fae65598c58dbe2abf371f833433aabb/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "a110ee2cc0c3656edfe90491240b904bef0152ff1d8aa4e9293b2f4fd7d85662", + "provenance_path": "tasks/e1aefc218026d7609beb1f98/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "351a32a1fae65598c58dbe2abf371f833433aabb", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "4e611ddd6e430f5578cce92d4d0d836762b843a8", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__q3rnjr33", + "task_sha256": "d1e6df5b7e0726707a4178bbca776ab4ecd3e1cd417b6f1bae5fd4df0ca9335f", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__q3rnjr33", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..21bef837808a6466c610137ea43d404f59de0fa3 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/instruction.md @@ -0,0 +1,30 @@ +Identity algorithm returns incorrect results for identical sequences + +#### Description + +The Identity algorithm is returning unexpected values when comparing sequences. When comparing identical sequences, it should return 1 for similarity, but it's returning 0 instead. Additionally, when comparing different sequences, it returns 1 when it should return 0. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# Test with identical sequences +identity = textdistance.Identity() +result = identity('test', 'test') +print(f"Identity of identical sequences: {result}") # Expected: 1, Actual: 0 + +# Test with different sequences +result2 = identity('spam', 'qwer') +print(f"Identity of different sequences: {result2}") # Expected: 0, Actual: 1 + +# Test with empty sequences +result3 = identity('', '') +print(f"Identity of empty sequences: {result3}") # Expected: 1, Actual: 0 +``` + +The Identity algorithm should return 1 when sequences are identical and 0 when they differ, but it's doing the opposite. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..6f761381f21bc0c84cb3875b83512592f924101d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_unequal_distance[alg20]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "4e611ddd6e430f5578cce92d4d0d836762b843a8", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "351a32a1fae65598c58dbe2abf371f833433aabb" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/simple.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 499765, + "task_id": "life4__textdistance.c3aca916.combine_file__q3rnjr33", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__q3rnjr33", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "cb31f57e7e1bfe07348d17c673f5c809225d5f9cc5ef6295a00bcee0c3f46d37", + "is_fork": true, + "learner_path": "tasks/e1aefc218026d7609beb1f98/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/351a32a1fae65598c58dbe2abf371f833433aabb/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "a110ee2cc0c3656edfe90491240b904bef0152ff1d8aa4e9293b2f4fd7d85662", + "provenance_path": "tasks/e1aefc218026d7609beb1f98/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "351a32a1fae65598c58dbe2abf371f833433aabb", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "4e611ddd6e430f5578cce92d4d0d836762b843a8", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__q3rnjr33", + "task_sha256": "d1e6df5b7e0726707a4178bbca776ab4ecd3e1cd417b6f1bae5fd4df0ca9335f", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..c3a7c5e7220e5e4f08be6500a8e89f38ba8b5ad4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "528fffe693e1bce80fe2a9bf4b9f7fbb25cfbad4ef313bbbabc363f79b70f04c", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/351a32a1fae65598c58dbe2abf371f833433aabb/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "a6068ee923f2bc95c6b304a724e5c49e829f275c604928b07cb187cc655a6943", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "bf2aff7b31541c21406c4a9b098de336d60c6faaca6c83c40f9d6de270904173", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__q3rnjr33", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "cb31f57e7e1bfe07348d17c673f5c809225d5f9cc5ef6295a00bcee0c3f46d37", + "is_fork": true, + "learner_path": "tasks/e1aefc218026d7609beb1f98/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/351a32a1fae65598c58dbe2abf371f833433aabb/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "a110ee2cc0c3656edfe90491240b904bef0152ff1d8aa4e9293b2f4fd7d85662", + "provenance_path": "tasks/e1aefc218026d7609beb1f98/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "351a32a1fae65598c58dbe2abf371f833433aabb", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "4e611ddd6e430f5578cce92d4d0d836762b843a8", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__q3rnjr33", + "task_sha256": "d1e6df5b7e0726707a4178bbca776ab4ecd3e1cd417b6f1bae5fd4df0ca9335f", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..4203a8bbf52a793f89af49c55e59a4ef91310861 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/provided-gold.diff @@ -0,0 +1,24 @@ +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index fae11fbc497ab3bbf6385620ac742ba154e664a8..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +@@ -76,9 +76,7 @@ + return 1 + + def __call__(self, *sequences: Sequence) -> int: +- if not sequences: +- return 0 +- return int(not self._ident(*sequences)) ++ return int(self._ident(*sequences)) + + + class Matrix(_BaseSimilarity): diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..71177a8001ed6fac4f3754eb1cc3b588559a28a0 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/solution/solve.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index fae11fbc497ab3bbf6385620ac742ba154e664a8..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +@@ -76,9 +76,7 @@ + return 1 + + def __call__(self, *sequences: Sequence) -> int: +- if not sequences: +- return 0 +- return int(not self._ident(*sequences)) ++ return int(self._ident(*sequences)) + + + class Matrix(_BaseSimilarity): +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8bc84997a22be116549324cdd3f429902392c717 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:693468fcd34f886bf716992fea661ad4f0b49a64fc067bfd8352d063146cb99c" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..bbe4e8f87dff86f5fc3735526c7f62fd2cac7840 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_unequal_distance[alg20]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..7a9e1b36e9bb6800b18f537981eb9c9f9c3ec20b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/canaries/first-hunk-only.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/simple.py b/textdistance/algorithms/simple.py +index fae11fbc497ab3bbf6385620ac742ba154e664a8..28f8948909bdb5c66ea01650e0766550e227fcf2 100644 +--- a/textdistance/algorithms/simple.py ++++ b/textdistance/algorithms/simple.py +@@ -29,7 +29,7 @@ + sequences = self._get_sequences(*sequences) + + def test(seq): +- return self.sim_test(seq[::-1]) ++ return self.sim_test(*seq) + + result = [c[0] for c in takewhile(test, zip(*sequences))] + +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__q3rnjr33/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..8630d6954a187b0901fcf7fec03e76c2253db4b7 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "cd0cf7e0327e5f026eca73be61f3c598280baa2c87e7abd932f430fb37872794", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "dd5682853b76323a8b70fa0b4893e29857733379dfe8d9d8aea8fc07654951c0", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "7e9121d9f33e7a8a802ea9a5da5b53fde5ebc35e25cad26e56b9f233b1d93b53", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "727de822293e660f0a4525210b7d15193d244a75", + "source_completion_sha256": "e19806fe386a0b7b0dd2114c27077d29f5184ff65271c3d684f338bf1e75d0ee", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__r87diko8", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "ea63d0ccf815f0a802d1c8d3328fdcaa6105a96c6e3b8901f7afc3abbb9521b1", + "is_fork": true, + "learner_path": "tasks/2f19699caa04815f98ebb95a/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/727de822293e660f0a4525210b7d15193d244a75/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "0d014ba05811c6025684a9bfb891f36213e1f38c47fdaea0f3c275a32483d266", + "provenance_path": "tasks/2f19699caa04815f98ebb95a/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "727de822293e660f0a4525210b7d15193d244a75", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "b3f40fc0b8e37155d57aa42b73af290a891e9db6", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__r87diko8", + "task_sha256": "79d8ca5b83277c5e942b3d7f43df3343008a0b60ce9fc7a1cba0d4f56019ed94", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__r87diko8", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..083e5e62d747437b808c1212e43aaa048e71ca35 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/instruction.md @@ -0,0 +1,78 @@ +# Bugs in sequence-based text distance algorithms + +#### Description +I found several issues with the sequence-based text distance algorithms in the library. The `LCSSeq`, `LCSStr`, and `RatcliffObershelp` algorithms are returning incorrect values, causing normalization issues and failing on edge cases. + +#### Steps/Code to Reproduce + +```python +from textdistance import lcsseq, lcsstr, ratcliff_obershelp + +# LCSSeq issue +print("LCSSeq similarity:") +s1 = "hello" +s2 = "helo" +result = lcsseq.similarity(s1, s2) +print(f"Expected: {len('helo')} = 4, Got: {result}") + +# LCSStr issue +print("\nLCSStr similarity:") +s1 = "hello" +s2 = "helo" +result = lcsstr.similarity(s1, s2) +print(f"Expected: {len('hel')} = 3, Got: {result}") + +# RatcliffObershelp issue +print("\nRatcliffObershelp maximum:") +result = ratcliff_obershelp.maximum("hello", "world") +print(f"Expected: 1, Got: {result}") + +# Empty string test +print("\nEmpty string test:") +print(f"LCSSeq: {lcsseq.distance('', '')}") +print(f"LCSStr: {lcsstr.distance('', '')}") +``` + +#### Expected Results +``` +LCSSeq similarity: +Expected: 4, Got: 4 + +LCSStr similarity: +Expected: 3, Got: 3 + +RatcliffObershelp maximum: +Expected: 1, Got: 1 + +Empty string test: +LCSSeq: 0 +LCSStr: 0 +``` + +#### Actual Results +``` +LCSSeq similarity: +Expected: 4, Got: 3 + +LCSStr similarity: +Expected: 3, Got: TypeError: 'tuple' object cannot be interpreted as an integer + +RatcliffObershelp maximum: +Expected: 1, Got: 0 + +Empty string test: +LCSSeq: 1 +LCSStr: -2 +``` + +The issues cause normalization to fail, with values outside the expected [0,1] range. Also, the algorithms don't handle empty strings correctly, returning non-zero values when they should return 0. + +#### Versions +``` +Python: 3.8.10 +textdistance: 4.2.2 +``` + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..6ca9e1d299e55f4c80e02d78aef591967cd8ea2a --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "b3f40fc0b8e37155d57aa42b73af290a891e9db6", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "727de822293e660f0a4525210b7d15193d244a75" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/sequence_based.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 499659, + "task_id": "life4__textdistance.c3aca916.combine_file__r87diko8", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__r87diko8", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "ea63d0ccf815f0a802d1c8d3328fdcaa6105a96c6e3b8901f7afc3abbb9521b1", + "is_fork": true, + "learner_path": "tasks/2f19699caa04815f98ebb95a/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/727de822293e660f0a4525210b7d15193d244a75/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "0d014ba05811c6025684a9bfb891f36213e1f38c47fdaea0f3c275a32483d266", + "provenance_path": "tasks/2f19699caa04815f98ebb95a/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "727de822293e660f0a4525210b7d15193d244a75", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "b3f40fc0b8e37155d57aa42b73af290a891e9db6", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__r87diko8", + "task_sha256": "79d8ca5b83277c5e942b3d7f43df3343008a0b60ce9fc7a1cba0d4f56019ed94", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..56c23c1be1b914b0897810786b26633b2f67d8e1 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "cd0cf7e0327e5f026eca73be61f3c598280baa2c87e7abd932f430fb37872794", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/727de822293e660f0a4525210b7d15193d244a75/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "e19806fe386a0b7b0dd2114c27077d29f5184ff65271c3d684f338bf1e75d0ee", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "6390ba55b3fb07adccf222e33ad3ff97cec8a10abc9c77275fd2ae24f5b69fc4", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__r87diko8", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "ea63d0ccf815f0a802d1c8d3328fdcaa6105a96c6e3b8901f7afc3abbb9521b1", + "is_fork": true, + "learner_path": "tasks/2f19699caa04815f98ebb95a/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/727de822293e660f0a4525210b7d15193d244a75/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "0d014ba05811c6025684a9bfb891f36213e1f38c47fdaea0f3c275a32483d266", + "provenance_path": "tasks/2f19699caa04815f98ebb95a/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "727de822293e660f0a4525210b7d15193d244a75", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "b3f40fc0b8e37155d57aa42b73af290a891e9db6", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__r87diko8", + "task_sha256": "79d8ca5b83277c5e942b3d7f43df3343008a0b60ce9fc7a1cba0d4f56019ed94", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..69d348fe7d43b3f5d549bcbae2faa546f5b4e81f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/provided-gold.diff @@ -0,0 +1,31 @@ +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index 6d2339da8acd9d397ccf67137b53361e46725bf5..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -99,7 +99,7 @@ + return self._recursive(*sequences) + + def similarity(self, *sequences) -> int: +- return len(self(*sequences)) - 1 ++ return len(self(*sequences)) + + + class LCSStr(_BaseSimilarity): +@@ -139,7 +139,7 @@ + return self._custom(*sequences) + + def similarity(self, *sequences: str) -> int: +- return len(self(sequences)) ++ return len(self(*sequences)) + + + class RatcliffObershelp(_BaseSimilarity): +@@ -160,7 +160,7 @@ + """ + + def maximum(self, *sequences: str) -> int: +- return 0 ++ return 1 + + def _find(self, *sequences: str) -> int: + subseq = LCSStr()(*sequences) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..080a950fab3a7580c1ea94d886b38b60a7b0cd2f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/solution/solve.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index 6d2339da8acd9d397ccf67137b53361e46725bf5..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -99,7 +99,7 @@ + return self._recursive(*sequences) + + def similarity(self, *sequences) -> int: +- return len(self(*sequences)) - 1 ++ return len(self(*sequences)) + + + class LCSStr(_BaseSimilarity): +@@ -139,7 +139,7 @@ + return self._custom(*sequences) + + def similarity(self, *sequences: str) -> int: +- return len(self(sequences)) ++ return len(self(*sequences)) + + + class RatcliffObershelp(_BaseSimilarity): +@@ -160,7 +160,7 @@ + """ + + def maximum(self, *sequences: str) -> int: +- return 0 ++ return 1 + + def _find(self, *sequences: str) -> int: + subseq = LCSStr()(*sequences) +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..40f4f5a2977b384165201ec256ffd79d9c2f3552 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:599709cdc6dcb58c1533eee7af1b47530bde95ad57c8c0e61fadff8fc264e17d" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..868a028ac49f90e6c3cffd89b547bda8c8c891b6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..9baaeb36f9be7b25fea4c593a5c0ce66dd8d7e7e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/canaries/first-hunk-only.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index 6d2339da8acd9d397ccf67137b53361e46725bf5..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -99,7 +99,7 @@ + return self._recursive(*sequences) + + def similarity(self, *sequences) -> int: +- return len(self(*sequences)) - 1 ++ return len(self(*sequences)) + + + class LCSStr(_BaseSimilarity): +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__r87diko8/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..0c02812b50a47f3d1c53cafed5f70bb526512535 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "480958227e3119d7ce076ec95800a81a32bbf6bc27de5cdf74f993414275dff4", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "6ef918797e541d1100cad3f04a8b6cef32fed85758561be3a489417170dac811", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "2aea5f845209b28c49f3a6230f1715f42b2a4843c019b2bfb42bf5c1ea445cb5", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "c8f63e93351256c8f0df7f346beddb919c851954", + "source_completion_sha256": "7824cdf73ed36d1cf8dc69bb51863e24750fb0d746cd0a6d476e88341a8c692a", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__rj09ojuj", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "f9a94f45f9fea49e4b84ec4dde5f20c9d4f74acd17548fbdfa05a1d821f585fe", + "is_fork": true, + "learner_path": "tasks/101eabbcf412192c7e7b8613/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/c8f63e93351256c8f0df7f346beddb919c851954/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "e0311aa13707f995f0095e7cbaa01b87118b9d3dc74474a564c3c6bd15bd40bb", + "provenance_path": "tasks/101eabbcf412192c7e7b8613/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "c8f63e93351256c8f0df7f346beddb919c851954", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "5463053b4864d7b11ef2327469f8c328abdb860d", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__rj09ojuj", + "task_sha256": "801a49af523c194ec8c14a623dd29c6680e184b0e9752c6caec2c0ec000a415a", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__rj09ojuj", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..623b509f2a01806c024fb79b749d1b6745aaa1ba --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/instruction.md @@ -0,0 +1,29 @@ +LCSStr returns empty string for non-empty sequences + +#### Description + +The LCSStr algorithm is returning an empty string when it should return the longest common substring for valid input sequences. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# This should return 'ab' but returns '' +result = textdistance.lcsstr('ab', 'abcd') +print(f"Expected: 'ab', Got: '{result}'") + +# This should return 'bc' but returns '' +result = textdistance.lcsstr('abcd', 'bc') +print(f"Expected: 'bc', Got: '{result}'") + +# This should return 'TEST' but returns '' +result = textdistance.lcsstr('MYTEST' * 100, 'TEST') +print(f"Expected: 'TEST', Got: '{result}'") +``` + +The algorithm appears to be returning empty strings for cases where there should be a valid longest common substring match. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..ca81d2c351c67478041a215c333f20ea456ff0ed --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "5463053b4864d7b11ef2327469f8c328abdb860d", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "c8f63e93351256c8f0df7f346beddb919c851954" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_mlipns.py", + "/testbed/tests/test_edit/test_needleman_wunsch.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_sequence/test_lcsstr.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/sequence_based.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 498857, + "task_id": "life4__textdistance.c3aca916.combine_file__rj09ojuj", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__rj09ojuj", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "f9a94f45f9fea49e4b84ec4dde5f20c9d4f74acd17548fbdfa05a1d821f585fe", + "is_fork": true, + "learner_path": "tasks/101eabbcf412192c7e7b8613/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/c8f63e93351256c8f0df7f346beddb919c851954/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "e0311aa13707f995f0095e7cbaa01b87118b9d3dc74474a564c3c6bd15bd40bb", + "provenance_path": "tasks/101eabbcf412192c7e7b8613/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "c8f63e93351256c8f0df7f346beddb919c851954", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "5463053b4864d7b11ef2327469f8c328abdb860d", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__rj09ojuj", + "task_sha256": "801a49af523c194ec8c14a623dd29c6680e184b0e9752c6caec2c0ec000a415a", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..5e710b103d1653299c5d571d7f5a2f5ded86b133 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "480958227e3119d7ce076ec95800a81a32bbf6bc27de5cdf74f993414275dff4", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/c8f63e93351256c8f0df7f346beddb919c851954/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "7824cdf73ed36d1cf8dc69bb51863e24750fb0d746cd0a6d476e88341a8c692a", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "b4de30dcd0c90e0fd4014ac0853355aad33e0b1546ba634dbee59eec0cfb2f7c", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__rj09ojuj", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "f9a94f45f9fea49e4b84ec4dde5f20c9d4f74acd17548fbdfa05a1d821f585fe", + "is_fork": true, + "learner_path": "tasks/101eabbcf412192c7e7b8613/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/c8f63e93351256c8f0df7f346beddb919c851954/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "e0311aa13707f995f0095e7cbaa01b87118b9d3dc74474a564c3c6bd15bd40bb", + "provenance_path": "tasks/101eabbcf412192c7e7b8613/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "c8f63e93351256c8f0df7f346beddb919c851954", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "5463053b4864d7b11ef2327469f8c328abdb860d", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__rj09ojuj", + "task_sha256": "801a49af523c194ec8c14a623dd29c6680e184b0e9752c6caec2c0ec000a415a", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..d58c03ddd6eb05debfa3fd5ce0ab0e5041c74059 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/provided-gold.diff @@ -0,0 +1,42 @@ +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index a65a8f9ac7a8fef9a4405346250ca8f09402b748..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -125,7 +125,7 @@ + return type(short)() # empty sequence + + def __call__(self, *sequences: str) -> str: +- if all(sequences): ++ if not all(sequences): + return '' + length = len(sequences) + if length == 0: +@@ -134,9 +134,9 @@ + return sequences[0] + + sequences = self._get_sequences(*sequences) +- if length == 2 and min(map(len, sequences)) < 200: +- return self._custom(*sequences) +- return self._standart(*sequences) ++ if length == 2 and max(map(len, sequences)) < 200: ++ return self._standart(*sequences) ++ return self._custom(*sequences) + + def similarity(self, *sequences: str) -> int: + return len(self(*sequences)) +@@ -174,11 +174,11 @@ + def __call__(self, *sequences: str) -> float: + result = self.quick_answer(*sequences) + if result is not None: +- return -result +- scount = len(sequences) +- ecount = sum(map(len, sequences)) ++ return result ++ scount = len(sequences) # sequences count ++ ecount = sum(map(len, sequences)) # elements count + sequences = self._get_sequences(*sequences) +- return (scount + self._find(*sequences)) / (ecount + 1) ++ return scount * self._find(*sequences) / ecount + + + lcsseq = LCSSeq() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ed3b7c949a04162975578e30efa734f97e827a0 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/solution/solve.sh @@ -0,0 +1,48 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index a65a8f9ac7a8fef9a4405346250ca8f09402b748..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -125,7 +125,7 @@ + return type(short)() # empty sequence + + def __call__(self, *sequences: str) -> str: +- if all(sequences): ++ if not all(sequences): + return '' + length = len(sequences) + if length == 0: +@@ -134,9 +134,9 @@ + return sequences[0] + + sequences = self._get_sequences(*sequences) +- if length == 2 and min(map(len, sequences)) < 200: +- return self._custom(*sequences) +- return self._standart(*sequences) ++ if length == 2 and max(map(len, sequences)) < 200: ++ return self._standart(*sequences) ++ return self._custom(*sequences) + + def similarity(self, *sequences: str) -> int: + return len(self(*sequences)) +@@ -174,11 +174,11 @@ + def __call__(self, *sequences: str) -> float: + result = self.quick_answer(*sequences) + if result is not None: +- return -result +- scount = len(sequences) +- ecount = sum(map(len, sequences)) ++ return result ++ scount = len(sequences) # sequences count ++ ecount = sum(map(len, sequences)) # elements count + sequences = self._get_sequences(*sequences) +- return (scount + self._find(*sequences)) / (ecount + 1) ++ return scount * self._find(*sequences) / ecount + + + lcsseq = LCSSeq() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5b57f08c03d01ec64d0902c45367f2e24eb76a37 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:14bbd5ea5debcfad25d30b8e9d463df4188f10adb7a44c6f1e1529d88909fe4e" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..ec0d29e956675f135f7cf44f93a8670c48233398 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted-inventory.json b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted-inventory.json new file mode 100644 index 0000000000000000000000000000000000000000..8f213084c5eb6b4dda7e60d7ceb9850ccc98f5aa --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted-inventory.json @@ -0,0 +1,197 @@ +{ + "directory_roots": [ + "tests" + ], + "files": { + "pyproject.toml": { + "bytes": 195, + "mode": 420, + "sha256": "75aa8c8b09fd67fdf9bf911cfb938c3f6b1f180d490c4e52681170b108398e3b" + }, + "setup.cfg": { + "bytes": 588, + "mode": 420, + "sha256": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc" + }, + "setup.py": { + "bytes": 3712, + "mode": 493, + "sha256": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + }, + "tests/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_common.py": { + "bytes": 2679, + "mode": 420, + "sha256": "345149e7e752d3949e5a1e0eb58f27af11871d3ff6f6cfcbc9c06afcbd434a7c" + }, + "tests/test_compression/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_compression/test_arith_ncd.py": { + "bytes": 807, + "mode": 420, + "sha256": "5b41d482c5ad039380496a93dd7a51838d20e3d1caac6477dc4dc7426bb8849f" + }, + "tests/test_compression/test_bwtrle_ncd.py": { + "bytes": 347, + "mode": 420, + "sha256": "ed59e3863d08aa6a83f2a14a1b051a8fa2af0b04ff668357d00ee1bf8270b16b" + }, + "tests/test_compression/test_bz2_ncd.py": { + "bytes": 346, + "mode": 420, + "sha256": "ef4a3683ffbd4adbe511fa3474e60100c19d1878b938f2cc95ff75ee385d8b38" + }, + "tests/test_compression/test_common.py": { + "bytes": 1699, + "mode": 420, + "sha256": "9acd999974c406d396fb226affbbd2e3c145b1544ff391b1f64de36cfd097cf8" + }, + "tests/test_compression/test_entropy_ncd.py": { + "bytes": 1834, + "mode": 420, + "sha256": "9a048cef66ca8fa0d38b47c68e84898c5db3e5fe627aed58ca190e0257738b4b" + }, + "tests/test_compression/test_sqrt_ncd.py": { + "bytes": 1744, + "mode": 420, + "sha256": "bd0ac7811f59f566a12a11d37b95fccd1a8c89cd7d5f70518628c9fd8c66036e" + }, + "tests/test_edit/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_edit/test_damerau_levenshtein.py": { + "bytes": 1304, + "mode": 420, + "sha256": "31432398fc3d0d69c644d453b4a27772f4fc9491ed59953db9909b7d05a4f322" + }, + "tests/test_edit/test_editex.py": { + "bytes": 1074, + "mode": 420, + "sha256": "82823b9796c19cda8783ec43c81611bedb931102f31ad374219b77fae2b6f9ca" + }, + "tests/test_edit/test_gotoh.py": { + "bytes": 1268, + "mode": 420, + "sha256": "a75b790971a1c1987b30bc53486467c1006aac4cc4f35a3210c24d8642a512e3" + }, + "tests/test_edit/test_hamming.py": { + "bytes": 487, + "mode": 420, + "sha256": "a2a28c13a4f9a9465360a10d8d09ac3e9d9f33bc467887176df01d0f20fba49c" + }, + "tests/test_edit/test_jaro.py": { + "bytes": 843, + "mode": 420, + "sha256": "e34db7e8f18da648305260d4193b8a95826e02fc70482d990b1c48ed64cc7cd0" + }, + "tests/test_edit/test_jaro_winkler.py": { + "bytes": 756, + "mode": 420, + "sha256": "b5b2daa6c08ebe30d4e442f463857d06d4f0606c0311c48cb96de9b49ee4c55b" + }, + "tests/test_edit/test_levenshtein.py": { + "bytes": 491, + "mode": 420, + "sha256": "373f3462501eb35f3c078281afa3e05ed2fd5173834dd3fb82391d37c36f32bb" + }, + "tests/test_edit/test_matrix.py": { + "bytes": 746, + "mode": 420, + "sha256": "a64ad456ec79301874322db2fa13111084f71669c62b04ffd89f41ba91fae322" + }, + "tests/test_edit/test_mlipns.py": { + "bytes": 582, + "mode": 420, + "sha256": "cbe80c1fdcdd76c2821f3e76ccf92342be9415b858e1033f31b3b30401715bb5" + }, + "tests/test_edit/test_needleman_wunsch.py": { + "bytes": 1291, + "mode": 420, + "sha256": "330f0cf2979d7db4bce5546ce5c29fd20b76e4461835bf12ce20cd027256ba7a" + }, + "tests/test_edit/test_smith_waterman.py": { + "bytes": 1285, + "mode": 420, + "sha256": "a18c9d8ecc20ec3da7d5c1571f45abac1752a4953729edcbf8ed7c24f757dc03" + }, + "tests/test_edit/test_strcmp95.py": { + "bytes": 548, + "mode": 420, + "sha256": "282723d296d2eef98fcf7460721ff872dc3618dcdae7e6cdac2d3aa722c586c9" + }, + "tests/test_external.py": { + "bytes": 3791, + "mode": 420, + "sha256": "6e23b27e9ad7a90343350b27cf03fb309cdf8c7544e4b15c7e84c8c0506ba6d9" + }, + "tests/test_phonetic/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_phonetic/test_editex.py": { + "bytes": 1555, + "mode": 420, + "sha256": "5da4a929fc8142ff60a2d26ca86cce55b112517bf4c0fa948289d1a076a887ff" + }, + "tests/test_sequence/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_sequence/test_lcsseq.py": { + "bytes": 960, + "mode": 420, + "sha256": "8ce76ce7264aa7a7765c2b48b1db388135f23ca304afce0334ce0c58f6818f35" + }, + "tests/test_sequence/test_lcsstr.py": { + "bytes": 732, + "mode": 420, + "sha256": "afb8c7570918427b3f16e69ed13ccbc26e73bb61510541093449330b782ecbbb" + }, + "tests/test_token/__init__.py": { + "bytes": 0, + "mode": 420, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "tests/test_token/test_bag.py": { + "bytes": 426, + "mode": 420, + "sha256": "b10166b87b22f2dcd75462894b5ab69cb4ea5e8a3a05359e246ff64f73dbcb16" + }, + "tests/test_token/test_cosine.py": { + "bytes": 466, + "mode": 420, + "sha256": "bd74ef63f33f98fdf929cb71032e5df09b09267694dc47c9b7b7b0b6ff66bdce" + }, + "tests/test_token/test_jaccard.py": { + "bytes": 1084, + "mode": 420, + "sha256": "fef734fed08c398272f3763e85ab225b95dad222077b626298f036912ae95b68" + }, + "tests/test_token/test_monge_elkan.py": { + "bytes": 430, + "mode": 420, + "sha256": "be0ad853d67b8c5eb6a0f9cc560b8c754b6a11bff0c5cccf71367e7d346a04eb" + }, + "tests/test_token/test_overlap.py": { + "bytes": 491, + "mode": 420, + "sha256": "d31ce86a919e2f643d3cc42841d6c4929b82ad028c4962aca1ec8e285ec13aac" + }, + "tests/test_token/test_sorensen.py": { + "bytes": 1022, + "mode": 420, + "sha256": "efbe18d66f2499c718507eea0c38edadab13575f82bd0714a2d12658a1536197" + } + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_matrix.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_matrix.py new file mode 100644 index 0000000000000000000000000000000000000000..4c243bfd84a42042d07da6e3fe8d89fc3c6b5994 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_matrix.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Matrix +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('', 'a', 0), + ('abcd', 'abcd', 1), + ('A', 'C', -3), + ('G', 'G', 7), + ('A', 'A', 10), + ('T', 'A', -4), + ('T', 'C', 0), + ('A', 'G', -1), + ('C', 'T', 0), +]) +def test_distance(left, right, expected): + actual = ALG(NW_MATRIX, symmetric=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_mlipns.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_mlipns.py new file mode 100644 index 0000000000000000000000000000000000000000..d7ded1d4131e98d375e0d9ded2d7c6b31cbf131d --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_mlipns.py @@ -0,0 +1,29 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MLIPNS + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 1), + ('a', '', 0), + ('', 'a', 0), + ('a', 'a', 1), + ('ab', 'a', 1), + ('abc', 'abc', 1), + ('abc', 'abcde', 1), + ('abcg', 'abcdeg', 1), + ('abcg', 'abcdefg', 0), + ('Tomato', 'Tamato', 1), + ('ato', 'Tam', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_needleman_wunsch.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_needleman_wunsch.py new file mode 100644 index 0000000000000000000000000000000000000000..c1cd59cc47f2043567d64e732fbc34597154708c --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_needleman_wunsch.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.NeedlemanWunsch +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 16), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', -5), + ('AGACTAGTTAC', 'TGACGSTGC', -7), + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_smith_waterman.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_smith_waterman.py new file mode 100644 index 0000000000000000000000000000000000000000..59e689e11d064551fe0750bd23e4aadf9192f536 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_smith_waterman.py @@ -0,0 +1,55 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.SmithWaterman +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', 26), +]) +def test_distance_matrix(left, right, expected): + sim_matrix = textdistance.Matrix(NW_MATRIX, symmetric=True) + actual = ALG(gap_cost=5, sim_func=sim_matrix)(left, right) + assert actual == expected + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('CGATATCAG', 'TGACGSTGC', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1), + ('AGACTAGTTAC', 'CGAGACGT', 0), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_cost=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_strcmp95.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_strcmp95.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7afee3e75824e561e1c30a9fa4d5a18562376f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_edit/test_strcmp95.py @@ -0,0 +1,25 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.StrCmp95 + + +@pytest.mark.parametrize('left, right, expected', [ + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.873), + ('DIXON', 'DICKSONX', 0.839333333), + ('TEST', 'TEXT', 0.9066666666666666), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_external.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_external.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7fddb80e5370fc9a1ab322b0cea1dd8d7d10e9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_external.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +# built-in +import string +from math import isclose + +# external +import hypothesis +import hypothesis.strategies +import pytest + +# project +import textdistance +from textdistance.libraries import prototype + + +libraries = prototype.clone() + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_compare(left, right, alg): + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), str(lib) + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +@pytest.mark.parametrize('qval', (None, 1, 2, 3)) +def test_qval(left: str, right: str, alg: str, qval: int | None) -> None: + for lib in libraries.get_libs(alg): + + if lib.module_name == 'jellyfish': + ascii = set(string.printable) + if (set(left) | set(right)) - ascii: + continue + + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + # algorithm doesn't support q-grams + if not hasattr(internal_func, 'qval'): + continue + + internal_func.qval = qval + # if qval unsopporting already set for lib + s1, s2 = internal_func._get_sequences(left, right) + if not lib.check_conditions(internal_func, s1, s2): + continue + quick_answer = internal_func.quick_answer(s1, s2) + if quick_answer is not None: + continue + + # test + int_result = internal_func(left, right) + s1, s2 = lib.prepare(s1, s2) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' + + +@pytest.mark.external +@pytest.mark.parametrize('alg', libraries.get_algorithms()) +@hypothesis.given( + left=hypothesis.strategies.lists(hypothesis.strategies.integers()), + right=hypothesis.strategies.lists(hypothesis.strategies.integers()), +) +def test_list_of_numbers(left, right, alg): + for lib in libraries.get_libs(alg): + conditions = lib.conditions or {} + internal_func = getattr(textdistance, alg)(external=False, **conditions) + external_func = lib.get_function() + if external_func is None: + raise RuntimeError('cannot import {}'.format(str(lib))) + + quick_answer = internal_func.quick_answer(left, right) + if quick_answer is not None: + continue + if not lib.check_conditions(internal_func, left, right): + continue + + int_result = internal_func(left, right) + s1, s2 = lib.prepare(left, right) + ext_result = external_func(s1, s2) + assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_phonetic/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_phonetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_phonetic/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_phonetic/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3621ab24459d3f787e564958c0355ff3db62d2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_phonetic/test_editex.py @@ -0,0 +1,61 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + # https://github.com/chrislit/abydos/blob/master/tests/distance/test_distance_editex.py + ('', '', 0), + ('nelson', '', len('nelson') * 2), + ('', 'neilsen', len('neilsen') * 2), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), + + # https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html + ('cat', 'hat', 2), + ('Niall', 'Neil', 2), + ('aluminum', 'Catalan', 12), + ('ATCG', 'TAGC', 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 2), + ('nelson', 'neilsen', 2), + ('neilsen', 'nelson', 2), + ('niall', 'neal', 1), + ('neal', 'niall', 1), + ('niall', 'nihal', 2), + ('nihal', 'niall', 2), + ('neal', 'nihl', 3), + ('nihl', 'neal', 3), +]) +def test_local(left, right, expected): + actual = ALG(external=False, local=True)(left, right) + assert actual == expected + + actual = ALG(external=True, local=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_sequence/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_sequence/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_sequence/test_lcsseq.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_sequence/test_lcsseq.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4cb5893921e6334d116f4f1c5e6774981222f6 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_sequence/test_lcsseq.py @@ -0,0 +1,41 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSSeq + + +@pytest.mark.parametrize('left, right, expected', [ + ('ab', 'cd', ''), + ('abcd', 'abcd', 'abcd'), + + ('test', 'text', 'tet'), + ('thisisatest', 'testing123testing', 'tsitest'), + ('DIXON', 'DICKSONX', 'DION'), + ('random exponential', 'layer activation', 'ratia'), + + ('a' * 80, 'a' * 80, 'a' * 80), + ('a' * 80, 'b' * 80, ''), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('seqs, expected', [ + (('a', 'b', 'c'), ''), + (('a', 'a', 'a'), 'a'), + (('test', 'text', 'tempest'), 'tet'), +]) +def test_distance_multiseq(seqs, expected): + actual = ALG(external=False)(*seqs) + assert actual == expected + + actual = ALG(external=True)(*seqs) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_sequence/test_lcsstr.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_sequence/test_lcsstr.py new file mode 100644 index 0000000000000000000000000000000000000000..4b710b5539a77d01e0bc0f55906e799f95121ca4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_sequence/test_lcsstr.py @@ -0,0 +1,38 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.LCSStr + + +@pytest.mark.parametrize('left, right, expected', [ + # prefix + ('ab', 'abcd', 'ab'), + ('abcd', 'ab', 'ab'), + + # middle + ('abcd', 'bc', 'bc'), + ('bc', 'abcd', 'bc'), + + # suffix + ('abcd', 'cd', 'cd'), + ('abcd', 'cd', 'cd'), + + # no + ('abcd', 'ef', ''), + ('ef', 'abcd', ''), + + # long + # https://github.com/life4/textdistance/issues/40 + ('MYTEST' * 100, 'TEST', 'TEST'), + ('TEST', 'MYTEST' * 100, 'TEST'), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_bag.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_bag.py new file mode 100644 index 0000000000000000000000000000000000000000..4caedaada4c684d18c310bf00286e3631cc45feb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_bag.py @@ -0,0 +1,22 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Bag + + +@pytest.mark.parametrize('left, right, expected', [ + ('qwe', 'qwe', 0), + ('qwe', 'erty', 3), + ('qwe', 'ewq', 0), + ('qwe', 'rtys', 4), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_cosine.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_cosine.py new file mode 100644 index 0000000000000000000000000000000000000000..5c518b8f5e3e7c09d7e4166b1b2bb98e58b6b106 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_cosine.py @@ -0,0 +1,23 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Cosine + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('nelson', 'neilsen', 5.0 / pow(6 * 7, .5)), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_jaccard.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_jaccard.py new file mode 100644 index 0000000000000000000000000000000000000000..e6284512554a9f58f6d102be8d9996a66c43b842 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_jaccard.py @@ -0,0 +1,45 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Jaccard + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 5), + ('nelson', 'neilsen', 5.0 / 8), + ('decide', 'resize', 3.0 / 9), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[1, 1]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[1, 1], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_monge_elkan.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_monge_elkan.py new file mode 100644 index 0000000000000000000000000000000000000000..c007c59f9afab688dd05ef9b2b2f5a9a157a6687 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_monge_elkan.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.MongeElkan + + +@pytest.mark.parametrize('left, right, expected', [ + (['Niall'], ['Neal'], .805), + (['Niall'], ['Nigel'], 0.7866666666666667), +]) +def test_similarity(left, right, expected): + actual = ALG(qval=1, algorithm=textdistance.jaro_winkler).similarity(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_overlap.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..077e6f4a26b74f962e7e655cb7ef439b5c46d963 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_overlap.py @@ -0,0 +1,24 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Overlap + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 3.0 / 4), + ('testme', 'textthis', 4.0 / 6), + ('nelson', 'neilsen', 5.0 / 6), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_sorensen.py b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_sorensen.py new file mode 100644 index 0000000000000000000000000000000000000000..5734419e257284316f55f744e068e11b2d101900 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/tests/trusted/tests/test_token/test_sorensen.py @@ -0,0 +1,43 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.Sorensen + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 2.0 * 3 / 8), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(external=True)(left, right) + assert isclose(actual, expected) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky(left, right): + td = textdistance.Tversky(ks=[.5, .5]).distance(left, right) + jd = ALG().distance(left, right) + assert isclose(jd, td) + + +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_compare_with_tversky_as_set(left, right): + td = textdistance.Tversky(ks=[.5, .5], as_set=True).distance(left, right) + jd = ALG(as_set=True).distance(left, right) + assert isclose(jd, td) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/canaries/first-hunk-only.sh b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/canaries/first-hunk-only.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9ff3d012e267d7aed3bac9a2efd511adaa1faf2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/canaries/first-hunk-only.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL' +diff --git a/textdistance/algorithms/sequence_based.py b/textdistance/algorithms/sequence_based.py +index a65a8f9ac7a8fef9a4405346250ca8f09402b748..b1fd7afc4ff45c051e2d4f27cef0e986c71d4cb7 100644 +--- a/textdistance/algorithms/sequence_based.py ++++ b/textdistance/algorithms/sequence_based.py +@@ -125,7 +125,7 @@ + return type(short)() # empty sequence + + def __call__(self, *sequences: str) -> str: +- if all(sequences): ++ if not all(sequences): + return '' + length = len(sequences) + if length == 0: +OPENENV_PARTIAL +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/canaries/original-bug.sh b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/canaries/original-bug.sh new file mode 100644 index 0000000000000000000000000000000000000000..927547df786c86ab3bb5eeb917a31e0fa1895f8b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/canaries/original-bug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -Eeuo pipefail +: diff --git a/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/openenv.json b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/openenv.json new file mode 100644 index 0000000000000000000000000000000000000000..a13b3c577df494f6c894584d2b608ab051ebc44f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__rj09ojuj/validation/openenv.json @@ -0,0 +1,27 @@ +{ + "canaries": "validation/canaries", + "profile": "harbor-semantic-v1", + "requires_credentials": false, + "resources": { + "cpu": 2, + "disk_mb": 16384, + "episode_timeout_s": 1800, + "memory_mb": 8192 + }, + "reward": { + "floor_margin": 0.1, + "oracle_tolerance": 0, + "range": [ + 0, + 1 + ] + }, + "reward_key": "reward", + "types": { + "tags": [ + "swe", + "python", + "mutation-repair" + ] + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/LICENSE.source b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/LICENSE.source new file mode 100644 index 0000000000000000000000000000000000000000..229b7d33f92ba0a6e1a8d7cc6da14c628bd08ecb --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/LICENSE.source @@ -0,0 +1,7 @@ +Copyright 2018 @orsinium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/adapter.json b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/adapter.json new file mode 100644 index 0000000000000000000000000000000000000000..3fa0574d1d73eec9b638911f805840def625a134 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/adapter.json @@ -0,0 +1,132 @@ +{ + "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", + "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", + "dependency_installation_pinned": false, + "dependency_setup_sha256": "ebea3d812d8ba431df8c8981356fc22539fe4432acc5a1ba9fbe73c2f420a2c8", + "gold_patch_sha256": "d3c50dcd18fbaf2aba2d7a2716b8aedfd1b029643d6694f06575f15835395778", + "hostile_code_isolation_established": false, + "known_wrong_semantic_implementations": 0, + "native_inventory_sha256": "501382ab519dc3953d4f67eb1808569c2a30976ddcf6f28c501a7d8001383ddc", + "new_files_deletions_and_executable_modes_supported": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_bug_canary_nop_equivalent": true, + "original_bug_runtime_wrongness_established": false, + "partial_repair_canary": true, + "partial_repair_sha256": "6560e8f846612274daaa0a24ab4729e208fdabc8af3c5be8df464a7c41f53375", + "partial_repair_wrongness_established": false, + "positive_approval_policy": "All original strict presence/identity/no-skip/no-error/exit checks retained", + "private_checker_sha256": "f0a641064b725415e23a0221bb53c90446d7efcb7f9ece5ede93a220d18dd9e7", + "private_checker_version": "matched-failure-precedence-v2", + "provided_original_bug_control": true, + "repo_url": "https://github.com/swesmith/life4__textdistance.c3aca916.git", + "runtime_image": null, + "runtime_ready": false, + "runtime_recipe": { + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } + }, + "runtime_resource_review_required": false, + "schema": "python-git-patch-jobs-v1", + "source_base_commit": "1cbf968582774b1e06280e8e60532c6f434d608b", + "source_completion_sha256": "229f98d293bb0a03bfd6c06ec03ef53460b622b7952f2f11102e5299830cbea9", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_pr_url": null, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__s5ap259k", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "13b1fb46e9caea6e15d35f0b887a10daca009307014725106d68084bce745610", + "is_fork": true, + "learner_path": "tasks/32fba59bb5b5ab2cf00a6e49/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/1cbf968582774b1e06280e8e60532c6f434d608b/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "4117db00a181fee8a8a67883f7bb3df64bfb6ac897945d2115c9ede6fdfbaeb0", + "provenance_path": "tasks/32fba59bb5b5ab2cf00a6e49/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "1cbf968582774b1e06280e8e60532c6f434d608b", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "036f84ba695db0ac5660b10e95207ecad0b20bc9", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__s5ap259k", + "task_sha256": "90510c40d665a77d045edea17c614300fc2db6f4c4a4ea6b189db3a7418bca4f", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "source_repo": "swesmith/life4__textdistance.c3aca916", + "symlink_submodule_changes_supported": false, + "task_id": "life4__textdistance.c3aca916.combine_file__s5ap259k", + "transfer": "index-independent-worktree-to-Git-binary-patch", + "transfer_path": "/testbed/submission.patch", + "upstream_repo": "life4/textdistance" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/dependency-setup.sh b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/dependency-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..83554f5cc9c6a04d214af473692644ac1476fe07 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/dependency-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +python -c 'import sys; assert sys.version_info[:2] == (3, 10)' +python -m pip install pytest==8.4.2 +pip install -e ".[benchmark,test]" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/environment/Dockerfile b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a59b58c2ea8217c78c1e39b4678f93c8c0023bcd --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/environment/Dockerfile @@ -0,0 +1,3 @@ +# Runtime is selected only by an independently qualified immutable amd64 receipt. +FROM ubuntu:22.04 +RUN false diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/instruction.md b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..1d85b1f08ffea5dbf5726934a137870ae2523399 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/instruction.md @@ -0,0 +1,25 @@ +NeedlemanWunsch and MLIPNS classes missing required methods after initialization changes + +#### Description + +After recent changes, the `NeedlemanWunsch` and `MLIPNS` classes are throwing `AttributeError` when trying to access basic methods. The classes seem to be missing their initialization or inheritance setup. + +#### Steps/Code to Reproduce + +```python +import textdistance + +# NeedlemanWunsch fails +nw = textdistance.NeedlemanWunsch() +result = nw.distance('GATTACA', 'GCATGCU') # AttributeError: 'NeedlemanWunsch' object has no attribute 'gap_cost' + +# MLIPNS also fails +mlipns = textdistance.MLIPNS() +result = mlipns.distance('abc', 'abc') # AttributeError: 'MLIPNS' object has no attribute 'distance' +``` + +The error occurs when trying to use these algorithms for basic distance calculations. Both classes appear to be missing essential attributes and methods that should be available after instantiation. + +## Environment + +The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest `. Don't install packages: the tests need nothing else, and the sandbox may have no network access. diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/metadata.json b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..f25de6436be61950f7c7eb6622eda84a15982d7f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/metadata.json @@ -0,0 +1,619 @@ +{ + "all_runtime_and_training_flags": false, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "source_healthy_reference_proof": { + "FAIL_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]" + ], + "PASS_TO_PASS": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ], + "all_git_blobs_modes_verified": true, + "cloud_launch_ready": false, + "commits": { + "bug": "036f84ba695db0ac5660b10e95207ecad0b20bc9", + "healthy": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "learner": "1cbf968582774b1e06280e8e60532c6f434d608b" + }, + "existing_squirrel_snapshot_reused": false, + "full_transfer_allowlist": [ + "/testbed/.gitignore", + "/testbed/.markdownlint.yaml", + "/testbed/LICENSE", + "/testbed/MANIFEST.in", + "/testbed/README.md", + "/testbed/Taskfile.yml", + "/testbed/deploy.sh", + "/testbed/fuzzing/build.sh", + "/testbed/fuzzing/fuzz_helpers.py", + "/testbed/fuzzing/textdistance_fuzzer.py", + "/testbed/licenses_example/README.md", + "/testbed/licenses_example/compare.py", + "/testbed/licenses_example/make_heatmap.ipynb", + "/testbed/licenses_example/requirements.txt", + "/testbed/logo.png", + "/testbed/logo.svg", + "/testbed/pyproject.toml", + "/testbed/setup.cfg", + "/testbed/setup.py", + "/testbed/tests/__init__.py", + "/testbed/tests/test_compression/__init__.py", + "/testbed/tests/test_compression/test_arith_ncd.py", + "/testbed/tests/test_compression/test_bwtrle_ncd.py", + "/testbed/tests/test_compression/test_bz2_ncd.py", + "/testbed/tests/test_compression/test_common.py", + "/testbed/tests/test_compression/test_entropy_ncd.py", + "/testbed/tests/test_compression/test_sqrt_ncd.py", + "/testbed/tests/test_edit/__init__.py", + "/testbed/tests/test_edit/test_damerau_levenshtein.py", + "/testbed/tests/test_edit/test_editex.py", + "/testbed/tests/test_edit/test_gotoh.py", + "/testbed/tests/test_edit/test_hamming.py", + "/testbed/tests/test_edit/test_jaro.py", + "/testbed/tests/test_edit/test_jaro_winkler.py", + "/testbed/tests/test_edit/test_levenshtein.py", + "/testbed/tests/test_edit/test_matrix.py", + "/testbed/tests/test_edit/test_smith_waterman.py", + "/testbed/tests/test_edit/test_strcmp95.py", + "/testbed/tests/test_external.py", + "/testbed/tests/test_phonetic/__init__.py", + "/testbed/tests/test_phonetic/test_editex.py", + "/testbed/tests/test_sequence/__init__.py", + "/testbed/tests/test_sequence/test_lcsseq.py", + "/testbed/tests/test_sequence/test_lcsstr.py", + "/testbed/tests/test_token/__init__.py", + "/testbed/tests/test_token/test_bag.py", + "/testbed/tests/test_token/test_cosine.py", + "/testbed/tests/test_token/test_jaccard.py", + "/testbed/tests/test_token/test_monge_elkan.py", + "/testbed/tests/test_token/test_overlap.py", + "/testbed/tests/test_token/test_sorensen.py", + "/testbed/textdistance/__init__.py", + "/testbed/textdistance/algorithms/__init__.py", + "/testbed/textdistance/algorithms/base.py", + "/testbed/textdistance/algorithms/compression_based.py", + "/testbed/textdistance/algorithms/edit_based.py", + "/testbed/textdistance/algorithms/phonetic.py", + "/testbed/textdistance/algorithms/sequence_based.py", + "/testbed/textdistance/algorithms/simple.py", + "/testbed/textdistance/algorithms/token_based.py", + "/testbed/textdistance/algorithms/types.py", + "/testbed/textdistance/algorithms/vector_based.py", + "/testbed/textdistance/benchmark.py", + "/testbed/textdistance/libraries.json", + "/testbed/textdistance/libraries.py", + "/testbed/textdistance/py.typed", + "/testbed/textdistance/utils.py" + ], + "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", + "mutation_matches_dataset_and_git_blobs": true, + "official_profile": { + "eval_sets": [], + "profile_class": "TextdistanceC3aca916", + "profile_lines": [ + 996, + 1002 + ], + "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", + "profile_source_path": "swesmith/profiles/python.py", + "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", + "upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "upstream_repo": "life4/textdistance" + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "private_test_paths": [ + "tests/test_common.py", + "tests/test_edit/test_mlipns.py", + "tests/test_edit/test_needleman_wunsch.py" + ], + "private_tests_unchanged": true, + "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", + "qwen_calibrated": false, + "runtime_qualified": false, + "source_paths": [ + "textdistance/algorithms/edit_based.py" + ], + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_stages_bytes": 497006, + "task_id": "life4__textdistance.c3aca916.combine_file__s5ap259k", + "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", + "upstream_repo": "life4/textdistance" + }, + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__s5ap259k", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "13b1fb46e9caea6e15d35f0b887a10daca009307014725106d68084bce745610", + "is_fork": true, + "learner_path": "tasks/32fba59bb5b5ab2cf00a6e49/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/1cbf968582774b1e06280e8e60532c6f434d608b/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "4117db00a181fee8a8a67883f7bb3df64bfb6ac897945d2115c9ede6fdfbaeb0", + "provenance_path": "tasks/32fba59bb5b5ab2cf00a6e49/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "1cbf968582774b1e06280e8e60532c6f434d608b", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "036f84ba695db0ac5660b10e95207ecad0b20bc9", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__s5ap259k", + "task_sha256": "90510c40d665a77d045edea17c614300fc2db6f4c4a4ea6b189db3a7418bca4f", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_kind": "original-source-mutation" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/provenance.json b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..4971d863a95aeab9ef450b9e68ca72f7fc05d55a --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/provenance.json @@ -0,0 +1,88 @@ +{ + "generated_reference": false, + "healthy_reference_delta_sha256": "d3c50dcd18fbaf2aba2d7a2716b8aedfd1b029643d6694f06575f15835395778", + "native_pytest_ids_preserved": true, + "original_source_code_license": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/1cbf968582774b1e06280e8e60532c6f434d608b/LICENSE" + }, + "provided_reference": true, + "qwen_calibrated": false, + "runtime_qualified": false, + "source_completion_sha256": "229f98d293bb0a03bfd6c06ec03ef53460b622b7952f2f11102e5299830cbea9", + "source_index_sha256": "e856874b9410fce9f3bfea52c8c482e84b3e43942d87517f8b55f0034bd40f6f", + "source_proof_sha256": "e668b3e08bc546f9db0dec2b70a8d7aa2265e691635a2f315da7b2a7bc341dc4", + "source_record": { + "anti_training_canary": false, + "anti_training_reviewed": true, + "candidate_id": "swesmith-py:life4__textdistance.c3aca916.combine_file__s5ap259k", + "cloud_launch_ready": false, + "eligibility": { + "reasons": [], + "semantic_nonoverlap_established": false, + "status": "eligible_for_controls", + "training_admissible": false, + "warnings": [] + }, + "healthy_mirror_commit": "97d7d4d227ae2f644a0c9b4544514b26c91ca6a8", + "instruction_sha256": "13b1fb46e9caea6e15d35f0b887a10daca009307014725106d68084bce745610", + "is_fork": true, + "learner_path": "tasks/32fba59bb5b5ab2cf00a6e49/learner", + "license_evidence": { + "source_code": { + "actual_upstream_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "actual_upstream_url": "https://raw.githubusercontent.com/life4/textdistance/c3aca916bd756a8cb71114688b469ec90ef5b232/LICENSE", + "reviewed": true, + "sha256": "a0e57f3899f173db90cde68c69b07eaea57c1ad8be4359105eeb0f805c681092", + "spdx": "MIT", + "training_allowed": true, + "url": "https://raw.githubusercontent.com/swesmith/life4__textdistance.c3aca916/1cbf968582774b1e06280e8e60532c6f434d608b/LICENSE" + }, + "task_bundle": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + } + }, + "original_source_commit": "c3aca916bd756a8cb71114688b469ec90ef5b232", + "patch_sha256": "4117db00a181fee8a8a67883f7bb3df64bfb6ac897945d2115c9ede6fdfbaeb0", + "provenance_path": "tasks/32fba59bb5b5ab2cf00a6e49/source-proof.json", + "repository_lineage": [ + "swesmith/life4__textdistance.c3aca916", + "life4/textdistance" + ], + "rfc008_complete": false, + "runtime_qualified": false, + "semantic_nonoverlap_established": false, + "source_commit": "1cbf968582774b1e06280e8e60532c6f434d608b", + "source_dataset": "SWE-bench/SWE-smith-py", + "source_head_commit": "036f84ba695db0ac5660b10e95207ecad0b20bc9", + "source_kind": "mutation", + "source_repo": "swesmith/life4__textdistance.c3aca916", + "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", + "source_split": "train", + "target_model_calibrated": false, + "task_id": "life4__textdistance.c3aca916.combine_file__s5ap259k", + "task_sha256": "90510c40d665a77d045edea17c614300fc2db6f4c4a4ea6b189db3a7418bca4f", + "training_admissible": false, + "upstream_identity_reviewed": true, + "upstream_repo": "life4/textdistance", + "usage": "quarantine_only" + }, + "task_bundle_license": { + "reviewed": true, + "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", + "spdx": "MIT", + "training_allowed": true, + "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" + }, + "training_admissible": false, + "trusted_tests_sha256": "1951d5a4ecae9bb791f9755d42e19fbe348cc4573add07c0f18549b8de2d2bef" +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/provided-gold.diff b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/provided-gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..07036a0ac8c4f317b76b131a9252d1d2829d6cc4 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/provided-gold.diff @@ -0,0 +1,68 @@ +diff --git a/textdistance/algorithms/edit_based.py b/textdistance/algorithms/edit_based.py +index 676c54e9aed2263bcbae3bfa29c49f1275267560..0a6e02f00872822ad4dd2408c41856b26a135e5b 100644 +--- a/textdistance/algorithms/edit_based.py ++++ b/textdistance/algorithms/edit_based.py +@@ -431,6 +431,21 @@ + https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm + """ + ++ def __init__( ++ self, ++ gap_cost: float = 1.0, ++ sim_func: SimFunc = None, ++ qval: int = 1, ++ external: bool = True, ++ ) -> None: ++ self.qval = qval ++ self.gap_cost = gap_cost ++ if sim_func: ++ self.sim_func = sim_func ++ else: ++ self.sim_func = self._ident ++ self.external = external ++ + def minimum(self, *sequences: Sequence[object]) -> float: + return -max(map(len, sequences)) * self.gap_cost + +@@ -445,11 +460,11 @@ + def normalized_distance(self, *sequences: Sequence[object]) -> float: + """Get distance from 0 to 1 + """ +- maximum = self.minimum(*sequences) +- minimum = self.maximum(*sequences) +- if minimum == 0: +- return 1 +- return (self.distance(*sequences) - maximum) / (minimum - maximum) ++ minimum = self.minimum(*sequences) ++ maximum = self.maximum(*sequences) ++ if maximum == 0: ++ return 0 ++ return (self.distance(*sequences) - minimum) / (maximum - minimum) + + def normalized_similarity(self, *sequences: Sequence[object]) -> float: + """Get similarity from 0 to 1 +@@ -488,6 +503,7 @@ + insert = dist_mat[i, j - 1] - self.gap_cost + dist_mat[i, j] = max(match, delete, insert) + return dist_mat[dist_mat.shape[0] - 1, dist_mat.shape[1] - 1] ++ + + class SmithWaterman(_BaseSimilarity): + """ +@@ -772,7 +788,7 @@ + return weight + + +-class MLIPNS(): ++class MLIPNS(_BaseSimilarity): + """ + Compute the Hamming distance between the two or more sequences. + The Hamming distance is the number of differing items in ordered sequences. +@@ -818,6 +834,7 @@ + return 1 + return 0 + ++ + hamming = Hamming() + levenshtein = Levenshtein() + damerau = damerau_levenshtein = DamerauLevenshtein() diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/solution/solve.sh b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..961d65f6168ca23021e4bbb636827b96ef155070 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/solution/solve.sh @@ -0,0 +1,74 @@ +#!/bin/bash +set -Eeuo pipefail +cd /testbed/repo +cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE' +diff --git a/textdistance/algorithms/edit_based.py b/textdistance/algorithms/edit_based.py +index 676c54e9aed2263bcbae3bfa29c49f1275267560..0a6e02f00872822ad4dd2408c41856b26a135e5b 100644 +--- a/textdistance/algorithms/edit_based.py ++++ b/textdistance/algorithms/edit_based.py +@@ -431,6 +431,21 @@ + https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm + """ + ++ def __init__( ++ self, ++ gap_cost: float = 1.0, ++ sim_func: SimFunc = None, ++ qval: int = 1, ++ external: bool = True, ++ ) -> None: ++ self.qval = qval ++ self.gap_cost = gap_cost ++ if sim_func: ++ self.sim_func = sim_func ++ else: ++ self.sim_func = self._ident ++ self.external = external ++ + def minimum(self, *sequences: Sequence[object]) -> float: + return -max(map(len, sequences)) * self.gap_cost + +@@ -445,11 +460,11 @@ + def normalized_distance(self, *sequences: Sequence[object]) -> float: + """Get distance from 0 to 1 + """ +- maximum = self.minimum(*sequences) +- minimum = self.maximum(*sequences) +- if minimum == 0: +- return 1 +- return (self.distance(*sequences) - maximum) / (minimum - maximum) ++ minimum = self.minimum(*sequences) ++ maximum = self.maximum(*sequences) ++ if maximum == 0: ++ return 0 ++ return (self.distance(*sequences) - minimum) / (maximum - minimum) + + def normalized_similarity(self, *sequences: Sequence[object]) -> float: + """Get similarity from 0 to 1 +@@ -488,6 +503,7 @@ + insert = dist_mat[i, j - 1] - self.gap_cost + dist_mat[i, j] = max(match, delete, insert) + return dist_mat[dist_mat.shape[0] - 1, dist_mat.shape[1] - 1] ++ + + class SmithWaterman(_BaseSimilarity): + """ +@@ -772,7 +788,7 @@ + return weight + + +-class MLIPNS(): ++class MLIPNS(_BaseSimilarity): + """ + Compute the Hamming distance between the two or more sequences. + The Hamming distance is the number of differing items in ordered sequences. +@@ -818,6 +834,7 @@ + return 1 + return 0 + ++ + hamming = Hamming() + levenshtein = Levenshtein() + damerau = damerau_levenshtein = DamerauLevenshtein() +OPENENV_REFERENCE +/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/task.toml b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5ed6dbbd64c0470eb883d693aeb25566d1e6df0e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/task.toml @@ -0,0 +1,24 @@ +version = "1.0" + +[agent] +timeout_sec = 1800.0 + +[verifier] +timeout_sec = 900.0 + +[environment] +docker_image = "ghcr.io/younesbelkada/scale800@sha256:ecba074a36be21467fc014da82536c410619c7de715d173551c90117c6357eae" +build_timeout_sec = 600.0 +cpus = 2 +memory_mb = 8192 +storage_mb = 16384 + +[metadata] +author_name = "SWE-smith source adapter" +category = "bugfix" +tags = ["swe", "python", "mutation-repair"] + +[environment.env] +# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's +# non-interactive shells never run `conda activate` +PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/check_pytest.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/check_pytest.py new file mode 100644 index 0000000000000000000000000000000000000000..7abfdc5972f57ca7f0cecbbeeb373414670f780e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/check_pytest.py @@ -0,0 +1,177 @@ +"""Preserve confirmed requested assertion failures; keep positive checks strict.""" + +import argparse +import hashlib +import json +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +GROUPS = ("pass-to-pass", "fail-to-pass") + + +def split_nodeid(target): + prefix, bracket, parameter = target.partition("[") + parts = prefix.split("::") + if bracket: + parts[-1] += bracket + parameter + return parts + + +def matches(case, target): + parts = split_nodeid(target) + module = parts[0].removesuffix(".py").replace("/", ".") + classname, name = case.get("classname", ""), case.get("name", "") + if not (classname == module or classname.startswith(module + ".")): + return False + selector = parts[-1] if len(parts) > 1 else "" + classes = parts[1:-1] + if classes and classname != module + "." + ".".join(classes): + return False + return ( + not selector + or name == selector + or ("[" not in selector and name.startswith(selector + "[")) + ) + + +def capture_panels(root): + panels, digests = {}, {} + for group in GROUPS: + path = Path(root) / (group + ".xml") + if not path.exists(): + panels[group] = None + continue + with path.open("rb") as stream: + raw = stream.read(4 * 1024**2 + 1) + if not 0 < len(raw) <= 4 * 1024**2 or re.search( + rb" 20000: + raise ValueError("Too many pytest cases") + identities = [(case.get("classname"), case.get("name")) for case in cases] + if len(identities) != len(set(identities)): + raise ValueError("Duplicate pytest case evidence") + panels[group] = cases + digests[group] = hashlib.sha256(raw).hexdigest() + return panels, digests + + +def strict_assess(panels, expected, native_exit): + """The original positive-approval conditions, applied to captured cases.""" + all_cases, actual_failure = [], False + for group in GROUPS: + cases = panels[group] + if cases is None: + if actual_failure: + continue + raise ValueError("Missing preceding pytest panel") + if actual_failure: + raise ValueError( + "Pytest evidence continued after the native stop-on-failure" + ) + targets = expected[group] + if any(not any(matches(case, target) for target in targets) for case in cases): + raise ValueError("Unexpected pytest case") + all_cases.extend(cases) + failures = [case for case in cases if case.find("failure") is not None] + if any( + case.find("error") is not None or case.find("skipped") is not None + for case in cases + ): + raise ValueError("Pytest collection/error/skip is not a completed panel") + actual_failure = actual_failure or bool(failures) + if not failures and any( + not any(matches(case, target) for case in cases) for target in targets + ): + raise ValueError("Declared pytest target never ran") + if actual_failure: + if native_exit == 0: + raise ValueError("Native verifier exit disagrees with pytest failure") + return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} + if native_exit != 0: + raise ValueError("Setup or native verifier failed without a real test failure") + if any(panels[group] is None for group in GROUPS): + raise ValueError("Missing completed pytest panel") + return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)} + + +def assess(root, expected, native_exit): + if type(native_exit) is not int: + raise ValueError("Native verifier exit must be an integer") + if not isinstance(expected, dict) or any( + not isinstance(expected.get(group), list) + or not expected[group] + or any(not isinstance(target, str) or not target for target in expected[group]) + for group in GROUPS + ): + raise ValueError("Complete exact native pytest targets required") + panels, digests = capture_panels(root) + counts = { + "cases": 0, + "matched_failures": 0, + "unexpected_cases": 0, + "unmatched_failures": 0, + "skipped_cases": 0, + "error_cases": 0, + "missing_panels": 0, + "missing_targets": 0, + } + for group in GROUPS: + cases = panels[group] + if cases is None: + counts["missing_panels"] += 1 + counts["missing_targets"] += len(expected[group]) + continue + counts["cases"] += len(cases) + for case in cases: + requested = any(matches(case, target) for target in expected[group]) + failure = case.find("failure") is not None + counts["matched_failures"] += int(requested and failure) + counts["unmatched_failures"] += int(not requested and failure) + counts["unexpected_cases"] += int(not requested) + counts["skipped_cases"] += int(case.find("skipped") is not None) + counts["error_cases"] += int(case.find("error") is not None) + counts["missing_targets"] += sum( + not any(matches(case, target) for case in cases) + for target in expected[group] + ) + if counts["matched_failures"]: + if native_exit == 0: + raise ValueError( + "Native verifier exit disagrees with requested pytest failure" + ) + return { + "reward": 0, + "valid_test_failure": True, + "cases": counts["cases"], + "diagnostic_counts": counts, + "panel_sha256": digests, + "decision": "confirmed_requested_failure_precedence", + } + result = strict_assess(panels, expected, native_exit) + result.update(diagnostic_counts=counts, panel_sha256=digests) + return result + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--root", required=True) + parser.add_argument("--expected", required=True) + parser.add_argument("--native-exit", type=int, required=True) + args = parser.parse_args() + result = assess( + args.root, json.loads(Path(args.expected).read_bytes()), args.native_exit + ) + reward = Path(args.root) / "reward.txt" + if reward.read_text().strip() != str(result["reward"]): + raise ValueError("Native raw reward disagrees with pytest evidence") + (Path(args.root) / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/expected-panels.json b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/expected-panels.json new file mode 100644 index 0000000000000000000000000000000000000000..b77c3cf1f94accc1ac77cb598eb6e7c350042879 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/expected-panels.json @@ -0,0 +1,433 @@ +{ + "fail-to-pass": [ + "tests/test_common.py::test_normalization_range[alg6]", + "tests/test_common.py::test_normalization_range[alg21]", + "tests/test_common.py::test_normalization_by_one[alg6]", + "tests/test_common.py::test_normalization_by_one[alg21]", + "tests/test_common.py::test_normalization_same[alg6]", + "tests/test_common.py::test_normalization_same[alg21]", + "tests/test_common.py::test_normalization_monotonic[alg6]", + "tests/test_common.py::test_normalization_monotonic[alg21]", + "tests/test_common.py::test_no_common_chars[alg6]", + "tests/test_common.py::test_no_common_chars[alg21]", + "tests/test_common.py::test_empty[alg6]", + "tests/test_common.py::test_empty[alg21]", + "tests/test_common.py::test_unequal_distance[alg6]", + "tests/test_common.py::test_unequal_distance[alg21]", + "tests/test_edit/test_mlipns.py::test_distance[--1]", + "tests/test_edit/test_mlipns.py::test_distance[a--0]", + "tests/test_edit/test_mlipns.py::test_distance[-a-0]", + "tests/test_edit/test_mlipns.py::test_distance[a-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[ab-a-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abc-1]", + "tests/test_edit/test_mlipns.py::test_distance[abc-abcde-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdeg-1]", + "tests/test_edit/test_mlipns.py::test_distance[abcg-abcdefg-0]", + "tests/test_edit/test_mlipns.py::test_distance[Tomato-Tamato-1]", + "tests/test_edit/test_mlipns.py::test_distance[ato-Tam-1]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-16]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC--5]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC--7]", + "tests/test_edit/test_needleman_wunsch.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]" + ], + "pass-to-pass": [ + "tests/test_common.py::test_normalization_range[alg0]", + "tests/test_common.py::test_normalization_range[alg1]", + "tests/test_common.py::test_normalization_range[alg2]", + "tests/test_common.py::test_normalization_range[alg3]", + "tests/test_common.py::test_normalization_range[alg4]", + "tests/test_common.py::test_normalization_range[alg5]", + "tests/test_common.py::test_normalization_range[alg7]", + "tests/test_common.py::test_normalization_range[alg8]", + "tests/test_common.py::test_normalization_range[alg9]", + "tests/test_common.py::test_normalization_range[alg10]", + "tests/test_common.py::test_normalization_range[alg11]", + "tests/test_common.py::test_normalization_range[alg12]", + "tests/test_common.py::test_normalization_range[alg13]", + "tests/test_common.py::test_normalization_range[alg14]", + "tests/test_common.py::test_normalization_range[alg15]", + "tests/test_common.py::test_normalization_range[alg16]", + "tests/test_common.py::test_normalization_range[alg17]", + "tests/test_common.py::test_normalization_range[alg18]", + "tests/test_common.py::test_normalization_range[alg19]", + "tests/test_common.py::test_normalization_range[alg20]", + "tests/test_common.py::test_normalization_range[alg22]", + "tests/test_common.py::test_normalization_range[alg23]", + "tests/test_common.py::test_normalization_by_one[alg0]", + "tests/test_common.py::test_normalization_by_one[alg1]", + "tests/test_common.py::test_normalization_by_one[alg2]", + "tests/test_common.py::test_normalization_by_one[alg3]", + "tests/test_common.py::test_normalization_by_one[alg4]", + "tests/test_common.py::test_normalization_by_one[alg5]", + "tests/test_common.py::test_normalization_by_one[alg7]", + "tests/test_common.py::test_normalization_by_one[alg8]", + "tests/test_common.py::test_normalization_by_one[alg9]", + "tests/test_common.py::test_normalization_by_one[alg10]", + "tests/test_common.py::test_normalization_by_one[alg11]", + "tests/test_common.py::test_normalization_by_one[alg12]", + "tests/test_common.py::test_normalization_by_one[alg13]", + "tests/test_common.py::test_normalization_by_one[alg14]", + "tests/test_common.py::test_normalization_by_one[alg15]", + "tests/test_common.py::test_normalization_by_one[alg16]", + "tests/test_common.py::test_normalization_by_one[alg17]", + "tests/test_common.py::test_normalization_by_one[alg18]", + "tests/test_common.py::test_normalization_by_one[alg19]", + "tests/test_common.py::test_normalization_by_one[alg20]", + "tests/test_common.py::test_normalization_by_one[alg22]", + "tests/test_common.py::test_normalization_by_one[alg23]", + "tests/test_common.py::test_normalization_same[alg0]", + "tests/test_common.py::test_normalization_same[alg1]", + "tests/test_common.py::test_normalization_same[alg2]", + "tests/test_common.py::test_normalization_same[alg3]", + "tests/test_common.py::test_normalization_same[alg4]", + "tests/test_common.py::test_normalization_same[alg5]", + "tests/test_common.py::test_normalization_same[alg7]", + "tests/test_common.py::test_normalization_same[alg8]", + "tests/test_common.py::test_normalization_same[alg9]", + "tests/test_common.py::test_normalization_same[alg10]", + "tests/test_common.py::test_normalization_same[alg11]", + "tests/test_common.py::test_normalization_same[alg12]", + "tests/test_common.py::test_normalization_same[alg13]", + "tests/test_common.py::test_normalization_same[alg14]", + "tests/test_common.py::test_normalization_same[alg15]", + "tests/test_common.py::test_normalization_same[alg16]", + "tests/test_common.py::test_normalization_same[alg17]", + "tests/test_common.py::test_normalization_same[alg18]", + "tests/test_common.py::test_normalization_same[alg19]", + "tests/test_common.py::test_normalization_same[alg20]", + "tests/test_common.py::test_normalization_same[alg22]", + "tests/test_common.py::test_normalization_same[alg23]", + "tests/test_common.py::test_normalization_monotonic[alg0]", + "tests/test_common.py::test_normalization_monotonic[alg1]", + "tests/test_common.py::test_normalization_monotonic[alg2]", + "tests/test_common.py::test_normalization_monotonic[alg3]", + "tests/test_common.py::test_normalization_monotonic[alg4]", + "tests/test_common.py::test_normalization_monotonic[alg5]", + "tests/test_common.py::test_normalization_monotonic[alg7]", + "tests/test_common.py::test_normalization_monotonic[alg8]", + "tests/test_common.py::test_normalization_monotonic[alg9]", + "tests/test_common.py::test_normalization_monotonic[alg10]", + "tests/test_common.py::test_normalization_monotonic[alg11]", + "tests/test_common.py::test_normalization_monotonic[alg12]", + "tests/test_common.py::test_normalization_monotonic[alg13]", + "tests/test_common.py::test_normalization_monotonic[alg14]", + "tests/test_common.py::test_normalization_monotonic[alg15]", + "tests/test_common.py::test_normalization_monotonic[alg16]", + "tests/test_common.py::test_normalization_monotonic[alg17]", + "tests/test_common.py::test_normalization_monotonic[alg18]", + "tests/test_common.py::test_normalization_monotonic[alg19]", + "tests/test_common.py::test_normalization_monotonic[alg20]", + "tests/test_common.py::test_normalization_monotonic[alg22]", + "tests/test_common.py::test_normalization_monotonic[alg23]", + "tests/test_common.py::test_no_common_chars[alg0]", + "tests/test_common.py::test_no_common_chars[alg1]", + "tests/test_common.py::test_no_common_chars[alg2]", + "tests/test_common.py::test_no_common_chars[alg3]", + "tests/test_common.py::test_no_common_chars[alg4]", + "tests/test_common.py::test_no_common_chars[alg5]", + "tests/test_common.py::test_no_common_chars[alg7]", + "tests/test_common.py::test_no_common_chars[alg8]", + "tests/test_common.py::test_no_common_chars[alg9]", + "tests/test_common.py::test_no_common_chars[alg10]", + "tests/test_common.py::test_no_common_chars[alg11]", + "tests/test_common.py::test_no_common_chars[alg12]", + "tests/test_common.py::test_no_common_chars[alg13]", + "tests/test_common.py::test_no_common_chars[alg14]", + "tests/test_common.py::test_no_common_chars[alg15]", + "tests/test_common.py::test_no_common_chars[alg16]", + "tests/test_common.py::test_no_common_chars[alg17]", + "tests/test_common.py::test_no_common_chars[alg18]", + "tests/test_common.py::test_no_common_chars[alg19]", + "tests/test_common.py::test_no_common_chars[alg20]", + "tests/test_common.py::test_no_common_chars[alg22]", + "tests/test_common.py::test_no_common_chars[alg23]", + "tests/test_common.py::test_empty[alg0]", + "tests/test_common.py::test_empty[alg1]", + "tests/test_common.py::test_empty[alg2]", + "tests/test_common.py::test_empty[alg3]", + "tests/test_common.py::test_empty[alg4]", + "tests/test_common.py::test_empty[alg5]", + "tests/test_common.py::test_empty[alg7]", + "tests/test_common.py::test_empty[alg8]", + "tests/test_common.py::test_empty[alg9]", + "tests/test_common.py::test_empty[alg10]", + "tests/test_common.py::test_empty[alg11]", + "tests/test_common.py::test_empty[alg12]", + "tests/test_common.py::test_empty[alg13]", + "tests/test_common.py::test_empty[alg14]", + "tests/test_common.py::test_empty[alg15]", + "tests/test_common.py::test_empty[alg16]", + "tests/test_common.py::test_empty[alg17]", + "tests/test_common.py::test_empty[alg18]", + "tests/test_common.py::test_empty[alg19]", + "tests/test_common.py::test_empty[alg20]", + "tests/test_common.py::test_empty[alg22]", + "tests/test_common.py::test_empty[alg23]", + "tests/test_common.py::test_unequal_distance[alg0]", + "tests/test_common.py::test_unequal_distance[alg1]", + "tests/test_common.py::test_unequal_distance[alg2]", + "tests/test_common.py::test_unequal_distance[alg3]", + "tests/test_common.py::test_unequal_distance[alg4]", + "tests/test_common.py::test_unequal_distance[alg5]", + "tests/test_common.py::test_unequal_distance[alg7]", + "tests/test_common.py::test_unequal_distance[alg8]", + "tests/test_common.py::test_unequal_distance[alg9]", + "tests/test_common.py::test_unequal_distance[alg10]", + "tests/test_common.py::test_unequal_distance[alg11]", + "tests/test_common.py::test_unequal_distance[alg12]", + "tests/test_common.py::test_unequal_distance[alg13]", + "tests/test_common.py::test_unequal_distance[alg14]", + "tests/test_common.py::test_unequal_distance[alg15]", + "tests/test_common.py::test_unequal_distance[alg16]", + "tests/test_common.py::test_unequal_distance[alg17]", + "tests/test_common.py::test_unequal_distance[alg18]", + "tests/test_common.py::test_unequal_distance[alg19]", + "tests/test_common.py::test_unequal_distance[alg20]", + "tests/test_common.py::test_unequal_distance[alg22]", + "tests/test_common.py::test_unequal_distance[alg23]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_arith_ncd.py::test_similarity[test-nani-2.1666666666666665]", + "tests/test_compression/test_arith_ncd.py::test_make_probs", + "tests/test_compression/test_arith_ncd.py::test_arith_output", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-test-0.6]", + "tests/test_compression/test_bwtrle_ncd.py::test_similarity[test-nani-0.8]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-test-0.08]", + "tests/test_compression/test_bz2_ncd.py::test_similarity[test-nani-0.16]", + "tests/test_compression/test_common.py::test_monotonicity[alg0]", + "tests/test_compression/test_common.py::test_monotonicity[alg1]", + "tests/test_compression/test_common.py::test_monotonicity[alg2]", + "tests/test_compression/test_common.py::test_monotonicity[alg3]", + "tests/test_compression/test_common.py::test_monotonicity[alg4]", + "tests/test_compression/test_common.py::test_monotonicity[alg5]", + "tests/test_compression/test_common.py::test_monotonicity[alg6]", + "tests/test_compression/test_common.py::test_simmetry[alg0]", + "tests/test_compression/test_common.py::test_simmetry[alg1]", + "tests/test_compression/test_common.py::test_simmetry[alg2]", + "tests/test_compression/test_common.py::test_simmetry[alg3]", + "tests/test_compression/test_common.py::test_simmetry[alg4]", + "tests/test_compression/test_common.py::test_simmetry[alg5]", + "tests/test_compression/test_common.py::test_simmetry[alg6]", + "tests/test_compression/test_common.py::test_is_normalized[alg0]", + "tests/test_compression/test_common.py::test_is_normalized[alg1]", + "tests/test_compression/test_common.py::test_is_normalized[alg2]", + "tests/test_compression/test_common.py::test_is_normalized[alg3]", + "tests/test_compression/test_common.py::test_is_normalized[alg4]", + "tests/test_compression/test_common.py::test_is_normalized[alg5]", + "tests/test_compression/test_common.py::test_is_normalized[alg6]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg0]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg1]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg2]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg3]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg4]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg5]", + "tests/test_compression/test_common.py::test_normalized_by_one[alg6]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-test-1]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[aaa-bbb-0]", + "tests/test_compression/test_entropy_ncd.py::test_similarity[test-nani-0.6]", + "tests/test_compression/test_entropy_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_entropy_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_entropy_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_entropy_ncd.py::test_normalization_range", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-test-0.41421356237309503]", + "tests/test_compression/test_sqrt_ncd.py::test_similarity[test-nani-1]", + "tests/test_compression/test_sqrt_ncd.py::test_simmetry_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_idempotency_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_monotonicity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_distributivity_compressor", + "tests/test_compression/test_sqrt_ncd.py::test_normalization_range", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[ab-bca-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_restricted[abcd-bdac-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-text-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tset-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-qwy-4]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-testit-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tesst-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[test-tet-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[cat-hat-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[Niall-Neil-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[aluminum-Catalan-7]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ATCG-TAGC-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ba-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-cde-3]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-ac-1]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bc-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[ab-bca-2]", + "tests/test_edit/test_damerau_levenshtein.py::test_distance_unrestricted[abcd-bdac-3]", + "tests/test_edit/test_editex.py::test_distance[--0]", + "tests/test_edit/test_editex.py::test_distance[nelson--12]", + "tests/test_edit/test_editex.py::test_distance[-neilsen-14]", + "tests/test_edit/test_editex.py::test_distance[ab-a-2]", + "tests/test_edit/test_editex.py::test_distance[ab-c-4]", + "tests/test_edit/test_editex.py::test_distance[ALIE-ALI-1]", + "tests/test_edit/test_editex.py::test_distance[-MARTHA-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params0-12]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params1-24]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params2-3]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params3-4]", + "tests/test_edit/test_editex.py::test_distance_with_params[MARTHA-MARHTA-params4-5]", + "tests/test_edit/test_gotoh.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[GATTACA-GCATGCU-0]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-TGACGSTGC-1.5]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_05[AGACTAGTTAC-CGAGACGT-1]", + "tests/test_edit/test_gotoh.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT--15]", + "tests/test_edit/test_hamming.py::test_distance[test-text-1]", + "tests/test_edit/test_hamming.py::test_distance[test-tset-2]", + "tests/test_edit/test_hamming.py::test_distance[test-qwe-4]", + "tests/test_edit/test_hamming.py::test_distance[test-testit-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tesst-2]", + "tests/test_edit/test_hamming.py::test_distance[test-tet-2]", + "tests/test_edit/test_jaro.py::test_distance[hello-haloa-0.7333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro.py::test_distance[frog-fog-0.9166666666666666]", + "tests/test_edit/test_jaro.py::test_distance[ATCG-TAGC-0.8333333333333334]", + "tests/test_edit/test_jaro.py::test_distance[MARTHA-MARHTA-0.944444444]", + "tests/test_edit/test_jaro.py::test_distance[DWAYNE-DUANE-0.822222222]", + "tests/test_edit/test_jaro.py::test_distance[DIXON-DICKSONX-0.7666666666666666]", + "tests/test_edit/test_jaro_winkler.py::test_distance[elephant-hippo-0.44166666666666665]", + "tests/test_edit/test_jaro_winkler.py::test_distance[fly-ant-0.0]", + "tests/test_edit/test_jaro_winkler.py::test_distance[frog-fog-0.925]", + "tests/test_edit/test_jaro_winkler.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DWAYNE-DUANE-0.84]", + "tests/test_edit/test_jaro_winkler.py::test_distance[DIXON-DICKSONX-0.8133333333333332]", + "tests/test_edit/test_levenshtein.py::test_distance[test-text-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tset-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-qwe-4]", + "tests/test_edit/test_levenshtein.py::test_distance[test-testit-2]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tesst-1]", + "tests/test_edit/test_levenshtein.py::test_distance[test-tet-1]", + "tests/test_edit/test_matrix.py::test_distance[--1]", + "tests/test_edit/test_matrix.py::test_distance[-a-0]", + "tests/test_edit/test_matrix.py::test_distance[abcd-abcd-1]", + "tests/test_edit/test_matrix.py::test_distance[A-C--3]", + "tests/test_edit/test_matrix.py::test_distance[G-G-7]", + "tests/test_edit/test_matrix.py::test_distance[A-A-10]", + "tests/test_edit/test_matrix.py::test_distance[T-A--4]", + "tests/test_edit/test_matrix.py::test_distance[T-C-0]", + "tests/test_edit/test_matrix.py::test_distance[A-G--1]", + "tests/test_edit/test_matrix.py::test_distance[C-T-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_matrix[AGACTAGTTAC-CGAGACGT-26]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident[GATTACA-GCATGCU-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[CGATATCAG-TGACGSTGC-0]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-TGACGSTGC-1]", + "tests/test_edit/test_smith_waterman.py::test_distance_ident_with_gap_5[AGACTAGTTAC-CGAGACGT-0]", + "tests/test_edit/test_strcmp95.py::test_distance[MARTHA-MARHTA-0.9611111111111111]", + "tests/test_edit/test_strcmp95.py::test_distance[DWAYNE-DUANE-0.873]", + "tests/test_edit/test_strcmp95.py::test_distance[DIXON-DICKSONX-0.839333333]", + "tests/test_edit/test_strcmp95.py::test_distance[TEST-TEXT-0.9066666666666666]", + "tests/test_external.py::test_compare[DamerauLevenshtein]", + "tests/test_external.py::test_compare[Hamming]", + "tests/test_external.py::test_compare[Jaro]", + "tests/test_external.py::test_compare[JaroWinkler]", + "tests/test_external.py::test_compare[Levenshtein]", + "tests/test_external.py::test_qval[None-DamerauLevenshtein]", + "tests/test_external.py::test_qval[None-Hamming]", + "tests/test_external.py::test_qval[None-Jaro]", + "tests/test_external.py::test_qval[None-JaroWinkler]", + "tests/test_external.py::test_qval[None-Levenshtein]", + "tests/test_external.py::test_qval[1-DamerauLevenshtein]", + "tests/test_external.py::test_qval[1-Hamming]", + "tests/test_external.py::test_qval[1-Jaro]", + "tests/test_external.py::test_qval[1-JaroWinkler]", + "tests/test_external.py::test_qval[1-Levenshtein]", + "tests/test_external.py::test_qval[2-DamerauLevenshtein]", + "tests/test_external.py::test_qval[2-Hamming]", + "tests/test_external.py::test_qval[2-Jaro]", + "tests/test_external.py::test_qval[2-JaroWinkler]", + "tests/test_external.py::test_qval[2-Levenshtein]", + "tests/test_external.py::test_qval[3-DamerauLevenshtein]", + "tests/test_external.py::test_qval[3-Hamming]", + "tests/test_external.py::test_qval[3-Jaro]", + "tests/test_external.py::test_qval[3-JaroWinkler]", + "tests/test_external.py::test_qval[3-Levenshtein]", + "tests/test_external.py::test_list_of_numbers[DamerauLevenshtein]", + "tests/test_external.py::test_list_of_numbers[Hamming]", + "tests/test_external.py::test_list_of_numbers[Jaro]", + "tests/test_external.py::test_list_of_numbers[JaroWinkler]", + "tests/test_external.py::test_list_of_numbers[Levenshtein]", + "tests/test_phonetic/test_editex.py::test_distance[--0]", + "tests/test_phonetic/test_editex.py::test_distance[nelson--12]", + "tests/test_phonetic/test_editex.py::test_distance[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_distance[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_distance[ab-c-4]", + "tests/test_phonetic/test_editex.py::test_distance[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_distance[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_distance[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_distance[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_distance[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_distance[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_distance[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_distance[nihl-neal-3]", + "tests/test_phonetic/test_editex.py::test_distance[cat-hat-2]", + "tests/test_phonetic/test_editex.py::test_distance[Niall-Neil-2]", + "tests/test_phonetic/test_editex.py::test_distance[aluminum-Catalan-12]", + "tests/test_phonetic/test_editex.py::test_distance[ATCG-TAGC-6]", + "tests/test_phonetic/test_editex.py::test_local[--0]", + "tests/test_phonetic/test_editex.py::test_local[nelson--12]", + "tests/test_phonetic/test_editex.py::test_local[-neilsen-14]", + "tests/test_phonetic/test_editex.py::test_local[ab-a-2]", + "tests/test_phonetic/test_editex.py::test_local[ab-c-2]", + "tests/test_phonetic/test_editex.py::test_local[nelson-neilsen-2]", + "tests/test_phonetic/test_editex.py::test_local[neilsen-nelson-2]", + "tests/test_phonetic/test_editex.py::test_local[niall-neal-1]", + "tests/test_phonetic/test_editex.py::test_local[neal-niall-1]", + "tests/test_phonetic/test_editex.py::test_local[niall-nihal-2]", + "tests/test_phonetic/test_editex.py::test_local[nihal-niall-2]", + "tests/test_phonetic/test_editex.py::test_local[neal-nihl-3]", + "tests/test_phonetic/test_editex.py::test_local[nihl-neal-3]", + "tests/test_sequence/test_lcsseq.py::test_distance[ab-cd-]", + "tests/test_sequence/test_lcsseq.py::test_distance[abcd-abcd-abcd]", + "tests/test_sequence/test_lcsseq.py::test_distance[test-text-tet]", + "tests/test_sequence/test_lcsseq.py::test_distance[thisisatest-testing123testing-tsitest]", + "tests/test_sequence/test_lcsseq.py::test_distance[DIXON-DICKSONX-DION]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "tests/test_sequence/test_lcsseq.py::test_distance[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs0-]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs1-a]", + "tests/test_sequence/test_lcsseq.py::test_distance_multiseq[seqs2-tet]", + "tests/test_sequence/test_lcsstr.py::test_distance[ab-abcd-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ab-ab]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-bc-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[bc-abcd-bc]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd0]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-cd-cd1]", + "tests/test_sequence/test_lcsstr.py::test_distance[abcd-ef-]", + "tests/test_sequence/test_lcsstr.py::test_distance[ef-abcd-]", + "tests/test_sequence/test_lcsstr.py::test_distance[MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST-TEST]", + "tests/test_sequence/test_lcsstr.py::test_distance[TEST-MYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTESTMYTEST-TEST]", + "tests/test_token/test_bag.py::test_distance[qwe-qwe-0]", + "tests/test_token/test_bag.py::test_distance[qwe-erty-3]", + "tests/test_token/test_bag.py::test_distance[qwe-ewq-0]", + "tests/test_token/test_bag.py::test_distance[qwe-rtys-4]", + "tests/test_token/test_cosine.py::test_distance[test-text-0.75]", + "tests/test_token/test_cosine.py::test_distance[nelson-neilsen-0.7715167498104595]", + "tests/test_token/test_jaccard.py::test_distance[test-text-0.6]", + "tests/test_token/test_jaccard.py::test_distance[nelson-neilsen-0.625]", + "tests/test_token/test_jaccard.py::test_distance[decide-resize-0.3333333333333333]", + "tests/test_token/test_jaccard.py::test_compare_with_tversky", + "tests/test_token/test_jaccard.py::test_compare_with_tversky_as_set", + "tests/test_token/test_monge_elkan.py::test_similarity[left0-right0-0.805]", + "tests/test_token/test_monge_elkan.py::test_similarity[left1-right1-0.7866666666666667]", + "tests/test_token/test_overlap.py::test_distance[test-text-0.75]", + "tests/test_token/test_overlap.py::test_distance[testme-textthis-0.6666666666666666]", + "tests/test_token/test_overlap.py::test_distance[nelson-neilsen-0.8333333333333334]", + "tests/test_token/test_sorensen.py::test_distance[test-text-0.75]", + "tests/test_token/test_sorensen.py::test_compare_with_tversky", + "tests/test_token/test_sorensen.py::test_compare_with_tversky_as_set" + ] +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/grade.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b37293830e51a5c5833c93c4705e1ed9364257 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/grade.py @@ -0,0 +1,128 @@ +"""Trusted private pytest panel runner. Installed only in a fresh grader Job.""" + +import hashlib +import importlib.util +import json +import os +import shutil +import stat +import subprocess +from pathlib import Path, PurePosixPath + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def safe(value): + path = PurePosixPath(value) + if ( + path.is_absolute() + or path.as_posix() != value + or not path.parts + or any(part in {".", "..", ".git"} for part in path.parts) + ): + raise ValueError("Unsafe trusted test path") + return path + + +def restore(worktree, private, manifest): + worktree, private = Path(worktree), Path(private) + captured = {} + for name, expected in manifest["files"].items(): + path = private / safe(name) + info = path.lstat() + raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" + if ( + not stat.S_ISREG(info.st_mode) + or len(raw) != expected["bytes"] + or sha(raw) != expected["sha256"] + or stat.S_IMODE(info.st_mode) != expected["mode"] + ): + raise ValueError("Trusted private test bytes or modes drifted") + captured[name] = (raw, expected["mode"]) + # Capture and verify every private byte before changing the submitted tree. + for name in manifest["directory_roots"]: + destination = worktree / safe(name) + if destination.is_symlink(): + raise ValueError("Submitted test directory is a symlink") + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.exists(): + if not destination.is_dir(): + raise ValueError("Submitted test directory is not a directory") + shutil.rmtree(destination) + for name, (raw, mode) in captured.items(): + destination = worktree / safe(name) + for parent in destination.parents: + if parent == worktree: + break + if parent.is_symlink(): + raise ValueError("Submitted test parent is a symlink") + if destination.is_symlink(): + raise ValueError("Submitted trusted file is a symlink") + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(raw) + destination.chmod(mode) + + +def run(worktree, private_root, output, invoke=None): + private_root, output, worktree = Path(private_root), Path(output), Path(worktree) + expected = json.loads((private_root / "expected-panels.json").read_bytes()) + config = json.loads((private_root / "panel-config.json").read_bytes()) + manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) + restore(worktree, private_root / "trusted", manifest) + output.mkdir(parents=True, exist_ok=True) + for name in ( + "reward.txt", + "pass-to-pass.xml", + "fail-to-pass.xml", + "pytest-evidence.json", + ): + (output / name).unlink(missing_ok=True) + environment = dict(os.environ) + for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): + environment.pop(key, None) + commands, native_exit = [], 0 + invoke = invoke or subprocess.run + for group in ("pass-to-pass", "fail-to-pass"): + if ( + not isinstance(expected[group], list) + or not expected[group] + or any( + not isinstance(target, str) or not target for target in expected[group] + ) + ): + raise ValueError("Frozen native pytest selectors are incomplete") + command = [ + *config["official_pytest_argv"], + "--override-ini=addopts=", + "--junitxml=" + str(output / (group + ".xml")), + *expected[group], + ] + result = invoke(command, cwd=worktree, env=environment, check=False) + native_exit = result.returncode + commands.append({"group": group, "argv": command, "exit_code": native_exit}) + if native_exit != 0: + break + (output / "pytest-commands.json").write_text( + json.dumps(commands, sort_keys=True) + "\n" + ) + spec = importlib.util.spec_from_file_location( + "trusted_pytest_result", private_root / "check_pytest.py" + ) + checker = importlib.util.module_from_spec(spec) + spec.loader.exec_module(checker) + result = checker.assess(output, expected, native_exit) + (output / "reward.txt").write_text(str(result["reward"]) + "\n") + (output / "pytest-evidence.json").write_text( + json.dumps(result, sort_keys=True) + "\n" + ) + return result + + +if __name__ == "__main__": + run("/testbed/repo", "/tests", "/logs/verifier") diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/panel-config.json b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/panel-config.json new file mode 100644 index 0000000000000000000000000000000000000000..48880d44cb86b85d149f929e05938eeedb3a5c0b --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/panel-config.json @@ -0,0 +1,25 @@ +{ + "dependency_installation_pinned": false, + "official_install_cmds": [ + "pip install -e \".[benchmark,test]\"" + ], + "official_pytest_argv": [ + "pytest", + "--disable-warnings", + "--color=no", + "--tb=no", + "--verbose" + ], + "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", + "operator_test_runner_prerequisites": [ + "python -m pip install pytest==8.4.2" + ], + "operator_test_runner_reason": "The official profile invokes pytest, but the common tools runtime does not provide it; pinned separately from source-native project requirements.", + "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", + "python_version": "3.10", + "source_bound_test_dependency_cmds": [], + "test_dependency_source_sha256": { + "setup.cfg": "c20a0419cdaa363270e295bc76b13815aa2f9b29461954e31a3ae9c2ede2eecc", + "setup.py": "59b4834644760e3c26953dfd69323afeae7aae5919df22589a19d6be674ddf0e" + } +} diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/test.sh b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..81b6d0620f05dbd3b54b4e7ea5de04ce3f8a98e2 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail +source /opt/miniconda3/bin/activate +conda activate testbed +cd /testbed/repo +exec python -I /tests/grade.py diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/pyproject.toml b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..33b1f800598642529b03fee8b92e04acf69d549e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/pyproject.toml @@ -0,0 +1,8 @@ +[tool.mypy] +files = ["textdistance"] +python_version = 3.7 +show_error_codes = true +disable_error_code = ["override"] +warn_unused_ignores = true +allow_redefinition = true +check_untyped_defs = true diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/setup.cfg b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cadb074632c7d50bba06be4523cd5cdb4a6772ca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +description_file = README.md +license_files = LICENSE + +[flake8] +max-line-length=120 +ignore=P101,P103,E241,B023 +exclude= + .tox + .pytest_cache + .venvs/ + build + +[isort] +skip=.tox,.pytest_cache,.venvs,build +line_length=120 +combine_as_imports=true +balanced_wrapping=true +lines_after_imports=2 +not_skip=__init__.py +multi_line_output=5 +import_heading_stdlib=built-in +import_heading_thirdparty=external +import_heading_firstparty=project +import_heading_localfolder=app + +[tool:pytest] +addopts = --strict-markers +markers = + external: tests that require external libs to run diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/setup.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..66438b757a204398b5780d45114ad24534faf53e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/setup.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# external +from setuptools import setup + + +extras = { + # enough for simple usage + 'extras': [ + 'jellyfish', # for DamerauLevenshtein + 'numpy', # for SmithWaterman and other + 'Levenshtein', # for Jaro and Levenshtein + 'pyxDamerauLevenshtein', # for DamerauLevenshtein + 'rapidfuzz>=2.6.0', # for Jaro, Levenshtein and other + ], + + # needed for benchmarking, optimization and testing + 'benchmark': [ + # common + 'jellyfish', + 'numpy', + 'Levenshtein', + 'pyxDamerauLevenshtein', + 'rapidfuzz>=2.6.0', + # slow + 'pylev', + 'py_stringmatching', + # other + 'tabulate', # to draw the table with results + ], + 'test': [ + 'hypothesis', + 'isort', + 'numpy', + 'pytest', + ], + 'lint': [ + 'twine', + 'mypy', + 'isort', + 'flake8', + 'types-tabulate', + + # flake8 plugins + 'flake8-blind-except', + 'flake8-bugbear', + 'flake8-commas', + 'flake8-logging-format', + 'flake8-mutable', + 'flake8-pep3101', + 'flake8-quotes', + 'flake8-string-format', + 'flake8-tidy-imports', + 'pep8-naming', + ], + + # for algos, from fastest to slowest, only faster than textdistance: + 'DamerauLevenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only for text + 'pyxDamerauLevenshtein', # for any iterators + ], + 'Hamming': [ + 'Levenshtein', # only same length and strings + 'rapidfuzz>=2.6.0', # only same length, any iterators of hashable elements + 'jellyfish', # only strings, any length + ], + 'Jaro': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + ], + 'JaroWinkler': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'jellyfish', # only text + ], + 'Levenshtein': [ + 'rapidfuzz>=2.6.0', # any iterators of hashable elements + 'Levenshtein', # only text + # yeah, other libs slower than textdistance + ], +} + +# backward compatibility +extras['common'] = extras['extras'] +extras['all'] = extras['benchmark'] + +# correct possible misspelling +extras['extra'] = extras['extras'] +extras['benchmarks'] = extras['benchmark'] + + +try: + long_description = open('README.md', encoding='utf-8').read() +except TypeError: + try: + long_description = open('README.md').read() + except UnicodeDecodeError: + long_description = '' + + +setup( + name='textdistance', + version='4.6.3', + + author='orsinium', + author_email='gram@orsinium.dev', + + description='Compute distance between the two texts.', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='distance between text strings sequences iterators', + + packages=['textdistance', 'textdistance.algorithms'], + package_data={'': ['*.json']}, + python_requires='>=3.5', + extras_require=extras, + + url='https://github.com/orsinium/textdistance', + download_url='https://github.com/orsinium/textdistance/tarball/master', + + license='MIT', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + ], +) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeca15f3e2495d8d5e3f7fdbbadabe26331b04e --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_common.py @@ -0,0 +1,108 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.bag, + + textdistance.hamming, + textdistance.levenshtein, + textdistance.damerau_levenshtein, + textdistance.jaro, + textdistance.jaro_winkler, + textdistance.mlipns, + + textdistance.lcsseq, + textdistance.lcsstr, + textdistance.ratcliff_obershelp, + + textdistance.jaccard, + textdistance.sorensen, + textdistance.tversky, + textdistance.overlap, + textdistance.cosine, + textdistance.strcmp95, + textdistance.monge_elkan, + + textdistance.mra, + + textdistance.prefix, + textdistance.postfix, + textdistance.identity, + # textdistance.length, + + # numpy-based: + # textdistance.gotoh, + textdistance.needleman_wunsch, + textdistance.smith_waterman, + textdistance.editex, +) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_range(left, right, alg): + assert 0 <= alg.normalized_distance(left, right) <= 1 + assert 0 <= alg.normalized_similarity(left, right) <= 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalization_by_one(left, right, alg): + d = alg.normalized_distance(left, right) + s = alg.normalized_similarity(left, right) + assert isclose(s + d, 1) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given(text=hypothesis.strategies.text()) +def test_normalization_same(text, alg): + assert alg.normalized_distance(text, text) == 0 + if alg is not textdistance.needleman_wunsch: + assert alg.distance(text, text) == 0 + assert alg.normalized_similarity(text, text) == 1 + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.settings(deadline=None) +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_normalization_monotonic(left, right, alg): + nd = alg.normalized_distance(left, right) + ns = alg.normalized_similarity(left, right) + d = alg.distance(left, right) + s = alg.similarity(left, right) + assert (nd < ns) == (d < s) + + +@pytest.mark.parametrize('alg', ALGS) +def test_no_common_chars(alg): + if alg is textdistance.editex: + return + assert alg.similarity('spam', 'qwer') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_empty(alg): + assert alg.distance('', '') == 0 + + +@pytest.mark.parametrize('alg', ALGS) +def test_unequal_distance(alg): + if alg.maximum('', 'qwertyui'): + assert alg.distance('', 'qwertyui') > 0 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_arith_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_arith_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..7d84acb462956120fefd703be003679ffccd2441 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_arith_ncd.py @@ -0,0 +1,35 @@ +# built-in +from fractions import Fraction +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.arith_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('test', 'nani', 2.1666666666666665), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +def test_make_probs(): + alg = textdistance.ArithNCD(terminator='\x00') + probs = alg._make_probs('lol', 'lal') + assert probs['l'] == (Fraction(0, 1), Fraction(4, 7)) + assert probs['o'][1] == Fraction(1, 7) + assert probs['a'][1] == Fraction(1, 7) + + +def test_arith_output(): + alg = textdistance.ArithNCD(terminator='\x00') + fraction = alg._compress('BANANA') + assert fraction.numerator == 1525 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_bwtrle_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_bwtrle_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..5630e92181b5d2de141e200db665648d8182f24f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_bwtrle_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bwtrle_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.6), + ('test', 'nani', 0.8), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_bz2_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_bz2_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..b8b42e24c5eadd9bcc6bcf529b26f61b29638036 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_bz2_ncd.py @@ -0,0 +1,20 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.bz2_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.08), + ('test', 'nani', 0.16), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_common.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6c2e8dc3d7d2d2228855e128539f9b306b3c2b9 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_common.py @@ -0,0 +1,67 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALGS = ( + textdistance.arith_ncd, + textdistance.bwtrle_ncd, + textdistance.bz2_ncd, + + # too slow, makes CI flaky + # textdistance.lzma_ncd, + + textdistance.rle_ncd, + textdistance.zlib_ncd, + textdistance.sqrt_ncd, + textdistance.entropy_ncd, +) + + +@pytest.mark.parametrize('alg', ALGS) +def test_monotonicity(alg): + same = alg('test', 'test') + similar = alg('test', 'text') + diffirent = alg('test', 'nani') + assert same <= similar <= diffirent + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_simmetry(left, right, alg): + assert alg.similarity(left, right) == alg.similarity(right, left) + assert alg.distance(left, right) == alg.distance(right, left) + assert alg.normalized_similarity(left, right) == alg.normalized_similarity(right, left) + assert alg.normalized_distance(left, right) == alg.normalized_distance(right, left) + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_is_normalized(left, right, alg): + a = alg(left, right) + d = alg.distance(left, right) + nd = alg.normalized_distance(left, right) + assert a == d == nd + + +@pytest.mark.parametrize('alg', ALGS) +@hypothesis.given( + left=hypothesis.strategies.text(), + right=hypothesis.strategies.text(), +) +def test_normalized_by_one(left, right, alg): + s = alg.normalized_similarity(left, right) + d = alg.normalized_distance(left, right) + assert isclose(s + d, 1) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_entropy_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_entropy_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8176498496759dce77e3fa696b401571ce6705 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_entropy_ncd.py @@ -0,0 +1,64 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.entropy_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 1), + ('aaa', 'bbb', 0), + ('test', 'nani', 0.6), +]) +def test_similarity(left, right, expected): + actual = ALG.similarity(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert isclose(ALG._compress(text), ALG._compress(rev)) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor actually does compression. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_distributivity_compressor(left1, left2, right): + if right in left1 or right in left2: + return + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_sqrt_ncd.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_sqrt_ncd.py new file mode 100644 index 0000000000000000000000000000000000000000..d25c4b56770161df7de54f0fb3cfdb0a85c8b45f --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_compression/test_sqrt_ncd.py @@ -0,0 +1,61 @@ +# built-in +from math import isclose + +# external +import hypothesis +import pytest + +# project +import textdistance + + +ALG = textdistance.sqrt_ncd + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'test', 0.41421356237309503), + ('test', 'nani', 1), +]) +def test_similarity(left, right, expected): + actual = ALG(left, right) + assert isclose(actual, expected) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_simmetry_compressor(text): + rev = ''.join(reversed(text)) + assert ALG._compress(text) == ALG._compress(rev) + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_idempotency_compressor(text): + # I've modified idempotency to some kind of distributivity for constant. + # Now it indicates that compressor really compress. + assert ALG._get_size(text * 2) < ALG._get_size(text) * 2 + + +@hypothesis.given( + left=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.characters(), +) +def test_monotonicity_compressor(left, right): + if right in left: + return + assert ALG._get_size(left) <= ALG._get_size(left + right) + + +@hypothesis.given( + left1=hypothesis.strategies.text(min_size=1), + left2=hypothesis.strategies.text(min_size=1), + right=hypothesis.strategies.text(min_size=1), +) +def test_distributivity_compressor(left1, left2, right): + actual1 = ALG._get_size(left1 + left2) + ALG._get_size(right) + actual2 = ALG._get_size(left1 + right) + ALG._get_size(left2 + right) + assert actual1 <= actual2 + + +@hypothesis.given(text=hypothesis.strategies.text(min_size=1)) +def test_normalization_range(text): + assert 0 <= ALG.normalized_similarity(text, text) <= 1 + assert 0 <= ALG.normalized_distance(text, text) <= 1 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/__init__.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_damerau_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_damerau_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..10856ac0e9839fa4fe8b5307fbca4808ea92f404 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_damerau_levenshtein.py @@ -0,0 +1,57 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.DamerauLevenshtein + +COMMON = [ + ('test', 'text', 1), + ('test', 'tset', 1), + ('test', 'qwy', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), + + ('cat', 'hat', 1), + ('Niall', 'Neil', 3), + ('aluminum', 'Catalan', 7), + ('ATCG', 'TAGC', 2), + + ('ab', 'ba', 1), + ('ab', 'cde', 3), + ('ab', 'ac', 1), + ('ab', 'bc', 2), +] + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 3), + ('abcd', 'bdac', 4), +]) +def test_distance_restricted(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + actual = ALG()._pure_python_restricted(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', COMMON + [ + ('ab', 'bca', 2), + ('abcd', 'bdac', 3), +]) +def test_distance_unrestricted(left, right, expected): + actual = ALG(external=False, restricted=False)(left, right) + assert actual == expected + + actual = ALG(external=True, restricted=False)(left, right) + assert actual == expected + + actual = ALG()._pure_python_unrestricted(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_editex.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_editex.py new file mode 100644 index 0000000000000000000000000000000000000000..380a632e309c2ddb3c8dffef4c50380513549249 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_editex.py @@ -0,0 +1,40 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Editex + + +@pytest.mark.parametrize('left, right, expected', [ + ('', '', 0), + ('nelson', '', 12), + ('', 'neilsen', 14), + ('ab', 'a', 2), + ('ab', 'c', 4), + ('ALIE', 'ALI', 1), + ('', 'MARTHA', 12), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, params, expected', [ + ('MARTHA', 'MARHTA', dict(match_cost=2), 12), + ('MARTHA', 'MARHTA', dict(match_cost=4), 24), + ('MARTHA', 'MARHTA', dict(group_cost=1, local=True), 3), + ('MARTHA', 'MARHTA', dict(group_cost=2, local=True), 4), + ('MARTHA', 'MARHTA', dict(mismatch_cost=4, local=True), 5), +]) +def test_distance_with_params(left, right, params, expected): + actual = ALG(external=False, **params)(left, right) + assert actual == expected + + actual = ALG(external=True, **params)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_gotoh.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_gotoh.py new file mode 100644 index 0000000000000000000000000000000000000000..f925dace30d009149d72d925ea3d0024482b8ecc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_gotoh.py @@ -0,0 +1,54 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Gotoh +# https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm +NW_MATRIX = { + ('A', 'A'): 10, + ('G', 'G'): 7, + ('C', 'C'): 9, + ('T', 'T'): 8, + ('A', 'G'): -1, + ('A', 'C'): -3, + ('A', 'T'): -4, + ('G', 'C'): -5, + ('G', 'T'): -3, + ('C', 'T'): 0, +} + + +def sim_ident(x, y): + if x == y: + return 1 + else: + return -1 + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), +]) +def test_distance_ident(left, right, expected): + actual = ALG(gap_open=1, gap_ext=1, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('GATTACA', 'GCATGCU', 0), + ('AGACTAGTTAC', 'TGACGSTGC', 1.5), + ('AGACTAGTTAC', 'CGAGACGT', 1), +]) +def test_distance_ident_with_gap_05(left, right, expected): + actual = ALG(gap_open=1, gap_ext=.5, sim_func=sim_ident)(left, right) + assert actual == expected + + +@pytest.mark.parametrize('left, right, expected', [ + ('AGACTAGTTAC', 'CGAGACGT', -15), +]) +def test_distance_ident_with_gap_5(left, right, expected): + actual = ALG(gap_open=5, gap_ext=5, sim_func=sim_ident)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_hamming.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_hamming.py new file mode 100644 index 0000000000000000000000000000000000000000..ce7cddcb03b733bcf76f6326c84e19b3a710d488 --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_hamming.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Hamming + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 2), + ('test', 'tet', 2), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_jaro.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_jaro.py new file mode 100644 index 0000000000000000000000000000000000000000..49588afee30973053150aedab6c15f6616ef9bca --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_jaro.py @@ -0,0 +1,31 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('hello', 'haloa', 0.7333333333333334), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.9166666666666666), + ('ATCG', 'TAGC', 0.8333333333333334), + ('MARTHA', 'MARHTA', 0.944444444), + ('DWAYNE', 'DUANE', 0.822222222), + ('DIXON', 'DICKSONX', 0.7666666666666666), + + # https://github.com/life4/textdistance/issues/41 + ('Sint-Pietersplein 6, 9000 Gent', 'Test 10, 1010 Brussel', 0.5182539682539683), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=False, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=False, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_jaro_winkler.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_jaro_winkler.py new file mode 100644 index 0000000000000000000000000000000000000000..8b94bc430f0c07727c8eaa67d2d83b7c9e292eda --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_jaro_winkler.py @@ -0,0 +1,30 @@ +# built-in +from math import isclose + +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.JaroWinkler + + +@pytest.mark.parametrize('left, right, expected', [ + ('elephant', 'hippo', 0.44166666666666665), + ('fly', 'ant', 0.0), + ('frog', 'fog', 0.925), + ('MARTHA', 'MARHTA', 0.9611111111111111), + ('DWAYNE', 'DUANE', 0.84), + ('DIXON', 'DICKSONX', 0.8133333333333332), + + # https://github.com/life4/textdistance/issues/39 + ('duck donald', 'duck daisy', 0.867272727272), +]) +def test_distance(left, right, expected): + actual = ALG(winklerize=True, external=False)(left, right) + assert isclose(actual, expected) + + actual = ALG(winklerize=True, external=True)(left, right) + assert isclose(actual, expected) diff --git a/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_levenshtein.py b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_levenshtein.py new file mode 100644 index 0000000000000000000000000000000000000000..6e9113f508ab1d429a3d77b880e31f9104ce83cc --- /dev/null +++ b/tasks/life4__textdistance.c3aca916.combine_file__s5ap259k/tests/trusted/tests/test_edit/test_levenshtein.py @@ -0,0 +1,24 @@ +# external +import pytest + +# project +import textdistance + + +ALG = textdistance.Levenshtein + + +@pytest.mark.parametrize('left, right, expected', [ + ('test', 'text', 1), + ('test', 'tset', 2), + ('test', 'qwe', 4), + ('test', 'testit', 2), + ('test', 'tesst', 1), + ('test', 'tet', 1), +]) +def test_distance(left, right, expected): + actual = ALG(external=False)(left, right) + assert actual == expected + + actual = ALG(external=True)(left, right) + assert actual == expected