nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: callowayproject/bump-my-version
Pull request #116 (2024-01-04 10:33:18)

Add support for legacy multiline search options (refs #98)
Support multiline `search` options in legacy config files.


Patch:
diff --git a/bumpversion/config/files_legacy.py b/bumpversion/config/files_legacy.py
index d930427a..5a9ea4de 100644
--- a/bumpversion/config/files_legacy.py
+++ b/bumpversion/config/files_legacy.py
@@ -58,6 +58,8 @@ def read_ini_file(file_path: Path) -> Dict[str, Any]:  # noqa: C901
                 "filename": section_parts[2],
             }
             file_options.update(options)
+            if "search" in file_options and isinstance(file_options["search"], list):
+                file_options["search"] = "\n".join(file_options["search"])
             if "replace" in file_options and isinstance(file_options["replace"], list):
                 file_options["replace"] = "\n".join(file_options["replace"])
             bumpversion_options["files"].append(file_options)
@@ -66,6 +68,8 @@ def read_ini_file(file_path: Path) -> Dict[str, Any]:  # noqa: C901
                 "glob": section_parts[2],
             }
             file_options.update(options)
+            if "search" in file_options and isinstance(file_options["search"], list):
+                file_options["search"] = "\n".join(file_options["search"])
             if "replace" in file_options and isinstance(file_options["replace"], list):
                 file_options["replace"] = "\n".join(file_options["replace"])
             bumpversion_options["files"].append(file_options)


Test patch:
diff --git a/tests/fixtures/legacy_multiline_search.cfg b/tests/fixtures/legacy_multiline_search.cfg
new file mode 100644
index 00000000..1a9e9a62
--- /dev/null
+++ b/tests/fixtures/legacy_multiline_search.cfg
@@ -0,0 +1,8 @@
+[bumpversion]
+current_version = 1.0.0
+
+[bumpversion:file:MULTILINE_SEARCH.md]
+search = **unreleased**
+	**v{current_version}**
+replace = **unreleased**
+	**v{new_version}**
diff --git a/tests/fixtures/legacy_multiline_search_expected.json b/tests/fixtures/legacy_multiline_search_expected.json
new file mode 100644
index 00000000..d8876a59
--- /dev/null
+++ b/tests/fixtures/legacy_multiline_search_expected.json
@@ -0,0 +1,11 @@
+{
+  "current_version": "1.0.0",
+  "files": [
+    {
+      "filename": "MULTILINE_SEARCH.md",
+      "search": "**unreleased**\n**v{current_version}**",
+      "replace": "**unreleased**\n**v{new_version}**"
+    }
+  ],
+  "parts": {}
+}
diff --git a/tests/test_config/test_files_legacy.py b/tests/test_config/test_files_legacy.py
index 4acb7f4a..a0e0b025 100644
--- a/tests/test_config/test_files_legacy.py
+++ b/tests/test_config/test_files_legacy.py
@@ -34,6 +34,7 @@ def cfg_file(request) -> str:
     ["conf_file", "expected_file"],
     [
         param("basic_cfg.cfg", "basic_cfg_expected.json", id="ini basic cfg"),
+        param("legacy_multiline_search.cfg", "legacy_multiline_search_expected.json", id="multiline search cfg"),
     ],
 )
 def test_read_ini_file(conf_file: str, expected_file: str, fixtures_path: Path) -> None:
Repository: callowayproject/bump-my-version
Pull request #118 (2024-01-05 13:26:09)

Legacy multiline search


Patch:
diff --git a/bumpversion/config/files_legacy.py b/bumpversion/config/files_legacy.py
index d930427a..5a9ea4de 100644
--- a/bumpversion/config/files_legacy.py
+++ b/bumpversion/config/files_legacy.py
@@ -58,6 +58,8 @@ def read_ini_file(file_path: Path) -> Dict[str, Any]:  # noqa: C901
                 "filename": section_parts[2],
             }
             file_options.update(options)
+            if "search" in file_options and isinstance(file_options["search"], list):
+                file_options["search"] = "\n".join(file_options["search"])
             if "replace" in file_options and isinstance(file_options["replace"], list):
                 file_options["replace"] = "\n".join(file_options["replace"])
             bumpversion_options["files"].append(file_options)
@@ -66,6 +68,8 @@ def read_ini_file(file_path: Path) -> Dict[str, Any]:  # noqa: C901
                 "glob": section_parts[2],
             }
             file_options.update(options)
+            if "search" in file_options and isinstance(file_options["search"], list):
+                file_options["search"] = "\n".join(file_options["search"])
             if "replace" in file_options and isinstance(file_options["replace"], list):
                 file_options["replace"] = "\n".join(file_options["replace"])
             bumpversion_options["files"].append(file_options)


Test patch:
diff --git a/tests/fixtures/legacy_multiline_search.cfg b/tests/fixtures/legacy_multiline_search.cfg
new file mode 100644
index 00000000..1a9e9a62
--- /dev/null
+++ b/tests/fixtures/legacy_multiline_search.cfg
@@ -0,0 +1,8 @@
+[bumpversion]
+current_version = 1.0.0
+
+[bumpversion:file:MULTILINE_SEARCH.md]
+search = **unreleased**
+	**v{current_version}**
+replace = **unreleased**
+	**v{new_version}**
diff --git a/tests/fixtures/legacy_multiline_search_expected.json b/tests/fixtures/legacy_multiline_search_expected.json
new file mode 100644
index 00000000..d8876a59
--- /dev/null
+++ b/tests/fixtures/legacy_multiline_search_expected.json
@@ -0,0 +1,11 @@
+{
+  "current_version": "1.0.0",
+  "files": [
+    {
+      "filename": "MULTILINE_SEARCH.md",
+      "search": "**unreleased**\n**v{current_version}**",
+      "replace": "**unreleased**\n**v{new_version}**"
+    }
+  ],
+  "parts": {}
+}
diff --git a/tests/test_config/test_files_legacy.py b/tests/test_config/test_files_legacy.py
index 4acb7f4a..a0e0b025 100644
--- a/tests/test_config/test_files_legacy.py
+++ b/tests/test_config/test_files_legacy.py
@@ -34,6 +34,7 @@ def cfg_file(request) -> str:
     ["conf_file", "expected_file"],
     [
         param("basic_cfg.cfg", "basic_cfg_expected.json", id="ini basic cfg"),
+        param("legacy_multiline_search.cfg", "legacy_multiline_search_expected.json", id="multiline search cfg"),
     ],
 )
 def test_read_ini_file(conf_file: str, expected_file: str, fixtures_path: Path) -> None:
Repository: callowayproject/bump-my-version
Pull request #204 (2024-06-26 16:12:39)

Fix error formatting


Patch:
diff --git a/bumpversion/scm.py b/bumpversion/scm.py
index 9ffb23f1..7e3ff964 100644
--- a/bumpversion/scm.py
+++ b/bumpversion/scm.py
@@ -73,16 +73,22 @@ class SourceCodeManager:
             cmd = [*cls._COMMIT_COMMAND, f.name, *extra_args]
             subprocess.run(cmd, env=env, capture_output=True, check=True)  # noqa: S603
         except (subprocess.CalledProcessError, TypeError) as exc:  # pragma: no-coverage
-            if isinstance(exc, TypeError):
-                err_msg = f"Failed to run {cls._COMMIT_COMMAND}: {exc}"
-            else:
-                output = "\n".join([x for x in [exc.stdout, exc.stderr] if x])
-                err_msg = f"Failed to run {exc.cmd}: return code {exc.returncode}, output: {output}"
-            logger.exception(err_msg)
-            raise BumpVersionError(err_msg) from exc
+            cls.format_and_raise_error(exc)
         finally:
             os.unlink(f.name)
 
+    @classmethod
+    def format_and_raise_error(cls, exc: Union[TypeError, subprocess.CalledProcessError]) -> None:
+        """Format the error message from an exception and re-raise it as a BumpVersionError."""
+        if isinstance(exc, subprocess.CalledProcessError):
+            output = "\n".join([x for x in [exc.stdout.decode("utf8"), exc.stderr.decode("utf8")] if x])
+            cmd = " ".join(exc.cmd)
+            err_msg = f"Failed to run `{cmd}`: return code {exc.returncode}, output: {output}"
+        else:  # pragma: no-coverage
+            err_msg = f"Failed to run {cls._COMMIT_COMMAND}: {exc}"
+        logger.exception(err_msg)
+        raise BumpVersionError(err_msg) from exc
+
     @classmethod
     def is_usable(cls) -> bool:
         """Is the VCS implementation usable."""


Test patch:
diff --git a/tests/test_scm.py b/tests/test_scm.py
index aaab9d37..f4451b03 100644
--- a/tests/test_scm.py
+++ b/tests/test_scm.py
@@ -7,11 +7,25 @@ import pytest
 from pytest import param, LogCaptureFixture
 
 from bumpversion import scm
-from bumpversion.exceptions import DirtyWorkingDirectoryError
+from bumpversion.exceptions import DirtyWorkingDirectoryError, BumpVersionError
 from bumpversion.ui import setup_logging
 from tests.conftest import get_config_data, inside_dir
 
 
+def test_format_and_raise_error(git_repo: Path) -> None:
+    """The output formatting from called process error string works as expected."""
+    with inside_dir(git_repo):
+        try:
+            subprocess.run(["git", "add", "newfile.txt"], capture_output=True, check=True)  # noqa: S603
+        except subprocess.CalledProcessError as e:
+            with pytest.raises(BumpVersionError) as bump_error:
+                scm.Git.format_and_raise_error(e)
+            assert bump_error.value.message == (
+                "Failed to run `git add newfile.txt`: return code 128, output: "
+                "fatal: pathspec 'newfile.txt' did not match any files\n"
+            )
+
+
 def test_git_is_usable(git_repo: Path) -> None:
     """Should return true if git is available, and it is a git repo."""
     with inside_dir(git_repo):
Repository: facebookexperimental/usort
Pull request #160 (2022-05-17 12:20:03)

Don't use trailrunner to format exactly one file
See #159

This optimises for a common use case when only one file is provided.

This change might belong to `trailrunner` repo as well. 


Patch:
diff --git a/usort/api.py b/usort/api.py
index 986e6a3..32d14bc 100644
--- a/usort/api.py
+++ b/usort/api.py
@@ -131,7 +131,10 @@ def usort_path(path: Path, *, write: bool = False) -> Iterable[Result]:
             paths = list(walk(path, excludes=config.excludes))
 
         fn = partial(usort_file, write=write)
-        results = [v for v in run(paths, fn).values()]
+        if len(paths) == 1:
+            results = [fn(paths[0])]  # shave off multiprocessing overhead
+        else:
+            results = [v for v in run(paths, fn).values()]
         return results
 
 


Test patch:
diff --git a/usort/tests/cli.py b/usort/tests/cli.py
index 19179ae..1c41b84 100644
--- a/usort/tests/cli.py
+++ b/usort/tests/cli.py
@@ -42,6 +42,7 @@ def sample_contents(s: AnyStr) -> Generator[str, None, None]:
 
 class CliTest(unittest.TestCase):
     def test_benchmark(self) -> None:
+        """Doesn't trigger multiprocessing (walk first in timings)"""
         with sample_contents("import sys\n") as dtmp:
             runner = CliRunner()
             with chdir(dtmp):
@@ -51,8 +52,48 @@ class CliTest(unittest.TestCase):
             result.output,
             dedent(
                 r"""
+                walking \.:\s+\d+ µs
                 parsing sample\.py:\s+\d+ µs
                 sorting sample\.py:\s+\d+ µs
+                total for \.:\s+\d+ µs
+                """
+            ).strip(),
+        )
+        self.assertEqual(0, result.exit_code)
+
+    def test_benchmark_multiple(self) -> None:
+        "Does trigger multiprocessing (walk after parsing/sorting in timings)"
+        with sample_contents("import sys\n") as dtmp:
+            (Path(dtmp) / "foo.py").write_text("print('hello')\n")
+
+            runner = CliRunner()
+            with chdir(dtmp):
+                result = runner.invoke(main, ["--benchmark", "check", "."])
+
+        self.assertRegex(
+            result.output,
+            dedent(
+                r"""
+                parsing foo\.py:\s+\d+ µs
+                sorting foo\.py:\s+\d+ µs
+                """
+            ).strip(),
+        )
+
+        self.assertRegex(
+            result.output,
+            dedent(
+                r"""
+                parsing sample\.py:\s+\d+ µs
+                sorting sample\.py:\s+\d+ µs
+                """
+            ).strip(),
+        )
+
+        self.assertRegex(
+            result.output,
+            dedent(
+                r"""
                 walking \.:\s+\d+ µs
                 total for \.:\s+\d+ µs
                 """
Repository: facebookexperimental/usort
Pull request #188 (2022-07-29 18:46:53)

Make sure indentation is tracked
https://github.com/facebookexperimental/usort/pull/187 broke the logic that keeps track of indentation for the purposes of line length tracking by not letting `visit_IndentedBlock` run in the transformer.

This affected (import) lines that are long enough to fit `line_length` without the indentation, but too long if we count indentation too.

This PR adds a test case for this situation.


Patch:
diff --git a/usort/sorting.py b/usort/sorting.py
index 3db305a..666728c 100644
--- a/usort/sorting.py
+++ b/usort/sorting.py
@@ -352,7 +352,9 @@ class ImportSortingTransformer(cst.CSTTransformer):
         return self.statement_map.get(node, node)
 
     def on_visit(self, node: cst.CSTNode) -> bool:
-        return not isinstance(node, (cst.BaseExpression, cst.BaseSmallStatement))
+        if isinstance(node, (cst.BaseExpression, cst.BaseSmallStatement)):
+            return False
+        return super().on_visit(node)
 
     def leave_SimpleStatementLine(
         self,


Test patch:
diff --git a/usort/tests/functional.py b/usort/tests/functional.py
index 8d7b384..c486cf1 100644
--- a/usort/tests/functional.py
+++ b/usort/tests/functional.py
@@ -542,6 +542,24 @@ numpy = ["numpy", "pandas"]
             """,
         )
 
+    def test_multi_line_expand_but_not_very_long(self) -> None:
+        """
+        This test makes sure indentation is taken into account properly.
+        Without indentation, these lines wouldn't be too long.
+        """
+        self.assertUsortResult(
+            """
+                if foo:
+                    from aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa import bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+            """,
+            """
+                if foo:
+                    from aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa import (
+                        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+                    )
+            """,
+        )
+
     def test_multi_line_expand_inner_function(self) -> None:
         self.assertUsortResult(
             """
Repository: kmyk/online-judge-tools
Pull request #20 (2017-06-02 11:56:20)

Update aoj
https://github.com/kmyk/online-judge-tools/issues/17


Patch:
diff --git a/onlinejudge/aoj.py b/onlinejudge/aoj.py
index c0cc566..2c92685 100644
--- a/onlinejudge/aoj.py
+++ b/onlinejudge/aoj.py
@@ -1,4 +1,5 @@
 # Python Version: 3.x
+# -*- coding: utf-8 -*-
 import onlinejudge.service
 import onlinejudge.problem
 import onlinejudge.dispatch
@@ -49,9 +50,15 @@ class AOJProblem(onlinejudge.problem.Problem):
         for pre in soup.find_all('pre'):
             log.debug('pre: %s', str(pre))
             hn = utils.previous_sibling_tag(pre)
+            if hn is None:
+                div = pre.parent
+                if div is not None:
+                    log.debug('div: %s', str(hn))
+                    hn = utils.previous_sibling_tag(div)
             log.debug('hN: %s', str(hn))
             log.debug(hn)
-            if hn and hn.name in [ 'h2', 'h3' ] and hn.string and 'ample' in hn.string.lower(): # 'ample' is the suffix of 'sample', 'example'
+            keywords = [ 'sample', 'example', '入力例', '出力例' ]
+            if hn and hn.name in [ 'h2', 'h3' ] and hn.string and any(filter(lambda keyword: keyword in hn.string.lower(), keywords)):
                 s = utils.textfile(pre.string.lstrip())
                 name = hn.string
                 samples.add(s, name)


Test patch:
diff --git a/tests/main.py b/tests/main.py
index be62b26..7332bef 100644
--- a/tests/main.py
+++ b/tests/main.py
@@ -66,6 +66,22 @@ class MainTest(unittest.TestCase):
                 'sample-4.in': '318d4b3abfa30cc8fad4b1d34430aea3',
                 'sample-7.in': 'dcac31a5a6542979ce45064ab0bfa83d',
             },
+            'http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2256&lang=jp': {
+                'sample-1.in': 'c89817f1ee0b53209d66abc94e457f7f',
+                'sample-1.out': 'b9c2c5761360aad068453f4e64dd5a4e',
+            },
+            'http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2310&lang=jp': {
+                'sample-1.in': '27ed9e879684b438fa6cc80c4261daf7',
+                'sample-1.out': '48a24b70a0b376535542b996af517398',
+                'sample-2.in': 'bb84849858ca512e14e071e25120ed78',
+                'sample-2.out': '6d7fce9fee471194aa8b5b6e47267f03',
+                'sample-3.in': '4c4ae7fb491ec5c6ad57d9d5711e44a6',
+                'sample-3.out': '9ae0ea9e3c9c6e1b9b6252c8395efdc1',
+                'sample-4.in': 'ad1109594a97eabe9bee60a743006de7',
+                'sample-4.out': '84bc3da1b3e33a18e8d5e1bdd7a18d7a',
+                'sample-5.in': 'b80447e0bc0c4ecc6fb3001b6a4e79f6',
+                'sample-5.out': 'c30f7472766d25af1dc80b3ffc9a58c7',
+            },
         }
         self.snippet_call_download(problems)
Repository: kmyk/online-judge-tools
Pull request #85 (2017-11-01 19:14:14)

#84: add a feature to list submissions of yukicoder


Patch:
diff --git a/onlinejudge/yukicoder.py b/onlinejudge/yukicoder.py
index 55ce1d7..8d34e2c 100644
--- a/onlinejudge/yukicoder.py
+++ b/onlinejudge/yukicoder.py
@@ -141,7 +141,27 @@ class YukicoderService(onlinejudge.service.Service):
                 row[column] = row[column].text.strip()
         return rows
 
-    # TODO: 複数ページになってる場合の対応ができてない そもそも複数になることあるのかすら不明
+    # example: https://yukicoder.me/submissions?page=4220
+    # example: https://yukicoder.me/submissions?page=2192&status=AC
+    # NOTE: 1ページしか読まない 全部欲しい場合は呼び出し側で頑張る
+    def get_submissions(self, page, status=None, session=None):
+        assert isinstance(page, int) and page >= 1
+        url = 'https://yukicoder.me/submissions?page=%d' % page
+        if status is not None:
+            assert status in 'AC WA RE TLE MLE OLE J_TLE CE WJ Judge NoOut IE'.split()
+            url += '&status=' + status
+        columns, rows = self._get_and_parse_the_table(url, session=session)
+        assert columns == [ '#', '提出日時', '', '提出者', '問題', '言語', '結果', '実行時間', 'コード長' ]  # 空白は「このユーザーの提出の表示」の虫眼鏡のため
+        for row in rows:
+            for column in columns:
+                if column == '#':
+                    row[column] = int(row[column].text)
+                elif column == '':
+                    del row[column]
+                else:
+                    row[column] = row[column].text.strip()
+        return rows
+
     def _get_and_parse_the_table(self, url, session=None):
         # get
         session = session or utils.new_default_session()


Test patch:
diff --git a/tests/yukicoder.py b/tests/yukicoder.py
index 9dec941..d5374d6 100644
--- a/tests/yukicoder.py
+++ b/tests/yukicoder.py
@@ -39,5 +39,10 @@ class YukicoderTest(unittest.TestCase):
         it = list(filter(lambda row: row['Wikiページ'] == 'decomposable_searching_problem', data))
         self.assertEqual(len(it), 1)
 
+    def test_get_submissions(self):
+        data = YukicoderService().get_submissions(page=3, status='TLE')
+        self.assertEqual(len(data), 50)
+        self.assertEqual(data[4]['結果'], 'TLE')
+
 if __name__ == '__main__':
     unittest.main()
Repository: kmyk/online-judge-tools
Pull request #488 (2019-08-18 03:21:17)

#487 : Can't get a name of a contest without penalty
#487 に対する修正案です。
ご確認ください。

fukatani: 例えばhttps://atcoder.jp/contests/practice も同じペナルティ表記なので、少なくとも現在のAtCoderの仕様であるというのは言えそうです。

Patch:
diff --git a/onlinejudge/service/atcoder.py b/onlinejudge/service/atcoder.py
index bed6f40..d7b2fb3 100644
--- a/onlinejudge/service/atcoder.py
+++ b/onlinejudge/service/atcoder.py
@@ -247,10 +247,17 @@ class AtCoderContest(object):
             assert False
         _, _, self._can_participate = soup.find('span', text=re.compile(r'^(Can Participate|参加対象): ')).text.partition(': ')
         _, _, self._rated_range = soup.find('span', text=re.compile(r'^(Rated Range|Rated対象): ')).text.partition(': ')
+
         penalty_text = soup.find('span', text=re.compile(r'^(Penalty|ペナルティ): ')).text
-        m = re.match(r'(Penalty|ペナルティ): (\d+)( minutes?|分)', penalty_text)
-        assert m
-        self._penalty = datetime.timedelta(minutes=int(m.group(2)))
+        if lang == 'en' and penalty_text == 'Penalty: None':
+            minutes = 0
+        elif lang == 'ja' and penalty_text == 'ペナルティ: なし':
+            minutes = 0
+        else:
+            m = re.match(r'(Penalty|ペナルティ): (\d+)( minutes?|分)', penalty_text)
+            assert m
+            minutes = int(m.group(2))
+        self._penalty = datetime.timedelta(minutes=minutes)
 
     def get_name(self, lang: str = 'en', session: Optional[requests.Session] = None) -> str:
         if lang == 'en':


Test patch:
diff --git a/tests/service_atcoder.py b/tests/service_atcoder.py
index 4d568b2..661f0ba 100644
--- a/tests/service_atcoder.py
+++ b/tests/service_atcoder.py
@@ -113,6 +113,13 @@ class AtCoderContestTest(unittest.TestCase):
         self.assertEqual(submissions[1].get_user_id(), 'snuke')
         self.assertEqual(submissions[1].get_status(), 'WA')
 
+    def test_get_contest_without_penalty(self):
+        contest = AtCoderContest.from_url('https://atcoder.jp/contests/otemae2019')
+        self.assertEqual(contest.get_name('ja'), '大手前プロコン 2019')
+        self.assertEqual(contest.get_penalty().total_seconds(), 0)  # This contest has no penalty
+        self.assertEqual(contest.get_name('en'), 'Otemae High School Programming Contest 2019')
+        self.assertEqual(contest.get_penalty().total_seconds(), 0)  # This contest has no penalty
+
 
 class AtCoderProblemTest(unittest.TestCase):
     def test_from_url(self):
Repository: kmyk/online-judge-tools
Pull request #554 (2019-10-15 19:14:13)

Handle empty testcases for AtCoder (e.g. AGC036 B)
This is the continuation of #513

I fixed my modification to pass the tests, and added a testcase.


Patch:
diff --git a/onlinejudge/service/atcoder.py b/onlinejudge/service/atcoder.py
index 8a09ea6..e45fc90 100644
--- a/onlinejudge/service/atcoder.py
+++ b/onlinejudge/service/atcoder.py
@@ -638,7 +638,11 @@ class AtCoderProblemDetailedData(AtCoderProblemData):
         for pre in soup.find_all('pre'):
             log.debug('pre tag: %s', str(pre))
             if not pre.string:
-                continue
+                if len(pre.contents):
+                    # <pre> element is not a sample but the input format
+                    continue
+                # the sample is an empty string, so set pre.string as '' instead of None
+                pre.string = ''
 
             def h3_plus(tag):
                 prv = tag.find_previous_sibling()


Test patch:
diff --git a/tests/command_download_atcoder.py b/tests/command_download_atcoder.py
index 5481158..1907927 100644
--- a/tests/command_download_atcoder.py
+++ b/tests/command_download_atcoder.py
@@ -131,6 +131,26 @@ class DownloadAtCoderTest(unittest.TestCase):
             },
         ], type='json')
 
+    def test_call_download_atcoder_agc036_b(self):
+        self.snippet_call_download('https://atcoder.jp/contests/agc036/tasks/agc036_b', [
+            {
+                "input": "3 2\n1 2 3\n",
+                "output": "2 3\n"
+            },
+            {
+                "input": "5 10\n1 2 3 2 3\n",
+                "output": "3\n"
+            },
+            {
+                "input": "6 1000000000000\n1 1 2 2 3 3\n",
+                "output": "\n"
+            },
+            {
+                "input": "11 97\n3 1 4 1 5 9 2 6 5 3 5\n",
+                "output": "9 2 6\n"
+            },
+        ], type='json')
+
     def test_call_download_invalid_url(self):
         self.snippet_call_download_raises(requests.exceptions.HTTPError, 'http://abc001.contest.atcoder.jp/tasks/abc001_100')