diff --git "a/evaluation_results/rag_top10_ir_test.json" "b/evaluation_results/rag_top10_ir_test.json" new file mode 100644--- /dev/null +++ "b/evaluation_results/rag_top10_ir_test.json" @@ -0,0 +1,52238 @@ +{ + "method": "rag_top10", + "split": "ir_test", + "exact_match_pct": 39.41018766756032, + "exact_match_count": 2058, + "n": 5222, + "n_total": 5222, + "code_bleu": 0.4204295924836561, + "edit_similarity": 0.5175077996329402, + "config": { + "top_k": 10, + "max_input_tokens": 16384, + "model_name": "Qwen/Qwen2.5-Coder-1.5B", + "embed_model_name": "Qwen/Qwen3-Embedding-0.6B" + }, + "entries": [ + { + "repo": "0xricksanchez/like-dbg", + "expected": "True", + "got": "assert are_lists_equal(expected, actual) is True", + "got_raw": "<|fim_suffix|>\n assert are_lists_equal(expected, actual) is True\n\ndef test_custom_args() -> None:\n kb = KernelBuilder(**{\"kroot\": \"foo\"})\n kb.extra_args = \"-e FOO -d BAR\"\n kb.disable_args = \"-e BAR -d FOO\"\n expected = \"-e FOO -d BAR\".split()\n actual = kb._custom_args().split()\n\n assert are_lists_equal(expected, actual) is True\n\ndef test_make_clean() -> None:\n kb = KernelBuilder(**{\"kroot\": \"foo\"})\n kb._run_ssh = MagicMock(return_value=0", + "exact_match": false, + "code_bleu": 0.14113991930789777, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "0xricksanchez/like-dbg", + "expected": "\"b1f3f40af1e5c64dbf4a1302ca94ac12\"", + "got": "\"00000000000000000000000000000000\"", + "got_raw": " \"00000000000000000000000000000000\"\n\n lkdl = KernelDownloader(**{\"user_cfg\": str(Path(\"./src/tests/confs/lkdl_tag.ini\").absolute())})\n lkdl.kernel_dl_path = tmp_path\n lkdl.archive = Path(lkdl.kernel_dl_path) / f\"linux-{lkdl._set_choice()}.tar.gz\"\n lkdl.dl_uri = \"https://github.com/0xricksanchez/like-dbg/blob/main/src/tests/files/empty", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "0xricksanchez/like-dbg", + "expected": "\"5.15.67\"", + "got": "5.10.102.1", + "got_raw": "5.10.102.1\n assert lkdl.mmp_uri == \"https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.102.tar.gz\"\n assert lkdl.commit_uri == \"https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.10.102\"\n assert lkdl.snap_uri == \"https://cdn.kernel.org/pub/linux/kernel/v5.x/\"\n\n assert lkdl.tag == \"5.10.102\"\n assert lkdl.commit == \"5.10.102\"\n", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.42105263157894735, + "n_retrieved": 10 + }, + { + "repo": "0xricksanchez/like-dbg", + "expected": "\"https://cdn.kernel.org/pub/linux/kernel/vKMAJOR.x/linux-KMAJOR.KMINOR.KPATCH.tar.xz\"", + "got": "\"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=KMAJOR.KMINOR.KPATCH\"", + "got_raw": " \"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=KMAJOR.KMINOR.KPATCH\"\n assert lkdl.mmp_uri == \"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5.10.77\"\n\n assert lkdl.mmp_uri == \"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5.10.77\"\n assert lkdl.mmp_uri == \"https://git.kernel.org/pub", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.7135135135135136, + "n_retrieved": 10 + }, + { + "repo": "0xricksanchez/like-dbg", + "expected": "-2", + "got": "1", + "got_raw": "1\n\ndef test_general_exception_2() -> None:\n kb = KernelBuilder(**{\"kroot\": \"foo\"})\n with pytest.raises(SystemExit) as ext:\n kb._run_ssh(\"ls\", warn=True)\n assert ext.type == SystemExit\n\n assert ext.value.code == 1\n\ndef test_general_exception_3() -> None:\n kb = KernelBuilder(**{\"kroot\": \"foo\"})\n with pytest.raises(SystemExit) as ext:\n kb._apply_patches()\n assert ext.type == SystemExit\n\n assert ext.value.code == 1\n\ndef test_general_exception_4() -> None", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "0xricksanchez/like-dbg", + "expected": "lkdl.archive", + "got": "0", + "got_raw": "0\n assert lkdl.is_present() == True\n assert lkdl.archive == Path(\"/bin/ls\")\n\n assert lkdl.run() == 0\n assert lkdl.is_present() == True\n assert lkdl.archive == Path(\"/bin/ls\")\n\n assert lkdl.run() == 0\n assert lkdl.is_present() == True\n assert lkdl.archive == Path(\"/bin/ls\")\n\n assert lkdl.run() == 0\n assert lkdl.is_present() == True\n assert lkdl.archive == Path(\"/bin/ls\")\n\n assert lkdl.run() == ", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "0xricksanchez/like-dbg", + "expected": "expected)", + "got": "", + "got_raw": "\n\n\n# File: src/debuggee.py\n self.cmd += \" earlyprintk=serial net.ifnames=0\"\n if not self.kaslr:\n self.cmd += \" nokaslr\"\n else:\n self.cmd += \" kaslr\"\n if not self.smep:\n self.cmd += \" nosmep\"\n if not self.smap:\n self.cmd += \" nosmap\"\n if not self.kpti:\n self.cmd += \" nopti\"\n else:\n self.cmd += \" pti=on\"\n self.cmd += f' oops=panic panic={self.in", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "0xricksanchez/like-dbg", + "expected": "f\"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-{lkdl.commit}.tar.gz\"", + "got": "dl_uri == \"https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.10.tar.gz\"", + "got_raw": " dl_uri == \"https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.10.tar.gz\"\n assert lkdl._set_choice() == \"5.10.10\"\n assert lkdl._set_commit() == \"e4e737bb5c170df6135a127739a9e6148ee3da82\"\n assert lkdl._set_choice() == \"e4e737bb5c170df6135a127739a9", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.6153846153846154, + "n_retrieved": 10 + }, + { + "repo": "0xricksanchez/like-dbg", + "expected": "SystemExit", + "got": "1", + "got_raw": "1\n assert ext.value.args[0] == \"Unsupported rootfs type: foo bar baz\"\n\n@patch(\"subprocess.run\")\ndef test_infer_qemu_fs_mount_cpio(sp_mock) -> None:\n d = Debuggee(**{\"kroot\": \"foo\"})\n mock = MagicMock()\n mock.configure_mock(**{\"stdout\": b\"foo bar baz\"})\n sp_mock.return_value = mock\n with pytest.raises(SystemExit) as ext:\n d.infer_qemu_fs_mount()\n\n assert ext.type == 1\n assert ext.value.args[0] == \"Unsupported rootfs type: foo bar", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AlignmentResearch/tuned-lens", + "expected": "0", + "got": "0", + "got_raw": "0\n\ndef test_load_lens_artifacts_smoke():\n config_path, params_path = load_lens_artifacts(\n \"AlignmentResearch/tuned-lens\",\n \"space\",\n \"main\",\n \"config.json\",\n \"params.pt\",\n )\n\n assert config_path.exists()\n assert params_path.exists()\n\ndef test_load_lens_artifacts_raises():\n with pytest.raises(ValueError):\n load_lens_artifacts(\n \"AlignmentResearch/tuned-lens\",\n \"space\",\n \"main\",\n \"config.json\",\n \"params.pt\",\n \"not_a_path\",\n )\n\ndef test_load_lens_artifacts_raises_if_not", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AlignmentResearch/tuned-lens", + "expected": "tokens[:, :1]", + "got": "0", + "got_raw": "0\n assert tokens[0, 0] == bos_token_id\n\ndef test_tuned_lens_generate_smoke_logit(random_small_model: trf.PreTrainedModel):\n logit_lens = LogitLens.from_model(random_small_model)\n bos_token_id = random_small_model.config.bos_token_id\n input_ids = th.tensor([bos_token_id])\n tokens = logit_lens.generate(\n model=random_small_model,\n layer=2,\n do_sample=True,\n input_ids=input_ids,\n max_new_tokens=10,\n )\n assert tokens.shape[-1] <= 11\n", + "exact_match": false, + "code_bleu": 0.07142857142857142, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AlignmentResearch/tuned-lens", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\ndef test_format_newline_replacement(formatter):\n token = \"ThisIsALongToken\\n\"\n expected = \"ThisIsALongToken\\\\n\"\n\n assert formatter.format(token) == expected\n\ndef test_format_newline_token(formatter):\n token = \"ThisIsALongToken\u010a\"\n expected = \"ThisIsALongToken\u010a\"\n\n assert formatter.format(token) == expected\n\ndef test_format_whitespace_token(formatter):\n token = \"\u0120ThisIsALongToken\"\n expected = \"\u0120ThisIsALongToken\"\n\n assert formatter.format(token) == expected\n\ndef test_format_whitespace_replacement(formatter):\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AlignmentResearch/tuned-lens", + "expected": "our_js_bwd)", + "got": "0.5 * (kl_fwd + kl_bwd))", + "got_raw": "0.5 * (kl_fwd + kl_bwd))\n th.testing.assert_close(our_js_bwd, 0.5 * (kl_fwd + kl_bwd))\n\ndef test_js_distance():\n p = Categorical(logits=th.randn(10))\n q = Categorical(logits=th.randn(10))\n m = Categorical(probs=0.5 * (p.probs + q.probs)) # type: ignore\n\n kl_fwd = kl_divergence(p, m)\n kl_bwd = kl_divergence(q, m)\n gt_js = 0.5 *", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.34285714285714286, + "n_retrieved": 10 + }, + { + "repo": "AndrewAnnex/SpiceyPy", + "expected": "0", + "got": "0", + "got_raw": "0\n with spice.KernelPool(kernel_list):\n assert spice.ktotal(\"all\") == expected_length\n\n\n# File: docs/ck.rst\nckgp`\nsearches for pointing is provided in the \"Details\" chapter of this\ndocument.\n\n.. code-block:: python\n\n from spiceypy import *\n #NAIF ID numbers for the\n # 1. Voyager 2 spacecraft\n # 2. Voyager 2 narrow angle camera\n sc = -32\n inst = -32001\n\n #The C-matrix should transform from J", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AndrewAnnex/SpiceyPy", + "expected": "BaseException)", + "got": "ImportError):", + "got_raw": "ImportError):\n attempt_download(CoreKernels.NAIF_2017_JUN_10, \"NAIF_2017_JUN_10\")\n\n with pytest.raises(ImportError):\n attempt_download(CoreKernels.NAIF_2017_JUN_10, \"NAIF_2017_JUN_10\", \"NAIF_2017_JUN_10\")\n\n with pytest.raises(ImportError):\n attempt_download(CoreKernels.NAIF_2017_JUN_10, \"NAIF_201", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "AndrewAnnex/SpiceyPy", + "expected": "np.pi", + "got": "3.141592653589793", + "got_raw": "3.141592653589793\n\n@pytest.mark.parametrize('function', [cyice.pi, spice.pi], ids=get_module_name)\n@pytest.mark.parametrize('grouped_benchmark', [\"pi\"], indirect=True)\ndef test_pi_2(function, grouped_benchmark):\n grouped_benchmark(function)\n\n assert function() == 3.141592653589793\n\n@pytest.mark.parametrize('function', [cyice.pi, spice.pi], ids=get_module_name)\n@pytest.mark.parametrize('grouped_benchmark', [\"pi\"], indirect=True)\ndef", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "AndrewAnnex/SpiceyPy", + "expected": "\"some error occured\"", + "got": "\"some error occured\"", + "got_raw": " \"some error occured\"\n\n assert spice.getmsg(\"EXPLAIN\", 200) == \"some error occured\"\n\n assert spice.getmsg(\"TRACE\", 200) == \"some error occured\"\n\n assert spice.getmsg(\"MESSAGE\", 200) == \"some error occured\"\n\n assert spice.getmsg(\"SHORT\", 40) == \"error\"\n\n assert spice.getmsg(\"LONG\", 200) == \"some error occured\"\n\n assert spice.getmsg(\"EXPLAIN\", 200) == \"some error occured\"\n\n assert spice.getmsg", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AndrewAnnex/SpiceyPy", + "expected": "19", + "got": "30", + "got_raw": "30\n\n assert sc == 0\n\n assert time == \"11:30:00\"\n\n assert ampm == \"AM\"\n\n@pytest.mark.parametrize('function', [cyice.et2lst_s, cyice.et2lst, spice.et2lst], ids=get_module_name)\n@pytest.mark.parametrize('grouped_benchmark', [\"et2lst\"], indirect=True)\ndef test_et2lst2(function, grouped_benchmark, load_core_kernels):\n et = spice.str2et(\"2004 may 17 16:30:00\")\n lon = 28", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "width", + "got": "1", + "got_raw": "1\n\n with pytest.raises(arg_value_error_range, match=\"width\"):\n AlignedPadding(width, 1)\n\n @pytest.mark.parametrize(\"height\", [1, 10, 0, -10])\n def test_height(self, height):\n\n assert AlignedPadding(1, height).height == 1\n\n with pytest.raises(arg_value_error_range, match=\"height\"):\n AlignedPadding(1, height)\n\n @pytest.mark.parametrize(\"h_align\", [HAlign.LEFT, HAlign.CENTER, HAlign.RIGHT])\n def test_h_align(self, h_align):\n\n assert AlignedPadding", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "TypeError, match=r\"'filepath'\")", + "got": "InvalidSizeError):", + "got_raw": "InvalidSizeError):\n from_file(BytesPath(\"python.png\"), width=100, height=100)\n\n with pytest.raises(InvalidSizeError):\n from_file(BytesPath(\"python.png\"), width=100, height=100, size=Size.AUTO)\n\n with pytest.raises(InvalidSizeError):\n from_file(BytesPath(\"python.png\"), width=100, height=100, size=Size.FIT)\n\n with pytest.raises(InvalidSizeError):\n from_file(BytesPath(\"python.png\"), width=100, height=100, size=", + "exact_match": false, + "code_bleu": 0.19362900077353815, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "9", + "got": "1", + "got_raw": "1\n assert screen._ti_image_cviews[0] == kitty_list_box._ti_image_cviews[0]\n assert screen._ti_image_cviews[0].z_index == 0\n assert screen._ti_image_cviews[0].z_index == 0\n assert screen._ti_image_cviews[0].z_index == 0\n assert screen._ti_image_cviews[0].z_index == 0\n assert screen._ti_image_cviews[0].z_index == 0\n assert screen._ti_image_cviews[0].z_index == 0\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "None", + "got": "100", + "got_raw": "100\n\n def test_init_animated_with_seek(self):\n image = BlockImage(anim_img, seek=10)\n assert image._seek_position == 10\n\n def test_init_animated_with_seek_out_of_range(self):\n with pytest.raises(InvalidSizeError):\n BlockImage(anim_img, seek=1000)\n\n def test_init_animated_with_n_frames(self):\n image = BlockImage(anim_img, n_frames=10)\n assert image._n_frames == 10\n\n def test_init_animated_with_n_frames_out_of_range(self):\n with", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "b\"\"", + "got": "", + "got_raw": " # noqa: W503\n (\n ctlseqs.KITTY_DELETE_Z_INDEX_b\n if value >= 0\n else ctlseqs.KITTY_DELETE_Z_INDEX\n ) % value\n\n def test_cursor(self):\n with self.setup_buffer() as (buf, tty_buf):\n KittyImage.clear(cursor=True, now=True)\n assert buf.getvalue() == \"\"\n assert tty_buf.getvalue() == ctlseqs.KITTY_DELETE_CURSOR_b\n\n with self.setup_buffer() as (buf, tty_buf):\n KittyImage.clear(cursor=True)\n assert buf.getvalue() == ctlseqs", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "0", + "got": "0", + "got_raw": "0\n assert UrwidImage._ti_next_z_index == next_z_index\n\n def test_free(self):\n gc.collect()\n UrwidImage._ti_next_z_index = 1\n UrwidImage._ti_free_z_indexes.clear()\n\n images = [UrwidImage(kitty_image) for _ in range(100)]\n z_indexes = {image_w._ti_z_index for image_w in images}\n next_z_index = UrwidImage._ti_next_z_index\n del images\n gc.collect()\n images = [UrwidImage(kitty_image) for _ in range(", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "1", + "got": "1", + "got_raw": "1\n\n def test_same(self):\n\n assert RenderArgs(Foo) == RenderArgs(Foo)\n\n def test_different_render_cls(self):\n\n assert RenderArgs(Foo) != RenderArgs(Bar)\n\n def test_different_args(self):\n\n assert RenderArgs(Foo, foo_args.update(foo=\"bar\")) != RenderArgs(Foo)\n\n def test_different_data(self):\n\n assert RenderArgs(Foo, foo_args.update(foo=\"bar\")) != RenderArgs(\n Foo, data_args.update(data=\"bar\")\n )\n\n class TestUpdate:\n\n def test_no_args(self):\n\n assert RenderArgs(Foo) == RenderArgs", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "f\"{self.trans:1.1", + "got": "str(self.trans) == f\"{self.trans:1}\"", + "got_raw": " str(self.trans) == f\"{self.trans:1}\"\n assert all(\n line == SGR_DEFAULT + \" \" * self.trans.width + SGR_DEFAULT\n for line in render.splitlines()\n )\n\n def test_alpha_threshold(self):\n # Transparency enabled with alpha threshold\n render = self.render_image(0.5)\n assert render == str(self.trans) == f\"{self.trans:0.5}\"\n assert all(\n line == SGR_DEFAULT + \" \" * self.trans.width + SGR_DEFAULT\n for line in render.splitlines()\n )\n # Transparency disabled\n render =", + "exact_match": false, + "code_bleu": 0.24808415001701817, + "edit_similarity": 0.5660377358490566, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "_size", + "got": "20", + "got_raw": "20\n assert self.image.height == 20\n\n def test_int_height(self):\n self.image.set_size(height=_size)\n\n assert self.image.width == 20\n assert self.image.height == 20\n\n def test_int_width_height(self):\n self.image.set_size(width=_size, height=_size)\n\n assert self.image.width == 20\n assert self.image.height == 20\n\n def test_size(self):\n self.image.set_size(Size.FIT)\n\n assert self.image.width == 20\n assert self.image.height == 20\n\n def test", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "{}", + "got": "0", + "got_raw": "0\n assert KittyImage._check_style_args({\"z_index\": 1}) == 1\n assert KittyImage._check_style_args({\"z_index\": 2**31 - 1}) == 2**31 - 1\n\n def test_mix(self):\n for value in (None, 1.0, (), [], \"2\"):\n with pytest.raises(TypeError):\n KittyImage._check_style_args({\"mix\": value})\n for value in (True, False, 0, 1, 2**31 - 1):\n with pytest.raises(ValueError):\n KittyImage._check", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "2", + "got": "2", + "got_raw": "2\n assert animate_char.anim_args.cache is False\n\n assert animate_char.anim_args.check_size is True\n assert animate_char.anim_args.allow_scroll is False\n\n assert animate_char.anim_args.hide_cursor is True\n assert animate_char.anim_args.echo_input is False\n\n assert animate_char.anim_args.output is STDOUT\n\n assert animate_char.anim_args.frame_count == 1\n assert animate_char.anim_args.frame_duration == 1\n\n assert animate_char.anim_args.frame_offset == 0\n assert animate_char.anim_args.seek_whence == Seek.START\n\n assert animate_char.anim_args.frame is None\n assert animate", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "100", + "got": "100", + "got_raw": "100\n assert self.h_image.height == 50\n\n self.v_image.set_size(frame_size=(100, 50))\n\n assert self.v_image.width == 100\n assert self.v_image.height == 50\n\n @reset_cell_size_ratio()\n def test_frame_size_relative(self):\n # Some of these assertions pass only when the cell ratio is about 0.5\n set_cell_ratio(0.5)\n\n self.image.set_size(frame_size=(100, 50))\n assert self.image.size == (100, 50", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "\"", + "got": "\"", + "got_raw": " \"#\"\n\n assert ConcretePadding(fill=\" \").fill == \" \"\n\n def test_get_padded_size(self):\n assert Padding().get_padded_size(Size(1, 1)) == Size(1, 1)\n\n assert Padding().get_padded_size(Size(1, 2)) == Size(1, 2)\n\n assert Padding().get_padded_size(Size(2, 1)) == Size(2, 1)\n\n assert Padding().get_padded_size(Size(2, 2)) == Size(2, 2)\n\n assert Padding().get_padded_size(Size(3, 3", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "3", + "got": "3", + "got_raw": "3\n assert ImageSource.FILE_PATH.value == \"_source\"\n assert ImageSource.PIL_IMAGE.value == \"_source\"\n assert ImageSource.URL.value == \"_url\"\n\ndef test_image_source_from_file():\n\n image = from_file(python_image)\n assert image.source == ImageSource.FILE_PATH\n\ndef test_image_source_from_url():\n\n image = from_url(python_image)\n assert image.source == ImageSource.URL\n\ndef test_image_source_from_pil_image():\n\n image = AutoImage(python_img)\n assert image.source == ImageSource.PIL_IMAGE\n\ndef test_image_source_from_pil_image_with_file_path():\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "AnonymouX47/term-image", + "expected": "10", + "got": "10", + "got_raw": "10\n assert Size(10, 1).height == 1\n assert Size(10, 1).width == 10\n assert Size(10, 1).height == 1\n\n assert Size(10, 1).width == 10\n assert Size(10, 1).height == 1\n assert Size(10, 1).width == 10\n assert Size(10, 1).height == 1\n\n assert Size(10, 1).width == 10\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Azure-Samples/rag-postgres-openai-python", + "expected": "\"22\"", + "got": "0", + "got_raw": "0\n\n assert response.text == '{\"error\": \"Not Found\"}'\n\n@pytest.mark.asyncio\nasync def test_assets_non_existent_404_with_redirect(test_client):\n \"\"\"test the assets route with a non-existent file and a redirect\"\"\"\n response = test_client.get(\"/assets/manifest.json\", follow_redirects=True)\n\n assert response.status_code == 404\n assert response.headers[\"Content-Type\"] == \"application/json\"\n\n assert response.headers[\"Content-Length\"] == 0\n\n assert response.text == '{\"error\": \"Not Found\"}'\n\n@pytest.mark.asyncio\nasync def test_assets_non_ex", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Azure-Samples/rag-postgres-openai-python", + "expected": "\"\"", + "got": "1234567890", + "got_raw": "1234567890\n assert token.token_type == \"Bearer\"\n assert token.expires_on == 9999999999\n assert token.expires_in == 9999999999\n assert token.scopes == [\"https://vault.azure.net/.default\"]\n assert token.token_type == \"Bearer\"\n assert token.token == 1234567890\n assert token.expires_on == 9999999999\n assert token.expires_in == 999999", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Azure-Samples/rag-postgres-openai-python", + "expected": "\"text-embedding-3-large\"", + "got": "\"text-embedding-3-large\"", + "got_raw": " \"text-embedding-3-large\"\n assert result.openai_embed_dimensions == 1024\n assert result.openai_chat_deployment == \"gpt-4\"\n assert result.openai_embed_deployment == \"text-embedding-3-large\"\n assert result.embedding_column == \"embedding_3l\"\n\n assert result.openai_chat_model == \"gpt-4o-mini\"\n assert result.openai_embed_model == \"text-embedding-3-large\"\n assert result.openai_embed_dimensions == 1024\n assert result.openai_chat_deployment == \"gpt-4\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Azure-Samples/rag-postgres-openai-python", + "expected": "\"45\"", + "got": "0", + "got_raw": "0\n assert response.headers[\"Content-Encoding\"] == \"gzip\"\n assert response.headers[\"Content-Disposition\"] == \"attachment; filename=item.json.gz\"\n\n assert response.headers[\"Content-Type\"] == \"application/json\"\n assert response.headers[\"Content-Length\"] == 0\n assert response.headers[\"Content-Encoding\"] == \"gzip\"\n assert response.headers[\"Content-Disposition\"] == \"attachment; filename=item.json.gz\"\n\n assert response.headers[\"Content-Type\"] == \"application/json\"\n assert response.headers[\"Content-Length\"] == 0\n assert response.headers[\"Content-Encoding\"] == \"gzip\"\n assert response.headers[\"Content", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Azure-Samples/rag-postgres-openai-python", + "expected": "response.content", + "got": "response.content", + "got_raw": " response.content\n\n\n# File: src/backend/fastapi_app/rag_advanced.py\nimport logging\nfrom typing import Any, Dict, List, Optional\n\nimport openai\nfrom openai.types import ChatCompletion, ChatCompletionMessage\n\nfrom fastapi_app.api_models import (\n ChatRequest,\n ErrorResponse,\n ItemPublic,\n ItemWithDistance,\n RetrievalResponse,\n RetrievalResponseDelta,\n)\nfrom fastapi_app.dependencies import ChatClient, CommonDeps, DBSession, EmbeddingsClient\nfrom fastapi_app.postgres_models import Item\nfrom fastapi_app.postgres_searcher import PostgresSearcher\nfrom fast", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Azure-Samples/rag-postgres-openai-python", + "expected": "\"vectors\"", + "got": "def test_live_server(self, mock_session_env, free_port):", + "got_raw": "<|fim_suffix|>\n def test_live_server(self, mock_session_env, free_port):\n with live_server_url(mock_session_env, free_port) as url:\n page = self.browser.new_page()\n page.goto(url)\n page.wait_for_selector(\"h1\")\n page.wait_for_selector(\"h1\", state=\"visible\")\n page.wait_for_selector(\"h1\", state=\"visible\")\n page.wait_for_selector(\"h1\", state=\"visible\")\n page.wait_for_selector(\"h1\", state=\"visible\")\n page.wait_for_selector(\"h1\", state=\"visible\")\n page.wait_for_selector(\"h1\", state", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "SystemExit)", + "got": "", + "got_raw": "\n\n\n# File: src/mss/linux/xshmgetimage.py\n# This is part of the MSS Python's module.\n# Source: https://github.com/BoboTiG/python-mss.\n\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING, Any\n\nfrom mss.base import MSSBase\nfrom mss.exception import ScreenShotError\nfrom mss.tools import parse_edid\n\nfrom . import xcb\nfrom .xcb import LIB\n\nif TYPE_CHECKING:\n from ctypes import Array\n\n from mss.models import Monitor\n from mss.screenshot import ScreenShot\n\nSUPPORTED_DEPTHS =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "0", + "got": "0", + "got_raw": "0\n assert primary[\"top\"] == 0\n assert primary[\"width\"] == 1920\n assert primary[\"height\"] == 1080\n assert primary[\"mon\"] == 0\n else:\n # On Windows, the primary monitor is at (0, 0)\n\n assert primary[\"left\"] == 0\n assert primary[\"top\"] == 0\n assert primary[\"width\"] == 1920\n assert primary[\"height\"] == 1080\n assert primary[\"mon\"] == 1\n\n\n# File: src/m", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "repr(ref1)", + "got": "", + "got_raw": " # noqa: PLR2004\n f\"{type(point).__name__}(left=2.0 top=1.0)\"\n\n # CGSize\n size = mss.darwin.CGSize(2.0, 1.0)\n ref2 = mss.darwin.CGSize()\n ref2.width = 2.0\n ref2.height = 1.0\n\n assert repr(size) == # noqa: PLR2004\n f\"{type(size).__name__}(width=2.0 height=1.0)\"\n\n # CGRect\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "output", + "got": "assert f\"Successfully built {file}\" in output", + "got_raw": "<|fim_suffix|>\n assert f\"Successfully built {file}\" in output\n\n with ZipFile(file) as zip:\n assert zip.namelist() == [\"mss-1.0.0-py3-none-any.whl\"]\n\n os.remove(file)\n\n\ndef test_check() -> None:\n output = check_output(CHECK, text=True)\n\n assert f\"mss-1.0.0-py3-none-any.whl\" in output\n assert \"All files are up to date\" in output\n\n\n# File: src/mss/exception.py\n# This is part of the MSS Python's module.\n", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "im2.rgb", + "got": "255 * im2.rgb", + "got_raw": "255 * im2.rgb\n assert im.raw == 255 * im2.raw\n\n # PIL like\n box3 = (left, top, right, lower)\n im3 = sct.grab(box3)\n assert im3.size == (width, height)\n\n # MSS like\n box4 = {\"left\": left, \"top\": top, \"width\": width, \"height\": height}\n im4 = sct.grab(box4)\n assert im3.size == im4.size\n assert im3.pos == im4.pos\n\n assert im3.rgb ==", + "exact_match": false, + "code_bleu": 0.5081327481546147, + "edit_similarity": 0.7, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "ScreenShotError)", + "got": "ImportError):", + "got_raw": "ImportError):\n mss.darwin.MSS()\n\n # `CoreGraphics` library\n monkeypatch.setattr(ctypes.util, \"find_library\", lambda _: \"CoreGraphics\")\n\n with patch.object(mss.darwin, \"CFUNCTIONS\", mss.darwin.CFUNCTIONS):\n mss.darwin.MSS()\n\n\n# File: src/mss/windows.py\n\"\"\"Windows-specific backend for MSS.\n\nUses the Windows API to capture windows and enumerate up to\n``max_displays`` active displays.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport ctypes\nimport ctypes.wintypes\nfrom ctypes import", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5517241379310345, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "ScreenShotError, match=r\"\\b8\\b\")", + "got": "", + "got_raw": " # type: ignore[no-untyped-def]\n ScreenShotError,\n match=\"8-bit color depth is not supported\",\n ),\n ):\n mss(backend=backend)\n\ndef test_unsupported_depth_with_cursor(backend: str) -> None:\n # 8-bit is normally PseudoColor. If the order of testing the display support changes, this might raise a\n # different message; just change the match= accordingly.\n with (\n pyvirtualdisplay.Display(size=(WIDTH, HEIGHT), color_depth=8) as vdisplay,\n\n pytest.raises( # type: ignore[no-un", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "{}", + "got": "", + "got_raw": " # noqa: PLR2004\n assert parse_edid(b\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\x00\") == # noqa: PLR2004\n assert parse_edid(b\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\") == # noqa: PLR2004\n assert parse_edid(b\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\") == # noqa: PLR2004\n assert parse_edid(b\"\\x00\\xff\\xff\\xff", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "BoboTiG/python-mss", + "expected": "1024", + "got": "1024", + "got_raw": "1024\n assert image.height == 768\n\n assert image.pixel(0, 0) == (0, 0, 0)\n assert image.pixel(1023, 767) == (255, 255, 255)\n\n assert image.pixel(512, 384) == (128, 128, 128)\n\n with pytest.raises(ScreenShotError):\n image.pixel(1024, 768)\n\n with pytest.raises(ScreenShotError):\n image", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "ValueError)", + "got": "", + "got_raw": "\n\n\n# File: atomic-examples/deep-research/deep_research/tools/webpage_scraper.py\nfrom typing import List, Optional\nimport asyncio\nfrom concurrent.futures import ThreadPoolExecutor\n\nimport aiohttp\nfrom pydantic import Field\n\nfrom atomic_agents import BaseIOSchema, BaseTool, BaseToolConfig\n\n\n################\n# INPUT SCHEMA #\n################\nclass SearXNGSearchToolInputSchema(BaseIOSchema):\n \"\"\"\n Schema for input to a tool for searching for information, news, references, and other content using SearXNG.\n Returns a list of search results with a short description or content", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "10", + "got": "10", + "got_raw": "10\n\n # Verify the API was called with default max_results parameter\n mock_aiohttp_session.post.assert_called_once()\n call_args = mock_aiohttp_session.post.call_args\n assert call_args[1][\"json\"][\"max_results\"] == 10\n\n # Test with max_results=0\n mock_aiohttp_session.post.reset_mock()\n result3 = await tavily_tool.run_async(input_schema, max_results=0)\n\n assert len(result3.results) == 0\n\n # Verify the API was called with max_results=0\n mock_aiohttp_session.post.assert_called_once", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "Any", + "got": "Any", + "got_raw": " Any\n assert result[1].default is None\n assert result[1].description == \"An unknown field\"\n\n def test_unknown_type_with_default(self):\n prop_schema = {\"type\": \"unknown\", \"description\": \"An unknown field\", \"default\": \"default value\"}\n result = SchemaTransformer.json_to_pydantic_field(prop_schema, True)\n\n assert result[0] == Any\n assert result[1].default == \"default value\"\n assert result[1].description == \"An unknown field\"\n\n def test_unknown_type_with_default_and_required(self):\n prop_schema = {\"type\":", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "expected_prompt", + "got": "expected_prompt", + "got_raw": " expected_prompt\n\n\ndef test_generate_prompt_with_context_providers():\n provider1 = MyProvider(\"Provider 1\")\n provider2 = MyProvider(\"Provider 2\")\n\n generator = SystemPromptGenerator(\n background=[\"Background info\"], steps=[\"Step 1\", \"Step 2\"], output_instructions=[\"Custom instruction\"], context_providers={\"provider1\": provider1, \"provider2\": provider2}\n )\n\n expected_prompt = \"\"\"# IDENTITY and PURPOSE\n- Background info\n\n# INTERNAL ASSISTANT STEPS\n- Step 1\n- Step 2\n\n# OUTPUT INSTRUCTIONS\n- Custom instruction\n- Always respond", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "30)", + "got": "30)", + "got_raw": "30)\n self.assertEqual(default_config.headers, {\n \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3\",\n \"Accept\": \"text/html,application/xhtml+xml,application/xml\",\n \"Accept-Language\": \"en-US,en;q=0.9\",\n })\n self.assertEqual(default_config.min_text_length, 200)\n self.assertEqual(default_config.max_content_length", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "payload_sent[\"include\"]", + "got": "", + "got_raw": " # Check if the domestic website is included\n assert \"sina.com.cn\" in # Check if the domestic website is included\n assert \"ads.example.com\" not in # Check if the ad/spam website is excluded\n assert \"spam.cn\" not in # Check if the ad/spam website is excluded\n\n@pytest.mark.asyncio\nasync def test_bocha_search_tool_config_params_real_case_en(mock_aiohttp_session):\n \"\"\"Test that config params freshness/include/exclude are included in request payload with English websites\"\"\"\n mock_api_key = os.getenv(\"BOCHA_API_KEY\")\n\n # Tool configuration", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "3", + "got": "3", + "got_raw": "3\n assert new_history.history[2].role == \"user\"\n assert new_history.history[2].content.test_field == \"New message\"\n\n # Test multimodal content\n test_image_path = Path(\"test_images\") / \"test.jpg\"\n if test_image_path.exists():\n history.add_message(\n \"user\",\n MockMultimodalSchema(\n instruction_text=\"Please analyze this image\",\n images=[instructor.Image.from_path(test_image_path)],\n ),\n )\n\n dumped_data = history.dump()\n new_history = ChatHistory()\n new_history.load(dumped_data)\n\n # Verify multimodal", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "result2", + "got": "result2", + "got_raw": " result2\n\n\ndef test_format_tool_message_tool_id_is_not_none():\n tool_call = MockToolCall(param1=\"test\", param2=42)\n tool_id = \"fixed-id\"\n\n result = format_tool_message(tool_call, tool_id)\n\n assert result[\"id\"] == tool_id\n\n\ndef test_format_tool_message_tool_id_is_none():\n tool_call = MockToolCall(param1=\"test\", param2=42)\n tool_id = None\n\n result = format_tool_message(tool_call, tool_id)\n\n assert result[\"id\"] == str(uuid.uuid4())\n\n\ndef test_format_tool_message_tool_id_is", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def test_input_schema_with_tool_name_field(self):\n \"\"\"Test that input schemas include tool_name field when is_output_schema=False.\"\"\"\n schema = {\n \"type\": \"object\",\n \"properties\": {\n \"query\": {\"type\": \"string\", \"description\": \"Search query\"},\n \"tool_name\": {\"type\": \"string\", \"description\": \"Name of the tool to use\"},\n },\n \"required\": [\"query\", \"tool_name\"],\n }\n model = SchemaTransformer.create_model_from_schema(schema, \"InputModel\", \"my_tool\")\n\n # Input schema should have tool_name field\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "steps", + "got": "t_providers[\"provider1\"].get_info() == \"Info 1\"", + "got_raw": "<|fim_suffix|>t_providers[\"provider1\"].get_info() == \"Info 1\"\n assert generator.context_providers[\"provider2\"].get_info() == \"Info 2\"\n\n assert generator.get_info() == \"\\n\".join(\n [\n \"# Custom background\",\n \"Step 1\",\n \"Step 2\",\n \"Custom instruction\",\n \"# EXTRA INFORMATION AND CONTEXT\",\n \"## Provider 1\",\n \"Info 1\",\n \"## Provider 2\",\n \"Info 2\",\n ]\n )\n\n assert generator.get_info() == \"\\n\".join(\n [\n \"# Custom background\",\n", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.11538461538461539, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "\"Test description\"", + "got": "\"Test description\"", + "got_raw": " \"Test description\"\n\ndef test_base_tool_config_with_defaults():\n config = BaseToolConfig()\n assert config.title is None\n assert config.description is None\n\ndef test_base_tool_config_with_values():\n config = BaseToolConfig(title=\"Test Tool\", description=\"Test description\")\n assert config.title == \"Test Tool\"\n\n assert config.description == \"Test description\"\n\ndef test_base_tool_config_with_defaults():\n config = BaseToolConfig()\n assert config.title is None\n assert config.description is None\n\ndef test_base_tool_config_with_values():\n config = BaseToolConfig(title=\"Test Tool\", description=\"Test description", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "\"MockToolCall\"", + "got": "MockToolCall.__class__.__name__", + "got_raw": " MockToolCall.__class__.__name__\n assert result[\"function\"][\"arguments\"] == json.dumps(tool_call.model_dump(), separators=(\", \", \": \"))\n\ndef test_format_tool_message_with_tool_id():\n tool_call = MockToolCall(param1=\"test\", param2=42)\n tool_id = str(uuid.uuid4())\n\n result = format_tool_message(tool_call, tool_id)\n\n assert result[\"id\"] == tool_id\n assert result[\"type\"] == \"function\"\n\n assert result[\"function\"][\"name\"] == MockToolCall.__class__.__name__\n assert result[\"function\"][\"arguments\"] == json.dumps", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.5333333333333333, + "n_retrieved": 10 + }, + { + "repo": "BrainBlend-AI/atomic-agents", + "expected": "CustomInput", + "got": "", + "got_raw": " # type: ignore\n assert tool.output_schema == # type: ignore\n\n # Test that the tool's name and description are correctly derived from the input schema\n assert tool.tool_name == \"TestTool\"\n assert tool.tool_description == \"Custom input schema for testing\"\n\n # Test that the tool's name and description are correctly derived from the input schema\n assert tool.tool_name == \"TestTool\"\n assert tool.tool_description == \"Custom input schema for testing\"\n\n # Test that the tool's name and description are correctly derived from the input schema\n assert tool.tool_name == \"TestTool\"\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "8002", + "got": "8002", + "got_raw": "8002\n\n def test_get_active_models(self, router):\n \"\"\"Test getting list of registered model names.\"\"\"\n router.add_backend(\"model1\", \"http://localhost:8001\", {\"port\": 8001})\n router.add_backend(\"model2\", \"http://localhost:8002\", {\"port\": 8002})\n\n active_models = router.get_active_models()\n assert len(active_models) == 2\n assert \"model1\" in active_models\n assert \"model2\" in active_models\n\n def test_route_request(self, router):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "2", + "got": "2", + "got_raw": "2\n assert config.models[0].name == \"model1\"\n assert config.models[0].model_path == \"path1\"\n assert config.models[0].port == 8001\n assert config.models[0].gpu_ids == []\n assert config.models[0].profile is None\n assert config.models[0].config_overrides == {}\n assert config.models[0].enabled is True\n assert config.models[0].loading_priority is None\n assert config.models[0].status == \"stopped\"\n assert config.models[0].registration_status is None\n assert config", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def test_tensor_parallel_adjustment_with_no_device(self):\n \"\"\"Tensor parallel size is adjusted when no device is specified.\"\"\"\n config = {\n \"model\": \"test-model\",\n \"port\": 8000,\n \"tensor_parallel_size\": 4, # Requesting 4 GPUs\n }\n\n server = VLLMServer(config)\n\n with patch(\"subprocess.Popen\") as mock_popen:\n mock_process = Mock()\n mock_process.poll.return_value = None\n mock_process.stdout = Mock()\n mock_process.stdout.readline.return_value = \"\"\n mock_process.pid = 1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "initial_models", + "got": "initial_models", + "got_raw": " initial_models\n\n # Refresh the cache\n manager.refresh_cache()\n\n # Verify cache is cleared and new models are fetched\n assert manager.cache.get_cached_models() == []\n\n def test_cache_refresh_does_not_clear_if_not_expired(self):\n \"\"\"Test that cache refresh does not clear if not expired.\"\"\"\n manager = ModelManager()\n\n # Cache some initial models\n initial_models = [{\"name\": \"old_model\", \"type\": \"model\"}]\n manager.cache.cache_models(initial_models)\n\n # Verify cached\n assert manager.cache.get_cached_models() == initial_models\n\n # Simulate a cache hit\n manager", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "8001", + "got": "8001", + "got_raw": "8001\n assert config.profile == \"standard\"\n assert config.config_overrides == {\"max_tokens\": 2048}\n assert config.enabled\n\n def test_model_config_validation(self):\n \"\"\"Test validation of ModelConfig.\"\"\"\n # Test invalid name\n with pytest.raises(ValidationError):\n ModelConfig(name=\"\", model_path=\"/path/to/model\", gpu_ids=[0, 1], port=8001)\n\n # Test invalid model path\n with pytest.raises(ValidationError):\n ModelConfig(name=\"test-model\", model_path=\"\", gpu_ids=[0, 1], port=80", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "False", + "got": "assert server.is_running() is False", + "got_raw": "<|fim_suffix|>\n assert server.is_running() is False\n\n def test_stop(self, mock_server_config):\n \"\"\"Test VLLMServer stop method.\"\"\"\n server = VLLMServer(mock_server_config)\n server.start()\n\n assert server.is_running() is True\n\n server.stop()\n\n assert server.is_running() is False\n\n def test_start(self, mock_server_config):\n \"\"\"Test VLLMServer start method.\"\"\"\n server = VLLMServer(mock_server_config)\n server.start()\n\n assert server.is_running() is True\n\n def test_start_with_existing_process(self, mock_server_config):\n \"\"\"Test", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "1", + "got": "1", + "got_raw": "1\n assert stats[\"misses\"] == 0\n\n # Refresh cache\n cache.refresh_cache()\n\n stats = cache.get_stats()\n\n assert stats[\"hits\"] == 1\n assert stats[\"misses\"] == 1\n\n def test_cache_stats_after_clear(self):\n \"\"\"Test that cache statistics are updated after clear.\"\"\"\n cache = ModelCache()\n\n # Initial stats\n stats = cache.get_stats() # Now using get_stats()\n assert stats[\"hits\"] == 0\n assert stats[\"misses\"] == 0\n\n # Cache and retrieve\n cache.cache_models([", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "{}", + "got": "result[\"metadata\"][\"architectures\"] == [\"qwen3\"])", + "got_raw": "result[\"metadata\"][\"architectures\"] == [\"qwen3\"]) # qwen3:30b\n assert result[\"metadata\"][\"model_type\"] == \"qwen\"\n assert result[\"metadata\"][\"torch_dtype\"] == \"q4_0\"\n assert result[\"metadata\"][\"vocab_size\"] == 32000\n\n def test_build_model_dict_with_gguf(self):\n \"\"\"Test building model dict for GGUF models.\"\"\"\n gguf_item = {\n \"name\": \"qwen3:30b\",\n \"path\": \"/usr/share/ollama/.ollama/models/b", + "exact_match": false, + "code_bleu": 0.08032276872815308, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "None", + "got": "", + "got_raw": "<|fim_suffix|>\n # Apply manifest data to models\n updated_models = apply_manifest_to_models(models, test_model_dir)\n\n # Check if the manifest data was applied correctly\n assert updated_models[0][\"name\"] == \"TestModel\"\n assert updated_models[0][\"display_name\"] == \"TestModel\"\n assert updated_models[0][\"publisher\"] == \"TestPublisher\"\n assert updated_models[0][\"notes\"] == \"TestNotes\"\n assert updated_models[0][\"metadata\"][\"architectures\"] == [\"TestModel\"]\n assert updated_models[0][\"metadata\"][\"model_type\"] == \"test\"\n assert", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "None", + "got": "None", + "got_raw": " None\n\n # Mock hf-model-tool's registry scan_all method\n with patch('vllm_cli.models.discovery.scan_for_models') as mock_scan:\n mock_scan.return_value = models\n\n # Call the refresh_cache method\n manager.refresh_cache()\n\n # Check if the cache was refreshed\n assert manager.cache.get_cached_models() is not None\n\n def test_refresh_cache_clears_cache(self):\n \"\"\"Test the refresh_cache method clears cache properly.\"\"\"\n manager = ModelManager()\n\n # Cache some models\n models = [{\"name\": \"test\", \"type\": \"ollama_model\"}]\n manager", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "8080", + "got": "8080", + "got_raw": "8080\n assert last_config[\"tensor_parallel_size\"] == 2\n\n @patch(\"vllm_cli.config.manager.Path.home\")\n def test_save_last_config(self, mock_home, temp_config_dir):\n \"\"\"Test saving last used configuration.\"\"\"\n mock_home.return_value = temp_config_dir\n config_dir = temp_config_dir / \".config\" / \"vllm-cli\"\n config_dir.mkdir(parents=True)\n\n config_file = config_dir / \"config.yaml\"\n test_config = {\n \"last_config\": {\n \"model\": \"llama-7b\",\n \"port\": ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "\"gguf\"", + "got": "0", + "got_raw": "0\n assert result[\"max_model_len\"] == 2048\n assert result[\"gpu_memory_utilization\"] == 0.5\n assert result[\"max_gpu_memory\"] == 0.5\n assert result[\"max_gpu_memory\"] == 0.5\n assert result[\"max_gpu_memory\"] == 0.5\n assert result[\"max_gpu_memory\"] == 0.5\n assert result[\"max_gpu_memory\"] == 0.5\n assert result[\"max_gpu_memory\"] == 0.5\n assert result[\"max_gpu_memory\"] == 0.", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Chen-zexi/vllm-cli", + "expected": "\"stop\"", + "got": "\"stop\"", + "got_raw": " \"stop\"\n assert args.port == 8000\n\n def test_stop_command_with_model(self):\n \"\"\"Test stop command with model.\"\"\"\n parser = create_parser()\n args = parser.parse_args([\"stop\", \"model_name\"])\n\n\n assert args.command == \"stop\"\n assert args.model == \"model_name\"\n\n def test_stop_command_with_all(self):\n \"\"\"Test stop command with all.\"\"\"\n parser = create_parser()\n args = parser.parse_args([\"stop\", \"--all\"])\n\n\n assert args.command == \"stop\"\n assert args.all\n\n def test_stop_command_with_invalid_port", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cloxl/xhshow", + "expected": "len(uri)", + "got": "32", + "got_raw": "32\n\ndef test_signing_without_session(mock_crypto_processor):\n \"\"\"\n Verify that when no session object is provided, the current state is used for signing.\n \"\"\"\n client = Xhshow()\n uri = \"/api/sns/web/v1/user/posted\"\n cookies = {\"a1\": \"test_a1\", \"web_session\": \"test_session\"}\n\n # Perform signing\n client.sign_headers_get(uri=uri, cookies=cookies)\n\n # Assert that build_payload_array was called\n mock_crypto_processor.build_payload_array.assert_called_once()\n\n # Get the actual arguments passed to the mock\n _,", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Cloxl/xhshow", + "expected": "session.window_props_length", + "got": "100", + "got_raw": "100 # Example value, adjust as needed\n assert actual_state.uri_length == len(uri)\n\ndef test_signing_without_session(mock_crypto_processor):\n \"\"\"\n Verify that when no session object is provided, the current state is used for signing.\n \"\"\"\n client = Xhshow()\n uri = \"/api/sns/web/v1/user/posted\"\n cookies = {\"a1\": \"test_a1\", \"web_session\": \"test_session\"}\n\n # Perform signing\n client.sign_headers_get(uri=uri, cookies=cookies)\n\n # Assert that build_payload_array was called\n mock_crypto_processor.build", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Cloxl/xhshow", + "expected": "50", + "got": "0", + "got_raw": "0\n\n assert result[0] == 121\n assert result[1] == 104\n assert result[2] == 96\n assert result[3] == 41\n\n assert result[4] == 0\n assert result[5] == 0\n assert result[6] == 0\n assert result[7] == 0\n\n assert result[8] == 0\n assert result[9] == 0\n assert result[10] == 0\n assert result[11] == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "Cloxl/xhshow", + "expected": "\"/api/search\"", + "got": "assert result == '/api/search'", + "got_raw": "<|fim_suffix|>\n assert result == '/api/search'\n\n def test_uri_with_query(self):\n \"\"\"URI with query parameters\"\"\"\n uri = '/api/search?num=10'\n result = extract_uri(uri)\n\n assert result == '/api/search'\n\n def test_uri_with_fragment(self):\n \"\"\"URI with fragment identifier\"\"\"\n uri = '/api/search#fragment'\n result = extract_uri(uri)\n\n assert result == '/api/search'\n\n def test_uri_with_query_and_fragment(self):\n \"\"\"URI with query and fragment identifiers\"\"\"\n uri = '/api/search?num=10#fragment'\n result = extract", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.5116279069767442, + "n_retrieved": 10 + }, + { + "repo": "Cloxl/xhshow", + "expected": "32", + "got": "32", + "got_raw": "32\n\n def test_sign_headers_get_with_string(self):\n \"\"\"\u6d4b\u8bd5 GET \u8bf7\u6c42\u4f7f\u7528\u5b57\u7b26\u4e32 cookies\"\"\"\n cookies = \"a1=test_a1_value; web_session=test_session\"\n\n headers = self.client.sign_headers(\n method=\"GET\",\n uri=\"/api/sns/web/v1/user_posted\",\n cookies=cookies,\n params={\"num\": \"30\"},\n )\n\n assert isinstance(headers, dict)\n assert \"x-s\" in headers\n assert \"x-s-common\" in headers\n assert \"x-t\" in headers\n assert \"x-b3-traceid\" in headers\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "0", + "got": "0", + "got_raw": "0\n assert_json_envelope(\n result.output,\n summary={\n \"impact\": 0,\n \"dependencies\": 0,\n \"dependencies_by_type\": {},\n \"dependencies_by_type_count\": {},\n \"dependencies_by_type_size\": {},\n \"dependencies_by_type_size_count\": {},\n \"dependencies_by_type_size_percent\": {},\n \"dependencies_by_type_size_percent_count\": {},\n \"dependencies_by_type_size_percent_percent\": {},\n \"dependencies_by_type_size_percent_percent_count\": {},\n \"dependencies_by_type_size_percent_percent_percent\": {},\n \"dependencies_by_type_size_percent_percent_percent_count\": {},\n \"dependencies_by", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "0", + "got": "0", + "got_raw": "0\n assert_json_envelope(\n result.output,\n summary={\"verdict\": \"PASS\", \"score\": 100, \"score_str\": \"100.00\"},\n score=100,\n score_str=\"100.00\",\n )\n\n def test_exits_zero_on_python_project(self, cli_runner, non_php_project, monkeypatch):\n monkeypatch.chdir(non_php_project)\n result = invoke_cli(cli_runner, [\"auth-gaps\"], cwd=non_php_project)\n\n assert result.exit_code == 0\n assert_json_envelope(\n result.output,\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "0", + "got": "1", + "got_raw": "1\n assert report[\"warnings\"] == [\"latest(nonexistent)>=1: metric not available for `latest(nonexistent)`\"]\n assert report[\"failures\"] == []\n\ndef test_unknown_metric_fails():\n mod = _load_gate_eval_module()\n results = {\"health\": {\"summary\": {\"health_score\": 80}}}\n report = mod.evaluate_gate(\"latest(nonexistent)>=100\", results)\n assert report[\"passed\"] is False\n\n assert report[\"checked_expressions\"] == 1\n assert report[\"warnings\"] == []\n assert report[\"failures\"] == [\"latest(nonexistent)>=", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "2", + "got": "2", + "got_raw": "2\n assert rules[0].pattern == r\".*\\.py\"\n assert rules[0].owners == [\"@backend-team\"]\n assert rules[1].pattern == r\".*\\.js\"\n assert rules[1].owners == [\"@frontend-team\"]\n\n def test_complex_rules(self, tmp_path):\n co = tmp_path / \"CODEOWNERS\"\n co.write_text(\n \"*.py @backend-team\\n*.js @frontend-team\\n*.py @backend-team\\n*.js @frontend-team\\n\"\n )\n from roam.commands.cmd_codeowners import parse_codeowners\n\n rules = parse_code", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "1", + "got": "1, result.output", + "got_raw": "1, result.output\n finally:\n os.chdir(old_cwd)\n\n def test_top_flag_with_threshold(self, tmp_path):\n \"\"\"--top N should limit cluster output.\"\"\"\n proj = _make_project(\n tmp_path,\n {\n \"a.py\": \"\"\"\n def process_a(items):\n results = []\n for item in items:\n if item.valid:\n results.append(item.value)\n return results\n \"\"\",\n \"b.py\": \"\"\"\n def process_b(entries):\n output = []\n for entry in entries:\n if entry.valid:\n output.append(entry.value)\n return output\n ", + "exact_match": true, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "result.output", + "got": "assert \"fn-coupling\" in result.stdout", + "got_raw": "<|fim_suffix|>\n assert \"fn-coupling\" in result.stdout\n assert \"fn-coupling\" in result.stderr\n assert_json_envelope(result.stdout, \"fn-coupling\", summary={\"verdict\": \"OK\"})\n assert_json_envelope(result.stderr, \"fn-coupling\", summary={\"verdict\": \"OK\"})\n\n def test_json(self, cli_runner, coupling_project, monkeypatch):\n monkeypatch.chdir(coupling_project)\n result = invoke_cli(cli_runner, [\"fn-coupling\", \"--json\"], cwd=coupling_project)\n\n assert \"fn-coupling\" in result", + "exact_match": false, + "code_bleu": 0.2907153684841096, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "n", + "got": "50", + "got_raw": "50\n for i, row in enumerate(result):\n assert row[\"id\"] == ids[i]\n\n def test_all_ids_returns_all_with_duplicates(self):\n \"\"\"Requesting all IDs returns all rows, even if some IDs are duplicates.\"\"\"\n n = 50\n conn = self._setup_db(n)\n ids = [random.randint(1, n) for _ in range(n)]\n result = batched_in(conn, \"SELECT * FROM test_items WHERE id IN ({ph})\", ids)\n\n assert len(result) == 50\n for i, row in enumerate(result):\n assert row[\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "out", + "got": "", + "got_raw": " # direct change\n assert \"service.py\" not in # no transitive change\n assert \"api.py\" not in # no transitive change\n assert \"tests/test_service.py\" in # affected test\n assert \"utils.py\" not in # no transitive change\n\n def test_affected_shows_transitive_changes(self, cli_runner, affected_project, monkeypatch):\n \"\"\"Transitive changes should appear in the TRANSITIVE (transitive) section.\"\"\"\n monkeypatch.chdir(affected_project)\n result = invoke_cli(cli_runner, [\"affected\"], cwd=affected_project)\n assert result", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "[]", + "got": "0", + "got_raw": "0\n\n def test_returns_empty_when_no_taint_summaries(self, tmp_path):\n \"\"\"If taint_summaries table does not exist, returns empty list.\"\"\"\n db_path = tmp_path / \"bare.db\"\n conn = sqlite3.connect(str(db_path))\n conn.row_factory = sqlite3.Row\n # Create a minimal schema with taint_summaries table\n conn.execute(\"CREATE TABLE IF NOT EXISTS files (id INTEGER PRIMARY KEY, path TEXT)\")\n conn.execute(\"CREATE TABLE IF NOT EXISTS taint_summaries (id INTEGER PRIMARY KEY, symbol_id INTEGER, param_taints_return TEXT, param_to", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "ep", + "got": "assert \"protocol\" in ep", + "got_raw": "<|fim_suffix|>\n assert \"protocol\" in ep\n assert \"file\" in ep\n assert \"line\" in ep\n assert \"fan_out\" in ep\n\n def test_json_entry_point_fields_with_fan_out(self, cli_runner, entry_project, monkeypatch):\n \"\"\"Each entry point should have name, kind, protocol, file, line, fan_out.\"\"\"\n monkeypatch.chdir(entry_project)\n result = invoke_cli(cli_runner, [\"entry-points\"], cwd=entry_project, json_mode=True)\n data = parse_json_output(result, \"entry-points\")\n for ep in data.get(\"entry_points\", [])", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.16, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "0", + "got": "0", + "got_raw": "0\n assert summary[\"dropped_runs_for_size_cap\"] > 0\n\n assert summary[\"truncated\"]\n assert summary[\"oversized_after_truncation\"]\n\ndef test_apply_guardrails_size_cap_truncates_with_oversized():\n mod = _load_sarif_guard_module()\n data = _make_sarif(30, msg_size=300)\n\n summary = mod.apply_guardrails(\n data,\n max_runs=20,\n max_results=25_000,\n max_bytes=1_000,\n )\n assert summary[\"results_before\"]", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "d", + "got": "assert \"value\" in d", + "got_raw": "<|fim_suffix|>\n assert \"value\" in d\n assert d[\"name\"] in [\"lines\", \"files\", \"symbols\", \"lines_per_file\", \"symbols_per_file\", \"lines_per_symbol\", \"symbols_per_symbol\"]\n assert d[\"value\"] >= 0\n\n def test_json_dimensions_array_with_zero(self, cli_runner, minimal_project):\n \"\"\"JSON includes dimensions array with all 7 dimensions, including zero.\"\"\"\n (minimal_project / \"app.py\").write_text(\"def main():\\n return 0\\n\")\n result = _invoke(cli_runner, minimal_project, json_mode=True)\n data =", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.1, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "\"b\"", + "got": "\"b\"", + "got_raw": " \"b\"\n assert result[1][\"name\"] == \"a\"\n\n def test_priority_score_over_pagerank(self):\n \"\"\"'score' takes priority over 'pagerank' when both are present.\"\"\"\n from roam.output.formatter import _sort_by_importance\n\n items = [\n {\"name\": \"a\", \"pagerank\": 0.1, \"score\": 100},\n {\"name\": \"b\", \"pagerank\": 0.9, \"score\": 1},\n ]\n result, was_sorted = _sort_by_importance(items)\n assert was_sorted is True", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "1", + "got": "1", + "got_raw": "1\n assert isinstance(data[\"files_to_read\"][0], dict)\n assert \"path\" in data[\"files_to_read\"][0]\n assert \"symbol\" in data[\"files_to_read\"][0]\n assert \"symbol_type\" in data[\"files_to_read\"][0]\n assert \"symbol_kind\" in data[\"files_to_read\"][0]\n assert \"symbol_name\" in data[\"files_to_read\"][0]\n assert \"symbol_location\" in data[\"files_to_read\"][0]\n assert \"symbol_location.line\" in data[\"files_to_read\"][0][\"symbol_location\"]\n assert \"symbol_location.column", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "h", + "got": "h", + "got_raw": " h\n assert \"partition\" in h\n assert \"partition\" in h[\"file\"]\n assert \"partition\" in h[\"partition\"]\n assert \"partition\" in h[\"partition\"][\"file\"]\n assert \"partition\" in h[\"partition\"][\"partition\"]\n assert \"partition\" in h[\"partition\"][\"partition\"][\"file\"]\n assert \"partition\" in h[\"partition\"][\"partition\"][\"partition\"]\n assert \"partition\" in h[\"partition\"][\"partition\"][\"partition\"][\"file\"]\n assert \"partition\" in h[\"partition\"][\"partition\"][\"partition\"][\"partition\"]\n assert \"partition\" in h[\"partition\"][\"partition\"][\"partition\"][\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "1", + "got": "1", + "got_raw": "1\n assert report[\"warnings\"] == []\n assert report[\"failures\"] == []\n\ndef test_scalar_gate_fail():\n mod = _load_gate_eval_module()\n results = {\"health\": {\"summary\": {\"health_score\": 70}}}\n report = mod.evaluate_gate(\"health_score>=70\", results)\n assert report[\"passed\"] is False\n\n assert report[\"checked_expressions\"] == 1\n assert report[\"warnings\"] == []\n assert report[\"failures\"] == [\"health_score>=70: health_score=70 (required >= 70)\"]\n\ndef test_trend", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "0", + "got": "0", + "got_raw": "0\n\n def test_exits_nonzero(self, cli_runner, congestion_project, monkeypatch):\n monkeypatch.chdir(congestion_project)\n result = invoke_cli(cli_runner, [\"congestion\", \"--max-unstaged\", \"1\"], cwd=congestion_project)\n\n assert result.exit_code != 0\n\n def test_exits_nonzero_with_gate(self, cli_runner, congestion_project, monkeypatch):\n monkeypatch.chdir(congestion_project)\n result = invoke_cli(cli_runner, [\"congestion\", \"--max-unstaged\", \"1\", \"--max-unstaged-gate\", \"1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "2", + "got": "2", + "got_raw": "2\n assert rows[0][\"name\"] == \"a\"\n assert rows[0][\"qualified_name\"] == \"a\"\n assert rows[0][\"kind\"] == \"function\"\n assert rows[0][\"file_path\"] == \"src/auth.py\"\n assert rows[0][\"signature\"] == \"def authenticate(token)\"\n\n def test_limit_respected_2(self, tmp_db):\n from roam.mcp_server import _batch_search_one\n\n conn = self._conn(tmp_db)\n rows, err = _batch_search_one(conn, \"a\", 2)\n conn.close()\n assert err is None", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "f", + "got": "assert \"secret\" in f", + "got_raw": "<|fim_suffix|>\n assert \"secret\" in f\n assert \"value\" in f[\"secret\"]\n assert f[\"secret\"][\"value\"] == \"AKIAIOSFODNN7TESTDATA\"\n\n def test_json_finding_fields_with_binary(self, binary_project):\n result = _invoke([\"secrets\"], binary_project, json_mode=True)\n data = json.loads(result.output)\n findings = data.get(\"findings\", [])\n assert len(findings) > 0\n f = findings[0]\n\n assert \"file\" in f\n assert \"path\" in f[\"file\"]\n assert f[\"file", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.09523809523809523, + "n_retrieved": 10 + }, + { + "repo": "Cranot/roam-code", + "expected": "7", + "got": "7", + "got_raw": "7\n assert \"file_count\" in dims\n assert \"line_count\" in dims\n assert \"function_count\" in dims\n assert \"function_line_count\" in dims\n assert \"function_complexity\" in dims\n assert \"function_complexity_line_count\" in dims\n assert \"function_complexity_line_count\" in dims\n\n def test_json_dimensions(self, cli_runner, minimal_project):\n \"\"\"JSON includes dimensions array with all 7 dimensions.\"\"\"\n result = _invoke(cli_runner, minimal_project, json_mode=True)\n data = json.loads(result.output)\n assert \"dimensions\" in data", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "CursorTouch/Windows-MCP", + "expected": "0", + "got": "0", + "got_raw": "0\n assert result.height == 0\n\n def test_partial_overlap(self, tree_instance):\n window = SimpleNamespace(left=0, top=0, right=50, bottom=50)\n element = SimpleNamespace(left=25, top=25, right=75, bottom=75)\n result = tree_instance.iou_bounding_box(window, element)\n\n assert result.width == 25\n assert result.height == 25\n\n def test_full_overlap(self, tree_instance):\n window = SimpleNamespace(left=0, top=0, right=50,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "CursorTouch/Windows-MCP", + "expected": "result", + "got": "result", + "got_raw": " result\n assert \"File\" in result\n assert \"2048\" in result\n assert \"2025-01-15 10:30:00\" in result\n assert \"2025-06-20 14:00:00\" in result\n assert \"2025-06-21 09:00:00\" in result\n assert \"False\" in result\n\n def test_to_string_with_extension(self):\n f = self._make_file(extension=\"txt\")\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "CursorTouch/Windows-MCP", + "expected": "1900", + "got": "1920", + "got_raw": "1920\n assert result.top == 1080\n assert result.right == 1920\n assert result.bottom == 1080\n\n def test_screen_clamping_with_negative_values(self, tree_instance):\n # Element extends beyond screen (1920x1080)\n window = SimpleNamespace(left=-100, top=-100, right=100, bottom=100)\n element = SimpleNamespace(left=1900, top=1060, right=2000, bottom=12", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "CursorTouch/Windows-MCP", + "expected": "\"Maximized\"", + "got": "1", + "got_raw": "1\n assert Status.MINIMIZED.value == 2\n assert Status.NORMAL.value == 3\n assert Status.HIDDEN.value == 4\n\n assert Browser.CHROME.value == \"chrome\"\n assert Browser.EDGE.value == \"msedge\"\n assert Browser.FIREFOX.value == \"firefox\"\n\n def test_enum_values(self):\n\n assert Status.MAXIMIZED.value == 1\n assert Status.MINIMIZED.value == 2\n assert Status.NORMAL.value == 3\n assert Status.HIDDEN.value == 4\n\n assert Browser.CHROME.value == \"chrome\"\n assert Browser.EDGE.value", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "CursorTouch/Windows-MCP", + "expected": "\"''\"", + "got": "'\"\"", + "got_raw": " '\"\"\n\n def test_single_quote(self):\n\n assert Desktop._ps_quote(\"'\") == \"'\"\n\n def test_double_quote(self):\n\n assert Desktop._ps_quote('\"') == '\"'\n\n def test_single_quote_in_string(self):\n\n assert Desktop._ps_quote(\"a'b\") == '\"a\\'b\"'\n\n def test_double_quote_in_string(self):\n\n assert Desktop._ps_quote('a\"b') == '\"a\\\"b\"'\n\n def test_single_quote_in_string_with_double_quote(self):\n\n assert Desktop._ps_quote(\"a'b\\\"c\") == '\"a\\'b\\\"c\"", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "CursorTouch/Windows-MCP", + "expected": "MAX_RETRIES", + "got": "1", + "got_raw": "1\n assert mock_sleep.call_count == 1\n\n @patch(\"windows_mcp.auth.service.time.sleep\")\n @patch(\"windows_mcp.auth.service.requests.post\")\n def test_timeout_error_retries(self, mock_post, mock_sleep):\n mock_post.side_effect = requests.Timeout()\n\n client = AuthClient(api_key=\"key\", sandbox_id=\"sb-1\")\n with pytest.raises(AuthError, match=\"Dashboard authentication request timed out.\"):\n client.authenticate()\n\n\n assert mock_post.call_count == 1\n assert mock_sleep.call_count == 1\n\n @patch(\"windows_mcp.auth.service.time.sleep", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "CursorTouch/Windows-MCP", + "expected": "1920", + "got": "2000", + "got_raw": "2000\n assert result.bottom == 1200\n\n def test_screen_clamping_with_zero_width(self, tree_instance):\n # Element extends beyond screen (1920x1080)\n window = SimpleNamespace(left=0, top=0, right=0, bottom=1080)\n element = SimpleNamespace(left=1900, top=1060, right=2000, bottom=1200)\n result = tree_instance.iou_bounding_box(window, element)\n assert result.left == 1900", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "CursorTouch/Windows-MCP", + "expected": "{\"key\": \"value\", \"count\": 42}", + "got": "{\"key\": \"value\", \"count\": 42}", + "got_raw": " {\"key\": \"value\", \"count\": 42}\n mock_analytics.track_tool.assert_called_once_with(\"test_tool\", {\"key\": \"value\", \"count\": 42})\n\n async def test_exception_preserved(self):\n mock_analytics = AsyncMock()\n\n @with_analytics(mock_analytics, \"test_tool\")\n async def tool_with_exception():\n raise ValueError(\"Test exception\")\n\n with pytest.raises(ValueError):\n await tool_with_exception()\n\n mock_analytics.track_error.assert_called_once_with(\n ValueError(\"Test exception\"),\n {\"tool_name\": \"test_tool\"},\n )\n\n async def test", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "np.array([2, 0, 1]))", + "got": "np.array([2, 0, 1]))", + "got_raw": " np.array([2, 0, 1]))\n\n\ndef test_label_2():\n from terracotta import image\n\n data = np.array([15, 16, 17])\n\n np.testing.assert_array_equal(image.label(data, [17, 15]), np.array([2, 0, 1]))\n\n\ndef test_label_3():\n from terracotta import image\n\n data = np.array([15, 16, 17])\n\n np.testing.assert_array_equal(image.label(data, [17, 15]), np.array([2", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "db", + "got": "db.meta_store", + "got_raw": " db.meta_store\n\n\n# File: terracotta/drivers/sqlite_remote_meta_store.py\n\"\"\"drivers/sqlite_remote_meta_store.py\n\nSQLite-backed metadata driver. Metadata is stored in an SQLite database.\n\"\"\"\n\nimport os\nfrom pathlib import Path\nfrom typing import Union\n\nfrom terracotta.drivers.relational_meta_store import RelationalMetaStore\n\n\nclass RemoteSQLiteMetaStore(RelationalMetaStore):\n \"\"\"An SQLite-backed metadata driver.\n\n Stores metadata and paths to raster files in SQLite.\n\n This is the simplest Terracotta driver, as it requires no additional infrastructure.\n The SQLite database is simply a file that can e", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.26666666666666666, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "ValueError)", + "got": "InvalidDatabaseError):", + "got_raw": "InvalidDatabaseError):\n drivers.get_driver(db_path, provider=provider)\n\n\n@pytest.mark.parametrize(\"case\", TEST_CASES)\ndef test_valid_paths(case):\n from terracotta import drivers\n\n db_path = case.format(provider=drivers.auto_detect_provider(case))\n\n with drivers.get_driver(db_path) as driver:\n assert driver.url == urlparse.urlparse(db_path)\n assert driver.url.drivername == drivers.auto_detect_provider(case)\n assert driver.url.username == TEST_CASES[case][\"username\"]\n assert driver.url.password == TEST_CASES[case][\"password\"]\n assert driver.url.host == TEST_CASES[case][\"", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5454545454545454, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "ValueError)", + "got": "", + "got_raw": "\n\n\n# File: terracotta/drivers/sqlite_remote_meta_store.py\n\"\"\"drivers/sqlite_remote_meta_store.py\n\nRemote SQLite-backed metadata driver. Metadata is stored in a SQLite database on S3.\n\"\"\"\n\nimport os\nfrom pathlib import Path\nfrom typing import Union\n\nfrom terracotta.drivers.relational_meta_store import RelationalMetaStore\n\n\nclass RemoteSQLiteMetaStore(RelationalMetaStore):\n \"\"\"A remote SQLite-backed metadata driver.\n\n Stores metadata and paths to raster files in a SQLite database on S3.\n\n This is the simplest Terracotta driver, as it requires no additional infrastructure.\n The SQLite database", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "tile_identity_transform)", + "got": "255 * tile_identity_transform)", + "got_raw": "255 * tile_identity_transform)\n\n\ndef test_singleband_color_transform_invalid(use_testdb):\n from terracotta.handlers import singleband\n\n ds_keys = [\"val21\", \"x\", \"val22\"]\n\n with pytest.raises(exceptions.InvalidArgumentsError):\n singleband.singleband(ds_keys, color_transform=\"gamma 1 1 sigmoidal 1 0 0\")\n\n\ndef test_singleband_color_transform_invalid_2(use_testdb):\n from terracotta.handlers import singleband\n\n ds_keys = [\"val21\", \"x\", \"val22\"]\n\n with pytest.raises(exceptions.Invalid", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.8888888888888888, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "src2.read())", + "got": "0)", + "got_raw": "0)\n np.testing.assert_array_equal(src2.read(), src1.read())\n\n # check for overviews\n with rasterio.open(str(unoptimized_raster_file)) as src1, rasterio.open(\n str(outfile)\n ) as src2:\n assert src1.overviews(1) == src2.overviews(1)\n assert src1.overviews(2) == src2.overviews(2)\n assert src1.overviews(4) == src2.overviews(4)\n assert src1.overviews(8) == src2.overviews(8)\n assert src1.overviews(", + "exact_match": false, + "code_bleu": 0.17909498863725698, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "(\"foo\", \"rgb\")", + "got": "[\"rgb\", \"foo\"]", + "got_raw": " [\"rgb\", \"foo\"]\n\n with driver.connect():\n assert driver.get_datasets() == [(\"foo\",)]\n\ndef test_ingest(raster_file, tmpdir):\n from terracotta.scripts import cli\n\n outfile = tmpdir / \"out.sqlite\"\n input_pattern = str(raster_file.dirpath(\"{name}.tif\"))\n\n runner = CliRunner()\n result = runner.invoke(cli.cli, [\"ingest\", input_pattern, \"-o\", str(outfile)])\n assert result.exit_code == 0\n assert outfile.check()\n\n from terracotta import get_driver\n\n driver = get_driver(str(outfile), provider=\"", + "exact_match": false, + "code_bleu": 0.32466791547509893, + "edit_similarity": 0.35714285714285715, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "repr(db)", + "got": "", + "got_raw": " # noqa: E501\n assert f\"raster_store=GeoTiffRasterStore()\" in repr(db)\n\n\n# File: terracotta/drivers/sqlite_remote_meta_store.py\n\"\"\"drivers/sqlite_remote_meta_store.py\n\nRemote SQLite-backed metadata driver. Metadata is stored in a remote SQLite database.\n\"\"\"\n\nimport os\nfrom pathlib import Path\nfrom typing import Union\n\nfrom terracotta.drivers.relational_meta_store import RelationalMetaStore\n\n\nclass RemoteSQLiteMetaStore(RelationalMetaStore):\n \"\"\"A remote SQLite-backed metadata driver.\n\n Stores metadata and paths to raster files in a remote SQLite database.\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "driver.key_names", + "got": "driver.key_names", + "got_raw": " driver.key_names\n\n if use_testdb:\n # test that the database is empty\n with driver.connect():\n assert not driver.get_datasets()\n\n # test that the database is empty\n with driver.connect():\n assert not driver.get_datasets()\n\n # test that the database is empty\n with driver.connect():\n assert not driver.get_datasets()\n\n # test that the database is empty\n with driver.connect():\n assert not driver.get_datasets()\n\n # test that the database is empty\n with driver.connect():\n assert not driver.get_datasets()\n\n # test that the database is empty\n with driver.connect", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "keys", + "got": "keys", + "got_raw": " keys\n\n with driver.connect():\n assert driver.get_datasets() == {}\n\n@moto.mock_aws\ndef test_remote_database_update(s3_db_factory):\n keys = (\"some\", \"keys\")\n dbpath = s3_db_factory(keys)\n\n from terracotta import get_driver\n\n driver = get_driver(dbpath)\n\n with driver.connect():\n assert driver.get_datasets() == {}\n\n # update database\n with driver.connect():\n driver.insert((\"some\", \"keys\"), \"some/path\")\n\n # wait for update to be reflected\n time.sleep(1)\n\n with driver.connect():\n assert driver.get_datasets", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "test_tile_size", + "got": "assert img_data.shape == (16, 32, 3)", + "got_raw": "<|fim_suffix|>\n assert img_data.shape == (16, 32, 3)\n\n assert np.all(img_data[:, :, 0] == 1)\n assert np.all(img_data[:, :, 1] == 2)\n assert np.all(img_data[:, :, 2] == 3)\n\n assert np.all(img_data[0, 0] == 1)\n assert np.all(img_data[0, 1] == 2)\n assert np.all(img_data[1, 0] == 1)\n assert np.all(img_data[1, 1] == 2)\n\n", + "exact_match": false, + "code_bleu": 0.08032276872815308, + "edit_similarity": 0.12, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "terracotta.cmaps.get_cmaps.AVAILABLE_CMAPS", + "got": "terracotta.cmaps.get_cmaps.AVAILABLE_CMAPS", + "got_raw": " terracotta.cmaps.get_cmaps.AVAILABLE_CMAPS\n assert \"bar\" in terracotta.cmaps.get_cmaps.AVAILABLE_CMAPS\n\n assert np.all(terracotta.cmaps.get_cmap(\"foo\") == custom_cmap_data)\n assert np.all(terracotta.cmaps.get_cmap(\"bar\") == custom_cmap_data)\n\ndef test_extra_cmap_invalid(monkeypatch, tmpdir):\n import importlib\n\n import terracotta.cmaps.get_cmaps\n\n custom_cmap_data = np.tile(np.arange(255, dtype=\"uint", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "4", + "got": "4", + "got_raw": "4\n assert len(cmap[0][\"rgba\"]) == 4\n\n assert cmap[0][\"value\"] == 0.0\n assert cmap[49][\"value\"] == 1.0\n\n assert cmap[0][\"rgba\"][0] == 255\n assert cmap[49][\"rgba\"][0] == 0\n\n assert cmap[0][\"rgba\"][1] == 0\n assert cmap[49][\"rgba\"][1] == 255\n\n assert cmap[0][\"rgba\"][2] == 0\n assert cmap[49][\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "1", + "got": "1", + "got_raw": "1\n assert subsegment.cause[\"exceptions\"][0][\"message\"] == \"foo\"\n assert subsegment.cause[\"exceptions\"][0][\"type\"] == \"NotImplementedError\"\n assert subsegment.cause[\"exceptions\"][0][\"stacktrace\"] == [\n \" File \\\"\\\", line 1, in \",\n \" File \\\"\\\", line 3, in run_test\",\n \" File \\\"\\\", line 10, in \",\n \" File \\\"\\\", line 12, in \",\n \" File", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "terracotta.exceptions.TileOutOfBoundsError)", + "got": "terracotta.exceptions.InvalidArgumentsError):", + "got_raw": "terracotta.exceptions.InvalidArgumentsError):\n singleband.singleband(keys, tile_xyz=(0, 0, 0))\n\n with pytest.raises(terracotta.exceptions.InvalidArgumentsError):\n singleband.singleband(keys, tile_xyz=(0, 0, 1))\n\n with pytest.raises(terracotta.exceptions.InvalidArgumentsError):\n singleband.singleband(keys, tile_xyz=(0, 1, 0))\n\n with pytest.raises(terracotta.exceptions.InvalidArgumentsError):\n singleband.singleband(keys, tile_xyz=(0, 1, 1))\n\n with pytest.raises(terracotta.exceptions", + "exact_match": false, + "code_bleu": 0.5410822690539396, + "edit_similarity": 0.7045454545454546, + "n_retrieved": 10 + }, + { + "repo": "DHI/terracotta", + "expected": "result)", + "got": "result)", + "got_raw": " result)\n\n\n@pytest.mark.parametrize(\"case\", INVALID_EXPR)\ndef test_invalid_expression(case):\n from terracotta.expressions import evaluate_expression\n\n expr, error = case\n\n with pytest.raises(ValueError) as exc_info:\n evaluate_expression(expr, OPERANDS)\n\n assert str(exc_info.value) == error\n\n\ndef test_invalid_expression_with_timeout():\n from terracotta.expressions import evaluate_expression\n\n expr = \"v1 * v2\"\n with pytest.raises(RuntimeError) as exc_info:\n evaluate_expression(expr, OPERANDS, timeout=0.001)\n\n assert str(exc_info.value) ==", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "1.0", + "got": "1.0", + "got_raw": "1.0\n\n@pytest.mark.parametrize(\"n_steps\", [3, 5])\ndef test_nstep_with_terminations(n_steps):\n buffer = create_buffer(n_steps=n_steps)\n fill_buffer(buffer, length=10, done_at=5, truncated_at=7) # done at 5, truncated at 7\n gamma = 0.99\n\n base_idx = 3\n batch = buffer._get_samples(np.array([base_idx]))\n actual = batch.rewards.item()\n # Discount factor for bootstrapping with target Q-Value\n np.testing.assert_allclose(batch", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "1.0", + "got": "1.0", + "got_raw": "1.0\n assert th.min(th.abs(squashed_actions)) >= -1.0\n\n # Check that the inverse is correct\n assert th.allclose(actions, bijector.inverse(squashed_actions))\n\n # Check that the log probability is correct\n log_prob = bijector.log_prob(actions)\n assert th.allclose(log_prob, th.tensor(-5.0))\n\n # Check that the inverse log probability is correct\n inv_log_prob = bijector.inverse_log_prob(squashed_actions)\n assert th.allclose(inv_log_prob, th.tensor(-5.0))\n\n # Check", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "0.8", + "got": "0.8", + "got_raw": "0.8\n\ndef test_rollout_success_rate_offpolicy_algo(tmp_path):\n \"\"\"\n Test if the rollout/success_rate information is correctly logged with off policy algorithms\n\n To do so, create a dummy environment that takes as argument dummy successes (i.e when an episode)\n is going to be successful or not.\n \"\"\"\n\n STATS_WINDOW_SIZE = 10\n\n # Add dummy successes with 0.3, 0.5 and 0.8 success_rate of length STATS_WINDOW_SIZE\n dummy_successes = [\n [True] * 3 + [False] * 7,\n [", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "True", + "got": "True", + "got_raw": " True\n\n # Check that the monitor file is created\n monitor_file = os.path.join(str(tmp_path), f\"stable_baselines-test-{uuid.uuid4()}.monitor.csv\")\n assert os.path.exists(monitor_file) is False\n _ = Monitor(env, monitor_file)\n assert os.path.exists(monitor_file) is True\n\n # Check that the monitor file is created\n monitor_file = os.path.join(str(tmp_path), f\"stable_baselines-test-{uuid.uuid4()}.monitor.csv\")\n assert os.path.exists(monitor_file) is False\n _ = Monitor(env, monitor", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "1", + "got": "0", + "got_raw": "0\n\n monitor_env1.reset(seed=0)\n monitor_env1.step(0)\n monitor_env1.step(0)\n monitor_env1.step(0)\n monitor_env1.step(0)\n monitor_env1.close()\n\n monitor_files = get_monitor_files(tmp_path)\n\n assert len(monitor_files) == 1\n\n monitor_file2 = os.path.join(tmp_path, f\"stable_baselines-test-{uuid.uuid4()}.monitor.csv\")\n monitor_env2 = Monitor(env1, monitor_file2)\n\n monitor_env2.reset(seed=0)\n monitor_env2.step(0)\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "1.0", + "got": "0.5", + "got_raw": "0.5\n else:\n assert np.min(env.actions) < -0.5\n else:\n # Check that the action are correctly scaled\n assert np.max(env.actions) > 1.0\n assert np.min(env.actions) < -1.0\n # Check that the action are correctly scaled\n assert np.max(env.actions) > 1.0\n assert np.min(env.actions) < -1.0\n # Check that the action are correctly scaled\n assert np.max(env.actions) > 1.0\n assert np.min(env.actions) < -1", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "None", + "got": "", + "got_raw": "<|fim_suffix|>\n # Test to change value for all the environments\n setattr_result = vec_env.set_attr(\"dummy1\", 42, indices=None)\n getattr_result = vec_env.get_attr(\"dummy1\")\n\n assert setattr_result is None\n assert getattr_result == [42] * N_ENVS\n\n # Test to change value for all the environments\n setattr_result = vec_env.set_attr(\"dummy1\", 42, indices=None)\n getattr_result = vec_env.get_attr(\"dummy1\")\n\n assert setattr_result is None\n assert getattr_result == [42] * N_ENVS\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "None", + "got": "None", + "got_raw": " None\n assert model.policy.action_space is not None\n assert model.policy.observation_space is not None\n assert model.policy.action_space.shape == (1,)\n assert model.policy.observation_space.shape == (1,)\n assert model.policy.action_space.dtype == np.float32\n assert model.policy.observation_space.dtype == np.float32\n assert model.policy.action_space.n == 2\n assert model.policy.observation_space.n == 2\n assert model.policy.action_space.low == -1\n assert model.policy.action_space.high == 1\n assert model.policy.observation_space.low == -", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "str(tmp_path)", + "got": "str(tmp_path)", + "got_raw": " str(tmp_path)\n logger = configure(folder=str(tmp_path), format_strings=[\"stdout\", \"log\"])\n assert logger.dir == str(tmp_path)\n logger = configure(folder=str(tmp_path), format_strings=[\"stdout\", \"log\", \"csv\"])\n assert logger.dir == str(tmp_path)\n logger = configure(folder=str(tmp_path), format_strings=[\"stdout\", \"log\", \"csv\", \"json\"])\n assert logger.dir == str(tmp_path)\n logger = configure(folder=str(tmp_path), format_strings=[\"stdout\", \"log\", \"csv\", \"json\", \"tensorboard\"])\n assert logger.dir == str", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "0", + "got": "0", + "got_raw": "0\n\n # Test that the model can be trained on CPU\n model = PPO(\"MlpPolicy\", \"Pendulum-v1\", n_steps=64, batch_size=63, verbose=1, device=\"cpu\")\n model.learn(64)\n\n loss = model.logger.name_to_value[\"train/loss\"]\n\n assert loss > 0\n\n\n# File: stable_baselines3/common/buffers.py\n def __init__(\n self,\n buffer_size: int,\n observation_space: gym.Space,\n action_space: gym.Space,\n device: th.device | str = \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "infos[0][\"episode\"][\"l\"]", + "got": "1000", + "got_raw": "1000\n ep_len, ep_reward = 0, 0\n monitor_env.close()\n\n # Check that the monitor file exists\n assert os.path.exists(monitor_file)\n\n # Check that the monitor file is not empty\n with open(monitor_file, \"r\") as f:\n assert f.read().strip() != \"\"\n\n # Check that the monitor file is not empty\n with open(monitor_file, \"r\") as f:\n assert f.read().strip() != \"\"\n\n # Check that the monitor file is not empty\n with open(monitor_file, \"r\")", + "exact_match": false, + "code_bleu": 0.05, + "edit_similarity": 0.07142857142857142, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "gamma", + "got": "0.989", + "got_raw": "0.989\n assert model.replay_buffer.batch_size == 3\n assert model.replay_buffer.n_envs == 2\n assert model.replay_buffer.n_steps == 3\n assert model.replay_buffer.max_size == int(2e4)\n assert model.replay_buffer.observation_space == env.observation_space\n assert model.replay_buffer.action_space == env.action_space\n assert model.replay_buffer.reward_space == env.reward_space\n assert model.replay_buffer.done_space == env.done_space\n assert model.replay_buffer.next_observation_space == env.observation_space\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "None", + "got": "None", + "got_raw": " None\n\n # Check that the model is still learning\n assert model._last_obs is not None\n\n # Check that the model is still learning\n assert model._last_obs is not None\n\n # Check that the model is still learning\n assert model._last_obs is not None\n\n # Check that the model is still learning\n assert model._last_obs is not None\n\n # Check that the model is still learning\n assert model._last_obs is not None\n\n # Check that the model is still learning\n assert model._last_obs is not None\n\n # Check that the model", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "0.3", + "got": "0.3", + "got_raw": "0.3\n\ndef test_rollout_success_rate_offpolicy_algo(tmp_path):\n \"\"\"\n Test if the rollout/success_rate information is correctly logged with off policy algorithms\n\n To do so, create a dummy environment that takes as argument dummy successes (i.e when an episode)\n is going to be successful or not.\n \"\"\"\n\n STATS_WINDOW_SIZE = 10\n\n # Add dummy successes with 0.3, 0.5 and 0.8 success_rate of length STATS_WINDOW_SIZE\n dummy_successes = [\n [True] * 3 + [False] * 7,\n [", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "model.policy.device.type", + "got": "model.policy.device.type", + "got_raw": " model.policy.device.type\n\n # Check that the policy is on the right device\n assert get_device(device).type == model.policy.device.type\n\n # Check that the policy is on the right device\n assert get_device(device).type == model.policy.device.type\n\n # Check that the policy is on the right device\n assert get_device(device).type == model.policy.device.type\n\n # Check that the policy is on the right device\n assert get_device(device).type == model.policy.device.type\n\n # Check that the policy is on the right device\n assert get_device(device).type == model.policy.device", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n check_env(env)\n\n # Return a tuple with more than 2 elements\n def wrong_reset(self, seed=None):\n return env.observation_space.sample(), {}, {}, {}\n\n env.reset = types.MethodType(wrong_reset, env)\n with pytest.raises(AssertionError):\n check_env(env)\n\n # Return a tuple with less than 2 elements\n def wrong_reset(self, seed=None):\n return env.observation_space.sample(), {}\n\n env.reset = types.MethodType(wrong_reset, env)\n with pytest.raises(AssertionError):\n check_env(env)\n\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "AssertionError, match=r\"use_sde=True\")", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n SAC(\"MlpPolicy\", \"Pendulum-v1\", sde_squash=False)\n\n with pytest.raises(NotImplementedError):\n SAC(\"MlpPolicy\", \"Pendulum-v1\", sde_squash=True)\n\n with pytest.raises(NotImplementedError):\n SAC(\"MlpPolicy\", \"Pendulum-v1\", sde_squash=True, use_sde=True)\n\n with pytest.raises(NotImplementedError):\n SAC(\"MlpPolicy\", \"Pendulum-v1\", sde_squash=True, use_sde=True, use_sde", + "exact_match": false, + "code_bleu": 0.19362900077353815, + "edit_similarity": 0.2711864406779661, + "n_retrieved": 10 + }, + { + "repo": "DLR-RM/stable-baselines3", + "expected": "callback.locals[\"new_obs\"]", + "got": "callback.locals[\"new_obs\"]", + "got_raw": " callback.locals[\"new_obs\"]\n assert checkpoint_callback.globals[\"new_obs\"] is callback.globals[\"new_obs\"]\n\n # Check that the child callback was called\n assert eval_callback.locals[\"new_obs\"] is callback.locals[\"new_obs\"]\n assert eval_callback.globals[\"new_obs\"] is callback.globals[\"new_obs\"]\n\n # Check that the child callback was called\n assert event_callback.locals[\"new_obs\"] is callback.locals[\"new_obs\"]\n assert event_callback.globals[\"new_obs\"] is callback.globals[\"new_obs\"]\n\n # Check that the child callback was called\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DebarghaG/proofofthought", + "expected": "any(\"Unknown optimization type\" in msg for msg in cm.output))", + "got": "1 in cm.output)", + "got_raw": "1 in cm.output)\n self.assertTrue(\"Unknown optimization type\" in cm.output[0])\n\n def test_optimize_minimize(self) -> None:\n \"\"\"Test that minimize objective works.\"\"\"\n config = {\n \"variables\": [{\"name\": \"y\", \"sort\": \"IntSort\"}],\n \"constraints\": [\"y >= 0\"],\n \"objectives\": [{\"expression\": \"y\", \"type\": \"minimize\"}],\n }\n self.optimizer.optimize(config, 10000)\n\n model = self.optimizer.optimizer.model()\n self.assertEqual(model[\"y\"].as_long(), 0)\n\n def", + "exact_match": false, + "code_bleu": 0.37343386687856367, + "edit_similarity": 0.3684210526315789, + "n_retrieved": 10 + }, + { + "repo": "DebarghaG/proofofthought", + "expected": "any(\"dictionary\" in msg for msg in cm.output))", + "got": "self.assertEqual(interpreter.config[\"constants\"], {\"a\": 1, \"b\": 2})", + "got_raw": "<|fim_suffix|>\n self.assertEqual(interpreter.config[\"constants\"], {\"a\": 1, \"b\": 2})\n\n finally:\n os.remove(temp_file)\n\n def test_invalid_sorts_section_structure(self) -> None:\n \"\"\"Test that invalid sorts structure is corrected.\"\"\"\n with tempfile.NamedTemporaryFile(mode=\"w\", suffix=\".json\", delete=False) as f:\n json.dump({\"sorts\": [\"not\", \"a\", \"list\"]}, f)\n temp_file = f.name\n\n try:\n with self.assertLogs(level=\"WARNING\") as cm:\n interpreter = Z3JSONInterpreter(temp_file)\n\n self", + "exact_match": false, + "code_bleu": 0.0690889519686715, + "edit_similarity": 0.1415929203539823, + "n_retrieved": 10 + }, + { + "repo": "DebarghaG/proofofthought", + "expected": "str(ctx.exception))", + "got": "str(ctx.exception))", + "got_raw": " str(ctx.exception))\n\n def test_parse_expression_with_valid_syntax(self) -> None:\n \"\"\"Test that valid expressions are parsed correctly.\"\"\"\n expr_str = \"x + y\"\n expr = self.parser.parse_expression(expr_str)\n self.assertIsInstance(expr, Function)\n self.assertEqual(expr.decl().name(), \"add\")\n self.assertEqual(expr.arg(0), self.constants[\"x\"])\n self.assertEqual(expr.arg(1), self.constants[\"y\"])\n\n def test_parse_expression_with_quantified_vars(self) -> None:\n \"\"\"Test that quantified variables are parsed correctly.\"\"\"\n expr_str = \"ForAll([x], x +", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DebarghaG/proofofthought", + "expected": "20000)", + "got": "20000)", + "got_raw": "20000)\n\n def test_load_and_validate_json(self) -> None:\n \"\"\"Test loading and validating JSON configuration.\"\"\"\n interpreter = Z3JSONInterpreter(\"tests/fixtures/simple_test.json\")\n config = interpreter.load_and_validate_json(\"tests/fixtures/simple_test.json\")\n self.assertEqual(config[\"sorts\"], [\"Bool\", \"Int\", \"Real\"])\n\n def test_load_and_validate_json_invalid(self) -> None:\n \"\"\"Test loading and validating JSON with invalid configuration.\"\"\"\n with self.assertRaises(ValueError):\n Z3JSONInterpreter(\"tests/fixtures/invalid_test.json\")\n\n def test_load_and_validate_json_missing(self) -> None", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DebarghaG/proofofthought", + "expected": "5)", + "got": "5)", + "got_raw": "5)\n\n def test_safe_eval_evaluates_complex_expression(self) -> None:\n \"\"\"Test that complex expressions evaluate correctly.\"\"\"\n expr = \"2 + 3 * (4 - 1) / 2\"\n result = ExpressionValidator.safe_eval(expr, {}, {})\n\n self.assertEqual(result, 5)\n\n def test_safe_eval_evaluates_expression_with_constants(self) -> None:\n \"\"\"Test that expressions with constants evaluate correctly.\"\"\"\n expr = \"2 + 3 * (4 - 1) / 2 + 5\"\n result = ExpressionValidator.safe_eval(expr, {\"5\": 5}, {})\n\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DebarghaG/proofofthought", + "expected": "str(ctx.exception))", + "got": "str(ctx.exception))", + "got_raw": " str(ctx.exception))\n\n def test_bug6_security_sandbox_imports(self) -> None:\n \"\"\"Bug #6: Security uses AST checking, not bytecode names.\"\"\"\n # Import statements should be blocked\n expr = \"import os\"\n tree = ast.parse(expr, mode=\"eval\")\n with self.assertRaises(ValueError) as ctx:\n ExpressionValidator.check_safe_ast(tree, expr)\n\n self.assertIn(\"Import\", str(ctx.exception))\n\n def test_bug7_security_sandbox_function_definitions(self) -> None:\n \"\"\"Bug #7: Security uses AST checking, not bytecode names.\"\"\"\n # Function definitions should be blocked\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"\"", + "got": "", + "got_raw": " # noqa: S101\n assert err == # noqa: S101\n\ndef test_propagation():\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger.add(sys.stderr, format=\"{message}\")\n logger", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "file.read()", + "got": "file.read()", + "got_raw": " file.read()\n\ndef test_formatting_with_context_manager():\n logger.remove()\n logger.add(\n lambda m: print(m, end=\"\"),\n filter=lambda record: record[\"level\"].name == \"ERROR\",\n level=\"ERROR\",\n )\n logger.add(\n lambda m: print(m, end=\"\"),\n filter=lambda record: record[\"level\"].name == \"WARNING\",\n level=\"WARNING\",\n )\n logger.add(\n lambda m: print(m, end=\"\"),\n filter=lambda record: record[\"level\"].name == \"INFO\",\n level=\"INFO\",\n )\n logger.add(\n lambda m:", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"\"", + "got": "", + "got_raw": " # no output\n assert lines == [\n \"It's fine\",\n \"Bye bye...\",\n \"An error has been caught in function 'test_caught_exception_queue_put', process 'MainThread' (1), thread 'MainThread' (1):\",\n \"Traceback (most recent call last):\",\n \" File \\\"test.py\\\", line 10, in \",\n \" logger.bind(broken=NotPicklable()).info('Bye bye...')\",\n \" File \\\"test.py\\\", line 6, in \",\n \" logger.info('It's fine again", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"\"", + "got": "", + "got_raw": " # nosec\n logger.info(\"Hello world\")\n\n assert file.read_text() == # nosec\n logger.info(\"Hello world\")\n\n assert file.read_text() == # nosec\n logger.info(\"Hello world\")\n\n assert file.read_text() == # nosec\n logger.info(\"Hello world\")\n\n assert file.read_text() == # nosec\n logger.info(\"Hello world\")\n\n assert file.read_text() == # nosec\n logger.info(\"Hello world\")\n\n assert file.read_text() == # nosec\n logger.info(\"Hello world\")\n\n assert file", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"\"", + "got": "0", + "got_raw": "0\n\n\ndef test_exception_raising_with_custom_exception(writer):\n logger.add(writer)\n\n @logger.catch(exception=ZeroDivisionError)\n def a():\n 1 / 0 # noqa: B018\n\n with pytest.raises(ZeroDivisionError):\n a()\n\n\n assert writer.read() == 0\n\n\ndef test_exception_raising_with_custom_exception_and_exclude(writer):\n logger.add(writer)\n\n @logger.catch(exception=ZeroDivisionError, exclude=ValueError)\n def a():\n 1 / 0 # noqa: B018\n\n with pytest.raises(ZeroDivisionError):\n a", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "OSError, match=\"^Rotation error$\")", + "got": "ZeroDivisionError):", + "got_raw": "ZeroDivisionError):\n logger.info(\"Hello\")\n logger.info(\"World\")\n 1 / 0\n\n\n assert capsys.readouterr().out == \"Hello\\nWorld\\n\"\n\n\ndef test_exception_during_rotation_caught(tmp_path, capsys):\n logger.add(\n tmp_path / \"test.log\",\n rotation=Mock(side_effect=[OSError(\"Rotation error\"), False]),\n format=\"{message}\",\n catch=True,\n )\n\n\n with pytest.raises(ZeroDivisionError):\n logger.info(\"Hello\")\n logger.info(\"World\")\n 1 / 0\n\n\n assert capsys.readouterr().out", + "exact_match": false, + "code_bleu": 0.2259005009024612, + "edit_similarity": 0.22641509433962265, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"2 3\\n\"", + "got": "2", + "got_raw": "2\n\n\n# File: loguru/_logger.py\n # If the record is not a dict, it is a string and we can't modify it\n if not isinstance(record, dict):\n return\n\n # If the record is a dict, we can modify it\n record.update(**extra)\n\n def bind(__self, **kwargs): # noqa: N805\n \"\"\"Bind attributes to the ``extra`` dict of each logged message record.\n\n This is used to add custom context to each logging call.\n\n Parameters\n ----------\n **kwargs\n Mapping between keys and values that will be", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"log.log\"", + "got": "assert validator(file.name)", + "got_raw": "<|fim_suffix|>\n assert validator(file.name)\n elif part == \"both\":\n\n assert validator(file.name)\n assert validator(file.parent.name)\n\n\ndef test_file_formatters_with_custom_format(tmp_path):\n file = tmp_path.joinpath(\"log.log\")\n\n logger.add(file, format=\"{time} - {level} - {message}\")\n logger.debug(\"Message\")\n\n assert file.read_text() == \"2018-12-09_11-23-55 - DEBUG - Message\\n\"\n\n\ndef test_file_formatters_with_custom_format_and_custom_level(tmp_path):\n file = tmp_path.joinpath(\"", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "ValueError, match=r\".* most likely a mistake\")", + "got": "", + "got_raw": "\n\n\n# File: docs/resources/recipes.rst\n.. |logging| replace:: :mod:`logging`\n.. _logging: https://docs.python.org/3/library/logging.html\n\n.. |logging.basicConfig| replace:: :func:`logging.basicConfig()`\n.. _logging.basicConfig: https://docs.python.org/3/library/logging.html#logging.basicConfig\n\n.. |logging.getLogger| replace:: :func:`logging.getLogger()`\n.. _logging.getLogger: https://docs.python.org/3/library/logging.html#logging.getLogger\n\n.. |logging.Logger| replace:: :class:`logging.Logger`\n.. _logging.Logger: https://docs.python.org/3", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"A\\nB\\n\"", + "got": "\"A\\nB\\n\"", + "got_raw": " \"A\\nB\\n\"\n\ndef test_add_sink_after_deepcopy(capsys):\n logger_ = copy.deepcopy(logger)\n\n logger_.add(print_, format=\"{message}\", catch=False)\n\n logger_.info(\"A\")\n logger.info(\"B\")\n\n out, err = capsys.readouterr()\n\n assert out == \"A\\nB\\n\"\n\ndef test_add_sink_before_deepcopy_with_exception(capsys):\n logger.add(print_, format=\"{message}\", catch=False)\n\n logger_ = copy.deepcopy(logger)\n\n logger_.info(\"A\")\n logger.exception(\"B\")\n\n out, err = capsys.readout", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"\"", + "got": "\"", + "got_raw": "<|fim_suffix|>\n<|fim_middle|>\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"1\\n\"", + "got": "2", + "got_raw": "2\n\n\ndef test_remove_interception_with_filter(writer):\n h = InterceptHandler()\n\n with make_logging_logger(\"foobar\", h) as logging_logger:\n logger.add(writer, format=\"{message}\")\n logging_logger.debug(\"1\")\n logging_logger.removeHandler(h)\n logging_logger.debug(\"2\")\n\n result = writer.read()\n\n assert result == 2\n\n\ndef test_remove_interception_with_filter_and_level(writer):\n h = InterceptHandler()\n\n with make_logging_logger(\"foobar\", h) as logging_logger:\n logger.add(writer, format=\"{message}\")\n logging_logger.debug(\"1\")\n logging_logger.removeHandler(h)\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"12 Test\\n\"", + "got": "10", + "got_raw": "10\n\n\ndef test_multiple_patches_with_same_name(writer):\n def patch_1(record):\n record[\"extra\"][\"a\"] = 5\n\n def patch_2(record):\n record[\"extra\"][\"a\"] += 1\n\n def patch_3(record):\n record[\"extra\"][\"a\"] *= 2\n\n logger.add(writer, format=\"{extra[a]} {message}\")\n logger.patch(patch_1).patch(patch_2).patch(patch_3).info(\"Test\")\n\n assert writer.read() == 10\n\n\ndef test_multiple_patches_with_same_name_and_different_order(writer):\n def patch_1(record", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"\"", + "got": "", + "got_raw": " # No error message\n\n\nclass StopSinkError:\n def __init__(self):\n self._i = 0\n\n def __call__(self, record):\n self._i += 1\n if self._i == 1:\n raise OSError(\"Stop error\")\n return True\n\n\n# File: loguru/_logger.py\n def __init__(self, core, exception, depth, record, lazy, colors, raw, capture, format, filter, **kwargs):\n self._core = core\n self._exception = exception\n self._depth = depth\n self._record = record", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"0 A\\n\"", + "got": "0", + "got_raw": "0\n\n\ndef test_bind_before_add(writer):\n logger_bound = logger.bind(a=0)\n logger_bound.debug(\"A\")\n logger.add(writer, format=\"{extra[a]} {message}\")\n assert writer.read() == 0\n\n\ndef test_bind_after_remove(writer):\n logger.add(writer, format=\"{extra[a]} {message}\")\n logger_bound = logger.bind(a=0)\n logger_bound.debug(\"A\")\n logger.remove()\n assert writer.read() == 0\n\n\ndef test_bind_before_remove(writer):\n logger_bound = logger.bind(a=0)\n logger_bound.debug(\"A\")\n logger.add(writer, format", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"\"", + "got": "0", + "got_raw": "0\n assert writer.read() == \"\"\n\n\n# File: loguru/_logger.py\n if not isinstance(name, str):\n raise TypeError(\"Invalid name, it should be a string, not: '%s'\" % type(name).__name__)\n\n if name == \"\":\n name = None\n\n if name is None:\n name = \"root\"\n\n if name not in self._core.levels:\n raise ValueError(\"Invalid name, no such level: '%s'\" % name)\n\n with self._core.lock:\n self._core.levels[name] = self._core.levels[name].no\n\n return self._core", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"\u5929\\n\"", + "got": "", + "got_raw": " # noqa: S105\n \"\u5929\\n\"\n\ndef test_file_sink_utf8_encoding_with_errors(tmp_path):\n file = tmp_path / \"test.log\"\n logger.add(file, encoding=\"utf8\", format=\"{message}\", errors=\"replace\", catch=False)\n logger.info(\"\u5929\")\n logger.remove()\n\n assert file.read_text(\"utf8\") == # noqa: S105\n \"????\\n\"\n\ndef test_file_sink_utf8_encoding_with_errors_and_no_catch(tmp_path):\n file = tmp_path / \"test.log\"\n logger.add(file, encoding=\"utf8\", format", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "dict(maj=\"ABC!DEF\")", + "got": "{\"maj\": \"random!\"}", + "got_raw": " {\"maj\": \"random!\"}\n\ndef test_parse_regex_pattern_with_caster(fileobj):\n caster = dict(maj=str.upper)\n result, *_ = list(logger.parse(fileobj, regex, caster=caster))\n\n assert result == {\"maj\": \"RANDOM!\"}\n\ndef test_parse_regex_pattern_with_caster_and_exception(fileobj):\n caster = dict(maj=str.upper)\n result, *_ = list(logger.parse(fileobj, regex, caster=caster, exception=True))\n\n assert result == {\"maj\": \"RANDOM!\"}\n\n assert result[\"exception\"][\"type\"] == \"re.error\"\n assert result[\"exception", + "exact_match": false, + "code_bleu": 0.19131240388845275, + "edit_similarity": 0.2702702702702703, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "\"1 2\\n\"", + "got": "1, \"The patcher function is not called\"", + "got_raw": "1, \"The patcher function is not called\"\n\n\ndef test_patch():\n logger.add(sys.stderr, format=\"{extra[a]} {extra[b]}\")\n logger.configure(patch=True)\n\n logger.debug(\"\")\n\n\n assert writer.read() == 1, \"The patcher function is not called\"\n\n\ndef test_patch_with_patcher():\n logger.add(sys.stderr, format=\"{extra[a]} {extra[b]}\")\n logger.configure(patch=True, patcher=lambda record: record[\"extra\"].update(a=1, b=2))\n\n logger.debug(\"\")\n\n\n assert writer.read() == 1, \"The patcher function is not", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.13043478260869565, + "n_retrieved": 10 + }, + { + "repo": "Delgan/loguru", + "expected": "error", + "got": "", + "got_raw": " # noqa: WPS432\n f\" File \\\"{__file__}\\\", line 10, in test_exception_formatting\\n\"\n f\" 1 / 0 # noqa: B018\\n\"\n f\"ZeroDivisionError: {error}\"\n\n\ndef test_exception_formatting_with_custom_format(tmp_path):\n file = tmp_path / \"test.log\"\n logger.add(FileHandler(str(file)), format=\"{exception}\")\n\n try:\n 1 / 0 # noqa: B018\n except ZeroDivisionError:\n logger.exception(\"Error\")\n\n result =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "TypeError, match=r\"id parameter must be convertible to int not \")", + "got": "pytest.raises(ValueError):", + "got_raw": " pytest.raises(ValueError):\n Object(snowflake)\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == snow", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "1", + "got": "1", + "got_raw": "1\n assert result[0].category == DeprecationWarning\n assert result[0].message.args[0] == \"test\"\n\n\n@mock.patch.object(utils, \"_root_module_path\", os.path.dirname(__file__))\n@pytest.mark.xfail(\n sys.version_info < (3, 12),\n raises=AssertionError,\n strict=True,\n reason=\"requires 3.12 functionality\",\n)\ndef test_deprecated_skip_internal() -> None:\n def func(n: int) -> None:\n if n == 0:\n utils.warn_deprecated(\"test\", skip_internal_frames=True)\n else", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "1024", + "got": "0", + "got_raw": "0\n assert Permissions(view_channel=False, read_messages=True).value == 0\n\n def test_init_permissions_keyword_arguments(self) -> None:\n assert Permissions(1, 2).value == 3\n assert Permissions(1, 2).value == 3\n assert Permissions(1, 2).value == 3\n\n def test_init_permissions_keyword_arguments_with_invalid_permissions(self) -> None:\n with pytest.raises(TypeError):\n Permissions(1, 2, 3)\n\n def test_init_permissions_keyword_arguments_with_invalid_permissions_type(self) -> None:\n with pytest.raises(TypeError):\n Permissions", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "\"a group\"", + "got": "\"group\"", + "got_raw": " \"group\"\n assert cog.group.subsub.qualified_name == \"group subsub\"\n\n def test_name(self) -> None:\n cog = self._create_cog()\n assert cog.a.name == \"a\"\n assert cog.sub.name == \"sub\"\n\n assert cog.group.name == \"group\"\n assert cog.group.subsub.name == \"subsub\"\n\n def test_name_localizations(self) -> None:\n cog = self._create_cog()\n assert cog.a.name_localizations == {\"en-US\": \"a\"}\n assert cog.sub.name_localizations == {\"en-US\": \"sub\"}\n\n assert cog", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.875, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "0", + "got": "0", + "got_raw": "0\n\n with pytest.raises(AttributeError):\n obj.id = 1\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises(AttributeError):\n del obj.id\n\n with pytest.raises", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "[]", + "got": "0", + "got_raw": "0\n\n def test_add_item(self) -> None:\n r = ActionRow()\n r.add_item(button1)\n\n assert list(r.children) == [button1]\n\n def test_add_item_with_label(self) -> None:\n r = ActionRow()\n r.add_item(label__text)\n\n assert list(r.children) == [label__text]\n\n def test_add_item_with_select(self) -> None:\n r = ActionRow()\n r.add_item(label__select)\n\n assert list(r.children) == [label__select]\n\n def test_add_item_with_separator(self) -> None:\n r = Action", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "frozenset([456, 789])", + "got": "456", + "got_raw": "456\n assert onboarding.enabled is True\n\n def test_onboarding_prompt(self, onboarding_prompt: OnboardingPrompt) -> None:\n assert onboarding_prompt.guild.id == 123\n assert onboarding_prompt.id == 0\n assert onboarding_prompt.title == \"test\"\n assert onboarding_prompt.options == []\n assert onboarding_prompt.single_select is True\n assert onboarding_prompt.required is True\n assert onboarding_prompt.in_onboarding is True\n assert onboarding_prompt.type == OnboardingPromptType.multiple_choice\n\n def test_onboarding_prompt_option(self, onboarding", + "exact_match": false, + "code_bleu": 0.07432544468767006, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "CustomCommand)", + "got": "", + "got_raw": " # pyright: ignore # noqa: PGH003\n expected_text=\"Command[None, (a: int, b: str), bool]\",\n )\n\n for gd in group_decorators:\n\n assert_type(gd(f), # pyright: ignore # noqa: PGH003\n expected_text=\"Group[None, (a: int, b: str), bool]\",\n )\n\n def _test_typing_cls_with_args(self) -> None:\n class CustomCommand(commands.Command): ...\n\n class CustomGroup(commands.Group): ...\n\n base = commands.GroupMixin[None]()\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "high", + "got": "0", + "got_raw": "0\n assert high > 0\n assert high - low == 1\n\n\ndef test_time_snowflake_high() -> None:\n dt = datetime.datetime(2021, 8, 29, 13, 50, 0, tzinfo=timezone.utc)\n high = utils.time_snowflake(dt, high=True)\n assert high > 0\n assert high - utils.time_snowflake(dt) == 1\n\n\ndef test_time_snowflake_low() -> None:\n dt = datetime.datetime(2021, 8, 29,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "cog.group", + "got": "cog.group", + "got_raw": " cog.group\n\n def test_subcommand(self) -> None:\n cog = self._create_cog()\n assert cog.a.sub.parent is cog.a\n assert cog.subsub.parent is cog.group\n\n def test_subcommand_group(self) -> None:\n cog = self._create_cog()\n assert cog.group.sub.parent is cog.group\n\n def test_subcommand_group_subcommand(self) -> None:\n cog = self._create_cog()\n assert cog.group.subsub.parent is cog.group\n\n def test_subcommand_group_subcommand_group(self) -> None:\n cog = self._create_cog()\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "210174600000", + "got": "881536165478499999", + "got_raw": "881536165478499999\n\n assert Object(snowflake).id == snowflake\n\n assert Object(snowflake).id == 881536165478499999\n\n assert Object(snowflake).id == Object(snowflake).id\n\n assert Object(snowflake).id == Object(881536165478499999).id\n\n assert Object(snowflake).id == Object(881536165", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "Permissions(32)", + "got": "32", + "got_raw": "32\n assert Cog().overwrite.default_member_permissions == 64\n assert Cog().overwrite_decorator_above.default_member_permissions == 64\n assert Cog().overwrite_decorator_below.default_member_permissions == 64\n\n def test_default_permissions(self, meta: DecoratorMeta) -> None:\n kwargs = {meta.attr_key: {\"default_member_permissions\": 32}}\n\n class Cog(commands.Cog, **kwargs):\n @meta.decorator()\n async def no_overwrite(self, _) -> None: ...\n\n @meta.decorator(default_member_permissions=64)\n async def overwrite", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "5", + "got": "5", + "got_raw": "5\n\n assert ins == TestFlags.four | TestFlags.one\n\n assert ins == TestFlags.four | TestFlags.one | TestFlags.two\n\n assert ins == TestFlags.four | TestFlags.one | TestFlags.two | TestFlags.three\n\n assert ins == TestFlags.four | TestFlags.one | TestFlags.two | TestFlags.three | TestFlags.five\n\n assert ins == TestFlags.four | TestFlags.one | TestFlags.two | TestFlags.three | TestFlags.five | TestFlags.six\n\n assert ins == TestFlags.four | TestFlags.one | TestFlags", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "exception)", + "got": "", + "got_raw": "\n\n\n# File: disnake/client.py\n# SPDX-License-Identifier: MIT\n\nfrom __future__ import annotations\n\nimport asyncio\nimport logging\nimport os\nimport sys\nimport time\nimport traceback\nimport warnings\nfrom collections import defaultdict\nfrom datetime import datetime, timedelta\nfrom enum import IntEnum\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Coroutine,\n Dict,\n Generic,\n List,\n Literal,\n Optional,\n Sequence,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n cast,\n overload,\n)\n\nimport aiohttp\nimport dis", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "DisnakeDev/disnake", + "expected": "value", + "got": "0x123456", + "got_raw": "0x123456\n\n assert Colour.from_rgb(*parts).red == 0x12\n assert Colour.from_rgb(*parts).green == 0x34\n assert Colour.from_rgb(*parts).blue == 0x56\n\n assert Colour.from_rgb(*parts).r == 0x12\n assert Colour.from_rgb(*parts).g == 0x34\n assert Colour.from_rgb(*parts).b == 0x56\n\n assert Colour.from_rgb(*parts).rgb == (0x12, 0x34, ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "expected_lines", + "got": "assert not errors", + "got_raw": "<|fim_suffix|>\n assert not errors\n\n assert formatted_lines == expected_lines\n\n def test_formats_fixture_with_tabs(self):\n \"\"\"Test that input.mk formats to expected.mk with tabs.\"\"\"\n config = Config(\n formatter=FormatterConfig(\n auto_insert_phony_declarations=False,\n ensure_final_newline=False,\n group_phony_declarations=False,\n phony_at_top=False,\n )\n )\n formatter = MakefileFormatter(config)\n\n # Load input fixture\n input_lines = [\n \"# Sample Makefile\",\n \"VAR:=value\",\n \"VAR2= another_value\",\n \"\",\n \".PHONY", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.06451612903225806, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "0", + "got": "0", + "got_raw": "0\n assert result.stdout.strip() == get_bash_completion(\"mbake\").strip()\n\n # Test zsh completions\n result = runner.invoke(app, [\"completions\", \"zsh\"])\n\n assert result.exit_code == 0\n assert result.stdout.strip() == get_zsh_completion(\"mbake\").strip()\n\n # Test fish completions\n result = runner.invoke(app, [\"completions\", \"fish\"])\n\n assert result.exit_code == 0\n assert result.stdout.strip() == get_fish_completion(\"mbake\").strip()\n\ndef test_completions_command_file(tmp_path):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "2", + "got": "1", + "got_raw": "1\n assert \"File not found: nonexistent.mk\" in result.stdout\n\n def test_validate_valid_file(self, runner):\n \"\"\"Test validation of a valid Makefile.\"\"\"\n with tempfile.NamedTemporaryFile(mode=\"w\", delete=False) as temp_file:\n temp_file.write(\"all:\\n\\t@echo 'Hello, World!'\")\n temp_file_path = Path(temp_file.name)\n\n result = runner.invoke(app, [\"validate\", temp_file_path])\n\n assert result.exit_code == 0\n assert \"\u2713\" in result.stdout\n\n def test_validate_invalid_file(self, runner):\n \"\"\"Test validation of an", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "[\"VAR:=value\", \"VAR2=value\"]", + "got": "[\"VAR = value\", \"VAR2 = value\"]", + "got_raw": " [\"VAR = value\", \"VAR2 = value\"]\n\n def test_does_not_change_assignment_spacing(self):\n rule = AssignmentSpacingRule()\n config = {\"space_around_assignment\": True}\n lines = [\"VAR := value\", \"VAR2 = value\"]\n\n result = rule.format(lines, config)\n\n assert not result.changed\n\n assert result.lines == [\"VAR := value\", \"VAR2 = value\"]\n\n def test_does_not_change_assignment_spacing_with_invalid_assignment(self):\n rule = AssignmentSpacingRule()\n config = {\"space_around_assignment\": True}\n lines = [\"VAR := value\", \"VAR2 =", + "exact_match": false, + "code_bleu": 0.32466791547509893, + "edit_similarity": 0.9152542372881356, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "fish_script", + "got": "fish_script", + "got_raw": " fish_script\n assert \"Read from stdin and write to stdout\" in fish_script\n\ndef test_bake_command_in_completions():\n \"\"\"Test that 'bake' command is included in all shell completion scripts.\"\"\"\n # Test bash completion script\n bash_script = get_completion_script(ShellType.BASH)\n assert \"bake\" in bash_script\n\n # Test zsh completion script\n zsh_script = get_completion_script(ShellType.ZSH)\n assert \"bake\" in zsh_script\n\n # Test fish completion script\n fish_script = get_completion_script(ShellType.FISH)\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "None", + "got": "assert result.changed", + "got_raw": "<|fim_suffix|>\n assert result.changed\n # Should insert .PHONY declarations\n phony_line = None\n for line in result.lines:\n if line.startswith(\".PHONY:\"):\n phony_line = line\n break\n\n assert phony_line is not None\n assert phony_line == \".PHONY: clean install\"\n\n def test_ungroups_phony_declarations(self):\n rule = PhonyRule()\n config = {\n \"group_phony_declarations\": False,\n \"phony_at_top\": True,\n \"auto_insert_phony_declarations\": True,\n }\n lines =", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.08, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "1", + "got": "1", + "got_raw": "1\n assert \"Error: Cannot specify files when using --stdin\" in result.output\n\n def test_format_stdin(self, runner, test_config):\n \"\"\"Test formatting stdin.\"\"\"\n with patch(\"mbake.cli.Config.load_or_default\", return_value=test_config):\n result = runner.invoke(app, [\"format\", \"--stdin\", \"-\"])\n\n assert result.exit_code == 0\n assert \"\u2713\" in result.output\n\n def test_format_stdin_with_check(self, runner, test_config):\n \"\"\"Test formatting stdin with --check.\"\"\"\n with patch(\"mbake.cli.Config.load_or_default\", return_value=test_config", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "\"LONGER_NAME = value\"", + "got": "\"LONGER_NAME = value\"", + "got_raw": " \"LONGER_NAME = value\"\n\n def test_empty_value_alignment_with_comments(self):\n \"\"\"Test alignment with empty values and comments.\"\"\"\n rule = AssignmentAlignmentRule()\n config = {\"align_variable_assignments\": True, \"align_across_comments\": True}\n\n input_lines = [\n \"CC = gcc\",\n \"# This is a comment\",\n \"EMPTY =\",\n \"LONGER_NAME = value\",\n ]\n\n result = rule.format(input_lines, config)\n\n assert result.changed\n assert result.lines[0] == \"CC = gcc\"\n assert result.lines[1] == \"# This is a comment", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "1", + "got": "2", + "got_raw": "2\n assert phony_lines[0].strip() == \".PHONY: clean install\"\n assert phony_lines[1].strip() == \".PHONY: all\"\n\n def test_phony_grouping_disabled(self):\n \"\"\"Test grouping disabled.\"\"\"\n rule = PhonyRule()\n config = {\n \"group_phony_declarations\": False,\n \"phony_at_top\": True,\n \"auto_insert_phony_declarations\": True,\n }\n\n input_lines = [\n \"# Comment\",\n \".PHONY: clean\",\n \"all: target\",\n \"\\techo 'building'\",\n \".PHONY", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "EbodShojaei/bake", + "expected": "formatted_lines", + "got": "", + "got_raw": " # Check that the original line is unchanged\n assert \"VERY_LONG = value\" in # Check that the original line is unchanged\n\n def test_alignment_enabled_by_default(self):\n \"\"\"Test that alignment is enabled when align_variable_assignments=True.\"\"\"\n config = create_alignment_config(align_assignments=True)\n formatter = MakefileFormatter(config)\n\n input_lines = [\n \"CC = gcc\",\n \"VERY_LONG = value\",\n ]\n\n formatted_lines, errors, warnings = formatter.format_lines(input_lines)\n\n # Should change when enabled\n\n assert \"CC = gcc\" in # Check that the original line is", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "FinanceData/FinanceDataReader", + "expected": "200", + "got": "10000", + "got_raw": "10000\n\n df = fdr.DataReader('KPI200', '2020-01-02') # KOSPI200 \uc9c0\uc218: 2020-01-02 ~ \ud604\uc7ac\n assert len(df) > 100\n\n assert df.loc['2020-01-02', 'Close'] > 10000\n\n df = fdr.DataReader('KOSPI', '2020-01-02', '2020-01-0", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "FinanceData/FinanceDataReader", + "expected": "0", + "got": "0", + "got_raw": "0\n assert df.index[0] == pd.Timestamp('2023-01-01 09:30:00')\n assert df.index[-1] == pd.Timestamp('2023-01-31 16:00:00')\n assert df['Close'].iloc[-1] == 18000.0\n\n # Multiple stocks\n df = fdr.DataReader('005930,000660,000270,035720,105", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "FinanceData/FinanceDataReader", + "expected": "90", + "got": "900", + "got_raw": "900\n\n df = fdr.StockListing('KOSDAQ') # 1,600+ \uc885\ubaa9 - \ucf54\uc2a4\ub2e5 (\uc8fc\uc2dd, \ubd80\ub3d9\uc0b0\ud22c\uc790\ud68c\uc0ac, \uc120\ubc15\ud22c\uc790\ud68c\uc0ac, \uc8fc\uc2dd\uc608\ud0c1\uc99d\uad8c)\n\n assert len(df) > 1600\n\n df = fdr.StockListing('KONEX') # 120+ \uc885\ubaa9 - \ucf54\ub125\uc2a4 (\uc8fc\uc2dd, \ubd80\ub3d9\uc0b0\ud22c\uc790\ud68c\uc0ac, \uc120\ubc15\ud22c\uc790\ud68c\uc0ac, \uc8fc\uc2dd\uc608\ud0c1\uc99d\uad8c)\n\n assert len(df) > 120", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "Forethought-Technologies/AutoChain", + "expected": "\"User: user query\\nAssistant: response to user\\n\"", + "got": "memory = LongTermMemory(", + "got_raw": "<|fim_suffix|>\n memory = LongTermMemory(\n long_term_memory=ChromaDBSearch(docs=[], description=\"long term memory\")\n )\n memory.save_conversation(\"user query\", MessageType.UserMessage)\n memory.save_conversation(\"response to user\", MessageType.AIMessage)\n\n conversation = memory.load_conversation().format_message()\n\n assert conversation == \"user query\\nresponse to user\\n\"\n\n memory.save_conversation(\"user query\", MessageType.UserMessage)\n memory.save_conversation(\"response to user\", MessageType.AIMessage)\n\n conversation = memory.load_conversation().format_message()\n\n assert conversation == \"user query\\nresponse", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.2191780821917808, + "n_retrieved": 10 + }, + { + "repo": "Forethought-Technologies/AutoChain", + "expected": "{ \"name\": \"sample_tool_func_with_type\", \"description\": \"This is just a dummy tool with typing info\", \"parameters\": { \"type\": \"object\", \"properties\": {\"k\": {\"type\": \"int\"}}, \"required\": [\"k\"], }, }", + "got": "{", + "got_raw": " {\n \"name\": \"sample_tool_func_with_type\",\n \"description\": \"This is just a \" \"dummy tool with typing info\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\"k\": {\"type\": \"integer\"}},\n \"required\": [\"k\"],\n },\n }\n\n with_type_tool_default = Tool(\n func=sample_tool_func_with_type_default,\n description=\"\"\"This is just a dummy tool with typing info\"\"\",\n )\n\n with_type_tool_default_dict = convert_tool_to_dict(with_type_tool_default)\n\n assert with_type_tool_default_dict == {\n \"name\":", + "exact_match": false, + "code_bleu": 0.016070366418955692, + "edit_similarity": 0.01015228426395939, + "n_retrieved": 10 + }, + { + "repo": "Forethought-Technologies/AutoChain", + "expected": "\"\"", + "got": "\"User: \\nAssistant: \\n\"", + "got_raw": " \"User: \\nAssistant: \\n\"\n\ndef test_buffer_kv_memory():\n memory = LongTermMemory(\n long_term_memory=ChromaDBSearch(docs=[], description=\"long term memory\")\n )\n memory.save_memory(\"key\", \"value\")\n memory.save_memory(\"key2\", \"value2\")\n\n assert memory.load_memory(\"key\") == \"value\"\n assert memory.load_memory(\"key2\") == \"value2\"\n\n memory.clear()\n assert memory.load_memory(\"key\") == None\n assert memory.load_memory(\"key2\") == None\n\ndef test_buffer_kv_memory_with_function():\n memory =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.16, + "n_retrieved": 10 + }, + { + "repo": "Forethought-Technologies/AutoChain", + "expected": "text", + "got": "text", + "got_raw": " text\n assert len(response.embeddings[0]) == 3\n assert response.embeddings[0][0] == -0.025949304923415184\n assert response.embeddings[0][1] == -0.012664584442973137\n assert response.embeddings[0][2] == 0.017791053280234337\n\n\n# File: autochain/models/chat_openai.py\n \"\"\"Model will", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Forethought-Technologies/AutoChain", + "expected": "\"\"", + "got": "\"\"", + "got_raw": " \"\"\n\n\n# File: autochain/chain/base_chain.py\nfrom typing import Any, Dict, List, Optional\n\nfrom autochain.agent.base_agent import BaseAgent\nfrom autochain.agent.message import ChatMessageHistory, MessageType\nfrom autochain.agent.structs import AgentAction, AgentFinish\nfrom autochain.chain import constants\nfrom autochain.memory.base import BaseMemory\nfrom autochain.tools.base import Tool\nfrom pydantic import BaseModel\n\nlogger = logging.getLogger(__name__)\n\n\nclass BaseChain(BaseModel, ABC):\n \"\"\"\n Base interface that all chains should implement.\n Chain will standardize inputs and outputs, the main entry", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "caplog.text", + "got": "caplog.text", + "got_raw": " caplog.text\n\ndef test_gitignore_add(tmp_path):\n # GIVEN a repository with a gitignore file\n repo = Repository.create(tmp_path)\n repo.create_commit()\n with open(tmp_path / \".gitignore\", \"w\") as f:\n f.write(\"node_modules/\")\n (tmp_path / \".gitignore\").chmod(0o644)\n\n # WHEN adding a path to the gitignore\n with cd(str(repo.path)):\n gitignore(Path(\"*.pyc\"))\n\n # THEN the path is added to the gitignore\n assert Path(\"*.pyc\") in repo.gitignore\n\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "target", + "got": "GIVEN a path inside bad.tar", + "got_raw": "<|fim_suffix|>\n GIVEN a path inside bad.tar\n WHEN asked for its symlink target\n THEN it returns the target if it's a symlink, or None if it's a regular file\n \"\"\"\n with tarfile.open(BAD_TAR_PATH) as tar:\n info = tar.getmember(name)\n\n assert _zip_get_symlink_target(tar, info) == target\n\n\ndef test_check_zip_content():\n \"\"\"\n GIVEN a bad.zip archive\n WHEN checked for content\n THEN an UnsafeArchive is raised\n \"\"\"\n with pytest.raises(UnsafeArchive):\n check_archive_content(BAD_ZIP_PATH)\n\n\n", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "instance", + "got": "\"\"\"", + "got_raw": "<|fim_suffix|>\n \"\"\"\n GIVEN a global user config\n AND a local user config\n WHEN running the set command to set the instance\n THEN the instance is stored in the global user config\n AND the global user config contains only the instance\n \"\"\"\n instance = \"https://example.com\"\n\n with cd(str(tmp_path)):\n # Create a local user config file, its content should not end up in the\n # global user config file\n config = Config()\n config.user_config.debug = True\n config.save()\n\n exit_code, output = self.run_cmd(cli_fs_runner, instance, param", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "None", + "got": "None", + "got_raw": " None\n\n def test_token_expiring(self):\n \"\"\"\n GIVEN an auth config file with a token expiring\n WHEN loading the AuthConfig\n THEN it works\n \"\"\"\n raw_config = deepcopy(TEST_AUTH_CONFIG)\n raw_config[\"instances\"][0][\"accounts\"][0][\"expire_at\"] = datetime.now(timezone.utc) + datetime.timedelta(days=1)\n write_yaml(get_auth_config_filepath(), raw_config)\n\n config = Config()\n\n\n assert config.auth_config.instances[0].account.expire_at is not None\n\n def test_token_expiring_with_default_token_lifetime(self):\n \"\"\"\n GIVEN an auth", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "None", + "got": "None", + "got_raw": " None\n assert result[\"tag_name\"] == \"v2.0.0\"\n\n def test_check_github_release_update_failure(self):\n \"\"\"Test checking GitHub release returns latest release.\"\"\"\n from ggshield.cmd.plugin.update import _check_github_release_update\n\n mock_response = mock.MagicMock()\n mock_response.status_code = 404\n\n with mock.patch(\"requests.get\", return_value=mock_response):\n result = _check_github_release_update(\"owner/repo\")\n\n\n assert result is None\n\n def test_find_wheel_asset_success(self):\n \"\"\"Test finding a wheel asset in a GitHub release.\"\"\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "[]", + "got": "0", + "got_raw": "0\n\n\ndef test_cache_catches_one_secret(client, isolated_fs):\n \"\"\"\n GIVEN a cache of last found secrets same as config ignored_matches\n WHEN I run a scan (therefore finding one secret)\n THEN config matches is unchanged and cache is updated\n \"\"\"\n commit = Commit.from_patch(_MULTIPLE_SECRETS_PATCH)\n config = Config()\n config.user_config.secret.ignored_matches = FOUND_SECRETS\n cache = Cache()\n cache.last_found_secrets = FOUND_SECRETS\n\n with my_vcr.use_cassette(\"multiple_secrets\"):\n scanner = SecretScanner(\n client", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "result.output", + "got": "result.output", + "got_raw": " result.output\n\n @patch(\"ggshield.cmd.secret.scan.docker.docker_save_to_tmp\")\n @patch(\"ggshield.cmd.secret.scan.docker.docker_scan_archive\")\n def test_docker_scan_failed_to_scan(\n self, scan_mock: Mock, save_mock: Mock, cli_fs_runner: click.testing.CliRunner\n ):\n save_mock.return_value = DOCKER_EXAMPLE_PATH\n scan_mock.side_effect = click.UsageError(\n 'Image \"ggshield-non-existant\" not found'\n )\n result = cli_fs_runner.invoke(\n cli,\n [\"-v\", \"secret\", \"scan\", \"docker", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "set()", + "got": "set()", + "got_raw": " set()\n\n\ndef test_get_gitignored_files_with_gitignore(tmp_path):\n \"\"\"\n GIVEN a file, that is in the .gitignore\n WHEN listing its content\n THEN an empty set is returned\n \"\"\"\n Repository.create(tmp_path)\n file_full_path = tmp_path / \"file.txt\"\n write_text(filename=str(tmp_path / \".gitignore\"), content=\"file.txt\")\n write_text(filename=str(file_full_path), content=\"\")\n\n file_paths = list_files(\n paths=[file_full_path],\n exclusion_regexes=set(),\n list_files_mode=ListFilesMode.ALL_BUT_GITIGNORED,\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "[]", + "got": "t_file = tmp_path / \"t\"", + "got_raw": "<|fim_suffix|>t_file = tmp_path / \"t\"\n test_file.touch()\n repo.add(test_file)\n repo.create_commit()\n\n info = CommitInformation.from_staged(tmp_path)\n\n assert info.paths == [test_file]\n\n\ndef test_from_staged_with_multiple_changes(tmp_path):\n \"\"\"\n GIVEN a repository with multiple changes\n WHEN calling CommitInformation.from_staged()\n THEN it returns a CommitInformation instance with the correct paths\n \"\"\"\n repo = Repository.create(tmp_path)\n test_file1 = tmp_path / \"t1\"\n test_file1.touch()\n test_file2 = tmp_path / \"t2", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "2", + "got": "2", + "got_raw": "2\n assert mock_downloader.download_and_install.call_args_list[0][0][0] == mock_download_info_1\n assert mock_downloader.download_and_install.call_args_list[1][0][0] == mock_download_info_2\n\n assert mock_config.save.call_count == 1\n assert mock_loader.load_enabled_plugins.call_count == 1\n assert mock_loader.load_enabled_plugins.call_args_list[0][0][0] == mock_config\n\n assert mock_plugin_api_client.get_available_plugins.call_count == 1\n assert mock_plugin_api_client.get_available_plugins.call_args_list[0][0", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "None", + "got": "assert result.returncode == expected_code", + "got_raw": "<|fim_suffix|>\n assert result.returncode == expected_code\n assert result.stdout == expected_stdout\n assert result.stderr == expected_stderr\n assert result.stdout == expected_stdout\n assert result.stderr == expected_stderr\n assert result.stdout == expected_stdout\n assert result.stderr == expected_stderr\n assert result.stdout == expected_stdout\n assert result.stderr == expected_stderr\n assert result.stdout == expected_stdout\n assert result.stderr == expected_stderr\n assert result.stdout == expected_stdout\n assert result.stderr == expected_stderr\n assert result.stdout == expected_stdout\n assert result.stderr == expected_stderr\n assert result.stdout ==", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.044444444444444446, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "result.output", + "got": "result.output", + "got_raw": " result.output\n assert \"API URL\" in result.output\n assert \"App version\" in result.output\n assert \"Secrets engine version\" in result.output\n assert \"Instance source\" in result.output\n assert \"API key source\" in result.output\n\n\n@my_vcr.use_cassette\ndef test_hmsl_api_status_with_no_api_key(cli_fs_runner: CliRunner, tmp_path: Path) -> None:\n \"\"\"\n GIVEN our cli\n WHEN running the hmsl api-status command\n THEN we should have a valid response\n \"\"\"\n result = cli_fs_runner.invoke(cli", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "\"1.1\"", + "got": "1.1", + "got_raw": "1.1\n assert not request_get_mock.called\n\n # Check that the second call does not make any network call\n latest_version = check_for_updates()\n assert latest_version == 1.1\n assert not request_get_mock.called\n\n\n@patch(\"requests.get\")\ndef test_check_for_updates_fails(request_get_mock: Mock, fs: FakeFilesystem):\n \"\"\"\n GIVEN a first check_for_updates() call\n WHEN calling check_for_updates() a second time\n THEN no network calls are made and no update is reported\n \"\"\"\n request_get_mock.return_value.status_code = 404", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "captured.err", + "got": "captured.err", + "got_raw": " captured.err\n\n else:\n generate_repo_with_merge_commit(\n tmp_path,\n with_conflict=with_conflict,\n secret_location=secret_location,\n scan_all_merge_files=scan_all_merge_files,\n )\n\n # AND the error message does not contain the Gitlab Token\n captured = capsys.readouterr()\n\n assert \"GitLab Token\" not in captured.err\n\n\n# File: ggshield/core/scan/commit.py\nfrom pathlib import Path\nfrom typing import Any\n\nimport click\nfrom click import UsageError\n\nfrom ggshield.cmd.secret.scan.secret_scan_common_options import (\n add_secret", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "result.stdout", + "got": "result.output", + "got_raw": " result.output\n\n@patch(\"ggshield.cmd.secret.scan.ci.check_git_dir\")\ndef test_ci_cmd_does_not_work_outside_ci_with_ci_env(monkeypatch, cli_fs_runner: click.testing.CliRunner):\n # GIVEN a CI env\n monkeypatch.setenv(\"CI\", \"true\")\n # WHEN `secret scan ci` is called\n result = cli_fs_runner.invoke(cli, [\"secret\", \"scan\", \"ci\"])\n\n # THEN it fails\n assert_invoke_exited_with(result, ExitCode.USAGE_ERROR)\n\n # And the error message explains why\n\n assert \"only be used in a CI", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.7692307692307693, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "message", + "got": "message", + "got_raw": " message\n\ndef test_encrypt_decrypt_with_prefix(key):\n message = \"Hello, world!\"\n encrypted = encrypt(message, key, prefix=\"my_prefix\")\n decrypted = decrypt(encrypted, key, prefix=\"my_prefix\")\n\n assert decrypted == message\n\ndef test_encrypt_decrypt_with_prefix_and_full_hashes(key):\n message = \"Hello, world!\"\n encrypted = encrypt(message, key, prefix=\"my_prefix\", full_hashes=True)\n decrypted = decrypt(encrypted, key, prefix=\"my_prefix\", full_hashes=True)\n\n assert decrypted == message\n\ndef test_encrypt_decrypt_with_prefix_and_full_hashes_and_censored(key):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "result.stdout", + "got": "assert \"Token in comment\" in result.stdout", + "got_raw": "<|fim_suffix|>\n assert \"Token in comment\" in result.stdout\n assert \"ggshield honeytokens\" in result.stdout\n assert \"ggshield honeytokens create\" in result.stdout\n assert \"ggshield honeytokens create-with-context\" in result.stdout\n assert \"ggshield honeytokens delete\" in result.stdout\n assert \"ggshield honeytokens list\" in result.stdout\n assert \"ggshield honeytokens show\" in result.stdout\n assert \"ggshield honeytokens update\" in result.stdout\n assert \"ggshield honeytokens update-with-context\" in result.stdout\n assert \"ggshield honeytokens update", + "exact_match": false, + "code_bleu": 0.4111336169005197, + "edit_similarity": 0.4727272727272727, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "result)", + "got": "0, result)", + "got_raw": "0, result)\n assert \"ggshield\" in result.stdout\n assert \"ggshield\" in result.stderr\n assert \"ggshield\" in result.output\n assert \"ggshield\" in result.error\n assert \"ggshield\" in result.exception\n assert \"ggshield\" in result.exception_message\n assert \"ggshield\" in result.exception_traceback\n assert \"ggshield\" in result.exception_traceback_message\n assert \"ggshield\" in result.exception_traceback_traceback\n assert \"ggshield\" in result.exception_traceback_traceback_message\n assert \"ggshield\" in result.exception", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.8235294117647058, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "result.output", + "got": "result.stdout", + "got_raw": " result.stdout\n assert \"Scan completed\" in result.stdout\n\n @patch(\"ggshield.cmd.secret.scan.prereceive.scan_commit_range\")\n def test_stdin_input_with_breakglass(\n self,\n scan_commit_range_mock: Mock,\n tmp_path,\n cli_fs_runner: CliRunner,\n ):\n \"\"\"\n GIVEN 3 commits through stdin input\n WHEN the command is run with breakglass\n THEN it should pass onto scan and return 0\n \"\"\"\n scan_commit_range_mock.return_value = ExitCode.SUCCESS\n\n repo = create_pre_receive_repo(tmp_path)\n old_sha = repo.get_top", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.7692307692307693, + "n_retrieved": 10 + }, + { + "repo": "GitGuardian/ggshield", + "expected": "valid", + "got": "_validate_filepath(filepath, exclusion_regexes) == valid", + "got_raw": " _validate_filepath(filepath, exclusion_regexes) == valid\n\n @pytest.mark.parametrize(\n \"filepath, exclusion_regexes, valid\",\n (\n [\"/usr/bin/secret.py\", set(), False],\n [\"usr/bin/secret.py\", set(), False],\n [\"/my/file/secret.py\", set(), True],\n [\"/my/file/usr/bin/secret.py\", set(), True],\n [\"/usr/share/nginx/secret.py\", set(), True],\n [\"/usr/src/app/secret.py\", set(), True],\n [\"/gems/secret.py\", set(), True],\n [\"/npm-b", + "exact_match": false, + "code_bleu": 0.14113991930789777, + "edit_similarity": 0.16393442622950818, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "[1, 2, 3]", + "got": "1", + "got_raw": "1\n assert cfg[\"e\"][1] == 2\n assert cfg[\"e\"][2] == 3\n\n assert cfg[\"f\"][\"a\"] == \"b\"\n assert cfg[\"f\"][\"c\"] == \"d\"\n\ndef test_config_dict_result_is_immutable(conf_dict):\n cfg = conf_dict()\n with pytest.raises(TypeError):\n cfg[\"a\"] = 2\n\ndef test_config_dict_result_is_json_serializable(conf_dict):\n cfg = conf_dict()\n assert opt.json.dumps(cfg) == '{\"a\": 1, \"b\": 2.0, \"c\": true, \"", + "exact_match": false, + "code_bleu": 0.08494336535733721, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "obs2", + "got": "obs2", + "got_raw": " obs2\n assert obs != 1\n assert obs != \"foo\"\n assert obs != \"bar\"\n assert obs != \"baz\"\n assert obs != \"qux\"\n assert obs != \"quux\"\n assert obs != \"quuz\"\n assert obs != \"corge\"\n assert obs != \"grault\"\n assert obs != \"garply\"\n assert obs != \"waldo\"\n assert obs != \"fred\"\n assert obs != \"plugh\"\n assert obs != \"xyzzy\"\n assert obs != \"thud\"\n\ndef test_fs_observer_save_json(tmpdir):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "{}", + "got": "1", + "got_raw": "1\n assert queue_observer._covered_observer.method_calls[2][0] == \"log_metrics\"\n assert queue_observer._covered_observer.method_calls[2][1] == (\n second[0],\n second[1],\n \"info\",\n )\n\n assert queue_observer._covered_observer.method_calls[2][2] == 2\n\ndef test_heartbeat_event(queue_observer):\n queue_observer.started_event()\n queue_observer.heartbeat_event(\"info\")\n queue_observer.join()\n assert queue_observer._covered_observer.method_calls[1][0] == \"heartbeat_event\"\n assert queue_observer._covered_observer.method_calls[", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "(2, 25)", + "got": "2", + "got_raw": "2\n assert ex.run(named_configs=[\"ncfg\", \"somemod.nsubcfg\"]).result == 25\n\n assert ex.run(named_configs=[\"ncfg\", \"somemod.nsubcfg\", \"somemod.nsubcfg\"]).result == 25\n\n assert ex.run(named_configs=[\"ncfg\", \"somemod.nsubcfg\", \"somemod.nsubcfg\", \"somemod.nsubcfg\"]).result == 25\n\n assert ex.run(named_configs=[\"ncfg\", \"somemod.nsubcfg\", \"somemod.nsubcfg\", \"somemod", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "[1, 2]", + "got": "[1, 2]", + "got_raw": " [1, 2]\n assert kwargs == {\"c\": 3, \"a\": 6, \"b\": 6}\n\ndef test_construct_arguments_fills_in_options():\n s = Signature(bariza)\n args, kwargs = s.construct_arguments([1, 2], {\"c\": 3}, {\"a\": 6, \"b\": 6, \"c\": 6})\n\n assert args == [1, 2]\n assert kwargs == {\"c\": 3, \"a\": 6, \"b\": 6}\n\ndef test_construct_arguments_fills_in_options_with_defaults():\n s", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "\"t\"", + "got": "1", + "got_raw": "1\n assert cfg[\"f\"][\"d\"] == 2\n assert cfg[\"f\"][\"dd\"] == 3\n assert cfg[\"f\"][\"e\"] == 4\n assert cfg[\"f\"][\"composit1\"] == 5\n assert cfg[\"f\"][\"composit2\"] == 6\n assert cfg[\"f\"][\"deriv\"] == 23\n assert cfg[\"f\"][\"func2\"] == \"Nothing to report\"\n\n assert cfg[\"a\"] == 1\n assert cfg[\"b\"] == 2\n assert cfg[\"c\"] == 3\n assert cfg[\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "tmpfile.content", + "got": "\"This is a test file\"", + "got_raw": " \"This is a test file\"\n\ndef test_artifact_event_works_with_relative_path(observer, sample_run, tmpfile):\n observer.started_event(**sample_run)\n observer.artifact_event(\"test_artifact.py\", tmpfile.name)\n\n assert _file_exists(observer.bucket, observer.dir, \"test_artifact.py\")\n artifact_data = _get_file_data(\n observer.bucket, observer.dir, \"test_artifact.py\"\n ).decode(\"utf-8\")\n\n assert artifact_data == \"This is a test file\"\n\ndef test_artifact_event_works_with_relative_path_with_prefix(observer, sample_run, tmpfile):\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.2777777777777778, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "2", + "got": "2", + "got_raw": "2\n\n d.update({\"a\": 10, \"b\": \"bar\"})\n assert d[\"a\"] == 10\n assert d[\"b\"] == \"bar\"\n\n assert d[\"c\"] == 2\n\n d.update({\"a\": 100, \"b\": \"baz\"})\n assert d[\"a\"] == 100\n assert d[\"b\"] == \"baz\"\n\n assert d[\"c\"] == 2\n\n d.update({\"a\": 1000, \"b\": \"quux\"})\n assert d[\"a\"] == 100", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "\"b.d\"", + "got": "\"b.d\"", + "got_raw": " \"b.d\"\n assert join_paths(\"a\", \"\", \"c\", \"d\") == \"a.c.d\"\n assert join_paths(\"a\", \"b\", \"\", \"d\") == \"a.b.d\"\n assert join_paths(\"a\", \"b\", \"c\", \"\") == \"a.b.c\"\n\n assert join_paths(\"a\", \"b\", \"c\", \"d\", \"e\") == \"a.b.c.d.e\"\n assert join_paths(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\") == \"a.b.c.d.e.f\"\n\n assert join_paths(\"a", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "1", + "got": "0.1", + "got_raw": "0.1\n assert (run.stop_time - datetime.utcnow()).total_seconds() < 0.1\n\n assert run.config == {\"a\": 17, \"foo\": {\"bar\": True, \"baz\": False}, \"seed\": 1234}\n assert run.config_modifications == ConfigSummary()\n assert run.info == {}\n assert run.root_logger is run.run_logger\n assert run.main_function == run.main_func\n assert run.observers == run.observer\n assert run.pre_run_hooks == []\n assert run.post_run_hooks == []\n assert run.result is None\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "{\"d\"}", + "got": "{\"a\", \"b\", \"c\", \"d\"}", + "got_raw": " {\"a\", \"b\", \"c\", \"d\"}\n assert cfg[\"a\"] == 10\n assert cfg[\"b\"] == 2.0\n assert cfg[\"c\"] == True\n assert cfg[\"d\"] == {\"a\": 1, \"b\": 2}\n\ndef test_fixed_subentry_of_preset2():\n config_dict = ConfigDict({})\n\n cfg = config_dict(preset={\"d\": {\"a\": 1, \"b\": 2}}, fixed={\"d\": {\"b\": 10}})\n\n\n assert set(cfg.keys()) == {\"a\", \"b", + "exact_match": false, + "code_bleu": 0.19960198807747329, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "cf.run", + "got": "1", + "got_raw": "1\n assert cf.run.mock_calls == [mock.call.info(\"Started\")]\n assert cf.run.mock_calls == [mock.call.info(\"Finished after 0:00:00.\")]\n\n\ndef test_captured_function_magic_run_argument_with_config():\n def foo(_run, a, b):\n return a + b\n\n cf = create_captured_function(foo)\n cf.logger = mock.MagicMock()\n cf.run = mock.MagicMock()\n\n assert cf(1, 2) == 3\n assert cf.run.mock_calls == [mock.call.info(\"Started\")]\n assert cf.run.mock_calls == [mock", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "4", + "got": "4", + "got_raw": "4\n loss = mongo_obs.metrics.find_one(\n {\"name\": \"training.loss\", \"run_id\": sample_run[\"_id\"]}\n )\n assert {\"name\": \"training.loss\", \"id\": str(loss[\"_id\"])} in sample_run[\"info\"][\n \"metrics\"\n ]\n assert loss[\"steps\"] == [10, 20, 30, 40]\n assert loss[\"values\"] == [1, 2, 3, 10]\n for i in range(len(loss[\"timestamps\"]) - 1):\n assert loss[\"timestamps\"][i] <= loss", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "{\"i\": 10}", + "got": "10", + "got_raw": "10\n\n assert cfg[\"h\"][\"i\"] == 10\n\n assert cfg[\"h\"][\"j\"] == 10\n\n assert cfg[\"h\"][\"j\"] == 10\n\n assert cfg[\"h\"][\"j\"] == 10\n\n assert cfg[\"h\"][\"j\"] == 10\n\n assert cfg[\"h\"][\"j\"] == 10\n\n assert cfg[\"h\"][\"j\"] == 10\n\n assert cfg[\"h\"][\"j\"] == 10\n\n assert cfg[\"h\"][\"j\"] == 10\n\n assert cfg[\"h\"][\"j\"]", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.36363636363636365, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "random.Random", + "got": "random.Random", + "got_raw": " random.Random\n assert seed == 1234\n\n SETTINGS.CONFIG.NUMPY_RANDOM_LEGACY_API = False\n rnd, seed = cf()\n if opt.has_numpy:\n assert type(rnd) == opt.np.random.Generator\n\n SETTINGS.CONFIG.NUMPY_RANDOM_LEGACY_API = True\n rnd, seed = cf()\n assert type(rnd) == opt.np.random.RandomState\n else:\n\n assert type(rnd) == random.Random\n assert seed == 1234\n\n SETTINGS.CONFIG.NUMPY_RANDOM_LEGACY_API = False\n rnd, seed", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "{}", + "got": "{}", + "got_raw": " {}\n\ndef test_construct_arguments_with_options_fills_in_options():\n s = Signature(foo)\n args, kwargs = s.construct_arguments([], {}, {'a': 10, 'b': 2.0, 'c': 'foo'})\n assert args == [10, 2.0, 'foo']\n assert kwargs == {}\n\ndef test_construct_arguments_with_options_fills_in_options_and_overrides_defaults():\n s = Signature(foo)\n args, kwargs = s.construct_arguments([], {}, {'a': 10, 'b': 2.0, 'c': 'foo', 'd': 10", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "(nr1, seed1)", + "got": "1234", + "got_raw": "1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert cf() == 1234\n assert", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "seed2", + "got": "1234", + "got_raw": "1234\n assert seed2 != 1234\n\n assert seed1 == get_seed(cf.rnd)\n assert seed2 == get_seed(cf.rnd)\n\n assert cf.logger.debug.call_count == 2\n assert cf.logger.debug.call_args_list[0][0][0] == \"Started\"\n assert cf.logger.debug.call_args_list[1][0][0] == \"Finished after %s.\" % datetime.timedelta(seconds=round(cf.logger.debug.call_args_list[1][0][1].total_seconds()))\n\n cf.logger.debug.reset_mock()\n cf.run = mock.MagicMock()\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "5", + "got": "5", + "got_raw": "5\n\n # unused config updates fail\n\n with pytest.raises(SacredError) as excinfo:\n ex.run(config_updates={\"c\": 4})\n\n assert \"unused\" in str(excinfo.value)\n\n # unused config updates fail even if they are in a config scope\n\n with pytest.raises(SacredError) as excinfo:\n ex.run(config_updates={\"c\": 4}, config_scopes=[\"foo\"])\n\n assert \"unused\" in str(excinfo.value)\n\n # unused config updates fail even if they are in a named config\n\n with pytest.raises(SacredError) as excinfo:\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "IDSIA/sacred", + "expected": "foo", + "got": "foo", + "got_raw": " foo\n\ndef test_main_with_args(ex):\n @ex.main\n def foo(a, b):\n pass\n\n assert \"foo\" in ex.commands\n\n assert ex.commands[\"foo\"] == foo\n\n with pytest.raises(SacredError):\n ex.run_commandline([\"foo\", \"1\", \"2\"])\n\n with pytest.raises(SacredError):\n ex.run_commandline([\"foo\", \"1\", \"2\", \"3\"])\n\n with pytest.raises(SacredError):\n ex.run_commandline([\"foo\", \"1\", \"2\", \"3\", \"4\"])\n\n with pytest.raises(Sac", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "initial_nodes", + "got": "initial_nodes, \\", + "got_raw": " initial_nodes, \\\n f\"Node names changed: {initial_nodes} -> {set(model.nodes.keys())}\"\n assert set(model.quads.keys()) == initial_elements, \\\n f\"Element names changed: {initial_elements} -> {set(model.quads.keys())}\"\n \n print(\"Test passed!\")\n\nif __name__ == \"__main__\":\n test_rectangle_mesh_regeneration()\n\n# File: Pynite/FEModel3D.py\n :param mesh_size: The target mesh size.\n :type mesh_size: float\n :param width: The overall width of the rectangular mesh measured along its local x-axis.\n", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.896551724137931, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "{})", + "got": "0)", + "got_raw": "0)\n self.assertEqual(self.node.DY, 0)\n self.assertEqual(self.node.DZ, 0)\n self.assertEqual(self.node.RX, 0)\n self.assertEqual(self.node.RY, 0)\n self.assertEqual(self.node.RZ, 0)\n\n def test_node_displacement_dicts_set(self):\n \"\"\"Test that displacement dictionaries are set correctly.\"\"\"\n\n self.node.DX = 1\n self.node.DY = 2\n self.node.DZ = 3\n self.node.RX = 4\n self.node.RY = 5\n self.node.RZ =", + "exact_match": false, + "code_bleu": 0.35818997727451396, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "model.springs", + "got": "model.springs, \"Spring was not deleted\"", + "got_raw": " model.springs, \"Spring was not deleted\"\n\n print(\"Test passed!\")\n\ntest_delete_mesh_with_attached_springs()\n\n# File: Pynite/FEModel3D.py\nfrom __future__ import annotations # Allows more recent type hints features\nfrom typing import TYPE_CHECKING, List, Dict, Union, Optional, Tuple, Literal\nfrom math import pi, sin, cos, ceil, isclose\n\nfrom Pynite.Node3D import Node3D\nfrom Pynite.Quad3D import Quad3D\nfrom Pynite.Plate3D import Plate3D\nfrom Pynite.Spring", + "exact_match": true, + "code_bleu": 0.5081327481546147, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "110)", + "got": "110)", + "got_raw": "110)\n self.assertEqual(section.J, 0.536)\n\n def test_section_properties(self):\n \"\"\"Test section properties.\"\"\"\n section = Section(self.model, 'W8x31', 9.13, 37.1, 110, 0.536)\n self.assertEqual(section.A, 9.13)\n self.assertEqual(section.Iy, 37.1)\n\n self.assertEqual(section.Iz, 110)\n self.assertEqual(section.J, 0.536)\n\n def test_section_properties(self):\n \"\"\"Test", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "2)", + "got": "1)", + "got_raw": "1)\n self.assertAlmostEqual(RY2/(1.4*5), 1, 1)\n\n def test_sloped_beam_2(self):\n \"\"\"\n Units for this model are kips and feet\n \"\"\"\n\n # Define a new beam\n beam = FEModel3D()\n\n # Define the nodes\n beam.add_node('N1', 0, 0, 0)\n beam.add_node('N2', 10, 10, 0)\n\n # Define the supports\n beam.def_support('N1', True, True, True, True, True,", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "0.03", + "got": "0.03", + "got_raw": "0.03\n assert abs(1 - My_min/My_min_PCA) < 0.03\n assert abs(1 - Sx/Sx_PCA) < 0.03\n assert abs(1 - My_max/My_max_Tim) < 0.03\n assert abs(1 - My_min/My_min_Tim) < 0.03\n assert abs(1 - Sx/Sx_PCA) < 0.03\n assert abs(1 - RMy/RMy_PCA) < 0.03\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "{})", + "got": "1.0)", + "got_raw": "1.0)\n self.assertEqual(combo.combo_tags, None)\n\n def test_loadcombo_creation_with_factors(self):\n \"\"\"Test creating a load combination with factors.\"\"\"\n combo = LoadCombo('D', factors={'D': 1.0})\n self.assertEqual(combo.name, 'D')\n self.assertEqual(combo.factors, {'D': 1.0})\n self.assertEqual(combo.combo_tags, None)\n\n def test_loadcombo_creation_with_tags(self):\n \"\"\"Test creating a load combination with tags.\"\"\"\n combo = LoadCombo('D', factors={'D': 1.0}, combo_tags", + "exact_match": false, + "code_bleu": 0.35818997727451396, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "29000)", + "got": "29000)", + "got_raw": "29000)\n self.assertEqual(mat.G, 11200)\n self.assertEqual(mat.nu, 0.3)\n self.assertEqual(mat.rho, 0.490)\n\n def test_material_addition(self):\n \"\"\"Test adding a material to the model.\"\"\"\n mat = Material(self.model, 'Steel', 29000, 11200, 0.3, 0.490)\n self.model.add_material(mat)\n self.assertIn(mat.name, self.model.materials)\n\n def test_material_removal(self):\n \"\"\"", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "model.nodes", + "got": "model.nodes, f\"Shared node '{shared_node_name}' not found in the model's nodes after deletion.\"", + "got_raw": " model.nodes, f\"Shared node '{shared_node_name}' not found in the model's nodes after deletion.\"\n\n # Verify the external nodes are still there\n assert n2.name in model.nodes, f\"External node '{n2.name}' not found in the model's nodes after deletion.\"\n assert n3.name in model.nodes, f\"External node '{n3.name}' not found in the model's nodes after deletion.\"\n assert n4.name in model.nodes, f\"External node '{n4.name}' not found in the model's nodes after deletion.\"\n\n # Verify the external quad is still there\n assert", + "exact_match": true, + "code_bleu": 0.4111336169005197, + "edit_similarity": 0.20754716981132076, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "1.2)", + "got": "1.2)", + "got_raw": "1.2)\n self.assertEqual(combo.factors['L'], 1.6)\n\n def test_loadcombo_creation_with_tags(self):\n \"\"\"Test creating load combination with initial tags.\"\"\"\n combo = LoadCombo('1.2D+1.6L', combo_tags=['tag1', 'tag2'])\n\n self.assertEqual(combo.combo_tags, ['tag1', 'tag2'])\n\n def test_loadcombo_creation_with_both_factors_and_tags(self):\n \"\"\"Test creating load combination with both initial factors and tags.\"\"\"\n combo = LoadCombo('1.2D+1.6L', factors={'D':", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "18", + "got": "18", + "got_raw": "18\n\n renderer.annotation_size = 10\n renderer.labels = False\n renderer.color_map = 'Mx'\n renderer.scalar_bar = False\n assert renderer.annotation_size == 10\n assert not renderer.labels\n assert renderer.color_map == 'Mx'\n assert not renderer.scalar_bar\n\n renderer.annotation_size = 12\n renderer.labels = True\n renderer.color_map = 'Mx'\n renderer.scalar_bar = True\n assert renderer.annotation_size == 12\n assert renderer.labels\n assert renderer.color_map == 'Mx'\n assert renderer.scalar_bar", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "-2.5", + "got": "0.0000000000", + "got_raw": "0.0000000000\n\ndef test_column_rotation_2():\n\n # Initialize a new model\n model = FEModel3D()\n\n # Define materials and sections\n model.add_material(name=\"Steel\", E=29000, G=11200, nu=0.3, rho=0.0002836)\n model.add_section(name=\"W14x90\", A=26.5, Iy=362, Iz=999, J=6.14)\n\n # Add nodes", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "JWock82/Pynite", + "expected": "0.05)", + "got": "0.03)", + "got_raw": "0.03)\n\n def test_AISC_benchmark_case3(self):\n\n column = FEModel3D()\n\n column.add_node('N1', 0, 0, 0)\n column.add_node('N2', 0, 28, 0)\n \n # Add an internal node to capture P-little-delta effects\n column.add_node('N4', 0, 28*1/3, 0)\n column.add_node('N5', 0, 28*2/3, 0)\n\n column.def_support('N1', True", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "\"What is the weather in Tokyo?\"", + "got": "\"Tokyo is in Japan, and the weather in Tokyo is 25 degrees Celsius.\"", + "got_raw": " \"Tokyo is in Japan, and the weather in Tokyo is 25 degrees Celsius.\"\n assert at.chat_message[1].avatar == \"assistant\"\n assert at.chat_message[1].markdown[0].value == \"That's correct! Tokyo is in Japan, and the weather in Tokyo is 25 degrees Celsius.\"\n\n at.sidebar.selectbox[1].set_value(\"interrupt-agent\")\n at.chat_input[0].set_value(\"What is my birthday?\").run()\n assert at.chat_message[0].avatar == \"user\"\n assert at.chat_message[0].markdown[0].value == \"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5252525252525253, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "NotImplementedError, match=\"Deepgram STT provider not yet implemented\")", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n SpeechToText(provider=\"deepgram\")\n\ndef test_init_with_invalid_provider():\n \"\"\"Test that invalid provider raises ValueError.\"\"\"\n # Passes if ValueError is raised (unknown provider)\n\n with pytest.raises(ValueError):\n SpeechToText(provider=\"unknown\")\n\ndef test_init_with_valid_provider():\n \"\"\"Test that valid provider is initialized.\"\"\"\n # Passes if SpeechToText is created with valid provider\n\n stt = SpeechToText(provider=\"openai\")\n assert stt\n\ndef test_transcribe_with_valid_provider():\n \"\"\"Test that valid provider transcribes audio.\"\"\"\n # Passes if transcribed text", + "exact_match": false, + "code_bleu": 0.24999999999999997, + "edit_similarity": 0.43478260869565216, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "RUN_ID", + "got": "RUN_ID", + "got_raw": " RUN_ID\n assert kwargs[\"json\"][\"key\"] == KEY\n assert kwargs[\"json\"][\"score\"] == SCORE\n assert kwargs[\"json\"][\"kwargs\"] == KWARGS\n\n # Test error response\n mock_response = Response(400, json={}, request=Request(\"POST\", \"http://test/feedback\"))\n with patch(\"httpx.AsyncClient.post\", return_value=mock_response) as mock_post:\n with pytest.raises(AgentClientError) as e:\n await agent_client.acreate_feedback(RUN_ID, KEY, SCORE, KWARGS)\n assert str(e.value) == \"Error:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "False", + "got": "False", + "got_raw": " False\n assert settings.OLLAMA_MODEL is None\n assert settings.OLLAMA_BASE_URL is None\n assert settings.USE_FAKE_MODEL is False\n assert settings.OPENROUTER_API_KEY is None\n\n assert settings.DEFAULT_MODEL is None\n assert settings.AVAILABLE_MODELS == set()\n\n assert settings.COMPATIBLE_MODEL is None\n assert settings.COMPATIBLE_API_KEY is None\n assert settings.COMPATIBLE_BASE_URL is None\n\n assert settings.OPENWEATHERMAP_API_KEY is None\n\n assert settings.GITHUB_PAT is None\n assert settings.MCP_GITHUB_SERVER_URL ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "fake_store", + "got": "assert \"Failed to load agent bad\" in caplog.text", + "got_raw": "<|fim_suffix|>\n assert \"Failed to load agent bad\" in caplog.text\n assert \"Agent loaded: good\" in caplog.text\n assert \"Agent loaded: bad\" not in caplog.text\n\n\n# File: src/agents/agents.py\n from dataclasses import dataclass\n\n from langgraph.graph.state import CompiledStateGraph\n from langgraph.pregel import Pregel\n\n\n class LazyLoadingAgent(ABC):\n \"\"\"Base class for agents that require async loading.\"\"\"\n\n def __init__(self) -> None:\n \"\"\"Initialize the agent.\"\"\"\n self._loaded = False\n self._graph: Compiled", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.1724137931034483, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "\"claude-haiku-4-5\"", + "got": "t isinstance(model, ChatGroq)", + "got_raw": "<|fim_suffix|>t isinstance(model, ChatGroq)\n\n assert model.model == GroqModelName.LLAMA_31_8B\n\ndef test_get_model_ollama():\n with patch.dict(os.environ, {\"OLLAMA_MODEL\": \"ollama\"}):\n model = get_model(OllamaModelName.OLLAMA_GENERIC)\n assert isinstance(model, ChatOllama)\n\n assert model.model == OllamaModelName.OLLAMA_GENERIC\n\ndef test_get_model_openai():\n with patch.dict(os.environ, {\"OPENAI_API_KEY\": \"test_key\"}):\n model = get_model(OpenAIModelName", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.2127659574468085, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "logging.ERROR", + "got": "40", + "got_raw": "40\n assert LogLevel.CRITICAL.to_logging_level() == 50\n\ndef test_check_str_is_http():\n \"\"\"Test check_str_is_http function.\"\"\"\n assert check_str_is_http(\"http://example.com\") == \"http://example.com\"\n assert check_str_is_http(\"https://example.com\") == \"https://example.com\"\n assert check_str_is_http(\"ftp://example.com\") == \"ftp://example.com\"\n\n with pytest.raises(ValueError):\n check_str_is_http(\"example.com\")\n\ndef test_settings():\n \"\"\"Test Settings class.\"\"\"\n settings = Settings()\n assert settings.MODE is None\n ", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "\"ai\"", + "got": "0", + "got_raw": "0\n assert response.content == ANSWER\n\ndef test_stream(agent_client):\n \"\"\"Test streaming invocation.\"\"\"\n QUESTION = \"What is the weather?\"\n ANSWER = \"The weather is sunny.\"\n\n # Mock successful response\n mock_request = Request(\"POST\", \"http://test/invoke\")\n mock_response = Response(\n 200,\n json={\"type\": \"ai\", \"content\": ANSWER},\n request=mock_request,\n )\n with patch(\"httpx.post\", return_value=mock_response):\n response = agent_client.stream(QUESTION)\n assert isinstance(response, ChatMessage)\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "[\"This is a test response from the fake model.\"]", + "got": "[\"This is a test response from the fake model.\"]", + "got_raw": " [\"This is a test response from the fake model.\"]\n\ndef test_get_model_anthropic():\n model = get_model(AnthropicModelName.HAIKU_45)\n assert isinstance(model, ChatAnthropic)\n\n assert model.model_name == \"claude-haiku-4-5\"\n\ndef test_get_model_groq():\n model = get_model(GroqModelName.LLAMA_GUARD_4_12B)\n assert isinstance(model, ChatGroq)\n\n assert model.model_name == \"llama-3.1-8b\"\n\ndef test_get_model_ollama():\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "\"42\"", + "got": "42", + "got_raw": "42\n assert tool_status.json[1].value == '{\"expression\": \"6 * 7\", \"result\": 42}'\n assert tool_status.icon == \":material/check:\"\n assert tool_status.markdown[3].value == \"The answer is 42\"\n\n assert at.chat_message[2].avatar == \"assistant\"\n assert at.chat_message[2].markdown[0].value == \"The answer is 42\"\n\n # Test that the last message container is updated\n assert at.last_message[0].value == \"The answer is 42\"\n\n # Test that the last", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "LogLevel.DEBUG", + "got": "assert settings.AZURE_OPENAI_API_KEY == \"test_key\"", + "got_raw": "<|fim_suffix|>\n assert settings.AZURE_OPENAI_API_KEY == \"test_key\"\n assert settings.AZURE_OPENAI_ENDPOINT == \"https://test_endpoint.com\"\n assert settings.AZURE_OPENAI_API_VERSION == \"2024-02-15-preview\"\n assert settings.AZURE_OPENAI_DEPLOYMENT_MAP == {\"gpt-4o\": \"test_deployment_id\"}\n\n # Test that the AZURE_OPENAI_DEPLOYMENT_MAP is parsed correctly\n assert isinstance(settings.AZURE_OPENAI_DEPLOYMENT_MAP, dict)\n assert \"gpt-4o\" in settings", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "JoshuaC215/agent-service-toolkit", + "expected": "mock_graph", + "got": "mock_graph", + "got_raw": " mock_graph\n mock_get_model.assert_called_once_with(settings.DEFAULT_MODEL)\n mock_create_agent.assert_called_once_with(\n model=mock_model,\n tools=agent._mcp_tools,\n name=\"github-mcp-agent\",\n system_prompt=prompt,\n )\n\n def test_load(self):\n \"\"\"Test loading the agent.\"\"\"\n agent = GitHubMCPAgent()\n agent._mcp_tools = [Mock(), Mock()]\n agent._mcp_client = Mock()\n agent._loaded = False\n\n with patch(\"agents.github_mcp_agent.github_mcp_agent.get_model\") as mock_get_model, patch(\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "'hZpzr8TbF08'", + "got": "'hZpzr8TbF08'", + "got_raw": " 'hZpzr8TbF08'\n assert e.error_string == 'hZpzr8TbF08 is not available in your region'\n\ndef test_members_only_error():\n # Ensure this can be caught as generic VideoUnavailable exception\n with pytest.raises(exceptions.VideoUnavailable):\n raise exceptions.MembersOnly('hZpzr8TbF08')\n try:\n raise exceptions.MembersOnly('hZpzr8TbF08')\n except exceptions.MembersOnly as e:\n\n assert e.video_id == 'hZpzr8TbF08'\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "3399554", + "got": "1234567890", + "got_raw": "1234567890\n assert cipher_signature.streams[0].filesize_approx == 1234567890\n assert cipher_signature.streams[0].filesize_gb == 1234567890 / (1024 * 1024 * 1024)\n\ndef test_filesize_approx(cipher_signature):\n\n assert cipher_signature.streams[0].filesize_approx == 1234567890\n\ndef test_filesize_gb(cipher_signature):\n\n assert cipher_signature.streams[0].", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "playlist_html", + "got": "playlist_html", + "got_raw": " playlist_html\n\n\n@mock.patch(\"pytubefix.request.get\")\ndef test_playlist_id(request_get, playlist_html):\n url = \"https://www.fakeurl.com/playlist?list=whatever\"\n request_get.return_value = playlist_html\n playlist = Playlist(url)\n\n assert playlist.playlist_id == \"whatever\"\n\n\n@mock.patch(\"pytubefix.request.get\")\ndef test_playlist_url(request_get, playlist_html):\n url = \"https://www.fakeurl.com/playlist?list=whatever\"\n request_get.return_value = playlist_html\n playlist = Playlist(url)\n\n assert playlist.playlist_url == \"https", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "18", + "got": "18", + "got_raw": "18\n assert cipher_signature.streams.get_by_itag(18).url == 'https://r1---sn-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "3", + "got": "3", + "got_raw": "3\n assert buffer.write.call_args_list[0][0][0] == b\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n assert buffer.write.call_args_list[1][0][0] == b\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n assert buffer.write.call_args_list[2][0][0] == b\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "'UCs6nmQViDpUw0nuIx9c_WvA'", + "got": "1234567890", + "got_raw": "1234567890\n\n@mock.patch('pytubefix.request.get')\ndef test_channel_url(request_get, channel_videos_html):\n request_get.return_value = channel_videos_html\n\n c = Channel('https://www.youtube.com/c/ProgrammingKnowledge/videos')\n\n assert c.channel_url == 'https://www.youtube.com/channel/1234567890'\n\n@mock.patch('pytubefix.request.get')\ndef test_channel_name(request_get, channel_videos_html):\n request_get.return_value = channel_videos_html\n\n c = Channel('https://www.youtube.com", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "RegexMatchError)", + "got": "RegexMatchError):", + "got_raw": "RegexMatchError):\n helpers.regex_search('foo', 'bar')\n\ndef test_regex_search_match():\n\n result = helpers.regex_search('foo', 'foobar')\n\n assert result == 'foobar'\n\ndef test_regex_search_match_with_group():\n\n result = helpers.regex_search('foo(.*)bar', 'foobar')\n\n assert result == 'bar'\n\ndef test_regex_search_match_with_group_and_named_group():\n\n result = helpers.regex_search('foo(?P.*?)(?Pbar)', 'foobar')\n\n assert result == 'bar'\n\ndef test_regex_search_match_with_group_and_named_group_and_non_capturing", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.9696969696969697, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "None", + "got": "None", + "got_raw": " None\n\n\n# File: pytubefix/async_youtube.py\n return stream_obj\n \n async def age_check(self):\n \"\"\"Async: If the video has age restrictions, confirm age via TV client.\"\"\"\n self.client = 'TV'\n innertube = InnerTube(\n client=self.client,\n use_oauth=self.use_oauth,\n allow_cache=self.allow_oauth_cache,\n token_file=self.token_file,\n oauth_verifier=self.oauth_verifier,\n use_po_token=self.use_po_token,\n po_token_verifier=self.po_token_verifier\n )\n \n if innertube.require_js_player:\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "ytmd.raw_metadata[0]", + "got": "ytmd.raw_metadata[0]", + "got_raw": " ytmd.raw_metadata[0]\n assert 'twoColumnWatchNextResults' in ytmd.raw_metadata[0]['contents']\n assert 'results' in ytmd.raw_metadata[0]['contents']['twoColumnWatchNextResults']\n assert 'results' in ytmd.raw_metadata[0]['contents']['twoColumnWatchNextResults']['results']\n assert 'contents' in ytmd.raw_metadata[0]['contents']['twoColumnWatchNextResults']['results']['results']\n assert 'videoSecondaryInfoRenderer' in ytmd.raw_metadata[0]['contents']['twoColumnWatchNextResults']['results']['results']['contents'][1]\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "{\"content-length\": \"16384\"}", + "got": "16384", + "got_raw": "16384\n\n\n@mock.patch(\"pytubefix.request.urlopen\")\ndef test_headers_no_content_length(mock_urlopen):\n response = mock.Mock()\n response.info.return_value = {}\n mock_urlopen.return_value = response\n response = request.head(\"http://fakeassurl.gov\")\n\n assert response is None\n\n\n@mock.patch(\"pytubefix.request.urlopen\")\ndef test_headers_no_content_length_2(mock_urlopen):\n response = mock.Mock()\n response.info.return_value = {\"content-length\": \"\"}\n mock_urlopen.return_value = response\n response = request.head(\"http://fake", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.3125, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "\"abc\"", + "got": "\"abc\"", + "got_raw": " \"abc\"\n\n assert helpers.safe_filename(\"abc#\") == \"abc\"\n\n assert helpers.safe_filename(\"abc\") == \"abc\"\n\n assert helpers.safe_filename(\"abc#\") == \"abc\"\n\n assert helpers.safe_filename(\"abc#\") == \"abc\"\n\n assert helpers.safe_filename(\"abc#\") == \"abc\"\n\n assert helpers.safe_filename(\"abc#\") == \"abc\"\n\n assert helpers.safe_filename(\"abc#\") == \"abc\"\n\n assert helpers.safe_filename(\"abc#\") == \"abc\"\n\n assert helpers.safe_filename(\"abc#\") == \"abc\"\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "{ 'foo': [], 'bar': {} }", + "got": "{'foo': [], 'bar': {}}", + "got_raw": " {'foo': [], 'bar': {}}\n\ndef test_parse_complex_object():\n test_html = 'test = {\"foo\": [], \"bar\": {}};'\n result = parse_for_object(test_html, r'test\\s*=\\s*')\n\n assert result == {'foo': [], 'bar': {}}\n\ndef test_parse_complex_object_with_comments():\n test_html = 'test = {\"foo\": [], \"bar\": {}};'\n result = parse_for_object(test_html, r'test\\s*=\\s*')\n\n assert result == {'foo': [], 'bar': {}}\n\ndef test_parse_complex_object_with_comments", + "exact_match": false, + "code_bleu": 1.0, + "edit_similarity": 0.9565217391304348, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "'m8uHb5jIGN8'", + "got": "'m8uHb5jIGN8'", + "got_raw": " 'm8uHb5jIGN8'\n assert e.error_string == 'm8uHb5jIGN8 is private'\n\ndef test_members_only_error():\n # Ensure this can be caught as generic VideoUnavailable exception\n with pytest.raises(exceptions.VideoUnavailable):\n raise exceptions.MembersOnly('m8uHb5jIGN8')\n try:\n raise exceptions.MembersOnly('m8uHb5jIGN8')\n except exceptions.MembersOnly as e:\n\n assert e.video_id == 'm8uHb5jIGN8'\n assert e.error_string == 'm8", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "0.02", + "got": "0.02", + "got_raw": "0.02\n\ndef test_rating_with_oauth(cipher_signature):\n \"\"\"Test the rating value of a YouTube object.\n\n This changes each time we rebuild the json files, so we want to use\n an estimate of where it will be. The two values seen to make this\n estimate were 2.073431 and 2.0860765. This represents a range of\n ~0.007 below and ~0.006 above 2.08. Allowing for up to 0.02 in either\n direction should provide", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "JuanBindez/pytubefix", + "expected": "'{\\'en\\': }'", + "got": "''", + "got_raw": " ''\n\ndef test_xml_captions():\n caption = Caption(\n {\"url\": \"url1\", \"name\": {\"simpleText\": \"name1\"}, \"languageCode\": \"en\", \"vssId\": \".en\"}\n )\n assert caption.xml_captions == 'K-pop!...'\n\ndef test_json_captions():\n caption = Caption(\n {\"url\":", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.7311827956989247, + "n_retrieved": 10 + }, + { + "repo": "Kludex/mangum", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n assert shutdown_complete == expected\n\n\n@pytest.mark.parametrize(\n \"mock_aws_api_gateway_event,lifespan\",\n [\n ([\"GET\", None, None], \"auto\"),\n ([\"GET\", None, None], \"on\"),\n ([\"GET\", None, None], \"off\"),\n ],\n indirect=[\"mock_aws_api_gateway_event\"],\n)\ndef test_lifespan_failure(mock_aws_api_gateway_event, lifespan) -> None:\n \"\"\"\n Test each lifespan option using an application that does not support lifespan\n messages.\n\n * \"auto\" (default):\n Application support for lifespan will be", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Kludex/mangum", + "expected": "b\"\"", + "got": "", + "got_raw": " # pragma: no cover\n b\"\"\n\n assert handler.scope[\"aws.context\"] == example_context\n assert handler.scope[\"aws.event\"] == event\n assert handler.scope[\"client\"] == (\"72.12.164.125\", 0)\n assert handler.scope[\"headers\"] == [\n [b\"accept\", b\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\"],\n [b\"accept-encoding\", b\"gzip\"],\n [b\"accept-language\", b\"en-US,en;q=", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Kludex/mangum", + "expected": "{ \"statusCode\": 200, \"isBase64Encoded\": False, \"headers\": {\"content-type\": \"text/plain; charset=utf-8\"}, \"multiValueHeaders\": {}, \"body\": \"Hello, world!\", }", + "got": "200", + "got_raw": "200\n assert response[\"body\"] == b\"Hello, world!\"\n\n\n@pytest.mark.parametrize(\"mock_aws_api_gateway_event\", [[\"GET\", \"\", None]], indirect=True)\ndef test_http_empty_body(mock_aws_api_gateway_event) -> None:\n async def app(scope, receive, send):\n assert scope[\"type\"] == \"http\"\n await send(\n {\n \"type\": \"http.response.start\",\n \"status\": 200,\n \"headers\": [[b\"content-type\", b\"text/plain; charset=utf-8\"]],\n }\n )\n await send({\"type\": \"http", + "exact_match": false, + "code_bleu": 0.02202235398153187, + "edit_similarity": 0.03773584905660377, + "n_retrieved": 10 + }, + { + "repo": "Kludex/mangum", + "expected": "LifespanFailure)", + "got": "UnexpectedMessage):", + "got_raw": "UnexpectedMessage):\n handler(mock_aws_api_gateway_event, None)\n\n\n@pytest.mark.parametrize(\n \"mock_aws_api_gateway_event,lifespan\",\n [([\"GET\", None, None], \"auto\"), ([\"GET\", None, None], \"on\")],\n indirect=[\"mock_aws_api_gateway_event\"],\n)\ndef test_lifespan_startup_failure(mock_aws_api_gateway_event, lifespan) -> None:\n async def app(scope, receive, send):\n if scope[\"type\"] == \"lifespan\":\n while True:\n message = await receive()\n if message[\"type\"] == \"lifespan.start", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "Kludex/mangum", + "expected": "caplog.text", + "got": "", + "got_raw": " # pragma: no cover\n assert \"GET /test/hello 200\" in # pragma: no cover\n assert \"GET /test/hello 200\" in # pragma: no cover\n assert \"GET /test/hello 200\" in # pragma: no cover\n assert \"GET /test/hello 200\" in # pragma: no cover\n assert \"GET /test/hello 200\" in # pragma: no cover\n assert \"GET /test/hello 200\" in # pragma", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Kludex/mangum", + "expected": "scope_body", + "got": "\"headers\": [", + "got_raw": "<|fim_suffix|>\n \"headers\": [\n [\n b\"accept\",\n b\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\n ],\n [b\"accept-encoding\", b\"gzip\"],\n [b\"accept-language\", b\"en-US,en;q=0.9\"],\n [b\"connection\", b\"keep-alive\"],\n [b\"host\", b\"lambda-alb-123578498.us-east-2.elb.amazonaws.com\"],\n [b\"upgrade-insecure-requests\", b", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "Kludex/mangum", + "expected": "message", + "got": "", + "got_raw": " # pragma: no cover\n message\n\n\n@pytest.mark.parametrize(\n \"arguments,message\",\n [\n (\n {\"api_gateway_base_path\": 1},\n \"Invalid argument supplied for `api_gateway_base_path`. Choices are: str\",\n ),\n (\n {\"api_gateway_base_path\": None},\n \"Invalid argument supplied for `api_gateway_base_path`. Choices are: str\",\n ),\n (\n {\"api_gateway_base_path\": \"1\"},\n \"Invalid argument supplied for `api_gateway_base_path`. Choices are: str\",\n ),\n (\n {\"api_gateway_base_path\": \"/\"},\n \"Invalid argument supplied", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "{ \"protocol\": \"redis\", \"url\": \"redis://localhost:6379\", }", + "got": "12345", + "got_raw": "12345\n assert schema[\"servers\"][\"prod\"] == 12345\n assert schema[\"servers\"][\"test\"] == 12345\n assert schema[\"servers\"][\"staging\"] == 12345\n assert schema[\"servers\"][\"local\"] == 12345\n assert schema[\"servers\"][\"default\"] == 12345\n assert schema[\"servers\"][\"test\"] == 12345\n assert schema[\"servers\"][\"test\"] == 12345\n assert schema[\"servers\"][\"test\"] ==", + "exact_match": false, + "code_bleu": 0.05, + "edit_similarity": 0.03225806451612903, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "None", + "got": "None", + "got_raw": " None\n\n @pytest.mark.asyncio\n async def test_rpc_timeout(self, queue: str, full_broker: BrokerAsyncUsecase):\n @full_broker.handle(queue)\n async def m(): # pragma: no cover\n await anyio.sleep(1)\n\n async with full_broker:\n await full_broker.start()\n\n r = await full_broker.publish(\n \"hello\",\n queue,\n callback=True,\n callback_timeout=0.1,\n )\n\n assert r is not None\n\n @pytest.mark.asyncio\n async def test_rpc_timeout_none(self, queue:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "\"hi\"", + "got": "1", + "got_raw": "1\n\n assert await test_broker.publish(message, callback=True) == 1\n\n assert await test_broker.publish(message, callback=True) == 1\n\n assert await test_broker.publish(message, callback=True) == 1\n\n assert await test_broker.publish(message, callback=True) == 1\n\n assert await test_broker.publish(message, callback=True) == 1\n\n assert await test_broker.publish(message, callback=True) == 1\n\n assert await test_broker.publish(message, callback=True) == 1\n\n assert await test_broker.publish(message, callback=True) == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "broker", + "got": "broker", + "got_raw": " broker\n assert app.context is context\n assert app.logger is logger\n assert app.logger.name == \"propan.app\"\n assert app.logger.level == logging.INFO\n assert app.logger.handlers[0].level == logging.INFO\n assert app.logger.handlers[0].formatter._fmt == \"%(asctime)s %(levelname)s %(name)s %(message)s\"\n assert app.logger.handlers[0].formatter._style._fmt == \"%(asctime)s %(levelname)s %(name)s %(message)s\"\n assert app.logger.handlers[0].formatter._style._datefmt == \"%Y-%m-%d %H:%M", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "RequestValidationError)", + "got": "ValidationError) as e:", + "got_raw": "ValidationError) as e:\n await router.broker.publish(msg)\n\n assert e.value.errors() == [\n {\n \"loc\": (\"a\",),\n \"msg\": \"value is not a valid integer\",\n \"type\": \"type_error.integer\",\n },\n {\n \"loc\": (\"b\",),\n \"msg\": \"value is not a valid string\",\n \"type\": \"type_error.str\",\n },\n ]\n\n\n@pytest.mark.asyncio\nasync def test_invalid_request_with_default(router: KafkaRouter):\n @router.event(\"test\")\n async def handler(a: int = 1, b: str =", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.7111111111111111, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "4", + "got": "2", + "got_raw": "2\n assert mock.yield_start.call_count == 1\n assert mock.yield_close.call_count == 1\n\n assert mock.call_count == 3\n assert mock.yield_start.call_count == 1\n assert mock.yield_close.call_count == 1\n\n assert mock.dep.call_args_list == [\n call(),\n call(),\n call(),\n ]\n assert mock.yield_start.call_args_list == [\n call(),\n ]\n assert mock.yield_close.call_args_list == [\n call(),\n ]\n\n assert mock.call_args_list == [\n call(\"hi, depends\"),\n call", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "\"test\")", + "got": "PropanMessage(\"test\", queue=queue))", + "got_raw": "PropanMessage(\"test\", queue=queue))\n mock.enter.assert_called_once()\n mock.exit.assert_called_once()\n\n @staticmethod\n @pytest.mark.asyncio\n async def test_async(get_middleware, queue: str, broker: BrokerAsyncUsecase):\n middleware, mock = get_middleware\n\n consume = asyncio.Event()\n mock.side_effect = lambda *_: consume.set() # pragma: no branch\n\n broker.include_middleware(middleware)\n\n @broker.handle(queue)\n async def handler(m):\n mock(m)\n mock.enter.assert_called_once()\n assert not mock.exit.called\n ", + "exact_match": false, + "code_bleu": 0.15619699684601276, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "await test_broker.publish(\"\", queue, callback=True)", + "got": "await self.testclient.post(", + "got_raw": " await self.testclient.post(\n \"/test\",\n json={\"body\": \"Hello, Rabbit!\"},\n )\n assert 2 == await self.testclient.post(\n \"/test\",\n json={\"body\": \"Hello, Rabbit!\"},\n headers={\"exchange\": \"test\"},\n )\n\n @pytest.mark.asyncio\n async def test_direct_with_exchange_type(\n self,\n test_broker: RabbitBroker,\n queue: str,\n ):\n @test_broker.handle(queue, exchange_type=ExchangeType.DIRECT)\n async def handler(m):\n return 1\n\n @test_broker.handle(queue", + "exact_match": false, + "code_bleu": 0.11894395226085014, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "None", + "got": "None", + "got_raw": " None\n\n @pytest.mark.asyncio\n async def test_rpc_timeout_error(self, queue: str, test_broker: BrokerAsyncUsecase):\n @test_broker.handle(queue)\n async def m(): # pragma: no cover\n await anyio.sleep(1)\n\n with pytest.raises(anyio.TimeoutError):\n await test_broker.publish(\n \"hello\",\n queue,\n callback=True,\n callback_timeout=0.001,\n )\n\n @pytest.mark.asyncio\n async def test_rpc_timeout_error(self, queue: str, test_broker: BrokerAsyncUsecase", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "None", + "got": "None", + "got_raw": " None\n\ndef test_init_with_broker(app_with_broker: PropanApp):\n\n assert isinstance(app_with_broker.broker, RabbitBroker)\n\ndef test_init_with_broker(app_with_broker: PropanApp):\n\n assert isinstance(app_with_broker.broker, RabbitBroker)\n\ndef test_init_with_broker(app_with_broker: PropanApp):\n\n assert isinstance(app_with_broker.broker, RabbitBroker)\n\ndef test_init_with_broker(app_with_broker: PropanApp):\n\n assert isinstance(app_with_broker.broker, RabbitBroker)\n\ndef test_init_with_broker(app_with_broker: PropanApp", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "{ \"Handler\": { \"bindings\": { \"redis\": { \"bindingVersion\": \"custom\", \"channel\": \"test\", \"method\": \"subscribe\", } }, \"servers\": [\"dev\"], \"subscribe\": { \"bindings\": {\"redis\": {\"bindingVersion\": \"custom\"}}, \"message\": {\"$ref\": \"", + "got": "1", + "got_raw": "1\n assert schema[\"channels\"][\"test\"][\"in\"][\"body\"][\"type\"] == \"integer\"\n assert schema[\"channels\"][\"test\"][\"in\"][\"body\"][\"format\"] == \"int32\"\n assert schema[\"channels\"][\"test\"][\"in\"][\"body\"][\"description\"] == \"a\"\n assert schema[\"channels\"][\"test\"][\"in\"][\"body\"][\"required\"] == [\"a\"]\n\n\n assert schema[\"channels\"][\"test\"][\"out\"][\"body\"][\"type\"] == \"integer\"\n assert schema[\"channels\"][\"test\"][\"out\"][\"body\"][\"format\"] == \"int32\"\n assert schema[\"channels\"][\"test\"][\"out\"][\"body\"][\"description", + "exact_match": false, + "code_bleu": 0.009615384615384616, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "1", + "got": "1", + "got_raw": "1\n assert mock.decode.call_count == 1\n assert mock.parse.call_count == 1\n\n```\n\n---\n\n## Testing\n\n**Propan** has a built-in testing framework that allows you to test your application without running external dependencies as a broker (for now only for RabbitMQ)!\n\n```python\nfrom propan import RabbitBroker\nfrom propan.test import TestRabbitBroker\n\nbroker = RabbitBroker()\n\n@broker.handle(\"ping\")\nasync def healthcheck(msg: str) -> str:\n return \"pong\"\n\nasync def test_publish():\n async with TestRabbitBroker(broker) as test_broker:\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "\"FuncMessage\"", + "got": "0", + "got_raw": "0\n assert result == 0\n assert response == 0\n\n\n\n# File: docs/docs_src/integrations/http_frameworks_integrations/fastapi.py\n\"\"\"\nYou can use Propan MQBrokers without PropanApp\nJust start and stop them whenever you want\n\"\"\"\nimport fastapi\nfrom propan import RabbitBroker\n\nbroker = RabbitBroker(\"amqp://guest:guest@localhost:5672/\")\n\n\n@broker.handle(\"test\")\nasync def base_handler(body):\n print(body)\n\n\napp = fastapi.FastAPI()\napp.include_router(broker.router)\n\n\n# File: docs/docs_src/int", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "2", + "got": "1", + "got_raw": "1\n assert \"is not a valid path\" in r.stdout\n\n\ndef test_gen_wrong_app(runner: CliRunner, rabbit_async_project: Path):\n app_path = f'{rabbit_async_project / \"app\" / \"serve\"}:app'\n r = runner.invoke(cli, [\"docs\", \"gen\", app_path])\n\n assert r.exit_code == 1\n assert \"is not a valid path\" in r.stdout\n\n\ndef test_gen_wrong_app_name(runner: CliRunner, rabbit_async_project: Path):\n app_path = f'{rabbit_async_project / \"app\" / \"serve\"}:app1", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Lancetnik/Propan", + "expected": "\"pong\"", + "got": "1", + "got_raw": "1\n```\n\nYou can find a complete example in [documentation](../integrations/2_fastapi-plugin)\n\nAlso, added the ability to [test](../getting_started/7_testing) your application without running external dependencies as a broker (for now only for RabbitMQ)!\n\n```python\nfrom propan import RabbitBroker\nfrom propan.test import TestRabbitBroker\n\nbroker = RabbitBroker()\n\n@broker.handler(\"ping\")\nasync def healthcheck(msg: str) -> str:\n return \"pong\"\n\nasync def test_publish():\n async with TestRabbitBroker(broker) as test_broker:\n await test_b", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "LonamiWebs/Telethon", + "expected": "[user]", + "got": "456", + "got_raw": "456\n assert await event.get_input_users() == user\n assert await event.get_input_user() == user.id\n assert await event.get_user() == user\n\n assert await event.get_users() == 456\n assert await event.get_input_users() == user\n assert await event.get_input_user() == user.id\n assert await event.get_user() == user\n\n assert await event.get_users() == 456\n assert await event.get_input_users() == user\n assert await event.get_input_user() == user.id\n assert await event.get_user() == user", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "LonamiWebs/Telethon", + "expected": "unpickled_error.message", + "got": "unpickled_error.message", + "got_raw": " unpickled_error.message\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n assert error.seconds == unpickled_error.seconds\n\n ", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "LonamiWebs/Telethon", + "expected": "media_file)", + "got": "sert_called_once_with(", + "got_raw": "sert_called_once_with(\n entity=entity, message=message, file=media_file,\n formatting_entities=formatting_entities,\n )\n assert result == expected_result\n\n @pytest.mark.asyncio\n async def test_send_msg_and_file_with_empty_message(self):\n async def async_func(result): # AsyncMock was added only in 3.8\n return result\n msg_methods = MessageMethods()\n expected_result = Message(\n id=0, peer_id=PeerChat(chat_id=0), message='', date=None,\n )\n entity = 'test_entity'\n message = Message(\n id=1", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.24242424242424243, + "n_retrieved": 10 + }, + { + "repo": "LonamiWebs/Telethon", + "expected": "sorted((e.offset, e.length) for e in entities_expected)", + "got": "", + "got_raw": "\n\n\n# File: telethon/utils.py\n return text\n\n\ndef test_get_inner_text():\n text = ' text '\n text_stripped = 'text'\n entities_before_and_after = (\n ([], []),\n ([Meu(i, 0) for i in range(10)], []), # del ''\n ([Meu(0, 0), Meu(0, 1), Meu(5, 1)], []), # del '', ' ', ' '\n ([Meu(0, 3)], [Meu(0, 2)]), # ' te", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "LonamiWebs/Telethon", + "expected": "[utils.get_input_peer(user)]", + "got": "456", + "got_raw": "456\n\n@pytest.mark.asyncio\nasync def test_get_input_users_with_action_message():\n user = get_user_456()\n event = events.ChatAction.build(types.UpdateChatParticipantAdd(\n chat_id=123,\n user_id=456,\n version=1\n ))\n event._set_client(get_client())\n event._entities[user.id] = user\n\n\n assert await event.get_input_users() == 456\n\n@pytest.mark.asyncio\nasync def test_get_input_users_with_action_message_and_input_user():\n user = get_user_456()\n event =", + "exact_match": false, + "code_bleu": 0.0625, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "LonamiWebs/Telethon", + "expected": "1", + "got": "1", + "got_raw": "1\n\n assert contm.count == 1\n\n def test_sync_acontext_with_loop(self):\n contm = self.NoopContextManager(loop=asyncio.new_event_loop())\n assert contm.count == 0\n\n with contm:\n\n assert contm.count == 1\n\n assert contm.count == 1\n\n def test_sync_acontext_with_loop_and_coro(self):\n contm = self.NoopContextManager(loop=asyncio.new_event_loop())\n assert contm.count == 0\n\n with contm:\n\n assert contm.count == 1\n\n assert contm.count", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"images\")", + "got": "3)", + "got_raw": "3)\n\n TermRepository(app_context.db.session).delete_empty_images()\n\n assert_sql_result(\"select wisource from wordimages\", [\"\", \" \"], 2)\n\n\ndef test_bulk_status_update(app_context, english):\n \"Bulk status update.\"\n t = fixture_saved_term(app_context, english)\n t.status = 0\n db.session.commit()\n\n # Set the status to 1, and check that the status was updated.\n Service(app_context.db.session).bulk_status_update(t, [english], 1)\n _assert_updated(t)\n\n # Set the status to 2, and check that the", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"\"", + "got": "", + "got_raw": " # pylint: disable=undefined-variable\n \"\"\n\n\ndef test_next_theme(app_context):\n \"Next theme is the next in the list.\"\n repo = UserSettingRepository(db.session)\n repo.set_value(\"current_theme\", \"foo\")\n repo.set_value(\"current_theme\", \"bar\")\n repo.set_value(\"current_theme\", \"baz\")\n repo.set_value(\"current_theme\", \"qux\")\n repo.set_value(\"current_theme\", \"quux\")\n repo.set_value(\"current_theme\", \"quuz\")\n repo.set_value(\"current_theme\", \"corge\")\n repo.set_value(\"current_theme\", \"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"texts\")", + "got": "\"text\")", + "got_raw": " \"text\")\n\n sql = \"select T2ID, T2Text from tags2\"\n assert_sql_result(sql, [\"1; hola\"], \"booktags\")\n\n sql = \"select BtBkID, BtT2ID from booktags\"\n assert_sql_result(sql, [\"1; 1\"], \"booktags\")\n\n sql = \"select BkID, BkCurrentTxID from books\"\n assert_sql_result(sql, [\"1; 1\"], \"book\")\n\n sql = \"select TxID, TxStartDate, TxWordCount from texts\"\n assert_sql_result(sql, [\"1", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.9333333333333333, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"popped\")", + "got": "0, \"hello\")", + "got_raw": "0, \"hello\")\n\n\ndef test_save_remove_flash_message2(spanish):\n \"Flash message is associated with term, can be popped.\"\n t = Term(spanish, \"HOLA\")\n t.set_flash_message(\"hello\")\n assert t.get_flash_message() == \"hello\"\n\n db.session.add(t)\n db.session.commit()\n sql = \"select WfWoID, WfMessage from wordflashmessages\"\n expected = [\"1; hello\"]\n assert_sql_result(sql, expected, \"hello\")\n\n assert t.pop_flash_message() == \"hello\", \"popped\"\n assert t.get_flash_message()", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"final\")", + "got": "1, \"updated year\")", + "got_raw": "1, \"updated year\")\n\n _assert_updated(t)\n\ndef test_changing_status_of_status_0_term_resets_WoStatusChanged(app_context, spanish):\n \"\"\"\n New unknown Terms get created with Status = 0 when a page is\n rendered for reading, but that's not _really_ the date that the\n term was created.\n \"\"\"\n t = Term(spanish, \"hola\")\n t.translation = \"hi\"\n t.status = 0\n db.session.add(t)\n db.session.commit()\n\n db.session.execute(text(\"update words set WoStatusChanged = 'a'\"))\n", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.3076923076923077, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "3", + "got": "3", + "got_raw": "3\n assert retrieved.dictionaries[0].usefor == \"terms\"\n assert retrieved.dictionaries[0].dicttype == \"embeddedhtml\"\n assert retrieved.dictionaries[0].dicturi == \"1?[LUTE]\"\n assert retrieved.dictionaries[0].sort_order == 1\n assert retrieved.dictionaries[1].usefor == \"terms\"\n assert retrieved.dictionaries[1].dicttype == \"popuphtml\"\n assert retrieved.dictionaries[1].dicturi == \"2?[LUTE]\"\n assert retrieved.dictionaries[1].sort_order == 2\n assert retrieved.dictionaries[", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"1 day ago\"", + "got": "\"1 day ago\"", + "got_raw": " \"1 day ago\"\n b.last_backup_datetime = now - 172801\n assert b.time_since_last_backup == \"2 days ago\"\n b.last_backup_datetime = now - 259201\n assert b.time_since_last_backup == \"3 days ago\"\n b.last_backup_datetime = now - 345601\n assert b.time_since_last_backup == \"4 days ago\"\n b.last_backup_datetime = now - 432001\n assert b.time_since_last_backup == \"5 days ago\"\n b.last_backup_datetime = now", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n@then(parsers.parse('{language} term \"{term}\" should be:\\n{expected}'))\ndef then_term_tags(language, term, expected):\n repo = LanguageRepository(db.session)\n lang = repo.find_by_name(language)\n spec = Term(lang, term)\n term_repo = TermRepository(db.session)\n t = term_repo.find_by_spec(spec)\n pstring = \", \".join([p.text for p in t.parents])\n if pstring == \"\":\n pstring = \"-\"\n tstring = \", \".join(sorted([p.text for p in t.term_tags]))\n if tstring == \"\":\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "2", + "got": "2", + "got_raw": "2\n assert stats.unknownpercent == 50.0\n assert stats.status_distribution == [\n (0, 2),\n (1, 2),\n (2, 0),\n (3, 0),\n (4, 0),\n (5, 0),\n (98, 0),\n (99, 0),\n ]\n\n assert_record_count_equals(\"bookstats\", 1, \"cache not saved\")\n assert_stats([2, 2, 50.0, [(0, 2), (1, 2), (2,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "msg)", + "got": "1, msg)", + "got_raw": "1, msg)\n\ndef test_parent_status(repo, spanish):\n \"Test that parent status is propagated to child.\"\n term = fixture_term(repo, spanish)\n parent = fixture_parent(repo, spanish)\n term.parents.append(parent)\n assert_statuses(term, [\"T\", \"P\"], \"parent status not propagated\")\n\ndef test_parent_status2(repo, spanish):\n \"Test that parent status is propagated to child.\"\n term = fixture_term(repo, spanish)\n parent = fixture_parent(repo, spanish)\n term.parents.append(parent)\n term.status = 2\n assert_statuses(term, [\"T\", \"P\"], \"parent", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.7272727272727273, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"there\")", + "got": "t = Term(spanish, \"HOLA\")", + "got_raw": "<|fim_suffix|>\n t = Term(spanish, \"HOLA\")\n t.set_current_image(\"hello.png\")\n db.session.add(t)\n db.session.commit()\n sql = \"select WiWoID, WiSource from wordimages\"\n expected = [\"1; hello.png\"]\n assert_sql_result(sql, expected, \"hello\")\n\n t.set_current_image(\"there.png\")\n assert t.get_current_image() == \"there.png\"\n\n db.session.add(t)\n db.session.commit()\n expected = [\"1; there.png\"]\n\n assert_sql_result(sql, expected, \"there\")\n\n t.set_current_image(\"\")\n assert", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.30303030303030304, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"now set\")", + "got": "1)", + "got_raw": "1)\n\n us_repo.set_value(\"backup_count\", 5)\n db.session.commit()\n\n assert_sql_result(sql, [\"5\"], 1)\n\n us_repo.set_value(\"backup_count\", 5)\n db.session.commit()\n\n assert_sql_result(sql, [\"5\"], 1)\n\n us_repo.set_value(\"backup_count\", 5)\n db.session.commit()\n\n assert_sql_result(sql, [\"5\"], 1)\n\n us_repo.set_value(\"backup_count\", 5)\n db.session.commit()\n\n assert_sql_result(sql, [\"5\"], 1)\n\n us_repo.set_value(\"backup_count\", ", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "[(2,)]", + "got": "assert migrator.has_migrations(db) is False, \"have migrations\"", + "got_raw": "<|fim_suffix|>\n assert migrator.has_migrations(db) is False, \"have migrations\"\n migrator.do_migration(db)\n\n cur = db.cursor()\n vals = cur.execute(\"SELECT * from v1;\").fetchall()\n assert vals == [(1,)], \"migrations run\"\n\n migfile = migdirs / \"migrations\" / \"m.sql\"\n migfile.write_text(\"drop view if exists v1; create view v1 as select 2;\")\n assert migrator.has_migrations(db) is False, \"have migrations\"\n migrator.do_migration(db)\n\n cur = db.cursor()\n ", + "exact_match": false, + "code_bleu": 0.1354599427337814, + "edit_similarity": 0.058823529411764705, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"unknown\"", + "got": "\"unknown\"", + "got_raw": " \"unknown\"\n assert t.comment == \"unknown comment\"\n\ndef test_find_or_create_by_text_returns_existing_if_match(_hola_tag, app_context):\n \"Return existing.\"\n repo = TermTagRepository(db.session)\n assert repo.find_by_text(\"Hola\") is None\n t = repo.find_or_create_by_text(\"Hola\")\n\n assert t.text == \"Hola\"\n assert t.comment == \"Hola comment\"\n\ndef test_find_or_create_by_text_returns_existing_if_match_with_comment(_hola_tag, app_context):\n \"Return existing.\"\n repo = TermTagRepository(db.session)\n assert repo.find_by_text", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"no langs\")", + "got": "1)", + "got_raw": "1)\n assert_sql_result(story_sql, [], 1)\n\n lang = Service(db.session).get_language_def(\"English\")\n assert lang.language.name == \"English\"\n assert len(lang.books) == 1\n assert lang.books[0].title == \"Tutorial\"\n\n assert_sql_result(lang_sql, [\"English\"], 1)\n assert_sql_result(story_sql, [\"Tutorial\"], 1)\n\n\ndef test_load_def_loads_lang_and_stories_with_demo_data(app_context):\n \"Can load a language, with demo data.\"\n story_sql = \"select bktitle from books order by BkTitle\"\n", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"11 GB\"", + "got": "11234567890", + "got_raw": "11234567890\n assert dbf.size_bytes == 11234567890\n assert dbf.size == \"11.23 GB\"\n assert dbf.size_bytes == \"11234567890\"\n\ndef test_database_backup_file_last_modified(auto_backup_file):\n dbf = DatabaseBackupFile(auto_backup_file.path)\n\n with patch(\"lute.backup.service.DatabaseBackupFile.last_modified\", datetime(2024, 1, 1, 0, 0, 0, tzinfo=", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"deleted\")", + "got": "\"saved deleted\")", + "got_raw": " \"saved deleted\")\n\n\n\n# File: lute/read/render/calculate_textitems.py\n\"\"\"\nCalculate text items for a given text.\n\"\"\"\n\nfrom lute.models.term import Term\nfrom lute.read.render.service import Service as ReadService\nfrom lute.read.render.multiword_indexer import MultiwordTermIndexer\nfrom lute.read.render.service import Service as ReadService\nfrom lute.read.render.service import Service as ReadService\nfrom lute.read.render.service import Service as ReadService\nfrom lute.read.render.service import Service as ReadService\nfrom lute.read.render.service import Service as ReadService\nfrom lute.read", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.7692307692307693, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"42\"", + "got": "42", + "got_raw": "42\n sql = \"select StValue, StKeyType from settings where StKey = 'backup_count'\"\n assert_sql_result(sql, [\"42; system\"], \"loaded\")\n\n ss_repo.set_value(\"backup_count\", 43)\n db.session.commit()\n sql = \"select StValue, StKeyType from settings where StKey = 'backup_count'\"\n assert_sql_result(sql, [\"42; user\"], \"loaded\")\n u = us_repo.get_value(\"backup_count\")\n\n assert u == 42\n sql = \"select StValue, StKeyType from settings where StKey = 'backup", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "\"(default)\"", + "got": "\"Default\", \"Default theme\"", + "got_raw": " \"Default\", \"Default theme\"\n assert lst[1][1] == \"Lute\", \"Lute theme\"\n assert lst[2][1] == \"Lute2\", \"Lute2 theme\"\n assert lst[3][1] == \"Lute3\", \"Lute3 theme\"\n assert lst[4][1] == \"Lute4\", \"Lute4 theme\"\n assert lst[5][1] == \"Lute5\", \"Lute5 theme\"\n assert lst[6][1] == \"Lute6\", \"Lute", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.43243243243243246, + "n_retrieved": 10 + }, + { + "repo": "LuteOrg/lute-v3", + "expected": "t.text", + "got": "t.text.lower(), text", + "got_raw": " t.text.lower(), text\n\n tokens = langname.parser.get_parsed_tokens(text, langname)\n assert len(tokens) == expected_count, text\n\n assert tokens[0].is_word == True, text\n assert tokens[-1].is_word == True, text\n\n assert tokens[0].is_end_of_sentence == False, text\n assert tokens[-1].is_end_of_sentence == True, text\n\n assert tokens[0].is_word_char == True, text\n assert tokens[-1].is_word_char == True, text\n\n assert tokens[0].token == text[0], text", + "exact_match": false, + "code_bleu": 0.2626909894424158, + "edit_similarity": 0.46153846153846156, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "expected_signing_key", + "got": "assert isinstance(model, models.ComAtprotoServerReserveSigningKey.Response)", + "got_raw": "<|fim_suffix|>\n assert isinstance(model, models.ComAtprotoServerReserveSigningKey.Response)\n assert isinstance(model.signing_key, str)\n\n\n assert model.signing_key == expected_signing_key\n\n\ndef test_model_serialization_with_missing_field() -> None:\n test_data = {\n 'signingKey': 'blabla',\n }\n with pytest.raises(ModelError):\n get_or_create(test_data, models.ComAtprotoServerReserveSigningKey.Response)\n\n\ndef test_model_serialization_with_wrong_type() -> None:\n test_data = {\n 'signingKey': 123,\n }\n with pytest", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.18947368421052632, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "expected_pds", + "got": "expected_pds", + "got_raw": " expected_pds\n\n assert session_string_new == session.encode()\n\ndef test_session_new_format_migration() -> None:\n expected_pds = 'https://bsky.social'\n session_string_old = 'handle:::did:::access_jwt:::refresh_jwt:::https://bsky.social'\n session_string_new = f'handle:::did:::access_jwt:::refresh_jwt:::{expected_pds}'\n\n session = Session.decode(session_string_old)\n\n assert session.handle == 'handle'\n assert session.did == 'did'\n assert session.access_jwt == 'access_jwt'\n assert session.refresh_jwt ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "ValidationError)", + "got": "ValidationError) as exc_info:", + "got_raw": "ValidationError) as exc_info:\n UnknownUnionModel(py_type='app.bsky.embed.record#view')\n\n assert exc_info.value.errors() == [\n {\n 'loc': ('py_type',),\n 'msg': 'Unknown type: app.bsky.embed.record#view',\n 'type': 'unknown_type',\n }\n ]\n\n\n# File: docs/source/aliases_db.py\nimport typing as t\n\nfrom sphinx.addnodes import pending_xref\nfrom sphinx.ext.intersphinx import missing_reference\n\nfrom docs.source.aliases_db import ALIASES_DB\n\nif t.TYPE_CHECKING:\n from docutils", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.7111111111111111, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "DidNotFoundError)", + "got": "UnsupportedDidWebPathError):", + "got_raw": "UnsupportedDidWebPathError):\n await AsyncDidResolver().resolve('did:plc:unknown')\n\n@pytest.mark.asyncio\nasync def test_did_resolver_with_unknown_did_http() -> None:\n\n with pytest.raises(DidNotFoundError):\n await AsyncDidResolver().resolve('did:plc:unknown')\n\n@pytest.mark.asyncio\nasync def test_did_resolver_with_unknown_did_dns() -> None:\n\n with pytest.raises(DidNotFoundError):\n await AsyncDidResolver().resolve('did:plc:unknown')\n\n@pytest.mark.asyncio\nasync def test_did_resolver_with_unknown_did_plc_with_web() ->", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4444444444444444, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "expected_hostname", + "got": "assert at_uri.hostname == expected_hostname", + "got_raw": "<|fim_suffix|>\n assert at_uri.hostname == expected_hostname\n\ndef test_at_uri_hostname_with_underscore() -> None:\n test_uri = 'at://_ideas.bsky.social'\n expected_hostname = '_ideas.bsky.social'\n\n at_uri = AtUri.from_str(test_uri)\n\n assert at_uri.hostname == expected_hostname\n\ndef test_at_uri_hostname_with_underscore_and_digits() -> None:\n test_uri = 'at://_100ideas.bsky.social'\n expected_hostname = '_100ideas.bsky.social'\n\n at_uri = AtUri.from_str(test_uri)\n\n assert at_uri.hostname == expected_hostname", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.5666666666666667, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "'application/json'", + "got": "tions. The `atproto_client.request` module contains the `RequestBase` class that provides a base for all requests. The `RequestBase` class contains the `set_additional_headers` method that allows you to set additional headers. The `set_additional_headers` method takes a dictionary of headers as an argument. The dictionary keys are the header names, and the values are the header values.", + "got_raw": "<|fim_suffix|>tions. The `atproto_client.request` module contains the `RequestBase` class that provides a base for all requests. The `RequestBase` class contains the `set_additional_headers` method that allows you to set additional headers. The `set_additional_headers` method takes a dictionary of headers as an argument. The dictionary keys are the header names, and the values are the header values.\n\nThe `set_additional_headers` method sets the headers in the `RequestBase` object. The headers are added to the `RequestBase` object's `headers` attribute.\n\nThe `set_additional_headers` method does not modify the `", + "exact_match": false, + "code_bleu": 0.013987724298778636, + "edit_similarity": 0.034482758620689655, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "valid_data['did']", + "got": "", + "got_raw": " # No interop test file for DID\n\n # Test invalid data fails\n with pytest.raises(ValidationError):\n get_or_create(\n {'handle': invalid_data['handle'], 'did': invalid_data['did']}, FooModel, strict_string_format=True\n )\n\n # Test that get_or_create uses strict validation.\n class FooModel(BaseModel):\n handle: string_formats.Handle\n did: string_formats.Did\n\n # Test valid data passes\n instance = get_or_create(\n {'handle': valid_data['handle'], 'did': valid_data['did']}, FooModel, strict_string_format=True", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "client.request.get_headers()", + "got": "t = client.with_bsky_chat_proxy()", + "got_raw": "<|fim_suffix|>t = client.with_bsky_chat_proxy()\n\n\n assert _ATPROTO_PROXY_HEADER not in client.headers\n assert _ATPROTO_PROXY_HEADER in dm_client.headers<|fim_middle|>client.headers\n assert _ATPROTO_PROXY_HEADER in dm_client.headers\n\n\ndef test_client_with_bsky_chat_proxy_async() -> None:\n client = AsyncClient()\n dm_clien", + "exact_match": false, + "code_bleu": 0.3073940764756322, + "edit_similarity": 0.4262295081967213, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "'2023-07-20T10:17:40.298101'", + "got": "1672840000", + "got_raw": "1672840000\n assert model.value['created_at'] == 1672840000\n\n assert model.value.text == 'test record namespaces'\n assert model.value['text'] == 'test record namespaces'\n\n assert model.value.embed is None\n assert model.value['embed'] is None\n\n assert model.value.embed is None\n assert model.value['embed'] is None\n\n assert model.value.embed is None\n assert model.value['embed'] is None\n\n assert model.value.embed is None\n assert model.value['embed'] is None\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2631578947368421, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "str(at_uri)", + "got": "str(at_uri)", + "got_raw": " str(at_uri)\n assert test_uri == str(at_uri2)\n\n assert test_uri == at_uri.to_str()\n assert test_uri == at_uri2.to_str()\n\n assert test_uri == at_uri.to_str()\n assert test_uri == at_uri2.to_str()\n\n assert test_uri == at_uri.to_str()\n assert test_uri == at_uri2.to_str()\n\n assert test_uri == at_uri.to_str()\n assert test_uri == at_uri2.to_str()\n\n assert test_uri == at_uri.to_str()\n assert test_uri == at_uri2.to", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "expected_did_plc", + "got": "assert did_plc == expected_did_plc", + "got_raw": "<|fim_suffix|>\n assert did_plc == expected_did_plc\n\n did_plc = await AsyncHandleResolver().ensure_resolve(expected_handle)\n\n assert did_plc == expected_did_plc\n\n did_plc = await AsyncHandleResolver().ensure_resolve(expected_handle)\n\n assert did_plc == expected_did_plc\n\n did_plc = await AsyncHandleResolver().ensure_resolve(expected_handle)\n\n assert did_plc == expected_did_plc\n\n did_plc = await AsyncHandleResolver().ensure_resolve(expected_handle)\n\n assert did_plc == expected_did_plc\n\n did_plc = await", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.64, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "car.root", + "got": "assert car.root_hash == expected_root", + "got_raw": "<|fim_suffix|>\n assert car.root_hash == expected_root\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car.root_hash\n assert car.root_hash == car", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.35555555555555557, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "'foo'", + "got": "assert isinstance(model, models.ComAtprotoServerReserveSigningKey.Response)", + "got_raw": "<|fim_suffix|>\n assert isinstance(model, models.ComAtprotoServerReserveSigningKey.Response)\n assert isinstance(model.signing_key, str)\n\n assert model.signing_key == expected_signing_key\n assert model['signing_key'] == expected_signing_key\n\n assert model.model_extra is not None\n\n # also, we want to have access to new fields from SDK\n # the problem here is that we can't access them via snake_case,\n # could be fixed in the future\n\n assert model.brandNewBackendField == 'foo'\n assert model['brand_new_backend_field'] == 'foo'\n\n ", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.05, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "expected_json_schema", + "got": "assert isinstance(model.cid, CID)", + "got_raw": "<|fim_suffix|>\n assert isinstance(model.cid, CID)\n assert model.cid == CID.decode(test_cid)\n\n model_json = model.model_dump_json()\n assert model_json == f'{{\"cid\":\"{test_cid}\"}}'\n\n expected_json_schema = {\n 'title': '_TestModel',\n 'type': 'object',\n 'properties': {\n 'cid': {\n 'title': 'Cid',\n 'type': 'string',\n },\n },\n 'required': ['cid'],\n }\n schema = model.model_json_schema()\n\n assert schema == expected_json_schema\n\n model = _TestModel(**", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.03773584905660377, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "blob_ref.ref.link", + "got": "assert blob_ref.to_dict() == {", + "got_raw": "<|fim_suffix|>\n assert blob_ref.to_dict() == {\n 'mime_type': 'text/plain',\n 'size': 0,\n 'ref': {\n 'link': 'bafyreidfayvfuwqa7qlnopdjiqrxzs6blmoeu4rujcjtnci5beludirz2a',\n },\n }\n\n assert blob_ref.to_ipld_json() == {\n 'mime_type': 'text/plain',\n 'size': 0,\n 'ref': {\n 'link': 'bafyreidfayvfuwqa7qlnopd", + "exact_match": false, + "code_bleu": 0.18575057999133596, + "edit_similarity": 0.425531914893617, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "expected_purpose", + "got": "t = client.app.bsky.graph.get_follows(client.me.did, limit=10)", + "got_raw": "<|fim_suffix|>t = client.app.bsky.graph.get_follows(client.me.did, limit=10)\n for uri, follow in follows.records.items():\n print(uri, follow.viewer.handle)\n\n follow = client.app.bsky.graph.get_follows.get(client.me.did, AtUri.from_str(uri).rkey)\n print(follow.viewer.handle)\n\n follow_record = models.AppBskyGraphGetFollows.Record(handle='marshal.dev', viewer=models.AppBskyActorDefs.ProfileView(handle='marshal.dev'))\n new_follow = client.app.bsky.graph.get_follows.create(client.me.did, follow_record)\n print(new_follow)\n\n ", + "exact_match": false, + "code_bleu": 0.04657469807170698, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "expected_pubkey_multibase", + "got": "* Add `get_author_feed` method to the `Client` class by @MarshalX in https://github.com/MarshalX/atproto/pull/134", + "got_raw": "<|fim_suffix|>\n* Add `get_author_feed` method to the `Client` class by @MarshalX in https://github.com/MarshalX/atproto/pull/134\n* Add `get_author_feed` method to the `Client` class by @MarshalX in https://github.com/MarshalX/atproto/pull/133\n* Add `get_author_feed` method to the `Client` class by @MarshalX in https://github.com/MarshalX/atproto/pull/132\n* Add `get_author_feed` method to the `Client` class by @MarshalX in https://", + "exact_match": false, + "code_bleu": 0.03280894525012139, + "edit_similarity": 0.13043478260869565, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "expected_did", + "got": "expected_did", + "got_raw": " expected_did\n assert atproto_data.did_key == expected_did_key\n assert atproto_data.handle == expected_handle\n\n@pytest.mark.asyncio\nasync def test_atproto_data_resolve_atproto_data_with_handle() -> None:\n expected_did = 'did:plc:kvwvcn5iqfooopmyzvb4qzba'\n expected_did_key = 'did:key:zQ3shc6V2kvUxn7hNmPy9JMToKT7u2NH27SnKNxGL1GcBcS4j'\n expected_handle = 'test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "bytes_blob_ref.ref", + "got": "0", + "got_raw": "0\n assert json_blob_ref.ref.cid == CID(plain_cid)\n assert json_blob_ref.ref.size == 0\n assert json_blob_ref.ref.mime_type == 'text/plain'\n\n assert json_blob_ref.to_bytes_representation() == bytes_blob_ref.to_bytes_representation()\n\n bytes_blob_ref = BlobRef(\n mime_type='text/plain',\n size=0,\n ref=plain_cid,\n )\n\n json_blob_ref = bytes_blob_ref.to_json_representation()\n assert not json_blob_ref.is_bytes_representation\n assert json_blob_ref.is_json_representation\n\n assert json_blob_ref.ref.link == 0\n assert", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MarshalX/atproto", + "expected": "did_doc", + "got": "", + "got_raw": "<|fim_suffix|>\n # 1. Create a new DID document\n did_doc = await client.com.atproto.did.create_did_document(\n models.ComAtprotoDidCreateDIDDocument.Params(\n did=did_web,\n handle='marshal.dev',\n keys=[\n models.ComAtprotoDidCreateDIDDocument.Keys(\n type='ed25519',\n public_key_base58='25519:25519:25519:25519:25519:25519:25519:25", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "self.bag.messages())", + "got": ".assertEqual(self.bag.get(\"email\"), \"Your email is invalid\")", + "got_raw": ".assertEqual(self.bag.get(\"email\"), \"Your email is invalid\")\n self.assertEqual(self.bag.get(\"username\"), \"Your username too short\")\n\n def test_get_messages_with_key(self):\n self.bag.reset()\n self.bag.add(\"email\", \"Your email is invalid\")\n self.bag.add(\"username\", \"Your username too short\")\n\n self.assertEqual(self.bag.get(\"email\"), \"Your email is invalid\")\n self.assertEqual(self.bag.get(\"username\"), \"Your username too short\")\n\n def test_get_messages_with_key(self):\n self.bag.reset()\n self.bag.add(\"email\",", + "exact_match": false, + "code_bleu": 0.27668736912821895, + "edit_similarity": 0.35, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "str", + "got": "str", + "got_raw": " str\n\n def test_should_return_hash_content_as_bytes(self):\n\n for driver in Hash.drivers.keys():\n hashed = Hash.make_bytes(\"masonite\", driver=driver)\n\n assert type(hashed) == bytes\n\n def test_should_return_hash_content_as_string(self):\n\n for driver in Hash.drivers.keys():\n hashed = Hash.check(\"masonite\", \"masonite\", driver=driver)\n\n assert type(hashed) == bool\n\n def test_should_return_hash_content_as_string(self):\n\n for driver in Hash.drivers.keys():\n hashed = Hash.needs_rehash(\"masonite", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "location)", + "got": "location)", + "got_raw": " location)\n\n def test_views_path(self):\n location = views_path()\n\n self.assertEqual(location, base_path(\"resources/views\"))\n\n def test_controllers_path(self):\n location = controllers_path()\n\n self.assertEqual(location, base_path(\"app/controllers\"))\n\n def test_seeds_path(self):\n location = seeds_path()\n\n self.assertEqual(location, base_path(\"database/seeds\"))\n\n def test_migrations_path(self):\n location = migrations_path()\n\n self.assertEqual(location, base_path(\"database/migrations\"))\n\n def test_config_path(self):\n location = config_path()\n\n self.assertEqual(location, base_path(\"config\"))\n\n def", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "self.bag.empty())", + "got": "self.bag.has(\"email\"))", + "got_raw": " self.bag.has(\"email\"))\n self.assertFalse( self.bag.has(\"name\"))\n\n def test_message_bag_has_any_errors(self):\n self.bag.reset()\n\n self.assertTrue( self.bag.has(\"email\"))\n self.assertFalse( self.bag.has(\"name\"))\n\n def test_message_bag_has_any_errors(self):\n self.bag.reset()\n\n self.assertTrue( self.bag.has(\"email\"))\n self.assertFalse( self.bag.has(\"name\"))\n\n def test_message_bag_has_any_errors(self):\n self.bag.reset()\n\n self.assertTrue( self.bag.has(\"email\"))\n self.assertFalse( self.bag", + "exact_match": false, + "code_bleu": 0.4671379777282001, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "bindings.keys())", + "got": "bindings)", + "got_raw": " bindings)\n self.assertIn(\"controllers.location\", bindings)\n self.assertIn(\"middleware.location\", bindings)\n self.assertIn(\"providers.location\", bindings)\n self.assertIn(\"services.location\", bindings)\n self.assertIn(\"view.location\", bindings)\n\n def test_can_bind_to_container(self):\n self.application.bind(\"container.test\", \"test\")\n self.assertEqual(self.application.make(\"container.test\"), \"test\")\n\n def test_can_bind_to_container_with_class(self):\n self.application.bind(\"container.test\", SayHello)\n self.assertEqual(self.application.make(\"container.test\").say_hello(), \"Hello World\")\n\n def test_can_bind_to_container_with_class", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.72, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "\"value\")", + "got": "1)", + "got_raw": "1)\n self.assertEqual(bag.get(\"test\"), 1)\n self.assertEqual(bag.get(\"param\"), \"hey\")\n self.assertEqual(bag.get(\"foo\"), [9, 8, 7, 6])\n self.assertEqual(bag.get(\"bar\"), \"baz\")\n\n def test_can_parse_multipart_formdata_content_type_with_json(self):\n data, content_type = encode_multipart_formdata({\"key\": \"value\", \"test\": 1})\n bag = InputBag()\n bag.load(\n {\n \"REQUEST_METHOD\": \"POST\",\n \"CONTENT_TYPE\": content_type,\n \"CONTENT", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "user.notifications.count())", + "got": "0)", + "got_raw": "0)\n\n def test_notifiable_get_unread_notifications(self):\n user = User.find(1)\n\n self.assertEqual(0, 0)\n\n def test_notifiable_mark_as_read(self):\n user = User.find(1)\n\n self.assertEqual(0, 0)\n\n def test_notifiable_mark_as_unread(self):\n user = User.find(1)\n\n self.assertEqual(0, 0)\n\n def test_notifiable_is_read(self):\n user = User.find(1)\n\n self.assertEqual(0, 0)\n\n def test_notifiable_is_unread(self):\n user = User.find(1", + "exact_match": false, + "code_bleu": 0.13432124147794275, + "edit_similarity": 0.06896551724137931, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "\"2\")", + "got": "2)", + "got_raw": "2)\n\n def test_can_decrement(self):\n self.session.set(\"count\", \"1\")\n self.assertEqual(self.session.get(\"count\"), \"1\")\n self.session.decrement(\"count\")\n\n self.assertEqual(self.session.get(\"count\"), 0)\n\n def test_can_remember(self):\n self.session.set(\"count\", \"1\")\n self.assertEqual(self.session.get(\"count\"), \"1\")\n self.session.remember(\"count\", lambda session: session.set(\"count\", \"2\"))\n\n self.assertEqual(self.session.get(\"count\"), \"2\")\n\n def test_can_remember_with_callable(self):\n self.session.set(\"", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "count + 1", + "got": "1", + "got_raw": "1\n assert user.notifications.first().data == {\n \"name\": \"Welcome\",\n \"message\": \"Welcome to the application\",\n }\n\n def test_send_to_anonymous_notifiable(self):\n user = User.find(1)\n count = user.notifications.count()\n user.notify(WelcomeNotification())\n assert user.notifications.count() == 1\n assert user.notifications.first().data == {\n \"name\": \"Welcome\",\n \"message\": \"Welcome to the application\",\n }\n\n def test_send_to_anonymous_notifiable_with_route(self):\n user = User.find(1)\n count = user.notifications.count", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "\"c\")", + "got": "\"c\")", + "got_raw": " \"c\")\n self.assertEqual(data_get(struct, \"a.nested.a\"), 1)\n self.assertEqual(data_get(struct, \"a.nested.a\", 0), 1)\n self.assertEqual(data_get(struct, \"a.nested.a\", 1), 0)\n self.assertEqual(data_get(struct, \"a.nested.a\", 2), None)\n self.assertEqual(data_get(struct, \"a.nested.a\", 2, 2), 2)\n self.assertEqual(data_get(struct, \"a.nested.a\", 2, 3), 3)\n self.assertEqual", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "None)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(data_get(struct, \"a.nested.unknown\", 1), 1)\n\n self.assertEqual(data_get(struct, \"a.nested.unknown\", \"default\"), \"default\")\n\n self.assertEqual(data_get(struct, \"a.nested.unknown\", \"default\", 1), 1)\n\n self.assertEqual(data_get(struct, \"a.nested.unknown\", \"default\", \"default\"), \"default\")\n\n self.assertEqual(data_get(struct, \"a.nested.unknown\", \"default\", \"default\", 1), 1)\n\n self.assertEqual(data_get(struct, \"a.nested.unknown\", \"default\", \"default\",", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "self.errors.messages())", + "got": "self.errors.get_messages(\"email\"))", + "got_raw": " self.errors.get_messages(\"email\"))\n self.assertIn(\"email must be a valid email\", self.errors.get_messages(\"email\"))\n\n def test_get_message(self):\n\n self.assertEqual(\"email is required\", self.errors.get_message(\"email\", \"email is required\"))\n self.assertEqual(\"email must be a valid email\", self.errors.get_message(\"email\", \"email must be a valid email\"))\n\n def test_get_message_with_default(self):\n\n self.assertEqual(\"email is required\", self.errors.get_message(\"email\", \"email is required\", \"default\"))\n self.assertEqual(\"email must be a valid email\", self.errors", + "exact_match": false, + "code_bleu": 0.4671379777282001, + "edit_similarity": 0.8070175438596491, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "\"arg2\")", + "got": "\"arg2\")", + "got_raw": " \"arg2\")\n\n def test_can_run_middleware_without_args(self):\n request = self.make_request()\n response = self.make_response()\n capsule = MiddlewareCapsule()\n MockMiddleware.before = MagicMock(return_value=request)\n capsule.add(\n {\n \"mock\": MockMiddleware,\n }\n )\n\n capsule.run_route_middleware([\"mock\"], request, response)\n\n MockMiddleware.before.assert_called_with(request, response)\n\n def test_can_run_middleware_with_kwargs(self):\n request = self.make_request()\n response = self.make_response()\n capsule = MiddlewareCapsule()\n MockMiddleware.before = MagicMock(return_value=request", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "validate.get(\"age\"))", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n validate.errors,\n {\n \"username\": [\"Custom Message for required Username.\"],\n \"not_email\": [\"Custom Message for Email not being an email.\"],\n \"valid_email\": [\"Custom Message for required Email.\"],\n \"valid_email.email\": [\"Custom Message for Email being a valid email.\"],\n \"age\": [\"Custom: Age must not be in 20, 21 and must not be numeric.\"],\n },\n )\n\n def test_custom_messages_with_custom_error(self):\n request = self.make_request(post_data={\"not_email\": \"joe@masonite.com\", \"age", + "exact_match": false, + "code_bleu": 0.21428571428571425, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "parse_human_time(\"2 hour\"))", + "got": "12, parse_human_time(\"12 seconds\"))", + "got_raw": "12, parse_human_time(\"12 seconds\"))\n self.assertEqual(12, parse_human_time(\"12 minutes\"))\n\n def test_migration_timestamp(self):\n self.fakeTime(pendulum.datetime(2021, 1, 1, 12, 0, 0))\n self.assertEqual(\"2021-01-01 12:00:00\", migration_timestamp())\n\n def test_cookie_expire_time(self):\n self.fakeTime(pendulum.datetime(2021, 1, 1, 12, 0, 0))\n", + "exact_match": false, + "code_bleu": 0.3073940764756322, + "edit_similarity": 0.7741935483870968, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "SayHello)", + "got": "SayHello)", + "got_raw": " SayHello)\n\n # Second pass - in container\n self.assertTrue(self.application.has(SayHello))\n say_hello = self.application.make(SayHello)\n\n self.assertIsInstance(say_hello, SayHello)\n\n def test_container_can_resolve_classes_with_binding(self):\n # First pass - not in container\n self.assertFalse(self.application.has(GreetingService))\n greeting_service = self.application.make(GreetingService)\n\n self.assertIsInstance(greeting_service, GreetingService)\n\n # Second pass - in container\n self.assertTrue(self.application.has(GreetingService))\n greeting_service = self.application.make(GreetingService)\n\n self.assertIsInstance", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "request.accepts_json())", + "got": "request.accepts(\"application/json\"), \"Request should accept json\"", + "got_raw": "\n request.accepts(\"application/json\"), \"Request should accept json\"\n )\n\n def test_requests_accepts_json_with_multiple_accepts(self):\n request = self.make_request(\n {\"HTTP_ACCEPT\": \"application/json, application/xml\"}\n )\n\n self.assertTrue(\n request.accepts(\"application/json\"), \"Request should accept json\"\n )\n\n def test_requests_accepts_json_with_multiple_accepts_and_precedence(self):\n request = self.make_request(\n {\"HTTP_ACCEPT\": \"application/xml, application/json\"}\n )\n\n self.assertTrue(\n request.accepts(\"application/json\"), \"Request should accept json\"\n ", + "exact_match": false, + "code_bleu": 0.239802967618271, + "edit_similarity": 0.45454545454545453, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "value", + "got": "value", + "got_raw": " value\n return self\n\n def assertJsonMissingPath(self, path):\n \"\"\"Assert that response is JSON and does not contain the given path.\"\"\"\n response_data = self._ensure_response_is_json()\n assert path not in response_data\n return self\n\n def assertJsonMissing(self, data={}):\n \"\"\"Assert that response is JSON and does not contain the given data dictionary. The\n assertion will pass even if it is not an exact match.\"\"\"\n response_data = self._ensure_response_is_json()\n assert data.items() <= response_data.items()\n return self\n\n def assertJsonMissingPath(self,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "\"\")", + "got": "0)", + "got_raw": "0)\n return self\n\n def assertConsoleHasNoErrors(self) -> \"TestCase\":\n \"\"\"Assert that nothing has been output to console standard error.\"\"\"\n self._readConsoleOutput()\n\n self.assertEqual(self._console_err, 0)\n return self\n\n def assertConsoleHasOutput(self) -> \"TestCase\":\n \"\"\"Assert that something has been output to console.\"\"\"\n self._readConsoleOutput()\n\n self.assertNotEqual(self._console_out, 0)\n return self\n\n def assertConsoleHasNoOutput(self) -> \"TestCase\":\n \"\"\"Assert that nothing has been output to console.\"\"\"\n self._read", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "MasoniteFramework/masonite", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def test_remaining(self):\n RateLimiter.attempt(\"test_key\", my_function, 2)\n RateLimiter.attempt(\"test_key\", my_function, 2)\n\n assert RateLimiter.remaining(\"test_key\") == 0\n\n def test_too_many_attempts(self):\n RateLimiter.attempt(\"test_key\", my_function, 2)\n RateLimiter.attempt(\"test_key\", my_function, 2)\n\n assert RateLimiter.too_many_attempts(\"test_key\") == True\n\n def test_available_in(self):\n RateLimiter.attempt(\"test_key\",", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MaxHalford/prince", + "expected": "[ \"alcohol_by_volume\", \"final_gravity\", \"international_bitterness_units\", \"standard_reference_method\", ]", + "got": "[\"alcohol\", \"abv\", \"beer_serving\", \"beer_serving_1\", \"beer_serving_2\", \"beer_serving_3\", \"beer_serving_4\", \"beer_serving_5\", \"beer_serving_6\", \"beer_serving_7\", \"beer_serving_8\", \"beer_serving_9\", \"beer_serving_10\", \"beer_serving_11\", \"beer_serving_12\", \"beer_serving_13\", \"beer_serving_14\", \"beer_serving_15\", \"beer_serving", + "got_raw": " [\"alcohol\", \"abv\", \"beer_serving\", \"beer_serving_1\", \"beer_serving_2\", \"beer_serving_3\", \"beer_serving_4\", \"beer_serving_5\", \"beer_serving_6\", \"beer_serving_7\", \"beer_serving_8\", \"beer_serving_9\", \"beer_serving_10\", \"beer_serving_11\", \"beer_serving_12\", \"beer_serving_13\", \"beer_serving_14\", \"beer_serving_15\", \"beer_serving", + "exact_match": false, + "code_bleu": 0.040668703998563635, + "edit_similarity": 0.17289719626168223, + "n_retrieved": 10 + }, + { + "repo": "MaxHalford/prince", + "expected": "aligned_shapes.shape)", + "got": "aligned_shapes.shape)", + "got_raw": " aligned_shapes.shape)\n\n def test_fit_transform(self):\n gpa = prince.GPA(copy=True)\n aligned_shapes = gpa.fit_transform(self.shapes)\n self.assertIsInstance(aligned_shapes, np.ndarray)\n\n self.assertEqual(self.shapes.shape, aligned_shapes.shape)\n\n def test_fit_transform_copy(self):\n gpa = prince.GPA(copy=True)\n aligned_shapes = gpa.fit_transform(self.shapes)\n self.assertIsInstance(aligned_shapes, np.ndarray)\n\n self.assertEqual(self.shapes.shape, aligned_shapes.shape)\n\n def test_fit_transform_no_copy(self):\n gpa = prince.GPA(copy=False)\n aligned_shapes =", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MaxHalford/prince", + "expected": "P * 100)", + "got": "100 * P, rtol=1e-3)", + "got_raw": "100 * P, rtol=1e-3)\n\n def test_row_coordinates(self):\n F = load_df_from_R(\"famd$ind$coord\")\n P = self.famd.row_coordinates_\n\n np.testing.assert_allclose(F, 100 * P, rtol=1e-3)\n\n def test_row_cosine_similarities(self):\n F = load_df_from_R(\"famd$ind$cos2\")\n P = self.famd.row_cosine_similarities_\n\n np.testing.assert_allclose(F, 100 * P, rtol=1e", + "exact_match": false, + "code_bleu": 0.15851165692617156, + "edit_similarity": 0.2962962962962963, + "n_retrieved": 10 + }, + { + "repo": "MaxHalford/prince", + "expected": "P * 100)", + "got": "100 * P, rtol=1e-3)", + "got_raw": "100 * P, rtol=1e-3)\n\n def test_row_contrib_sup(self):\n F = load_df_from_R(\"mfa$ind.sup$contrib\").iloc[:, : self.mfa.n_components]\n P = self.mfa.row_contributions_sup_\n\n np.testing.assert_allclose(F, 100 * P, rtol=1e-3)\n\n def test_row_contrib_sup_groups(self):\n F = load_df_from_R(\"mfa$ind.sup.groups$contrib\").iloc[:, : self.mfa.n_components]\n P = self.mfa.row_contributions_sup_groups_\n\n", + "exact_match": false, + "code_bleu": 0.15851165692617156, + "edit_similarity": 0.2962962962962963, + "n_retrieved": 10 + }, + { + "repo": "MaxHalford/prince", + "expected": "np.abs(P))", + "got": "1, atol=1e-10)", + "got_raw": "1, atol=1e-10)\n np.testing.assert_allclose(np.abs(P), 1, atol=1e-10)\n\n def test_svd_V(self):\n G = load_df_from_R(\"ca$svd$V\").to_numpy()\n Q = sparse.diags(self.ca.col_masses_.to_numpy() ** -0.5) @ self.ca.svd_.V.T\n\n np.testing.assert_allclose(np.abs(G), 1, atol=1e-10)\n np.testing.assert_allclose(np.abs(Q), 1, atol=1e-10", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "Mayitzin/ahrs", + "expected": "0.1)", + "got": "0.1)", + "got_raw": "0.1)\n self.assertEqual(ahrs.filters.aqua.adaptive_gain(acc, alpha_bar=0.01, t1=0.1, t2=0.2), 0.08615664547367627)\n self.assertEqual(ahrs.filters.aqua.adaptive_gain(acc, alpha_bar=0.01, t1=0.2, t2=0.5), 0.0)\n self.assertEqual(ahrs.filters.aqua.adaptive_gain(acc, alpha_bar=0.01, t1=0", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Mayitzin/ahrs", + "expected": "0.0)", + "got": "0.0)", + "got_raw": "0.0)\n self.assertEqual(self.q0.y, 0.0)\n self.assertEqual(self.q0.z, 0.0)\n\n self.assertEqual(self.q0.v[0], 0.0)\n self.assertEqual(self.q0.v[1], 0.0)\n self.assertEqual(self.q0.v[2], 0.0)\n\n def test_vector_quaternion(self):\n self.assertEqual(self.q3.w, 0.0)\n self.assertEqual(self.q3.x, self.vector3[0])\n self.assertEqual(self.q3.y, self.vector3[1])\n self.assertEqual(self", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Mayitzin/ahrs", + "expected": "1.0)", + "got": "1.0, places=10)", + "got_raw": "1.0, places=10)\n self.assertTrue(np.allclose(self.R@self.R.T, np.identity(3)))\n\n def test_rotation_matrix_from_rpy(self):\n self.assertAlmostEqual(np.linalg.norm(self.R@self.R.T - np.identity(3)), 0.0, places=10)\n\n def test_rotation_matrix_from_quaternion(self):\n self.assertAlmostEqual(np.linalg.norm(self.R1@self.R1.T - np.identity(3)), 0.0, places=10)\n\n def test_rotation_matrix_from_vector(self):\n self.assertAlmostEqual(np.linalg.norm(self.R@self.R.T - np", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.42105263157894735, + "n_retrieved": 10 + }, + { + "repo": "Mayitzin/ahrs", + "expected": "self.q4.w)", + "got": "0.0, self.decimal_precision)", + "got_raw": "0.0, self.decimal_precision)\n self.assertAlmostEqual(qc[1], -self.vector4[0], self.decimal_precision)\n self.assertAlmostEqual(qc[2], -self.vector4[1], self.decimal_precision)\n self.assertAlmostEqual(qc[3], -self.vector4[2], self.decimal_precision)\n\n def test_norm(self):\n self.assertAlmostEqual(self.q0.norm, 1.0, self.decimal_precision)\n self.assertAlmostEqual(self.q3.norm, 1.0, self.decimal_precision)\n self.assertAlmostEqual(self.q4.norm, 1.0, self.decimal_precision", + "exact_match": false, + "code_bleu": 0.31239399369202553, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "Mayitzin/ahrs", + "expected": "3.0)", + "got": "3.0)", + "got_raw": "3.0)\n self.assertEqual(circle.min(), -3.0)\n self.assertEqual(circle.shape, (10, 2))\n\n def test_geometry_circle_default(self):\n circle = ahrs.common.geometry.circle([1, 1])\n\n self.assertEqual(circle.max(), 3.0)\n self.assertEqual(circle.min(), -3.0)\n self.assertEqual(circle.shape, (20, 2))\n\n def test_geometry_ellipse_custom(self):\n ellipse = ahrs.common.geometry.ellipse([1, 1], 0.5, [2, 1], 10)\n\n self.assertEqual(", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "\"important\"", + "got": "\"important\"", + "got_raw": " \"important\"\n\n def test_with_tooltip(self) -> None:\n \"\"\"Checks if an object with a tooltip has been created\"\"\"\n obj = drawpyo.XMLBase(tooltip=\"important\")\n\n assert obj.tooltip == \"important\"\n\n def test_with_id(self) -> None:\n \"\"\"Checks if an object with an id has been created\"\"\"\n obj = drawpyo.XMLBase(id=12345)\n\n assert obj.id == 12345\n\n def test_with_attributes(self) -> None:\n \"\"\"Checks if an object with attributes has been created\"\"\"\n obj = drawpyo", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "l", + "got": "l", + "got_raw": " l\n assert parent.tree_children[1] is r\n\n def test_add_left_and_add_right_assign_tree(self):\n \"\"\"Helpers should attach nodes to the diagram and set parent links.\"\"\"\n bt = BinaryTreeDiagram()\n parent = BinaryNodeObject(value=\"Parent\")\n l = BinaryNodeObject(value=\"L\")\n r = BinaryNodeObject(value=\"R\")\n\n bt.add_left(parent, l)\n bt.add_right(parent, r)\n\n assert l._tree_parent is parent\n assert r._tree_parent is parent\n assert l.tree is bt\n assert r.tree is bt\n # left at", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "None", + "got": "None", + "got_raw": " None\n assert scheme.stroke_color is None\n assert scheme.font_color is None\n\ndef test_hex_values_allowed():\n scheme = ColorScheme(fill_color=\"#AABBCC\", stroke_color=\"#FF0000\", font_color=\"#000000\")\n\n assert scheme.fill_color == \"#AABBCC\"\n assert scheme.stroke_color == \"#FF0000\"\n assert scheme.font_color == \"#000000\"\n\ndef test_default_color_values_allowed():\n scheme = ColorScheme(fill_color=StandardColor.BLUE5, stroke_color=StandardColor.GRAY4, font_color=StandardColor.RED", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "p1", + "got": "p1", + "got_raw": " p1\n assert p1.left is child\n assert p1.tree_children[0] is child\n\n p1.left = None\n\n assert child._tree_parent is None\n assert p1.left is None\n assert p1.tree_children[0] is None\n\n def test_move_child_between_parents_using_setter(self):\n \"\"\"Assigning a child to a new parent removes it from the old parent's children.\"\"\"\n p1 = BinaryNodeObject(value=\"P1\")\n p2 = BinaryNodeObject(value=\"P2\")\n child = BinaryNodeObject(value=\"C\")\n\n p1.left", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "(30, 40)", + "got": "(30, 40)", + "got_raw": " (30, 40)\n\n def test_move_updates_geometry(self, simple_mapping):\n \"\"\"Moving legend shifts all objects\"\"\"\n legend = Legend(mapping=simple_mapping, position=(10, 10))\n original_geometry = legend.group.geometry\n\n legend.move((30, 40))\n\n assert legend.group.geometry == original_geometry + (20, 30)\n\n def test_move_updates_page(self, simple_mapping):\n \"\"\"Moving legend shifts all objects\"\"\"\n legend = Legend(mapping=simple_mapping, position=(10, 10))\n original_page = legend.page\n\n legend.move", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "20", + "got": "20", + "got_raw": "20\n assert chart.position == (0, 0)\n assert chart.size == 200\n assert chart.slice_colors == [\"#66ccff\"]\n assert chart.title == None\n assert chart.title_text_format == TextFormat()\n assert chart.label_text_format == TextFormat()\n assert chart.background_color == None\n assert chart.label_formatter == PieChart.default_label_formatter\n assert chart.slice_colors == [\"#66ccff\"]\n assert chart.slice_colors[0] == ColorScheme(\n fill_color=\"#66ccff\",\n stroke_color=\"#66ccff\",\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "obj_style", + "got": "obj_style", + "got_raw": " obj_style\n assert obj_style[\"fillColor\"] == \"#FF0000\"\n assert \"strokeColor\" in obj_style\n assert obj_style[\"strokeColor\"] == \"#000000\"\n\n # Check that the template styles have been copied\n template1_style = parse_style(template1.style)\n\n assert \"fillColor\" in template1_style\n assert template1_style[\"fillColor\"] == \"#FF0000\"\n assert \"strokeColor\" in template1_style\n assert template1_style[\"strokeColor\"] == \"#000000\"\n\n # Check", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "5", + "got": "5", + "got_raw": "5\n assert len(diagram.groups) == 2\n assert len(diagram.groups[0].objects) == 2\n assert len(diagram.groups[1].objects) == 2\n assert diagram.groups[0].objects[0].value == \"B\"\n assert diagram.groups[0].objects[1].value == \"C\"\n assert diagram.groups[1].objects[0].value == \"D\"\n assert diagram.groups[1].objects[1].value == \"E\"\n\n def test_from_dict_scalar(self):\n \"\"\"Test a dictionary with a scalar value.\"\"\"\n data =", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "50", + "got": "50", + "got_raw": "50\n\n def test_stroke_color(self, empty_page: drawpyo.Page) -> None:\n \"\"\"Checks the stroke color setting\"\"\"\n edge = Edge(page=empty_page, strokeColor=\"red\")\n\n assert edge.strokeColor == \"red\"\n\n def test_fill_color(self, empty_page: drawpyo.Page) -> None:\n \"\"\"Checks the fill color setting\"\"\"\n edge = Edge(page=empty_page, fillColor=\"red\")\n\n assert edge.fillColor == \"red\"\n\n def test_color_scheme(self, empty_page: drawpyo.Page) -> None:\n \"\"\"Checks the color scheme setting\"\"\"\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "TypeError)", + "got": "", + "got_raw": "\n\n\n# File: src/drawpyo/diagram/edges.py\nfrom __future__ import annotations\n\nfrom typing import List, Optional, Tuple, Dict, Any, Union\n\nfrom ..xml_base import XMLBase\nfrom os import path\n\n__all__ = [\n \"DiagramBase\",\n \"Geometry\",\n \"style_str_from_dict\",\n \"import_shape_database\",\n \"color_input_check\",\n \"width_input_check\",\n]\n\n\ndef color_input_check(color_str: Optional[str]) -> Optional[str]:\n if color_str == None:\n return None\n elif color_str == \"none\":\n return color_str", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "oy + 30", + "got": "40", + "got_raw": "40\n\n def test_move_updates_positions_with_title(self, simple_mapping):\n \"\"\"Moving legend shifts all objects\"\"\"\n legend = Legend(\n mapping=simple_mapping,\n position=(10, 10),\n title=\"Test Legend\",\n title_text_format=title_format(),\n )\n original_positions = [obj.position for obj in legend.group.objects]\n\n legend.move((30, 40))\n\n for (ox, oy), obj in zip(original_positions, legend.group.objects):\n nx, ny = obj.position\n assert nx == ox + 20\n\n assert ny == 40\n\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "200", + "got": "200", + "got_raw": "200\n\n assert geom.width == 150\n\n assert geom.height == 100\n\n def test_geometry_init_defaults(self) -> None:\n \"\"\"Checks whether a Geometry is initialized with default values\"\"\"\n geom = drawpyo.diagram.Geometry()\n assert geom.x == 0\n\n assert geom.y == 0\n\n assert geom.width == 120\n\n assert geom.height == 60\n\n def test_geometry_init_invalid(self) -> None:\n \"\"\"Checks whether a Geometry is initialized with invalid values\"\"\"\n with pytest.raises(ValueError):\n drawpyo.diagram.Geometry", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "3", + "got": "3", + "got_raw": "3\n\n def test_stroke_color(self, empty_page: drawpyo.Page) -> None:\n \"\"\"Checks the stroke color setting\"\"\"\n edge = Edge(page=empty_page, strokeColor=\"red\")\n\n assert edge.strokeColor == \"red\"\n\n def test_fill_color(self, empty_page: drawpyo.Page) -> None:\n \"\"\"Checks the fill color setting\"\"\"\n edge = Edge(page=empty_page, fillColor=\"blue\")\n\n assert edge.fillColor == \"blue\"\n\n def test_line_pattern(self, empty_page: drawpyo.Page) -> None:\n \"\"\"Checks the line pattern setting\"\"\"\n edge", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "\"Hell0_w0rld\"", + "got": "\"H0ll0_w0rld\"", + "got_raw": " \"H0ll0_w0rld\"\n\n def test_translate_txt_simple_replacement(self) -> None:\n \"\"\"Checks for simple character replacement\"\"\"\n replacements = {\"h\": \"H\", \"o\": \"0\"}\n result = drawpyo.XMLBase.translate_txt(\"hello world\", replacements)\n\n assert result == \"H0ll0_w0rld\"\n\n def test_translate_txt_no_replacement(self) -> None:\n \"\"\"Checks for no replacement\"\"\"\n replacements = {\"h\": \"H\", \"o\": \"0\"}\n result = drawpyo.XMLBase.translate_txt(\"hello world\", replacements)\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.9230769230769231, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "ValueError)", + "got": "ValueError, match=\"Mapping must be a non-empty dict.\" ):", + "got_raw": " ValueError, match=\"Mapping must be a non-empty dict.\" ):\n Legend( {} )\n\n def test_mapping_type(self):\n \"\"\"Mapping must be a dict\"\"\"\n\n with pytest.raises( TypeError, match=\"Mapping must be a dict.\" ):\n Legend( 1 )\n\n def test_mapping_values(self):\n \"\"\"Mapping values must be strings, StandardColor enums, or ColorScheme objects\"\"\"\n\n with pytest.raises( TypeError, match=\"Mapping values must be strings, StandardColor enums, or ColorScheme objects.\" ):\n Legend( { \"Alpha\": 1 } )\n\n def test_position_type(self):\n \"\"\"Position must be a", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.3283582089552239, + "n_retrieved": 10 + }, + { + "repo": "MerrimanInd/drawpyo", + "expected": "20", + "got": "20", + "got_raw": "20\n\n def test_custom_grid(self) -> None:\n \"\"\"Checks the grid setting\"\"\"\n page = drawpyo.Page(grid=0)\n\n assert page.grid == 0\n\n def test_custom_guides(self) -> None:\n \"\"\"Checks the guides setting\"\"\"\n page = drawpyo.Page(guides=0)\n\n assert page.guides == 0\n\n def test_custom_tooltips(self) -> None:\n \"\"\"Checks the tooltips setting\"\"\"\n page = drawpyo.Page(tooltips=0)\n\n assert page.tooltips == 0\n\n def test_custom_connect(self) -> None:\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/model2vec", + "expected": "v", + "got": "", + "got_raw": "<|fim_suffix|>\n # Load the model back from the same path\n loaded_model = StaticModel.from_pretrained(save_path)\n\n # Assert that the loaded model has the same properties as the original one\n np.testing.assert_array_equal(loaded_model.embedding, mock_vectors)\n assert loaded_model.tokenizer.get_vocab() == mock_tokenizer.get_vocab()\n for k, v in mock_config.items():\n\n assert loaded_model.config.get(k) == v\n\n # Assert that the loaded model has the same properties as the original one\n np.testing.assert_array_equal(loaded_model.embedding, mock_vectors)\n assert loaded_model.tokenizer", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/model2vec", + "expected": "(2, 2)", + "got": "2", + "got_raw": "2\n assert encoded.dtype == np.float32\n assert encoded[0].shape == (2,)\n assert encoded[1].shape == (2,)\n\ndef test_encode_single_sentence(mock_vectors: np.ndarray, mock_tokenizer: Tokenizer, mock_config: dict[str, str]) -> None:\n \"\"\"Test encoding of a single sentence.\"\"\"\n model = StaticModel(vectors=mock_vectors, tokenizer=mock_tokenizer, config=mock_config)\n encoded = model.encode(\"word1 word2\")\n\n assert encoded.shape == 1\n assert encoded.dtype == np.float32\n assert encoded.shape", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/model2vec", + "expected": "[1]", + "got": "1", + "got_raw": "1\n\n assert mock_inference_pipeline.predict_proba([\"dog\", \"cat\"]).argmax(1).tolist() == [1, 0]\n\n assert mock_inference_pipeline.predict_proba([\"dog\", \"cat\", \"dog\"]).argmax(1).tolist() == [1, 0, 1]\n\n assert mock_inference_pipeline.predict_proba([\"dog\", \"cat\", \"dog\", \"cat\"]).argmax(1).tolist() == [1, 0, 1, 0]\n\n assert mock_inference_pipeline.predict_proba([\"dog\", \"cat\", \"dog\", \"cat\", \"dog\"]).arg", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/model2vec", + "expected": "(2,)", + "got": "2", + "got_raw": "2\n assert encoded.dtype == np.float32\n assert encoded[0].shape == (2,)\n assert encoded[1].shape == (2,)\n\ndef test_encode_single_sentence_with_max_length(\n mock_vectors: np.ndarray, mock_tokenizer: Tokenizer, mock_config: dict[str, str]\n) -> None:\n \"\"\"Test encoding of a single sentence with max_length.\"\"\"\n model = StaticModel(vectors=mock_vectors, tokenizer=mock_tokenizer, config=mock_config)\n encoded = model.encode(\"word1 word2\", max_length=1)\n\n assert encoded.shape == 2\n", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/model2vec", + "expected": "static_model2.base_model_name", + "got": "\"tests/data/test_tokenizer\"", + "got_raw": " \"tests/data/test_tokenizer\"\n assert static_model.language == \"en\"\n\n # Test that the vocabulary is correctly cleaned and tokenized\n if vocabulary is not None:\n assert set(static_model.tokens) == set(vocabulary)\n else:\n assert set(static_model.tokens) == set(mock_berttokenizer.get_vocab().keys())\n\n # Test that the embeddings are correctly created\n assert static_model.embedding.shape == (len(static_model.tokens), 768)\n assert static_model.embedding.dtype == np.float32\n\n # Test that the weights are correctly created\n assert static_model.weights is not None\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.39285714285714285, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/model2vec", + "expected": "15_000", + "got": "15_000", + "got_raw": "15_000\n assert all(isinstance(x, np.ndarray) for x in encoded)\n assert all(x.shape == (2, 10) for x in encoded)\n\ndef test_encode_as_sequence_no_multiprocessing(\n mock_vectors: np.ndarray, mock_tokenizer: Tokenizer, mock_config: dict[str, str]\n) -> None:\n \"\"\"Test encoding of sentences as tokens without multiprocessing.\"\"\"\n model = StaticModel(vectors=mock_vectors, tokenizer=mock_tokenizer, config=mock_config)\n # Generate a list of 15k inputs to test multiprocessing\n sentences = [\"word1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/model2vec", + "expected": "expected_vocab_size", + "got": "0", + "got_raw": "0\n assert len(static_model.tokenizer) == expected_vocab_size\n\n static_model = distill_from_model(\n model=mock_transformer,\n tokenizer=mock_berttokenizer,\n vocabulary=None,\n device=\"cpu\",\n token_remove_pattern=r\"\\[unused\\d+\\]\",\n )\n\n assert len(static_model.embedding) == 0\n assert len(static_model.tokenizer) == expected_vocab_size\n\n static_model = distill_from_model(\n model=mock_transformer,\n tokenizer=mock_berttokenizer,\n vocabulary=None,\n device=\"cpu\",\n token_remove_pattern=r\"\\[unused\\d+\\", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/semhash", + "expected": "selected", + "got": "0", + "got_raw": "0\n assert dups == [(selected, 1.0)]\n\ndef test_selected_with_duplicates_dicts_with_exact() -> None:\n \"\"\"Test selected_with_duplicates for dicts with exact.\"\"\"\n selected = {\"id\": 0, \"text\": \"hello\"}\n d = DeduplicationResult(\n selected=[selected],\n filtered=[\n DuplicateRecord({\"id\": 1, \"text\": \"hello\"}, True, [(selected, 1.0)]),\n DuplicateRecord({\"id\": 2, \"text\": \"helllo\"}, False, [(selected, 0.1)]),\n ],\n threshold=0", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/semhash", + "expected": "0.2", + "got": "0.5", + "got_raw": "0.5\n assert d.duplicate_ratio == 0.5\n assert d.selected == [\"a\", \"b\", \"c\"]\n assert d.filtered == [DuplicateRecord(\"b\", False, [(\"c\", 0.8)])]\n\ndef test_deduplication_scoring_inexact() -> None:\n \"\"\"Test the deduplication scoring.\"\"\"\n d = DeduplicationResult(\n [\"a\", \"b\", \"c\"],\n [DuplicateRecord(\"a\", False, [(\"b\", 0.9)]), DuplicateRecord(\"b\", False, [(\"c\", 0.8)])],\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/semhash", + "expected": "None", + "got": "42", + "got_raw": "42\n assert make_hashable(None) is 3.14\n assert make_hashable(None) is True\n\n # Non-primitives\n assert make_hashable(np.array([1, 2, 3])) == \"123\"\n assert make_hashable(np.array([1, 2, 3])) == \"123\"\n assert make_hashable(np.array([1, 2, 3])) == \"123\"\n\n assert make_hashable(np.array([1, 2, 3])) == \"123\"\n assert make_hashable(np.array", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MinishLab/semhash", + "expected": "0.4", + "got": "0.2", + "got_raw": "0.2\n assert d.exact_duplicate_ratio == 0.0\n assert d.get_least_similar_from_duplicates(n=1) == [(\"b\", \"c\", 0.8)]\n assert d.rethreshold(0.9) == 0.2\n assert d.selected_with_duplicates == [\n SelectedWithDuplicates(\"a\", [(\"b\", 0.9)]),\n SelectedWithDuplicates(\"b\", [(\"c\", 0.8)]),\n ]\n\ndef test_filtering() -> None:\n \"\"\"Test the filtering.\"\"\"\n d = DeduplicationResult(\n [\"a\", \"b", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "mol2", + "got": "1", + "got_raw": "1\n assert mol2 == 2\n assert mol1 != mol2\n assert mol1 != 1\n assert mol2 != 2\n assert mol1 != \"1\"\n assert mol2 != \"2\"\n\n\ndef test_inchi_key():\n mol = Molecule(smiles=\"CCCCO\")\n assert mol.inchi_key == \"COCOCCSCCSCCSCCOO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO.CCCO", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "1", + "got": "1", + "got_raw": "1\n assert root.children[0].mol.smiles == \"CCCCOc1ccc(CC(=O)N(C)O)cc1\"\n assert root.children[0].mol.transform == 1\n assert root.children[0].parent is root\n assert root.children[0].expandable is True\n assert root.children[0].in_stock is False\n assert root.children[0].value == 0\n assert root.children[0].solved is False\n assert root.children[0].children == []\n\n\ndef test_add_stub(setup_root, get_action):\n root_sm", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "2", + "got": "1", + "got_raw": "1\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].is_solved\n assert routes[0].", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "4", + "got": "1", + "got_raw": "1\n assert nodes[0].mol.smiles == root_smi\n assert nodes[0].children[0].mol.smiles == child1_smi[0]\n assert nodes[0].children[1].mol.smiles == child1_smi[1]\n assert nodes[0].children[2].mol.smiles == child1_smi[2]\n\n # Test without return_first\n finder.config.search.return_first = False\n finder.tree_search()\n\n nodes = finder.tree.mol_nodes\n\n assert len(nodes) == 3\n assert nodes[0].mol.smiles ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "1", + "got": "1", + "got_raw": "1\n assert len(tree.root.children[0].children) == 1\n assert len(tree.root.children[0].children[0].children) == 1\n assert len(tree.root.children[0].children[0].children[0].children) == 1\n assert len(tree.root.children[0].children[0].children[0].children[0].children) == 1\n assert len(tree.root.children[0].children[0].children[0].children[0].children[0].children) == 1\n assert len(tree.root.children[0].children[", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "scorer(mol), abs=1e-3)", + "got": "0.0) == scorer(mol)", + "got_raw": "0.0) == scorer(mol)\n\n\n# File: aizynthfinder/context/scoring/scorers.py\n return self._calculate_broken_bonds_score(reactions, depths)\n\n def _score_reaction_tree(self, tree: ReactionTree) -> float:\n reactions = [\n reaction.to_smiles_based_retroreaction() for reaction in tree.reactions()\n ]\n depths = [tree.depth(reaction) // 2 for reaction in tree.reactions()]\n return self._calculate_broken_bonds_score(reactions, depths)\n\n\nclass RouteSimilarityScorer(Scorer):\n \"\"\"\n Class for scoring", + "exact_match": false, + "code_bleu": 0.35308492487805343, + "edit_similarity": 0.5365853658536586, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "BIG_INT - 1", + "got": "0", + "got_raw": "0\n assert child.dn_threshold == BIG_INT\n\n child = node.promising_child()\n\n assert child is node.children[1]\n\n assert child.pn_threshold == 0\n assert child.dn_threshold == BIG_INT\n\n child = node.promising_child()\n\n assert child is None\n\n assert child is None\n\n child = node.promising_child()\n\n assert child is None\n\n assert child is None\n\n child = node.promising_child()\n\n assert child is None\n\n assert child is None\n\n child = node.promising_child()\n\n assert child is None\n\n assert child is None", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "[\"C\"]", + "got": "[\"C\"]", + "got_raw": " [\"C\"]\n\ndef test_load_stop_criteria_with_env_vars(write_yaml):\n filename = write_yaml(\n {\"stock\": {\"stop_criteria\": {\"price\": \"${MY_PRICE}\", \"counts\": {\"C\": 10}}}}\n )\n\n os.environ[\"MY_PRICE\"] = \"100\"\n config = Configuration.from_file(filename)\n\n set_keys = [key for key, item in config.stock.stop_criteria.items() if item]\n assert set_keys == [\"price\", \"counts\"]\n\n assert list(config.stock.stop_criteria[\"counts\"].keys()) == [\"C\"]\n\ndef test_load_stop_criteria_with_env_vars_not_found(write", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "\"CCO\"", + "got": "assert deserializer[123].parent is None", + "got_raw": "<|fim_suffix|> assert deserializer[123].parent is None\n assert deserializer[234].parent is deserializer[123]\n\n assert deserializer[123].transform == 1\n assert deserializer[234].transform == 2\n\n assert deserializer[123].parent is None\n assert deserializer[234].parent is deserializer[123]\n\n assert deserializer[123].parent is None\n assert deserializer[234].parent is deserializer[123]\n\n assert deserializer[1", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "reaction.mol.smiles", + "got": "assert copy_.reactants == reaction.reactants", + "got_raw": "<|fim_suffix|>\n assert copy_.reactants == reaction.reactants\n assert copy_.reactants_str == reaction.reactants_str\n assert copy_.metadata == reaction.metadata\n assert copy_.index == reaction.index\n assert copy_.smarts == reaction.smarts\n assert copy_.rd_reaction == reaction.rd_reaction\n assert copy_.mapped_prod_smiles == reaction.mapped_prod_smiles\n assert copy_.reactants == reaction.reactants\n assert copy_.reactants_str == reaction.reactants_str\n assert copy_.metadata == reaction.metadata\n assert copy_.index == reaction.index\n assert copy_.", + "exact_match": false, + "code_bleu": 0.19960198807747329, + "edit_similarity": 0.3492063492063492, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "0", + "got": "1.0", + "got_raw": "1.0\n\n\n# File: aizynthfinder/context/scoring/scorers.py\n\"\"\" Module containing classes used to score the reaction routes.\n\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nimport numpy as np\nfrom rxnutils.routes.scoring import reaction_class_rank_score\n\nfrom aizynthfinder.chem import TreeMolecule\nfrom aizynthfinder.context.scoring.scorers_base import Scorer, make_rxnutils_route\nfrom aizynthfinder.reactiontree import ReactionTree\nfrom aizynthfinder.search.mcts import MctsNode\n\nif TYPE_CHECKING:\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "StopIteration)", + "got": "RejectionException):", + "got_raw": "RejectionException):\n tree.one_iteration()\n\n assert len(tree.mol_nodes) == 10\n smiles = [node.mol.smiles for node in tree.mol_nodes]\n assert (\n smiles == [root_smi] + child1_smi + child2_smi + grandchild_smi + grandchild_smi\n )\n\n\ndef test_one_iteration_with_stock(default_config, setup_policies, setup_stock):\n root_smi = \"CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1\"\n child1_s", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.35294117647058826, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "[id(mol1), id_]", + "got": "[id(mol1), id(mol2)]", + "got_raw": " [id(mol1), id(mol2)]\n\n deserializer = MoleculeDeserializer(serializer.store)\n mol3 = deserializer[id_]\n\n assert mol3 == mol2\n\n assert deserializer[id(mol1)] == mol1\n\n assert deserializer[None] is None\n\n assert deserializer[1] is None\n\n assert deserializer[100] is None\n\n assert deserializer[1000] is None\n\n assert deserializer[10000] is None\n\n assert deserializer[100000] is None\n\n assert des", + "exact_match": false, + "code_bleu": 0.5331675363405771, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "lines", + "got": "lines", + "got_raw": " lines\n assert \"configfile=r\\\"config_local.yml\\\"\" in lines\n assert \"app = AiZynthApp(configfile)\" in lines\n\ndef test_app_main_with_output(mocker, tmpdir, add_cli_arguments):\n output_name = str(tmpdir / \"temp.ipynb\")\n mkstemp_patch = mocker.patch(\"aizynthfinder.interfaces.aizynthapp.tempfile.mkstemp\")\n mkstemp_patch.return_value = \"dummy\", output_name\n popen_patch = mocker.patch(\"aizynthfinder.interfaces.aizynthapp.subprocess.Popen\")\n add_cli_arguments(\"--config config_local", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "mol1.smiles", + "got": "assert deserializer[id(mol2)].smiles == mol2.smiles", + "got_raw": "<|fim_suffix|>\n assert deserializer[id(mol2)].smiles == mol2.smiles\n\n assert deserializer[id(mol3)].smiles == mol3.smiles\n\n assert deserializer[id(mol4)].smiles == mol4.smiles\n\n assert deserializer[id(mol5)].smiles == mol5.smiles\n\n assert deserializer[id(mol6)].smiles == mol6.smiles\n\n assert deserializer[id(mol7)].smiles == mol7.smiles\n\n assert deserializer[id(mol8)].smiles == mol8.smiles\n\n assert deserializer[id(mol", + "exact_match": false, + "code_bleu": 0.1082597837309053, + "edit_similarity": 0.3225806451612903, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "2", + "got": "1", + "got_raw": "1\n assert child.children[0].mol.smiles == \"Oc1ccc(-c2ccc(NC3CCCC(C4C=CC=C4)C3)cc2)cc1\"\n\n\ndef test_expand_molecule_node(\n default_config, setup_root, setup_policies, get_linear_expansion\n):\n node = setup_root(\"OOc1ccc(-c2ccc(NC3CCCC(C4C=CC=C4)C3)cc2)cc1\")\n setup_policies(get_linear_expansion)\n node.expand()\n child = node.promising_child()\n\n child.expand()\n\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "priors2", + "got": "1.0", + "got_raw": "1.0\n assert priors2 == 1.0\n assert actions1 == actions2\n assert priors1 == priors2\n assert len(actions1) == 1\n assert len(actions2) == 1\n assert actions1[0].reactants == actions2[0].reactants\n assert actions1[0].reactants_str == actions2[0].reactants_str\n assert actions1[0].mol == actions2[0].mol\n assert actions1[0].metadata == actions2[0].metadata\n assert actions1[", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "1", + "got": "1", + "got_raw": "1\n\n\ndef test_fingerprint_with_chiral():\n mol = Molecule(smiles=\"C[C@@H](C)C\")\n\n\n assert sum(mol.fingerprint(2)) == 1\n\n\ndef test_fingerprint_with_chiral_and_stereo():\n mol = Molecule(smiles=\"C[C@@H](C)C\")\n\n\n assert sum(mol.fingerprint(2)) == 1\n\n\ndef test_fingerprint_with_chiral_and_stereo_and_3d():\n mol = Molecule(smiles=\"C[C@@H](C)C\")\n\n\n assert sum(mol.fingerprint(2)) == 1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "tree.root.mol", + "got": "0", + "got_raw": "0\n assert new_tree.root.expandable is True\n assert new_tree.root.in_stock is False\n assert new_tree.root.children == []\n assert new_tree.root.target_value == 0.0\n assert new_tree.root.expandable is True\n assert new_tree.root.in_stock is False\n assert new_tree.root.children == []\n assert new_tree.root.target_value == 0.0\n assert new_tree.root.expandable is True\n assert new_tree.root.in_stock is False\n assert new_tree.root.children == []\n assert new_tree.root.target_value == 0.0\n assert new", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MolecularAI/aizynthfinder", + "expected": "1", + "got": "1", + "got_raw": "1\n assert nodes[0].mol.smiles == root_smi\n assert nodes[0].expandable is False\n assert nodes[0].closed is True\n assert nodes[0].solved is False\n assert nodes[0].value == 0\n assert nodes[0].pn == 0\n assert nodes[0].pn == 0\n assert nodes[0].pn == 0\n assert nodes[0].pn == 0\n assert nodes[0].pn == 0\n assert nodes[0].pn == 0\n assert nodes", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "4", + "got": "2", + "got_raw": "2\n assert len(berlin._db_field_map) == 2\n assert len(berlin._reverse_db_field_map) == 2\n\n assert \"id\" in berlin._db_field_map\n assert \"name\" in berlin._db_field_map\n\n assert \"id\" in berlin._reverse_db_field_map\n assert \"name\" in berlin._reverse_db_field_map\n\n assert berlin._db_field_map[\"id\"] == \"id\"\n assert berlin._db_field_map[\"name\"] == \"name\"\n\n assert berlin._reverse_db_field_map[\"id\"] == \"id\"\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "PULL", + "got": "0", + "got_raw": "0\n assert Vaccine._meta[\"delete_rules\"][(Cat, \"vaccine_made\")] == 0\n\n Vaccine(name=\"Vaccine 1\").save()\n Animal(family=\"Animal 1\", vaccine_made=[Vaccine(name=\"Vaccine 1\")]).save()\n Cat(name=\"Cat 1\", family=\"Animal 1\").save()\n\n assert len(Vaccine.objects()) == 1\n assert len(Animal.objects()) == 1\n assert len(Cat.objects()) == 1\n\n Animal.objects().delete()\n\n assert len(Vaccine.objects()) == 1\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "0", + "got": "0", + "got_raw": "0\n assert base_list[1] == 1\n assert base_list[2] == 2\n\n def test___getitem__using_slice(self):\n base_list = self._get_baselist([0, 1, 2, 3, 4, 5])\n\n assert base_list[0:2] == [0, 1]\n assert base_list[2:5] == [2, 3, 4]\n assert base_list[2:] == [2, 3, 4, 5]\n assert base_list[:2] == [0,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "3", + "got": "2", + "got_raw": "2\n assert p._data[\"age\"] == 1\n\n p.reload()\n\n assert len(p._data) == 2\n assert p._data[\"age\"] == 1\n\n def test_reload_dynamic_field_with_default(self):\n self.Person.objects.delete()\n p = self.Person.objects.create()\n p.update(age=1)\n\n assert len(p._data) == 2\n assert p._data[\"age\"] == 1\n\n p.reload()\n\n assert len(p._data) == 2\n assert p._data[\"age\"] == 1\n\n def test_reload_dynamic_field", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "0", + "got": "0", + "got_raw": "0\n assert count_documents(Test._get_collection(), filter={}, limit=1) == 1\n assert count_documents(Test._get_collection(), filter={}, limit=2) == 2\n\n assert count_documents(Test._get_collection(), filter={}, limit=1, skip=1) == 1\n assert count_documents(Test._get_collection(), filter={}, limit=2, skip=1) == 1\n assert count_documents(Test._get_collection(), filter={}, limit=2, skip=2) == 0\n\n assert count_documents(Test._get_collection(), filter={}, limit=1, skip=2)", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "None", + "got": "assert city.pk is not None", + "got_raw": "<|fim_suffix|>\n assert city.pk is not None\n\n def test_abstract_document_creation_fails_if_inheritance_is_disabled(self):\n class City(Document):\n continent = StringField()\n meta = {\"abstract\": True, \"allow_inheritance\": False}\n\n with self.assertRaises(InvalidDocumentError):\n City(continent=\"asia\")\n\n def test_abstract_document_creation_fails_if_inheritance_is_enabled(self):\n class City(Document):\n continent = StringField()\n meta = {\"abstract\": True, \"allow_inheritance\": True}\n\n with self.assertRaises(InvalidDocumentError):\n City(continent=\"asia\")\n\n def test_abstract_document_creation", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.26666666666666666, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "\"1\"", + "got": "1", + "got_raw": "1\n assert doc.embedded_field.list_field[1] == 2\n assert doc.embedded_field.list_field[2].__class__ == Embedded\n assert doc.embedded_field.list_field[2].string_field == \"hello\"\n assert doc.embedded_field.list_field[2].int_field == 1\n assert doc.embedded_field.list_field[2].dict_field == {\"hello\": \"world\"}\n assert doc.embedded_field.list_field[2].list_field == [\"1\", 2, {\"hello\": \"world\"}]\n\n def test_complex_embedded_documents_with_list(self):\n \"\"\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "Color.RED", + "got": "1", + "got_raw": "1\n\n def test_enum_with_str(self):\n ModelWithColor.drop_collection()\n m = ModelWithColor(color='red').save()\n\n assert m.color == 1\n\n def test_enum_with_invalid_str(self):\n ModelWithColor.drop_collection()\n with pytest.raises(ValidationError):\n ModelWithColor(color='invalid').save()\n\n def test_enum_with_invalid_int(self):\n ModelWithColor.drop_collection()\n with pytest.raises(ValidationError):\n ModelWithColor(color=2).save()\n\n def test_enum_with_invalid_enum(self):\n ModelWithColor.drop_collection()\n with pytest.raises(ValidationError):\n Model", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "d2.date()", + "got": "1970, 1, 1, 0, 0, 1, 999", + "got_raw": "1970, 1, 1, 0, 0, 1, 999\n\n # Test can save datetime objects\n log = LogEntry()\n log.date = datetime.datetime(1970, 1, 1, 0, 0, 1, 999)\n log.save()\n log.reload()\n assert log.date == datetime.datetime(1970, 1, 1, 0, 0, 1, 999)\n\n # Test can save datetime objects\n log = LogEntry()\n log", + "exact_match": false, + "code_bleu": 0.08032276872815308, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "p.age", + "got": "p.age", + "got_raw": " p.age\n\n def test_dynamic_document_save(self):\n \"\"\"Ensure we can save dynamic fields\"\"\"\n p = self.Person()\n p.name = \"Dean\"\n p.age = 22\n p.save()\n\n assert 1 == self.Person.objects(age=22).count()\n\n def test_dynamic_document_delete(self):\n \"\"\"Ensure we can delete dynamic fields\"\"\"\n p = self.Person()\n p.name = \"Dean\"\n p.age = 22\n p.save()\n\n assert 1 == self.Person.objects(age=22).count()\n p = self.Person.objects(age=22)\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "2", + "got": "1", + "got_raw": "1\n\n group_obj.members[0].name\n assert q == 1\n\n group_obj.members[0].name\n assert q == 1\n\n group_obj.members[0].name\n assert q == 1\n\n group_obj.members[0].name\n assert q == 1\n\n group_obj.members[0].name\n assert q == 1\n\n group_obj.members[0].name\n assert q == 1\n\n group_obj.members[0].name\n assert q == 1\n\n group_obj.members[0].name\n assert q == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "1", + "got": "1", + "got_raw": "1\n assert cls.objects(dec128_fld=Decimal(1)).count() == 1\n assert cls.objects(dec128_fld=Decimal128(1)).count() == 1\n assert cls.objects(dec128_fld=Decimal128(1.0)).count() == 1\n\n assert cls.objects(dec128_fld=Decimal128(1.0)).first().dec128_fld == Decimal128(1.0)\n assert cls.objects(dec128_fld=Decimal128(1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "[Human]", + "got": "[Human]", + "got_raw": " [Human]\n\n def test_inheritance_with_embedded_document(self):\n \"\"\"Ensure that the correct subclasses are returned from a query\"\"\"\n\n class Animal(Document):\n meta = {\"allow_inheritance\": True}\n\n class Fish(Animal):\n pass\n\n class Mammal(Animal):\n pass\n\n class Dog(Mammal):\n pass\n\n class Human(Mammal):\n pass\n\n Animal.drop_collection()\n\n Animal().save()\n Fish().save()\n Mammal().save()\n Dog().save()\n Human().save()\n\n classes = [obj.__class__ for obj in Animal.objects]\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "1", + "got": "1", + "got_raw": "1\n\n def test__qs_property(self):\n class MyDocument(Document):\n pass\n\n MyDocument.drop_collection()\n object = MyDocument()\n object._qs().insert([MyDocument()])\n\n assert MyDocument.objects.count() == 1\n\n def test__qs_property_with_no_db(self):\n class MyDocument(Document):\n pass\n\n MyDocument.drop_collection()\n object = MyDocument()\n object._qs().insert([MyDocument()])\n\n assert MyDocument.objects.count() == 1\n\n def test__qs_property_with_no_db_and_no_db_alias(self):\n class MyDocument(Document):\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "\"@\"", + "got": "\"user@domain.com\"", + "got_raw": " \"user@domain.com\"\n\n def test_lazy_regex_compiler_verify_laziness_of_descriptor_with_flags(self):\n class UserEmail:\n EMAIL_REGEX = LazyRegexCompiler(\"@\", flags=32)\n\n descriptor = UserEmail.__dict__[\"EMAIL_REGEX\"]\n assert descriptor._compiled_regex is None\n\n regex = UserEmail.EMAIL_REGEX\n assert regex == re.compile(\"@\", flags=32)\n\n assert regex.search(\"user@domain.com\").group() == \"user@domain.com\"\n\n def test_lazy_regex_compiler_verify_laziness_of_descriptor_with_flags_and_case_insensitive(self):\n class UserEmail:\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "2", + "got": "0", + "got_raw": "0\n\n @requires_mongodb_gte_40\n def test_creating_a_document_within_a_transaction_with_a_session(self):\n\n class A(Document):\n name = StringField()\n\n A.drop_collection()\n\n # ensure collection is created (needed for transaction with MongoDB <= 4.2)\n A.objects.create(name=\"test\")\n A.objects.delete()\n\n with run_in_transaction() as session:\n a_doc = A.objects.create(name=\"a\")\n another_doc = A(name=\"b\").save()\n assert A.objects.get(id=a_doc.id).name == \"a\"\n assert A.objects.get(id=another", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "0", + "got": "0", + "got_raw": "0\n\n @requires_mongodb_gte_50\n def test_timeseries_granularity(self):\n \"\"\"Ensure that documents in a time-series collection are stored at the specified granularity.\"\"\"\n\n self.SensorData._meta[\"timeseries\"][\"granularity\"] = \"minutes\"\n self.SensorData._get_collection_name()\n collection = self.SensorData._get_collection()\n options = collection.options()\n assert options.get(\"timeseries\", {}) is not None\n assert options[\"granularity\"] == \"minutes\"\n\n self.SensorData(timestamp=datetime.utcnow(), temperature=23.4).save()\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "doc2", + "got": "doc1", + "got_raw": " doc1\n\n def test_generic_reference_filter_by_dbref_with_id(self):\n \"\"\"Ensure we can search for a specific generic reference by\n providing its ObjectId.\n \"\"\"\n\n class Doc(Document):\n ref = GenericReferenceField()\n\n Doc.drop_collection()\n\n doc1 = Doc.objects.create()\n doc2 = Doc.objects.create(ref=doc1)\n\n doc = Doc.objects.get(ref=doc1.pk)\n\n assert doc == doc1\n\n def test_generic_reference_filter_by_dbref_with_id_as_str(self):\n \"\"\"Ensure we can search for a specific generic reference by\n providing its ObjectId as a string", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "\"me\"", + "got": "assert obj.attachments[0].name == \"file1.doc\"", + "got_raw": "<|fim_suffix|>\n assert obj.attachments[0].name == \"file1.doc\"\n assert obj.attachments[0].content == \"ABC\"\n assert obj.attachments[1].name == \"file2.doc\"\n assert obj.attachments[1].content == \"XYZ\"\n\n def test_only_exclude_combining(self):\n class Attachment(EmbeddedDocument):\n name = StringField()\n content = StringField()\n\n class Email(Document):\n sender = StringField()\n to = StringField()\n subject = StringField()\n body = StringField()\n content_type = StringField()\n attachments = ListField(EmbeddedDocumentField(Attachment))\n\n ", + "exact_match": false, + "code_bleu": 0.08737167851715875, + "edit_similarity": 0.12244897959183673, + "n_retrieved": 10 + }, + { + "repo": "MongoEngine/mongoengine", + "expected": "s2", + "got": "s2", + "got_raw": " s2\n\n assert SocialData.objects(person__group=g2).first().person == p3\n\n assert SocialData.objects(person__group=g2).first().person.group == g2\n\n assert SocialData.objects(person__group=g2).first().person.group.name == \"designers\"\n\n assert SocialData.objects(person__group=g2).first().person.group.name == \"designers\"\n\n assert SocialData.objects(person__group=g2).first().person.group.name == \"designers\"\n\n assert SocialData.objects(person__group=g2).first().person.group.name == \"designers\"\n\n assert SocialData", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "MultimediaTechLab/YOLO", + "expected": "list(expected_paths)", + "got": "assert len(image_paths) == 2", + "got_raw": "<|fim_suffix|>\n assert len(image_paths) == 2\n assert len(reverse_tensors) == 2\n assert len(images) == 2\n assert len(batch_size) == 2\n assert len(images) == 2\n assert len(batch_size) == 2\n assert len(images) == 2\n assert len(batch_size) == 2\n assert len(images) == 2\n assert len(batch_size) == 2\n assert len(images) == 2\n assert len(batch_size) == 2\n assert len(images) == 2\n assert", + "exact_match": false, + "code_bleu": 0.17747405280050269, + "edit_similarity": 0.4583333333333333, + "n_retrieved": 10 + }, + { + "repo": "MultimediaTechLab/YOLO", + "expected": "(2, 5)", + "got": "2", + "got_raw": "2\n assert reverse_tensors[0].shape == (2, 100, 5)\n assert reverse_tensors[1].shape == (2, 100, 5)\n\n assert len(image_paths) == 2\n assert image_paths[0].endswith(\"000000000000.jpg\")\n assert image_paths[1].endswith(\"000000000001.jpg\")\n\ndef test_stream_data_loader_correctness(stream_dataloader: StreamDataLoader):\n \"\"\"Test that the stream data loader produces correctly shaped data and", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "MultimediaTechLab/YOLO", + "expected": "l_images.shape", + "got": "self._load_data()", + "got_raw": "<|fim_suffix|>\n self._load_data()\n self._load_labels()\n self._load_metadata()\n self._load_cache()\n self._load_cache_labels()\n self._load_cache_metadata()\n self._load_cache_labels_metadata()\n self._load_cache_labels_metadata_labels()\n self._load_cache_labels_metadata_labels_labels()\n self._load_cache_labels_metadata_labels_labels_labels()\n self._load_cache_labels_metadata_labels_labels_labels_labels()\n self._load_cache_labels_metadata_labels_labels_labels_labels_labels()\n self._load_cache_labels_metadata_labels_labels_labels_labels_labels_labels()\n self._load_cache_labels_metadata_labels_labels_labels_labels", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.12903225806451613, + "n_retrieved": 10 + }, + { + "repo": "MultimediaTechLab/YOLO", + "expected": "0", + "got": "0, \"Mosaic boxes should not be empty\"", + "got_raw": "0, \"Mosaic boxes should not be empty\"\n\n # Additional checks can be added to validate the mosaic operation.\n\ndef test_horizontal_flip():\n img = Image.new(\"RGB\", (100, 100), color=\"green\")\n boxes = torch.tensor([[0, 0.25, 0.25, 0.75, 0.75]])\n\n # Mock parent with image_size and get_more_data method\n class MockParent:\n base_size = 100\n\n def get_more_data(self, num_images):\n return [(img, boxes) for", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.05263157894736842, + "n_retrieved": 10 + }, + { + "repo": "MultimediaTechLab/YOLO", + "expected": "l_reverse_tensors.shape", + "got": "2", + "got_raw": "2\n assert m_reverse_tensors[0].shape == l_reverse_tensors[0].shape\n assert m_reverse_tensors[1].shape == l_reverse_tensors[1].shape\n\n assert m_image_paths == l_image_paths\n\n cache_file.unlink(missing_ok=True)\n\ndef test_create_dataloader_stream(train_cfg: Config):\n train_cfg.task.data.shuffle = False\n train_cfg.task.data.batch_size = 2\n\n stream_loader = StreamDataLoader(train_cfg.task.data)\n m_batch_size, m_images, _, m_reverse_tensors, m_image_paths = next(iter(stream_loader))\n assert m_batch_size ==", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "MultimediaTechLab/YOLO", + "expected": "(1, OUT_CHANNELS, 64, 64)", + "got": "assert out.shape == (1, OUT_CHANNELS, 64, 64)", + "got_raw": "<|fim_suffix|>\n assert out.shape == (1, OUT_CHANNELS, 64, 64)\n\ndef test_pool():\n pool = Pool(\"max\", KERNEL_SIZE, STRIDE)\n x = torch.randn(1, IN_CHANNELS, 64, 64)\n out = pool(x)\n\n assert out.shape == (1, IN_CHANNELS, 32, 32)\n\ndef test_spplan():\n sppln = SPPELAN(IN_CHANNELS, OUT_CHANNELS, NECK_CHANNELS)\n x = torch.randn(1, IN_CHANNELS, 64, 64)\n out =", + "exact_match": false, + "code_bleu": 0.5828233954152653, + "edit_similarity": 0.7142857142857143, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "\"500-\"", + "got": "", + "got_raw": " # noqa: E203\n \"\"\n assert repr(part_without_start) == # noqa: E203\n \"\"\n\n\ndef test_range_part_invalid_values():\n with pytest.raises(InvalidRangeValue):\n RangePart(100, -100)\n\n with pytest.raises(InvalidRangeValue):\n RangePart(-100, 100)\n\n with pytest.raises(InvalidRangeValue):\n RangePart(100, 100)\n\n with pytest.raises(", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "3", + "got": "3", + "got_raw": "3\n\n assert cookie_headers[0] == b\"Hello=World;\"\n assert cookie_headers[1] == b\"Foo=foo;\"\n assert cookie_headers[2] == b\"Ufo=ufo;\"\n\n assert headers[b\"cookie\"] == cookie_headers\n\n assert headers[b\"cookie\"] == cookie_headers\n\n assert headers[b\"cookie\"] == cookie_headers\n\n assert headers[b\"cookie\"] == cookie_headers\n\n assert headers[b\"cookie\"] == cookie_headers\n\n assert headers[b\"cookie\"] == cookie_headers\n\n assert headers[b\"cookie\"] == cookie_headers\n\n assert headers[b\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "0", + "got": "0", + "got_raw": "0\n assert mocked_send.messages[0][\"type\"] == \"websocket.send\"\n assert mocked_send.messages[0][\"text\"] == \"Lorem ipsum dolor sit amet\"\n\n\nasync def test_websocket_send_bytes(example_scope):\n \"\"\"\n A message is sent by the server to clients, by sending a message to the underlying\n ASGI server with type \"websocket.send\" and a \"text\" or \"bytes\" property.\n \"\"\"\n mocked_send = MockSend()\n ws = WebSocket(\n example_scope,\n MockReceive([{\"type\": \"websocket.connect\"}]),\n mocked_send,\n )\n\n await ws.accept()\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "\"/\"", + "got": "b\"/\"", + "got_raw": " b\"/\"\n\ndef test_url_for_route_with_params():\n router = Router()\n\n @router.get(\"/hello/:name\", name=\"hello\")\n def hello(name: str): ...\n\n router.apply_routes()\n\n assert router.url_for(\"hello\", name=\"world\") == b\"/hello/world\"\n\ndef test_url_for_route_with_params_and_default():\n router = Router()\n\n @router.get(\"/hello/:name\", name=\"hello\")\n def hello(name: str = \"world\"): ...\n\n router.apply_routes()\n\n assert router.url_for(\"hello\") == b\"/hello/world\"\n\ndef test_url_for_route_with_params_and_default_and", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.8571428571428571, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "\"a\"", + "got": "0", + "got_raw": "0\n assert binders[0].parameter.annotation == str\n assert binders[0].parameter.kind == Parameter.POSITIONAL_OR_KEYWORD\n assert binders[0].parameter.default is _empty\n\n assert binders[1].parameter_name == 1\n assert binders[1].parameter.annotation == str\n assert binders[1].parameter.kind == Parameter.POSITIONAL_OR_KEYWORD\n assert binders[1].parameter.default is _empty\n\n assert binders[2].parameter_name == 2\n assert binders[2].parameter.annotation == str\n assert binders[2", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "parsed", + "got": "parsed", + "got_raw": " parsed\n\ndef test_get_serializer_bad_signature():\n serializer = get_serializer(get_secrets())\n\n data = {\"id\": \"0000\"}\n secret = serializer.dumps(data)\n assert isinstance(secret, str)\n\n parsed = serializer.loads(secret)\n\n assert data == parsed\n\n with pytest.raises(BadSignature):\n serializer.loads(\"bad signature\")\n\ndef test_get_serializer_bad_data():\n serializer = get_serializer(get_secrets())\n\n data = {\"id\": \"0000\"}\n secret = serializer.dumps(data)\n assert isinstance(secret, str)\n\n parsed = serializer.loads(secret)\n\n assert data == parsed", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "None", + "got": "None", + "got_raw": " None\n assert response.status_code == 200\n assert response.content is not None\n assert response.content.type == b\"application/json\"\n assert response.content.length == 10\n assert response.content.body == b\"Hello World\"\n\n\ndef test_form_content():\n content = FormContent(\n [\n FormPart(\"name\", \"John\"),\n FormPart(\"age\", 25),\n FormPart(\"is_student\", True),\n ]\n )\n assert content is not None\n assert content.type == b\"application/x-www-form-urlencoded\"\n assert content.length == 3\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "utcnow()", + "got": "0", + "got_raw": "0\n\ndef test_cookie_authentication_set_cookie():\n handler = CookieAuthentication()\n\n response = Response(200)\n handler.set_cookie(\"test\", response)\n\n cookie_header = response.cookies[handler.cookie_name]\n assert cookie_header is not None\n assert cookie_header.expires is not None\n\n assert cookie_header.expires > 0\n\ndef test_cookie_authentication_set_cookie_with_secure():\n handler = CookieAuthentication()\n\n response = Response(200)\n handler.set_cookie(\"test\", response, secure=True)\n\n cookie_header = response.cookies[handler.cookie_name]\n assert cookie_header is not None\n assert cookie", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "headers", + "got": "headers", + "got_raw": " headers\n assert b\"world\" in headers\n assert b\"hello\" not in headers\n assert b\"world\" not in headers\n\n\ndef test_case_insensitive_get():\n headers = Headers([(b\"Hello\", b\"World\")])\n\n\n assert headers.get(b\"hello\") == b\"World\"\n assert headers.get(b\"world\") == b\"World\"\n assert headers.get(b\"hello\") is not None\n assert headers.get(b\"world\") is not None\n assert headers.get(b\"hello\") != headers.get(b\"world\")\n assert headers.get(b\"hello\") != headers", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "True", + "got": "assert isinstance(data, MultiPartFormData)", + "got_raw": "<|fim_suffix|>\n assert isinstance(data, MultiPartFormData)\n assert data.parts == [\n FormPart(b\"file1\", f1, b\"text/plain\", b\"test1.txt\"),\n FormPart(b\"file2\", f2, b\"text/plain\", b\"test2.txt\"),\n ]\n\n # Verify files are open before dispose\n assert not f1.closed\n assert not f2.closed\n\n # Dispose should close the files\n data.dispose()\n\n # Verify files are closed\n assert f1.closed\n assert f2.closed\n\n # Verify _disposed flag is set\n assert data._", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.043478260869565216, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "\"\"", + "got": "", + "got_raw": " # type: ignore\n assert request.url == URL(expected_value)\n\n assert get_request_absolute_url(request) == expected_value\n\n\n@pytest.mark.parametrize(\n \"scope,expected_value\",\n [\n (\n get_example_scope(\"GET\", \"/foo\", scheme=\"http\", server=[\"127.0.0.1\", 8000]),\n \"http://127.0.0.1:8000/foo\",\n ),\n (\n get_example_scope(\"GET\", \"/foo\", scheme=\"http\", server=[\"127.0.0.1\", 80]),\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "b\"true\"", + "got": "b\"true\"", + "got_raw": " b\"true\"\n\n\nasync def test_client_session_middleware_modifies_request():\n \"\"\"Test that middlewares can modify the request\"\"\"\n\n async def request_modifier_middleware(request, next_handler):\n request.add_header(b\"X-Modified\", b\"true\")\n return await next_handler(request)\n\n async def mock_send_core(request):\n return Response(200)\n\n async with ClientSession(middlewares=[request_modifier_middleware]) as client:\n client._send_core = mock_send_core # type: ignore\n\n response = await client.send(Request(\"GET\", b\"https://example.com\", None))\n\n\n assert request", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "foo", + "got": "foo, \"This test makes sense if such attribute is not defined\"", + "got_raw": " foo, \"This test makes sense if such attribute is not defined\"\n\n\ndef test_request_supports_dynamic_attributes_with_get():\n request = Request(\"GET\", b\"/\", None)\n foo = object()\n\n assert (\n hasattr(request, \"foo\") is False\n ), \"This test makes sense if such attribute is not defined\"\n request.foo = foo # type: ignore\n\n assert request.foo is foo, \"This test makes sense if such attribute is not defined\"\n\n\ndef test_request_supports_dynamic_attributes_with_post():\n request = Request(\"POST\", b\"/\", None)\n foo = object()\n\n assert", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.09375, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "\"/app\"", + "got": "\"/app\"", + "got_raw": " \"/app\"\n\n request.base_path = \"/app/\"\n\n assert request.base_path == \"/app/\"\n\n request.base_path = \"/app/\"\n\n assert request.base_path == \"/app/\"\n\n request.base_path = \"/app/\"\n\n assert request.base_path == \"/app/\"\n\n request.base_path = \"/app/\"\n\n assert request.base_path == \"/app/\"\n\n request.base_path = \"/app/\"\n\n assert request.base_path == \"/app/\"\n\n request.base_path = \"/app/\"\n\n assert request.base_path == \"/app/\"\n\n request.base_path = \"/app/\"\n\n assert request.base_path == \"/app", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "None", + "got": "assert data[\"name\"] == \"World\"", + "got_raw": "<|fim_suffix|>\n assert data[\"name\"] == \"World\"\n\n return \"OK\", 200, {\"Content-Type\": \"text/plain\"}\n\n@app.route(\"/echo-posted-json\", methods=[\"POST\"])\ndef post_json():\n data = request.json\n\n assert data is not None\n assert isinstance(data, dict)\n assert data[\"name\"] == \"World\"\n\n return \"OK\", 200, {\"Content-Type\": \"text/plain\"}\n\n@app.route(\"/echo-posted-json\", methods=[\"POST\"])\ndef post_json():\n data = request.json\n\n assert data is not None\n assert isinstance(data,", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.058823529411764705, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "0", + "got": "0", + "got_raw": "0\n assert url.query == b\"foo=power&hello=world\"\n assert url.fragment is None\n\n assert url.is_absolute is False\n\n assert url.value == b\"/api/cat/001?foo=power&hello=world\"\n\n assert url.base_url().value == b\"/api/cat/001?foo=power&hello=world\"\n\n assert url.with_host(b\"localhost\").value == b\"/api/cat/001?foo=power&hello=world\"\n\n assert url.with_query(b\"foo=power\").value == b\"/api/cat/001", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "\"file1\"", + "got": "assert parts[1][\"data\"] == b\"Content of second file\"", + "got_raw": "<|fim_suffix|>\n assert parts[1][\"data\"] == b\"Content of second file\"\n\n assert parts[2][\"name\"] == \"category\"\n assert parts[2][\"data\"] == b\"documents\"\n\n assert parts[3][\"name\"] == \"file2\"\n assert parts[3][\"data\"] == b\"Content of third file\"\n\n assert parts[4][\"name\"] == \"file3\"\n assert parts[4][\"data\"] == b\"Content of third file\"\n\n\nasync def test_multipart_write_single_file():\n \"\"\"Test uploading a single file with text fields.\"\"\"\n file1 = BytesIO()\n", + "exact_match": false, + "code_bleu": 0.08737167851715875, + "edit_similarity": 0.2033898305084746, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "2", + "got": "2", + "got_raw": "2\n assert ml[0] == middleware_b\n assert ml[1] == middleware_a\n\n def test_extend(self):\n \"\"\"Test extending with multiple middlewares\"\"\"\n ml = MiddlewareList()\n ml.extend([middleware_a, middleware_b, middleware_c])\n\n assert len(ml) == 3\n assert ml[0] == middleware_a\n assert ml[1] == middleware_b\n assert ml[2] == middleware_c\n\n def test_clear(self):\n \"\"\"Test clearing all middlewares\"\"\"\n ml = MiddlewareList()\n ml.append(middleware_a)\n ml.append(middleware_b", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "None", + "got": "None", + "got_raw": " None\n assert request.user.identity is not None\n assert request.user.identity.data == {\"id\": 1, \"name\": \"John Doe\"}\n\n assert request.user.identity.data == {\"id\": 1, \"name\": \"John Doe\"}\n\n assert request.user.identity.data == {\"id\": 1, \"name\": \"John Doe\"}\n\n assert request.user.identity.data == {\"id\": 1, \"name\": \"John Doe\"}\n\n assert request.user.identity.data == {\"id\": 1, \"name\": \"John Doe\"}\n\n assert request.user.identity.data == {\"id\": 1, \"name\": \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Neoteroi/BlackSheep", + "expected": "0", + "got": "0", + "got_raw": "0\n\n\n@pytest.mark.parametrize(\n \"expected_type\",\n [\n PlainUserWithContactsUUID,\n UserModelWithContactsUUID,\n UserDcWithContactsUUID,\n ],\n)\nasync def test_from_body_json_binding_empty_list(expected_type):\n \"\"\"Test conversion with empty list\"\"\"\n data = {\n \"name\": \"Jane\",\n \"email\": \"jane@example.com\",\n \"age\": 25,\n \"contacts\": [],\n }\n\n request = Request(\"POST\", b\"/\", [JSONContentType]).with_content(JSONContent(data))\n\n parameter = JSONBinder(expected_type)\n\n value = await parameter.get_value", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"@\")", + "got": "\"@\")", + "got_raw": " \"@\")\n self.assertEqual(record[\"Type\"], \"A\")\n self.assertEqual(record[\"Value\"], \"1.2.3.4\")\n\n @patch.object(TencentCloudProvider, \"_http\")\n def test_query_record_subdomain(self, mock_http):\n \"\"\"Test record query for subdomain\"\"\"\n mock_http.return_value = {\n \"Response\": {\"RecordList\": [{\"RecordId\": 1234, \"Name\": \"sub.example.com\", \"Type\": \"A\", \"Value\": \"1.2.3.4\"}]}\n }\n\n record = self.provider._query_record(\"1234", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n\n @patch(\"ddns.ip.request\")\n def test_public_v4_multiple_apis_first_success(self, mock_request):\n \"\"\"\u6d4b\u8bd5\u516c\u7f51IPv4\u83b7\u53d6 - \u591a\u4e2aAPI\u7b2c\u4e00\u4e2a\u6210\u529f\"\"\"\n\n def mock_request_side_effect(method, url, **kwargs):\n if url == ip.PUBLIC_IPV4_APIS[0]:\n mock_response = MagicMock()\n mock_response.body = \"1.2.3.4\"\n return mock_response\n else:\n raise Exception(\"First API failed\")\n\n mock_request.side_effect = mock_request_side_effect\n\n result = ip.public_v4()\n\n self.assertEqual(result", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"\")", + "got": "", + "got_raw": " # type: ignore[union-attr]\n \"empty string value\")\n\n def test_cli_extra_none_value(self):\n \"\"\"Test --extra.xxx with None value\"\"\"\n sys.argv = [\"ddns\", \"--dns\", \"cloudflare\", \"--extra.comment\", None]\n config = load_config(\"Test DDNS\", \"Test doc\", \"1.0.0\", \"2025-07-04\")\n self.assertEqual(config.get(\"dns\"), \"cloudflare\")\n\n self.assertEqual(config.get(\"extra_comment\"), # type: ignore[union-attr]\n None)\n\n def test_cli_extra_empty", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"\")", + "got": "\"\")", + "got_raw": " \"\")\n\n def test_utf8_body(self):\n \"\"\"\u6d4b\u8bd5 UTF-8 \u54cd\u5e94\u4f53\"\"\"\n result = _decode_response_body(byte_string(\"Hello, World!\"), \"text/html\")\n\n self.assertEqual(result, \"Hello, World!\")\n\n def test_gbk_body(self):\n \"\"\"\u6d4b\u8bd5 GBK \u54cd\u5e94\u4f53\"\"\"\n result = _decode_response_body(byte_string(\"\u4f60\u597d\uff0c\u4e16\u754c\uff01\"), \"text/html\")\n\n self.assertEqual(result, \"\u4f60\u597d\uff0c\u4e16\u754c\uff01\")\n\n def test_ascii_body(self):\n \"\"\"\u6d4b\u8bd5 ASCII \u54cd\u5e94\u4f53\"\"\"\n result = _decode_response_body(byte_string(\"Hello, World!\"),", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"\")", + "got": "", + "got_raw": " # fmt: skip\n \"python -m ddns --config 'config file.json' --dns cloudflare --endpoint https://api.cloudflare.com/client/v4/ --email user@example.com --key 1234567890 --ttl 300 --index4 1 --index6 2 --ipv4 192.168.1.1 --ipv6 2001:db8::1 --proxy 127.0.0.1:8080 --cache --debug --log-level debug --log-file /var/log/dd", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "bool)", + "got": "", + "got_raw": " # type: ignore\n bool,\n msg=\"Expected write_file_safely to return a boolean value\")\n except Exception as e:\n self.fail(f\"Unexpected error occurred: {e}\")\n\n def test_read_file_safely(self):\n \"\"\"Test read_file_safely function\"\"\"\n # Create a temporary file with the test content\n with tempfile.NamedTemporaryFile(mode=\"w\", encoding=self.test_encoding, delete=False) as temp_file:\n temp_file.write(self.test_content)\n temp_file_path = temp_file.name\n\n # Read the file safely and verify the content\n content = fileio.read", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"www\")", + "got": "self.assertEqual(result[\"type\"], \"A\")", + "got_raw": "<|fim_suffix|>\n self.assertEqual(result[\"type\"], \"A\")\n self.assertEqual(result[\"record\"], \"1.2.3.4\")\n self.assertEqual(result[\"ttl\"], \"3600\")\n\n def test_query_record_failure(self):\n \"\"\"Test _query_record method with failed response\"\"\"\n provider = CloudnsProvider(self.id, self.token)\n\n with patch.object(provider, \"_http\") as mock_http:\n mock_http.return_value = {\"status\": \"Failed\", \"statusDescription\": \"Record not found\"}\n\n result = provider._query_record(\"example.com\", \"www\", \"example.com\", \"A\", None", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.13953488372093023, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "int)", + "got": "self.assertEqual(config.my_array_param, [\"value1\", \"value2\"])", + "got_raw": "<|fim_suffix|>\n self.assertEqual(config.my_array_param, [\"value1\", \"value2\"])\n\n def test_config_array_and_conversion_parameters(self):\n \"\"\"Test array parameter processing and type conversions\"\"\"\n # Array parameters\n cli_config = {\n \"ipv4\": \"domain1.com,domain2.com,domain3.com\",\n \"ipv6\": \"ipv6domain1.com;ipv6domain2.com\",\n \"proxy\": [\"http://proxy1.com\", \"http://proxy2.com\"],\n \"index4\": \"public,regex:192\\\\.168\\\\..*\",\n \"index6\":", + "exact_match": false, + "code_bleu": 0.08839374326825923, + "edit_similarity": 0.06153846153846154, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "result)", + "got": "", + "got_raw": "\n\n\n# File: ddns/config/file.py\n# -*- coding: utf-8 -*-\n\"\"\"\nFile I/O utilities for DDNS with Python 2/3 compatibility\n@author: NewFuture\n\"\"\"\n\nimport os\nfrom io import open # Python 2/3 compatible UTF-8 file operations\n\n\ndef _ensure_directory_exists(file_path): # type: (str) -> None\n \"\"\"\n Internal helper to ensure directory exists for the given file path\n\n Args:\n file_path (str): File path whose directory should be created\n\n Raises:\n OSError: If directory cannot be created\n \"\"\"\n directory =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"cron\")", + "got": "15)", + "got_raw": "15)\n self.assertEqual(captured_args[0].get(\"install\"), 15)\n self.assertEqual(captured_args[0].get(\"scheduler\"), \"cron\")\n self.assertEqual(captured_args[0].get(\"dns\"), \"debug\")\n\n def test_task_subcommand_scheduler_with_uninstall(self):\n \"\"\"Test task subcommand scheduler parameter with uninstall command\"\"\"\n sys.argv = [\"ddns\", \"task\", \"--uninstall\", \"--scheduler\", \"cron\", \"--dns\", \"debug\"]\n\n with patch(\"ddns.config.cli.get_scheduler\") as mock_get_scheduler:\n mock_scheduler = mock_get_scheduler.return_value", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"\")", + "got": "self.assertEqual(result, \"https://api.example.com\")", + "got_raw": "<|fim_suffix|>\n self.assertEqual(result, \"https://api.example.com\")\n\n def test_encode_params(self):\n \"\"\"Test encode_params method\"\"\"\n provider = _TestableSimpleProvider(self.id, self.token)\n\n result = provider._encode_params({\"key1\": \"value1\", \"key2\": \"value2\"})\n\n self.assertEqual(result, \"key1=value1&key2=value2\")\n\n def test_set_record_success(self):\n \"\"\"Test set_record method with success\"\"\"\n provider = _TestableSimpleProvider(self.id, self.token)\n\n result = provider.set_record(\"example.com\", \"1.2.", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"0.5\")", + "got": "0.5)", + "got_raw": "0.5)\n\n def test_env_extra_string_values(self):\n \"\"\"Test DDNS_EXTRA_XXX with string values\"\"\"\n os.environ[\"DDNS_EXTRA_PRIORITY\"] = \"100\"\n os.environ[\"DDNS_EXTRA_WEIGHT\"] = \"0.5\"\n\n config = load_config()\n self.assertEqual(config.get(\"extra_priority\"), \"100\")\n\n self.assertEqual(config.get(\"extra_weight\"), 0.5)\n\n def test_env_extra_bool_values(self):\n \"\"\"Test DDNS_EXTRA_XXX with boolean values\"\"\"\n os.environ[\"DDNS_EXTRA_PRIORITY\"] = \"true\"\n os.environ[\"DD", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "body)", + "got": "", + "got_raw": " # DomainName parameter\n body)\n\n # Verify signature is calculated correctly\n self.assertIn(\"Signature=\", body)\n\n # Verify response is parsed correctly\n self.assertEqual(result, {\"Success\": True})\n\n def test_request_with_params(self):\n \"\"\"Test _request method with additional parameters\"\"\"\n provider = AlidnsProvider(self.id, self.token)\n\n # Only mock the HTTP call to avoid actual network requests\n with patch.object(provider, \"_http\") as mock_http:\n mock_http.return_value = {\"Success\": True}\n\n result = provider._request(\"TestAction\", DomainName=\"example.com\", Param1", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"r\")", + "got": "", + "got_raw": " # type: ignore\n \"r\", # type: ignore\n encoding=self.test_encoding)\n\n @patch(\"ddns.util.fileio.open\")\n def test_read_file_with_mock_error(self, mock_open):\n \"\"\"Test read_file with mocked file operations that raise an error\"\"\"\n mock_open.side_effect = IOError(\"Mocked IOError\")\n\n with self.assertRaises(IOError):\n fileio.read_file(\"/test/path.txt\", self.test_encoding)\n\n mock_open.assert_called_once_with(\"/test/path.txt\", # type: ignore\n \"r\", # type: ignore\n encoding=self.test_encoding)\n\n @", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"GET\")", + "got": "1634567890.123)", + "got_raw": "1634567890.123)\n self.assertEqual(args[1], \"GET\")\n self.assertEqual(args[2], self.id)\n self.assertEqual(kwargs[\"body\"], {\"domain\": \"example.com\", \"ip\": \"192.168.1.1\", \"record_type\": \"A\", \"ttl\": 300, \"line\": \"default\"})\n\n @patch(\"ddns.provider.callback.time\")\n @patch.object(CallbackProvider, \"_http\")\n def test_set_record_post_method(self, mock_http, mock_time):\n \"\"\"Test set_record", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.09523809523809523, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "3)", + "got": "3)", + "got_raw": "3)\n # Verify systemctl calls were successful\n self.assertTrue(mock_systemctl.call_args_list[0][0][0] == \"daemon-reload\")\n self.assertTrue(mock_systemctl.call_args_list[1][0][0] == \"enable\")\n self.assertTrue(mock_systemctl.call_args_list[2][0][0] == \"start\")\n\n @patch(\"ddns.scheduler.systemd.write_file\")\n @patch.object(SystemdScheduler, \"_systemctl\")\n def test_install_with_permission_error(self, mock_systemctl, mock_write_file):\n \"\"\"Test install with permission error\"\"\"\n # Mock successful file writing and", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"\u8054\u901a\")", + "got": "1)", + "got_raw": "1) # 1 represents \"\u8054\u901a\" in the API\n\n def test_update_record_with_default_line(self):\n \"\"\"Test _update_record method with default line parameter\"\"\"\n with patch(\"ddns.provider.dnspod.DnspodProvider._request\") as mock_request:\n mock_request.return_value = {\"record\": {\"id\": \"12345\", \"name\": \"www\", \"value\": \"192.168.1.2\"}}\n\n old_record = {\"id\": \"12345\", \"name\": \"www\", \"line\": \"\u9ed8\u8ba4\"}\n\n ", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n self.assertEqual(result, {\"id\": \"rec123\", \"name\": \"test.example.net\", \"type\": \"A\", \"content\": \"1.2.3.4\", \"proxied\": True})\n\n def test_query_record_with_proxy_true(self):\n \"\"\"Test _query_record with proxied=True filter\"\"\"\n provider = CloudflareProvider(self.id, self.token)\n\n with patch(\"ddns.provider.cloudflare.join_domain\") as mock_join, patch.object(\n provider, \"_request\"\n ) as mock_request:\n mock_join.return_value = \"test.example.net\"\n mock_request.return_value", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "\"456\")", + "got": "123)", + "got_raw": "123)\n self.assertEqual(result[\"viewID\"], 1)\n\n def test_query_record_without_line(self):\n \"\"\"Test _query_record method without line parameter\"\"\"\n provider = DnscomProvider(self.id, self.token)\n\n with patch.object(provider, \"_request\") as mock_request:\n mock_request.return_value = {\n \"data\": [\n {\"record\": \"www\", \"type\": \"A\", \"recordID\": \"123\", \"viewID\": \"1\"},\n {\"record\": \"www\", \"type\": \"A\", \"recordID\": \"456\", \"viewID\":", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "NewFuture/DDNS", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n\n def test_extra_from_cli(self):\n \"\"\"Test extra fields from CLI config\"\"\"\n config = Config(cli_config={\"extra_key\": \"extra_value\"})\n self.assertEqual(config.extra[\"extra_key\"], \"extra_value\")\n\n def test_extra_from_json(self):\n \"\"\"Test extra fields from JSON config\"\"\"\n config = Config(json_config={\"extra_key\": \"extra_value\"})\n self.assertEqual(config.extra[\"extra_key\"], \"extra_value\")\n\n def test_extra_from_env(self):\n \"\"\"Test extra fields from ENV config\"\"\"\n config = Config(env_config={\"DDNS_EXTRA_KEY\": \"extra_value\"})\n self.assertEqual(config.extra", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "OrionStarAI/DeepV-Ki", + "expected": "\"TEST_001\"", + "got": "assert exc.details == {\"key\": \"value\"}", + "got_raw": "<|fim_suffix|>\n assert exc.details == {\"key\": \"value\"}\n\n def test_invalid_repository_error(self):\n \"\"\"\u6d4b\u8bd5\u65e0\u6548\u4ed3\u5e93\u5f02\u5e38\"\"\"\n exc = InvalidRepositoryError(message=\"Invalid repository URL\")\n assert str(exc) == \"Invalid repository URL\"\n\n assert exc.error_code == \"INVALID_REPO\"\n\n def test_repository_error(self):\n \"\"\"\u6d4b\u8bd5\u4ed3\u5e93\u5f02\u5e38\"\"\"\n exc = RepositoryError(message=\"Repository not found\")\n assert str(exc) == \"Repository not found\"\n\n assert exc.error_code == \"REPO_NOT_FOUND\"\n\n def test_repository_access_error(self):\n \"\"\"\u6d4b\u8bd5\u4ed3\u5e93\u8bbf\u95ee\u6743\u9650\u5f02\u5e38\"\"\"\n exc = Repository", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.08333333333333333, + "n_retrieved": 10 + }, + { + "repo": "OrionStarAI/DeepV-Ki", + "expected": "data", + "got": "assert \"message\" in data", + "got_raw": "<|fim_suffix|>\n assert \"message\" in data\n assert data[\"status\"] == \"ok\"\n assert data[\"message\"] == \"OK\"\n\n def test_health_check_endpoint_with_error(self, client):\n \"\"\"\u6d4b\u8bd5 /health \u7aef\u70b9\uff0c\u8fd4\u56de\u9519\u8bef\u72b6\u6001\"\"\"\n response = client.get(\"/health\")\n assert response.status_code == 500\n data = response.json()\n\n assert \"status\" in data\n assert \"message\" in data\n assert data[\"status\"] == \"error\"\n assert data[\"message\"] == \"Internal Server Error\"\n\n# File: api/azureai_client.py", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "OrionStarAI/DeepV-Ki", + "expected": "\"integration_test@example.com\"", + "got": "user_data[\"uid\"]", + "got_raw": " user_data[\"uid\"]\n assert data[\"user_info\"][\"username\"] == user_data[\"username\"]\n assert data[\"user_info\"][\"user_no\"] == user_data[\"sub\"]\n\ndef test_protected_endpoint_with_invalid_jwt():\n \"\"\"Test accessing a protected endpoint with an invalid JWT\"\"\"\n # 1. Create a token\n user_data = {\n \"uid\": \"integration_test@example.com\",\n \"username\": \"integration_test\",\n \"sub\": \"test_session_id\"\n }\n token = create_access_token(user_data)\n\n # 2. Ensure session does NOT exist locally (to test restoration)\n # We", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.2608695652173913, + "n_retrieved": 10 + }, + { + "repo": "OrionStarAI/DeepV-Ki", + "expected": "\"user\"", + "got": "\"user\"", + "got_raw": " \"user\"\n assert repo.repo_name == \"project\"\n assert repo.repo_url == \"https://github.com/user/project\"\n assert repo.platform == \"github\"\n assert repo.default_branch == \"main\"\n\n def test_wiki_page_creation(self):\n \"\"\"\u6d4b\u8bd5 WikiPage \u521b\u5efa\"\"\"\n page = WikiPage(\n id=\"page_id\",\n title=\"Page Title\",\n content=\"Page Content\",\n section_id=\"section_id\",\n section_title=\"Section Title\",\n section_content=\"Section Content\",\n section_level=1,\n section_type=\"text\",\n section_order=1,\n section_parent_id=None,\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "OrionStarAI/DeepV-Ki", + "expected": "True", + "got": "", + "got_raw": "<|fim_suffix|>\n # 1. Create a token\n user_data = {\n \"uid\": \"integration_test@example.com\",\n \"username\": \"integration_test\",\n \"sub\": \"test_session_id\"\n }\n token = create_access_token(user_data)\n\n # 2. Ensure session does NOT exist locally (to test restoration)\n # We use a random session ID to ensure it's new\n import uuid\n session_id = str(uuid.uuid4())\n user_data[\"sub\"] = session_id\n token = create_access_token(user_data)\n\n # 3. Request with Token\n response =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "executed[\"refreshToken\"])", + "got": "", + "got_raw": "\n\n\n# File: graphql_auth/mixins.py\n @classmethod\n def resolve_mutation(cls, root, info, **kwargs):\n try:\n with transaction.atomic():\n f = cls.form(kwargs)\n if f.is_valid():\n email = kwargs.get(UserModel.EMAIL_FIELD, False)\n UserStatus.clean_email(email)\n user = f.save()\n send_activation = (\n app_settings.SEND_ACTIVATION_EMAIL is True and email\n )\n send_password_set = (\n app_settings.ALLOW_PASSWORDLESS_REGISTRATION is True\n and app_settings.SEND_PASSWORD_SET_EMAIL is True\n and email", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "True)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(executed[\"errors\"], [])\n self.assertEqual(executed[\"data\"][\"verifyAccount\"][\"success\"], True)\n self.assertEqual(executed[\"data\"][\"verifyAccount\"][\"errors\"], [])\n self.assertEqual(executed[\"data\"][\"verifyAccount\"][\"user\"][\"id\"], self.user1.id)\n self.assertEqual(executed[\"data\"][\"verifyAccount\"][\"user\"][\"email\"], self.user1.email)\n self.assertEqual(executed[\"data\"][\"verifyAccount\"][\"user\"][\"username\"], self.user1.username)\n self.assertEqual(executed[\"data\"][\"verifyAccount\"][\"user\"][\"verified\"], True)\n self.assertEqual(executed[\"data\"][\"verifyAccount\"][\"", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "False)", + "got": "0)", + "got_raw": "0)\n self.assertEqual(executed[\"errors\"], Messages.INVALID_TOKEN)\n\n def test_reset_password_invalid_token(self):\n token = get_token(self.user1, \"password_reset\")\n query = self.get_query(token, \"wrong_pass\")\n executed = self.make_request(query)\n\n self.assertEqual(executed[\"success\"], 0)\n self.assertEqual(executed[\"errors\"], Messages.INVALID_TOKEN)\n\n def test_reset_password_invalid_password(self):\n token = get_token(self.user1, \"password_reset\")\n query = self.get_query(token, \"wrong_pass\")\n executed = self.make_request(query)\n\n self.assertEqual(executed[\"success", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "{\"verified\": False})", + "got": "200)", + "got_raw": "200)\n self.assertEqual(executed[\"data\"][\"publicUser\"][\"verified\"], True)\n\n def test_private_user_query(self):\n query = \"\"\"\n query {\n privateUser {\n verified\n }\n }\n \"\"\"\n executed = self.make_request(query, variables={\"user\": self.user1})\n\n self.assertEqual(executed, 200)\n self.assertEqual(executed[\"data\"][\"privateUser\"][\"verified\"], True)\n\n def test_user_query(self):\n query = \"\"\"\n query {\n user {\n username\n verified\n }\n }\n \"\"\"\n executed = self.make_request(query, variables={\"", + "exact_match": false, + "code_bleu": 0.17909498863725698, + "edit_similarity": 0.08333333333333333, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "True)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(executed[\"errors\"], {})\n\n def test_send_email_valid_email(self):\n \"\"\"\n valid email should be successful request\n \"\"\"\n query = self.get_query(\"foo@email.com\")\n executed = self.make_request(query)\n\n self.assertEqual(executed[\"success\"], 1)\n self.assertEqual(executed[\"errors\"], {})\n\n def test_send_email_invalid_email_with_secondary_email(self):\n \"\"\"\n invalid email should be successful request\n \"\"\"\n query = self.get_query(\"invalid@email.com\")\n executed = self.make_request(query)\n\n self.assertEqual(executed[\"success\"], 1)\n ", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "executed[\"errors\"])", + "got": "PasswordSetMixin.form.is_valid(executed[\"errors\"]))", + "got_raw": "PasswordSetMixin.form.is_valid(executed[\"errors\"]))\n self.assertEqual(\n executed[\"errors\"][\"password1\"][0],\n Messages.PASSWORD_DOES_NOT_MATCH,\n )\n\n def test_set_password_invalid_token(self):\n token = \"wrong_token\"\n query = self.get_query(token, \"wrong_pass\")\n executed = self.make_request(query)\n self.assertEqual(executed[\"success\"], False)\n\n self.assertTrue(PasswordSetMixin.form.is_valid(executed[\"errors\"]))\n self.assertEqual(\n executed[\"errors\"][\"token\"][0],\n Messages.INVALID_TOKEN,\n )\n\n def test_set_password_invalid_password(self):\n token", + "exact_match": false, + "code_bleu": 0.38058030016749456, + "edit_similarity": 0.5428571428571428, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n\n @mock.patch(\n \"graphql_auth.models.UserStatus.send_activation_email\",\n mock.MagicMock(side_effect=SMTPException),\n )\n def test_register_email_send_fail_with_secondary_email(self):\n executed = self.make_request(self.register_query())\n self.assertEqual(executed[\"success\"], False)\n self.assertEqual(executed[\"errors\"][\"nonFieldErrors\"], Messages.EMAIL_FAIL)\n\n self.assertEqual(len(get_user_model().objects.all()), 0)\n\n @mock.patch(\n \"graphql_auth.models.UserStatus.send_activation_email\",\n mock.MagicMock(side_effect=SMTPException),\n )\n def test_register_email_send_fail_with", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "executed[\"errors\"][\"newPassword2\"])", + "got": "RefreshToken.objects.filter(user=self.user).exists())", + "got_raw": "RefreshToken.objects.filter(user=self.user).exists())\n\n def test_wrong_password(self):\n \"\"\"\n wrong inputs\n \"\"\"\n variables = {\"user\": self.user, \"old_password\": \"wrong\", \"new_password1\": \"123456\", \"new_password2\": \"123456\"}\n executed = self.make_request(self.get_query(\"wrong\"), variables)\n self.assertEqual(executed[\"success\"], False)\n\n self.assertTrue(RefreshToken.objects.filter(user=self.user).exists())\n\n def test_wrong_old_password(self):\n \"\"\"\n wrong inputs\n \"\"\"\n variables = {\"user\": self", + "exact_match": false, + "code_bleu": 0.07223943354597204, + "edit_similarity": 0.2727272727272727, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "{ \"nonFieldErrors\": [ { \"code\": \"password_already_set\", \"message\": \"Password already set for account.\", } ] })", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n executed[\"errors\"][\"password_set\"][0][\"message\"],\n Messages.PASSWORD_ALREADY_SET,\n )\n\n def test_wrong_token(self):\n token = \"wrong_token\"\n query = self.get_query(token)\n executed = self.make_request(query)\n self.assertEqual(executed[\"success\"], False)\n\n self.assertEqual(\n executed[\"errors\"][\"password_set\"][0][\"message\"], Messages.INVALID_TOKEN\n )\n\n def test_expired_token(self):\n token = get_token(self.user1, \"password_set\")\n query = self.get_query(token)\n executed = self.make_request(query)\n self.assertEqual(executed[\"success", + "exact_match": false, + "code_bleu": 0.0670443252045523, + "edit_similarity": 0.0975609756097561, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "True)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(self.archived_user.is_active, 0)\n\n self.login_user(email=\"gaa@email.com\", password=\"123456super\")\n\n self.assertEqual(self.archived_user.status.archived, 0)\n self.assertEqual(self.archived_user.is_active, 1)\n\n def test_not_verified_user_cannot_login(self):\n\n self.assertEqual(self.not_verified_user.status.verified, 0)\n\n with self.assertRaises(InvalidCredentials):\n self.login_user(email=\"boo@email.com\", password=\"123456super\")\n\n def test_verified_user_can_login(self):\n\n self.assertEqual", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "None)", + "got": "0)", + "got_raw": "0)\n self.assertEqual(executed[\"token\"], None)\n self.assertEqual(executed[\"refreshToken\"], None)\n\n # register again\n executed = self.make_request(self.register_query())\n self.assertEqual(executed[\"success\"], False)\n self.assertEqual(executed[\"errors\"], 1)\n self.assertEqual(executed[\"token\"], None)\n self.assertEqual(executed[\"refreshToken\"], None)\n\n # unregister\n user_registered.disconnect(receive_signal)\n\n # register again\n executed = self.make_request(self.register_query())\n self.assertEqual(executed[\"success\"], True)\n self.assertEqual(executed[\"errors\"], 0)\n", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "PedroBern/django-graphql-auth", + "expected": "Messages.UNAUTHENTICATED)", + "got": "Messages.NOT_AUTHENTICATED)", + "got_raw": " Messages.NOT_AUTHENTICATED)\n\n def test_not_verified(self):\n \"\"\"\n try to archive not verified\n \"\"\"\n query = self.make_query()\n executed = self.make_request(query)\n self.assertEqual(executed[\"success\"], False)\n\n self.assertEqual(executed[\"errors\"][\"nonFieldErrors\"], Messages.NOT_VERIFIED)\n\n def test_not_verified_and_not_authenticated(self):\n \"\"\"\n try to archive not verified and not authenticated\n \"\"\"\n query = self.make_query()\n executed = self.make_request(query)\n self.assertEqual(executed[\"success\"], False)\n\n self.assertEqual(executed[\"errors\"][\"nonFieldErrors\"],", + "exact_match": false, + "code_bleu": 0.5081327481546147, + "edit_similarity": 0.9230769230769231, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "w[2])", + "got": ".assertEqual(cur.warning_count, 0)", + "got_raw": ".assertEqual(cur.warning_count, 0)\n\n def test_fetchone(self):\n con = self.connect()\n cur = con.cursor()\n cur.execute(\"SELECT * FROM test\")\n self.assertEqual(cur.fetchone(), (\"row1\",))\n self.assertEqual(cur.fetchone(), (\"row2\",))\n self.assertEqual(cur.fetchone(), (\"row3\",))\n self.assertEqual(cur.fetchone(), (\"row4\",))\n self.assertEqual(cur.fetchone(), (\"row5\",))\n self.assertEqual(cur.fetchone(), None)\n\n def test_fetchmany(self):\n con = self.connect()\n cur = con.cursor()\n cur.execute(\"SELECT * FROM test\")\n ", + "exact_match": false, + "code_bleu": 0.14113991930789777, + "edit_similarity": 0.10256410256410256, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "11)", + "got": "11)", + "got_raw": "11)\n finally:\n c.execute(\"drop table if exists a\")\n c.execute(\"drop table if exists b\")\n\n def test_issue_80(self):\n \"\"\"DictCursor should not raise an exception when the result set is empty\"\"\"\n conn = self.connect()\n c = conn.cursor(pymysql.cursors.DictCursor)\n\n with warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\")\n c.execute(\"drop table if exists a\")\n c.execute(\"create table a (id int, value int)\")\n\n try:\n c.execute(\"select * from a\")\n r = c.fetchone()\n self.assertEqual", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "l)", + "got": "0 in l)", + "got_raw": "0 in l)\n self.connection.commit()\n self.cursor.execute(\"select col1 from %s where col1=%s\" % (self.table, 0))\n l = self.cursor.fetchall()\n self.assertTrue(0 in l)\n self.connection.rollback()\n self.cursor.execute(\"select col1 from %s where col1=%s\" % (self.table, 0))\n l = self.cursor.fetchall()\n self.assertFalse(0 in l)\n\n def test_transactions_rollback(self):\n columndefs = (\"col1 INT\", \"col2 VARCHAR(255)\")\n\n def generator(row, col):\n", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.4444444444444444, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "err.OperationalError", + "got": "err.OperationalError", + "got_raw": " err.OperationalError\n assert cm.value.args[0] == 28000\n assert cm.value.args[1] == \"Access denied\"\n\n data = b\"\\xff\\x15\\x04#28000Access denied\"\n with pytest.raises(err.OperationalError) as cm:\n err.raise_mysql_exception(data)\n\n assert cm.type == err.OperationalError\n assert cm.value.args[0] == 28000\n assert cm.value.args[1] == \"Access denied\"\n\n data = b\"\\xff\\x15\\x0", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "self.connection.literal(3.1415))", + "got": "3.1415e0)", + "got_raw": "3.1415e0)\n\n def test_literal_int(self):\n\n self.assertEqual(\"1234567890\", 1234567890)\n\n def test_literal_str(self):\n\n self.assertEqual(\"'abc'\", \"abc\")\n\n def test_literal_str_with_backslash(self):\n\n self.assertEqual(\"'\\\\abc'\", \"\\\\abc\")\n\n def test_literal_str_with_single_quote(self):\n\n self.assertEqual(\"'abc''def'\", \"abc'def\")\n\n def test_literal_str_with_double_quote(self):\n\n self.assertEqual('\"abc\"def', \"abc\\\"def\")\n\n def test", + "exact_match": false, + "code_bleu": 0.11939665909150465, + "edit_similarity": 0.34146341463414637, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "None", + "got": "0, \"nextset() should return 0 on success\"", + "got_raw": "0, \"nextset() should return 0 on success\"\n assert cur.nextset() == 0, \"nextset() should return 0 on success\"\n assert cur.nextset() == 0, \"nextset() should return 0 on success\"\n assert cur.nextset() == 0, \"nextset() should return 0 on success\"\n assert cur.nextset() == 0, \"nextset() should return 0 on success\"\n assert cur.nextset() == 0, \"nextset() should return 0 on success\"\n assert cur.nextset() == 0,", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.08888888888888889, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "(1045, \"Access denied\")", + "got": "28000", + "got_raw": "28000\n assert cm.value.message == \"Access denied\"\n assert cm.value.errno == 28000\n assert cm.value.sqlstate == \"28000\"\n assert cm.value.args[0] == 28000\n assert cm.value.args[1] == \"Access denied\"\n assert cm.value.args[2] == \"28000\"\n assert cm.value.args[3] == \"Access denied\"\n assert cm.value.args[4] == \"28000\"\n assert cm.value.args[5] == \"", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.07142857142857142, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "orphans)", + "got": ".connection.close()", + "got_raw": ".connection.close()\n\n def _create_table(self, table_name):\n self.cursor.execute(\n f\"CREATE TABLE `{table_name}` (\"\n f\"`id` int(11) NOT NULL AUTO_INCREMENT,\"\n f\"`text` varchar(255) COLLATE utf8mb4_bin NOT NULL,\"\n f\"`binary` BLOB,\"\n f\"`u_text` varchar(255) COLLATE utf8mb4_bin NOT NULL,\"\n f\"`u_binary` BLOB,\"\n f\"`blob` BLOB,\"\n f\"`u_blob` BLOB,\"\n f\"`blob_text` B", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.2962962962962963, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "r)", + "got": "1, r)", + "got_raw": "1, r)\n self.assertEqual([(2,)], list(cur))\n\n r = cur.nextset()\n\n self.assertTrue(1, r)\n self.assertEqual([], list(cur))\n\n r = cur.nextset()\n\n self.assertTrue(0, r)\n self.assertEqual([], list(cur))\n\n def test_nextset_unbuffered(self):\n con = self.connect(\n init_command='SELECT \"bar\"; SELECT \"baz\"',\n client_flag=CLIENT.MULTI_STATEMENTS,\n )\n cur = con.cursor()\n cur.execute(\"SELECT 1; SELECT 2;\")\n self.assertEqual([(1,)], list(cur))\n\n r", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "self.driver.Error)", + "got": "", + "got_raw": "\n\n\n# File: docs/source/user/examples.rst\n.. _examples:\n\n========\nExamples\n========\n\n.. _CRUD:\n\nCRUD\n----\n\nThe following examples make use of a simple table\n\n.. code:: sql\n\n CREATE TABLE `users` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `email` varchar(255) COLLATE utf8_bin NOT NULL,\n `password` varchar(255) COLLATE utf8_bin NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "(\"row1\", 0))", + "got": "", + "got_raw": " # this is a tuple\n (\"row1\", 0.01))\n\n # this will sleep 0.01 seconds per row\n if db_type == \"mysql\":\n sql = (\n \"SELECT /*+ MAX_EXECUTION_TIME(2000) */ data, sleep(0.01) FROM test\"\n )\n else:\n sql = \"SET STATEMENT max_statement_time=2 FOR SELECT data, sleep(0.01) FROM test\"\n\n cur.execute(sql)\n # unlike SSCursor, Cursor returns a tuple of tuples here\n self.assertEqual(\n cur.fetchall", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "cur.fetchall())", + "got": "list(cur.fetchall()))", + "got_raw": " list(cur.fetchall()))\n\n con.close()\n\n def test_nextset(self):\n con = self.connect(client_flag=CLIENT.MULTI_STATEMENTS)\n cur = con.cursor()\n\n cur.execute(\"SELECT 1; SELECT 2; SELECT 3;\")\n self.assertEqual([(1,)], list(cur))\n self.assertEqual([(2,)], list(cur.nextset()))\n self.assertEqual([(3,)], list(cur.nextset()))\n self.assertEqual([], list(cur.nextset()))\n\n con.close()\n\n def test_nextset_unbuffered(self):\n con = self.connect(client_flag=CLIENT.MULTI_STATEMENTS)\n cur = con.cursor()\n\n", + "exact_match": false, + "code_bleu": 0.6389431042462724, + "edit_similarity": 0.8333333333333334, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "lowercase_latin1", + "got": "lowercase_latin1", + "got_raw": " lowercase_latin1\n\n # lowercase and lowercase should resolve to the same charset\n lowercase_latin1 = pymysql.charset.charset_by_name(\"latin1\")\n\n assert lowercase_latin1 == uppercase_latin1\n\n # lowercase and uppercase should resolve to the same charset\n uppercase_latin1 = pymysql.charset.charset_by_name(\"LATIN1\")\n\n assert uppercase_latin1 == lowercase_latin1\n\n # lowercase and lowercase should resolve to the same charset\n lowercase_latin1 = pymysql.charset.charset_by_name(\"latin1\")\n\n assert lowercase_latin1 == uppercase_latin1\n\n # lowercase and uppercase", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "ER.NO_SUCH_TABLE)", + "got": "1146)", + "got_raw": "1146)\n self.assertEqual(msg.args[1], ER.ER_NO_SUCH_TABLE)\n\n def test_bug_2671682_2(self):\n from pymysql.constants import ER\n\n try:\n self.cursor.execute(\"describe some_non_existent_table\")\n except self.connection.ProgrammingError as msg:\n\n self.assertEqual(msg.args[0], 1146)\n self.assertEqual(msg.args[1], ER.ER_NO_SUCH_TABLE)\n\n def test_bug_2671682_3(self):\n from pymysql.constants import ER\n\n try:\n self.cursor", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "PyMySQL/PyMySQL", + "expected": "[(2,)])", + "got": "[(2,)])", + "got_raw": " [(2,)])\n self.assertTrue(cursor.nextset())\n\n self.assertListEqual(list(cursor), [(3,)])\n self.assertTrue(cursor.nextset())\n\n # Test nextset()\n self.assertEqual(cursor.nextset(), None)\n\n # Test scroll()\n cursor.scroll(1, \"relative\")\n self.assertEqual(cursor.rownumber, 2)\n\n cursor.scroll(-1, \"absolute\")\n self.assertEqual(cursor.rownumber, 1)\n\n # Test close()\n cursor.close()\n self.assertEqual(cursor.nextset(), None)\n\n # Test kill()\n cursor.execute(\"SELECT 1\")\n cursor.kill(cursor.connection.thread_id())\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n assert_equal(route2.duration(), 6122 + 0 - 4718)\n\n # This route visits 34, reloads, and then visits 23, 38, and 48, as\n # follows:\n # - Leave the depot at 14579.\n # - Visit 34 at 14902, leave at 15802.\n # - Return to reload depot at 16125.\n # - Visit 23 at 16430, leave at", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "3)", + "got": "3)", + "got_raw": "3)\n\n # Below targetFeasible, so should increase the loadPenalty to 110%, and\n # +1 from the bounds check. So 1.1 * 3 = 3.3, and int(3.3) = 3.\n for sol in [infeas] * num_registrations:\n pm.register(sol)\n\n assert_equal(pm.cost_evaluator().load_penalty(2, 1, 0), 3)\n\n # Above targetFeasible, so should decrease the loadPenalty to 90%, and -1\n # from the", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "4)", + "got": "10)", + "got_raw": "10)\n assert_equal(data.num_vehicles, 10)\n assert_equal(data.capacity, 100)\n\n # From the EDGE_WEIGHT_SECTION in the file.\n\n assert_equal(data.edge_weights.shape, (10, 10))\n assert_allclose(data.edge_weights, np.array([\n [0, 10, 10, 10, 10, 10, 10, 10, 10, 10],\n [10, 0, 10, 10, 10, 10,", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n assert_equal(improved.num_clients, 10)\n assert_equal(improved.num_groups, 3)\n assert_equal(improved.num_routes, 3)\n assert_equal(improved.num_trips, 10)\n assert_equal(improved.num_clients, 10)\n assert_equal(improved.num_groups, 3)\n assert_equal(improved.num_routes, 3)\n assert_equal(improved.num_trips, 10)\n assert_equal(improved.num_clients, 10)\n assert_equal(improved.num_groups, 3)\n assert_equal(improved.num_routes, ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n assert_(route2[0] is nodes[0])\n assert_(route2[1] is nodes[1])\n assert_(route2[2] is nodes[2])\n\n # Now we actually perform the move.\n op.apply(nodes[-1], route2[0], cost_evaluator)\n\n assert_(nodes[-1].route is route2)\n assert_equal(route2.num_clients(), 3)\n\n assert_equal(route1.num_clients(), 0)\n assert_(route1[0] is nodes[0])\n assert_(route1[1] is nodes[1])\n assert", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "(-103, True))", + "got": "103)", + "got_raw": "103)\n\n # Replacing client 1 with 3 is slightly improving:\n # delta = dist(0, 3) + dist(3, 4) - dist(0, 1) - dist(1, 4)\n # = 1944 + 1090 - 1544 - 1593\n # = -103.\n node = Node(loc=3)\n\n assert_equal(op.evaluate(node, cost_eval), 103)\n\n # Replacing client 1 with 4 is slightly improving:\n ", + "exact_match": false, + "code_bleu": 0.16988673071467442, + "edit_similarity": 0.47058823529411764, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "pickup)", + "got": "assert_equal(load_segment.load(), load)", + "got_raw": "<|fim_suffix|>\n assert_equal(load_segment.load(), load)\n\n with pytest.raises(ValueError):\n load_segment.delivery(1)\n\n with pytest.raises(ValueError):\n load_segment.pickup(1)\n\n with pytest.raises(ValueError):\n load_segment.load(1)\n\n\ndef test_attribute_setters():\n \"\"\"\n Tests that the attribute member functions return the passed in values.\n \"\"\"\n load_segment = LoadSegment(0, 0, 0)\n load_segment.delivery(1)\n assert_equal(load_segment.delivery(), 1)\n\n load_segment.pickup(2)\n assert_equal(load_segment.pickup(), 2)\n\n load_segment", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "ValueError)", + "got": "", + "got_raw": " # type: ignore[call-overload]\n ValueError, match=\"max_iterations < 0 not understood.\"\n ):\n MaxIterations(max_iterations)\n\n\ndef test_max_iterations():\n \"\"\"\n Maximum iterations is correctly handled.\n \"\"\"\n\n max_iterations = 1000\n criterion = MaxIterations(max_iterations)\n\n assert criterion(1000) is False\n assert criterion(1001) is True\n\n\ndef test_max_iterations_with_callback():\n \"\"\"\n Maximum iterations is correctly handled with a callback.\n \"\"\"\n\n max_iterations = 1000\n criterion = MaxIterations(max_iterations)\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "11 + 3 * 9)", + "got": "11 + 3 * 9)", + "got_raw": "11 + 3 * 9)\n\n # 3rd segment, defined for values in [10, 20).\n assert_equal(fn(10), 11 + 3 * 10)\n\n assert_equal(fn(19), 11 + 3 * 19)\n\n # 4th segment, defined for values >= 20.\n assert_equal(fn(20), 11 + 3 * 20)\n assert_equal(fn(21), 11 + 3 * 21)\n assert_equal(fn(100),", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "ValueError)", + "got": "from numpy.testing import assert_, assert_equal, assert_raises", + "got_raw": "\n\n\nfrom numpy.testing import assert_, assert_equal, assert_raises\n\nfrom pyvrp import PiecewiseLinearFunction\n\ndef test_piecewise_linear_function_raises_inconsisten_argument_sizes():\n \"\"\"\n Tests that the piecewise linear function cannot be constructed with\n inconsistently sized arguments.\n \"\"\"\n\n with assert_raises(\n\n\nfrom numpy.testing import assert_, assert_equal, assert_raises\n\nfrom pyvrp import PiecewiseLinearFunction\n\ndef test_piecewise_linear_function_raises_inconsisten_argument_sizes():\n \"\"\"\n Tests that the piecewise linear function cannot be constructed with\n inconsistently sized arguments.\n \"\"\"\n\n with assert_raises(", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.0821917808219178, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n\n assert_equal(data.num_clients, 3)\n\n assert_equal(data.num_vehicles, 1)\n\n assert_equal(data.num_vehicle_types, 1)\n\n assert_equal(data.num_vehicle_type_profiles, 1)\n\n assert_equal(data.num_vehicle_type_profiles, 1)\n\n assert_equal(data.num_vehicle_type_profiles, 1)\n\n assert_equal(data.num_vehicle_type_profiles, 1)\n\n assert_equal(data.num_vehicle_type_profiles, 1)\n\n assert_equal(data.num_vehicle_type_profiles, 1)\n\n assert_equal(data.num_vehicle_type_profiles, 1)\n\n assert_equal(data.num_vehicle_type_profiles, ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "x)", + "got": "1)", + "got_raw": "1)\n assert_equal(client.y, 1)\n assert_equal(client.delivery, [1])\n assert_equal(client.pickup, [0])\n assert_equal(client.service_duration, 1)\n assert_equal(client.tw_early, 0)\n assert_equal(client.tw_late, 1)\n assert_equal(client.release_time, 0)\n assert_equal(client.prize, 0)\n assert_equal(client.required, True)\n assert_equal(client.group, None)\n assert_equal(client.name, \"test name\")\n\n\n@pytest.mark.parametrize(\n (\n \"x\",\n \"y\",\n \"delivery\",\n \"", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "[5])", + "got": "10)", + "got_raw": "10)\n\n evaluator = CostEvaluator(data, route)\n evaluator.set_cost(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n assert_(should_apply)\n\n # The move should be applied.\n new_route = op.apply(route[1], cost_eval)\n assert_equal(new_route, route)\n\n # The move should be applied again.\n new_route = op.apply(new_route[1], cost_eval)\n assert_equal(new_route, route)\n\n # The move should not be applied again.\n new_route = op.apply(new_route[1], cost_eval)\n assert_equal(new_route, route)\n\n # The move should be applied again.\n new_route = op.apply(new_route[1], cost_eval)\n assert_equal(new_route", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "stats)", + "got": "", + "got_raw": " # check that the statistics are equal\n Statistics(),\n err_msg=\"Statistics are not equal\",\n )\n\n stats.collect(sol, sol, sol, cost_eval) # add one more iteration\n assert_equal(stats, # check that the statistics are equal\n Statistics(),\n err_msg=\"Statistics are not equal\",\n )\n\n stats.collect(sol, sol, sol, cost_eval) # add one more iteration\n assert_equal(stats, # check that the statistics are equal\n Statistics(),\n err_msg=\"Statistics are not equal\",\n )\n\n stats.collect(sol, sol, sol, cost_eval)", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "3)", + "got": "10)", + "got_raw": "10)\n fleet = minimise_fleet(ok_small, MaxIterations(1000))\n assert_equal(fleet.num_available, 10)\n assert_equal(fleet.num_available, ok_small.num_vehicles)\n\ndef test_OkSmallWithOptionalClients(ok_small_with_optional_clients):\n \"\"\"\n Tests that the fleet minimisation procedure attains the lower bound on the\n OkSmallWithOptionalClients instance.\n \"\"\"\n\n assert_equal(ok_small_with_optional_clients.num_vehicles, 10)\n fleet = minimise_fleet(ok_small_with_optional_clients, MaxIterations(1000))\n assert_equal(f", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n\n assert_equal(len(neighbours[1]), 0)\n\n assert_equal(len(neighbours[2]), 0)\n\n assert_equal(len(neighbours[3]), 0)\n\n assert_equal(len(neighbours[4]), 0)\n\n assert_equal(len(neighbours[5]), 0)\n\n assert_equal(len(neighbours[6]), 0)\n\n assert_equal(len(neighbours[7]), 0)\n\n assert_equal(len(neighbours[8]), 0)\n\n assert_equal(len(neighbours[9]), 0)\n\n assert_equal(len(neighbours[10]), 0)\n\n assert_equal(len(ne", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n assert_equal(vehicle_type.capacity, [])\n assert_equal(vehicle_type.start_depot, 0)\n assert_equal(vehicle_type.end_depot, 0)\n assert_equal(vehicle_type.fixed_cost, 0)\n assert_equal(vehicle_type.tw_early, 0)\n assert_equal(vehicle_type.tw_late, 0)\n assert_equal(vehicle_type.shift_duration, 0)\n assert_equal(vehicle_type.max_distance, 0)\n assert_equal(vehicle_type.unit_distance_cost, 0)\n assert_equal(vehicle_type.unit_duration_cost, 0)\n assert_equal(vehicle_type.start_late, 0)\n\n\ndef", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "client)", + "got": "1)", + "got_raw": "1)\n assert_equal(search_sol.nodes[client].route, 0)\n\n assert_equal(search_sol.nodes[client].location, 1)\n assert_equal(search_sol.nodes[client].vehicle, 0)\n\n assert_equal(search_sol.nodes[client].visit, 0)\n\n assert_equal(search_sol.nodes[client].visit_type, 0)\n\n assert_equal(search_sol.nodes[client].visit_type, 0)\n\n assert_equal(search_sol.nodes[client].visit_type, 0)\n\n assert_equal(search_sol.nodes[client].visit_type, 0)\n\n assert_equal(search_sol.nodes[client].visit", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "PyVRP/PyVRP", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n assert_equal(callbacks.end_cnt, 1)\n assert_equal(callbacks.init, init)\n assert_equal(callbacks.res, res)\n\n\ndef test_callback_on_iteration(ok_small):\n \"\"\"\n Tests that ILS calls the provided callbacks at each iteration.\n \"\"\"\n\n class Callbacks(IteratedLocalSearchCallbacks):\n def __init__(self):\n self.iters = 0\n self.cand: Solution | None = None\n self.best: Solution | None = None\n\n def on_iteration(self, current, candidate, best, cost_evaluator):\n self.iters += 1\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "'haar')", + "got": "1)", + "got_raw": "1)\n assert_raises(TypeError, pywt.dwtn, data, 'haar')\n assert_raises(TypeError, pywt.dwtn, data, 'haar', 1)\n assert_raises(TypeError, pywt.dwtn, data, 'haar', 'symmetric')\n assert_raises(TypeError, pywt.dwtn, data, 'haar', 'symmetric', 1)\n assert_raises(TypeError, pywt.dwtn, data, 'haar', 'symmetric', 1, 1)\n assert_raises(TypeError, pywt.dwtn, data, 'haar', 'symmetric', 1, 1, 1", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "(5, 3))", + "got": "1)", + "got_raw": "1)\n assert_raises(TypeError, wp.__getitem__, (1, 2))\n assert_raises(TypeError, wp.__getitem__, (1, 2, 3))\n\n # getitem input must be a string or tuple of strings\n\n assert_raises(TypeError, wp.__setitem__, 1, 1)\n assert_raises(TypeError, wp.__setitem__, (1, 2), 1)\n assert_raises(TypeError, wp.__setitem__, (1, 2, 3), 1)\n\n # setitem input must be a string or tuple of strings\n\n assert_raises(TypeError, wp.__del", + "exact_match": false, + "code_bleu": 0.17909498863725698, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "np.linspace(0, 5, x.size, endpoint=False))", + "got": "2**(-3.5)*np.arange(x.size))", + "got_raw": "2**(-3.5)*np.arange(x.size))\n assert_allclose(phi_d, phi_d_expect)\n assert_allclose(phi_r, phi_r_expect)\n assert_allclose(psi_d, psi_d_expect)\n assert_allclose(psi_r, psi_r_expect)\n\ndef test_wavefun_symm():\n w = pywt.Wavelet('symm')\n # symm is not an orthogonal wavelet, so 5 outputs from wavefun\n phi_d, psi_d, phi_r, psi_r, x = w.wavefun(level=3)\n for arr in [phi_d, psi", + "exact_match": false, + "code_bleu": 0.18710158230410626, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "cD0)", + "got": "0.5*(cD0 - cD1))", + "got_raw": "0.5*(cD0 - cD1))\n assert_allclose(cD[1], 0.5*(cD1 - cD0))\n\n\ndef test_dwt_single_axis_complex():\n x = [[3+1j, 7+1j, 1+1j, 1+1j],\n [-2+1j, 5+1j, 4+1j, 6+1j]]\n\n cA, cD = pywt.dwt(x, 'db2', axis=-1)\n\n cA0, cD0 = pywt.dwt", + "exact_match": false, + "code_bleu": 0.17747405280050269, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "None)", + "got": "0.5)", + "got_raw": "0.5)\n assert_raises(TypeError, pywt.dwt, x, 'db2', 'symmetric', 0.5)\n\n assert_raises(TypeError, pywt.dwt, x, 'db2', 'symmetric', [0, 1, 2])\n assert_raises(TypeError, pywt.dwt, x, 'db2', 'symmetric', (0, 1, 2))\n\n assert_raises(TypeError, pywt.dwt, x, 'db2', 'symmetric', (0, 1, 2.5))\n\n assert_raises(TypeError, pywt.dwt,", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "np.array([5., 13.]))", + "got": "np.array([1.050660171793, 3.901480343556,", + "got_raw": " np.array([1.050660171793, 3.901480343556,\n 6.752300515321, 9.603120687084]),\n rtol=1e-12)\n\n # Third level\n\n assert_allclose(wp['aaa'].data, np.array([0.525330085896, 2.576150171793,\n ", + "exact_match": false, + "code_bleu": 0.43959679029144905, + "edit_similarity": 0.4918032786885246, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "v)", + "got": "0, err_msg=f\"coeff {k} not zero\")", + "got_raw": "0, err_msg=f\"coeff {k} not zero\")\n\n # verify the inverse transform didn't modify any coeffs\n for c, c2 in zip(coeffs, coeffs_copy):\n for k, v in c.items():\n assert_array_equal(c2[k], 0, err_msg=f\"coeff {k} not zero\")\n\n # verify the inverse transform didn't modify any coeffs\n for c, c2 in zip(coeffs, coeffs_copy):\n for k, v in c.items():\n assert_array_equal(c2[k], 0, err_msg=f\"coeff {k} not zero\")\n\n # verify", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.05714285714285714, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "[])", + "got": "0)", + "got_raw": "0)\n\n # 1-level transform\n coeffs = pywt.swtn(X, current_wavelet, level=1)\n assert_equal(coeffs['aa'].shape, (input_length, input_length))\n assert_equal(coeffs['ad'].shape, (input_length, input_length))\n assert_equal(coeffs['da'].shape, (input_length, input_length))\n assert_equal(coeffs['dd'].shape, (input_length, input_length))\n\n # 2-level transform\n coeffs = pywt.swtn(X, current_wavelet, level=2)\n assert_equal(coeffs['aa'].shape, (input_length, input", + "exact_match": false, + "code_bleu": 0.35818997727451396, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "expected[i, :])", + "got": "expected[i])", + "got_raw": " expected[i])\n\n node = wp['ad']\n del wp['ad']\n\n dataleafs = [n.data for n in wp.get_leaf_nodes(False)]\n expected = np.array([[5., 13.], [-2, -2], [-1, -1], [0, 0]])\n\n for i in range(4):\n\n assert_allclose(dataleafs[i], expected[i])\n\n wp['ad'] = node.data\n\n dataleafs = [n.data for n in wp.get_leaf_nodes(False)]\n expected = np.array([[5., 13.], [-2, -", + "exact_match": false, + "code_bleu": 0.4316250567652526, + "edit_similarity": 0.8888888888888888, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "c)", + "got": "c, wavelet=cwave)", + "got_raw": " c, wavelet=cwave)\n\n\ndef test_error_on_non_continuous_wavelet():\n # A ValueError is raised if a non-Continuous wavelet is selected\n data = np.ones((16, 16))\n for dec_fun, rec_fun in zip([pywt.dwt2, pywt.dwtn],\n [pywt.idwt2, pywt.idwtn]):\n for cwave in ['morl', 'db1']:\n assert_raises(ValueError, dec_fun, data, wavelet=cwave)\n\n c = dec_fun(data, 'db1')\n\n assert_raises(ValueError, rec_fun, ", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.21052631578947367, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "[[0, 1]] * 2)", + "got": "soft_result, pywt.threshold(data, 2, 'soft', mode='twoway'),", + "got_raw": "soft_result, pywt.threshold(data, 2, 'soft', mode='twoway'),\n rtol=1e-12)\n assert_allclose(soft_result, pywt.threshold(-data, 2, 'soft', mode='twoway'),\n rtol=1e-12)\n\n # hard\n hard_result = [0., 0., 0., 1., 1., 1., 2.]\n assert_allclose(pywt.threshold(data, 2, 'hard'),\n np.array(hard_result), rtol=1e-12)\n ", + "exact_match": false, + "code_bleu": 0.0859076483566362, + "edit_similarity": 0.136986301369863, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "res2)", + "got": "0)", + "got_raw": "0)\n assert_allclose(res2, 0)\n\n res1 = pywt.idwt(None, [1, 2, 0, 1], 'db2', 'symmetric')\n res2 = pywt.idwt([0, 0, 0, 0], [1, 2, 0, 1], 'db2', 'symmetric')\n\n assert_allclose(res1, 0)\n assert_allclose(res2, 0)\n\n res1 = pywt.idwt([1, 2, 0, 1], None, 'db2',", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "pywt.WaveletPacket)", + "got": "", + "got_raw": " # axis out of range\n pywt.WaveletPacket, data=x, wavelet='db1', mode='symmetric',\n axis=x.ndim)\n\n # ValueError if axis is not a valid axis\n assert_raises(ValueError, # axis is not a valid axis\n pywt.WaveletPacket, data=x, wavelet='db1', mode='symmetric',\n axis=x.ndim + 1)\n\ndef test_wavelet_packet():\n rstate = np.random.RandomState(0)\n shape = (32, 16)\n x = rstate.standard_normal(shape)\n wp =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "PyWavelets/pywt", + "expected": "x)", + "got": "2*np.pi*Fb*x, atol=1e-15)", + "got_raw": "2*np.pi*Fb*x, atol=1e-15)\n\ndef test_fbsp():\n LB = -20\n UB = 20\n N = 1000\n m = 10\n Fb = 1\n Fc = 1.5\n\n [psi, x] = ref_fbsp(LB, UB, N, m, Fb, Fc)\n w = pywt.ContinuousWavelet(f\"fbsp{m}-{Fb}-{Fc}\")\n assert_almost_equal(w.center_frequency, Fc)\n assert_almost_equal", + "exact_match": false, + "code_bleu": 0.08513012360883544, + "edit_similarity": 0.14814814814814814, + "n_retrieved": 10 + }, + { + "repo": "Quantweb3-com/NexusTrader", + "expected": "balances", + "got": "", + "got_raw": " # type: ignore\n assert balances[\"BTCUSDT-PERP.BINANCE\"].free == Decimal(0.001) # type: ignore\n assert balances[\"BTCUSDT-PERP.BINANCE\"].locked == Decimal(0) # type: ignore\n\n # sync position to redis\n await async_cache._sync_to_redis()\n balances = async_cache._get_all_positions_from_redis(ExchangeType.BINANCE)\n\n\n assert \"BTCUSDT-PERP.BINANCE\" in # type: ignore\n assert balances[\"BTCUSDT-PERP.BINANCE\"].free == Decimal", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Quantweb3-com/NexusTrader", + "expected": "-1", + "got": "0", + "got_raw": "0\n assert position.side == PositionSide.SELL\n\n await mock_linear_connector.cancel_order(\n symbol=\"BTCUSDT-PERP.BINANCE\", order_id=order.oid\n )\n await mock_linear_connector._cache._init_storage()\n await mock_linear_connector._init_balance()\n await mock_linear_connector._init_position()\n order = await mock_linear_connector.create_order(\n symbol=\"BTCUSDT-PERP.BINANCE\",\n side=OrderSide.BUY,\n type=OrderType.LIMIT,\n amount=Decimal(\"1\"),\n )\n assert order.status == OrderStatus.PENDING\n\n ", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Quantweb3-com/NexusTrader", + "expected": "btc.total", + "got": "0.001 == async_cache._get_balance(BinanceAccountType.SPOT, \"BTC\")", + "got_raw": "0.001 == async_cache._get_balance(BinanceAccountType.SPOT, \"BTC\")\n assert 1000 == async_cache._get_balance(BinanceAccountType.SPOT, \"USDT\")\n\n assert 0.001 == async_cache._get_balance(BinanceAccountType.FUTURE, \"BTC\")\n assert 0 == async_cache._get_balance(BinanceAccountType.FUTURE, \"USDT\")\n\n assert 0.001 == async_cache._get_balance(BinanceAccountType.SPOT, \"BTC\")\n assert 1000 == async_cache._get_balance(B", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.10810810810810811, + "n_retrieved": 10 + }, + { + "repo": "Quantweb3-com/NexusTrader", + "expected": "1", + "got": "1", + "got_raw": "1\n assert position[0].asset == \"USDT\"\n assert position[0].side == PositionSide.BUY\n assert position[0].quantity == Decimal(\"10000\")\n assert position[0].price == Decimal(\"10000\")\n assert position[0].leverage == Decimal(\"1\")\n assert position[0].realized_pnl == Decimal(\"0\")\n assert position[0].unrealized_pnl == Decimal(\"0\")\n assert position[0].unrealized_cost == Decimal(\"0\")\n assert position[0].unrealized_cost", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[", + "got_raw": " [\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n ]\n\n def test_merge_never1(self):\n scheduler = TestScheduler()\n n1 = reactivex.never()\n n2 = reactivex.never()\n\n def create():\n return reactivex.merge(n1, n2)\n\n results = scheduler.start(create)\n\n assert results.messages == [\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "diff", + "got": "diff < timedelta(milliseconds=1100)", + "got_raw": " diff < timedelta(milliseconds=1100)\n\n def test_new_thread_now(self):\n scheduler = NewThreadScheduler()\n diff = scheduler.now\n sleep(1.1)\n diff = scheduler.now - diff\n\n assert timedelta(seconds=1) < diff < timedelta(seconds=2)\n\n def test_new_thread_now_2(self):\n scheduler = NewThreadScheduler()\n diff = scheduler.now\n sleep(1.1)\n diff = scheduler.now - diff\n\n assert timedelta(milliseconds=1000) < diff < timedelta(milliseconds=1100)\n\n def test_new_thread_now", + "exact_match": true, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.20512820512820512, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "e scheduler.start(test_create)", + "got_raw": "<|fim_suffix|>e scheduler.start(test_create)\n assert results.messages == [\n on_next(210, 1),\n on_next(300, 2),\n on_next(310, 50),\n on_next(320, 1),\n on_next(330, 2),\n on_next(340, 50),\n on_next(350, 1),\n on_next(360, 2),\n on_next(370, 50),\n on_completed(380),\n ]\n assert e", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[", + "got_raw": " [\n on_next(200, 0),\n on_completed(200)\n ]\n assert scheduler.state == 0\n\n def test_generate_dispose_error(self):\n scheduler = TestScheduler()\n ex = \"ex\"\n\n def create():\n return reactivex.generate(\n 0,\n lambda x: True,\n lambda x: x + 1,\n lambda x: _raise(ex)\n )\n\n results = scheduler.start(create, disposed=200)\n\n assert results.messages == [\n on_next(200, 0),\n on_error(200", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[on_completed(250)]", + "got_raw": " [on_completed(250)]\n\n def test_find_never_predicate(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(on_next(150, 1))\n\n def create():\n return xs.pipe(ops.find(lambda x, i, s: False))\n\n res = scheduler.start(create)\n\n\n assert res.messages == [on_completed(250)]\n\n def test_find_never_predicate_index(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(on_next(150, 1))\n\n def create():\n return xs.pipe(ops.find(lambda", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.19047619047619047, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[on_next(340, 8)]", + "got": "[", + "got_raw": " [\n on_next(300, 7),\n on_next(350, 3),\n on_next(360, 4),\n on_next(370, 1),\n on_next(390, 8),\n on_next(410, 5),\n on_next(430, 6),\n on_next(450, 9),\n on_next(520, 11),\n on_next(560, 20),\n on_completed(600)\n ]\n\n assert ys[0", + "exact_match": false, + "code_bleu": 0.07432544468767006, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[on_completed(225)]", + "got_raw": " [on_completed(225)]\n assert left.subscriptions == [subscribe(200, 225)]\n assert right.subscriptions == [subscribe(200, 225)]\n\n def test_take_until_nopreempt_never_complete(self):\n scheduler = TestScheduler()\n right_msgs = [on_next(150, 1), on_completed(225)]\n left = reactivex.never()\n right = scheduler.create_hot_observable(right_msgs)\n\n def create():\n return left.pipe(ops.take_until(right))\n\n results = scheduler.start(create)\n\n assert results.messages", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.19047619047619047, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[8.0]", + "got": "8.0", + "got_raw": "8.0\n\n def test_filter_with_average_and_pipe(self) -> None:\n \"\"\"Test filtering followed by average with pipe.\"\"\"\n source: Observable[int] = rx.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n\n result: Observable[float] = (\n source.pipe(\n ops.filter(lambda x: x % 2 == 0), # [2, 4, 6, 8, 10]\n ops.take_while(lambda x: x < 9), # [2,", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[on_completed(225)]", + "got": "[on_completed(225)]", + "got_raw": " [on_completed(225)]\n assert results.was_subscribed() == True\n assert results.was_disposed() == False\n\n def test_amb_never_empty_2(self):\n scheduler = TestScheduler()\n r_msgs = [on_next(150, 1), on_completed(225)]\n n = reactivex.never()\n e = scheduler.create_hot_observable(r_msgs)\n\n def create():\n return n.pipe(ops.amb(e))\n\n results = scheduler.start(create)\n\n assert results.messages == [on_completed(225)]\n assert results.w", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[", + "got_raw": " [\n on_next(300, 9),\n on_completed(650)\n ]\n assert results2.messages == [\n on_next(400, 9),\n on_completed(650)\n ]\n assert results3.messages == [\n on_next(900, 9),\n on_completed(650)\n ]\n assert s[0].messages == [\n on_next(200, 9),\n on_completed(650)\n ]\n assert subscription[0].is_disposed == True\n assert subscription1[", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[", + "got_raw": " [\n on_next(150, 1),\n on_completed(150)\n ]\n\n def test_delay_never_2(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(on_next(150, 1))\n\n def create():\n return xs.pipe(delay(10))\n\n results = scheduler.start(create, disposed=100)\n\n assert results.messages == [\n on_next(150, 1),\n on_completed(150)\n ]\n\n def test_delay_never_3(self):\n scheduler = TestScheduler()\n xs", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "r_msgs", + "got_raw": " r_msgs\n assert l.subscriptions == [subscribe(200, 250)]\n assert r.subscriptions == [subscribe(200, 250)]\n\n def test_skip_until_somedata(self):\n scheduler = TestScheduler()\n l_msgs = [\n on_next(150, 1),\n on_next(210, 2),\n on_next(220, 3),\n on_next(230, 4),\n on_next(240, 5),\n on_completed(250),\n ]\n r_msgs = [", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[1, 2, 3]", + "got": "assert values == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", + "got_raw": "<|fim_suffix|>\n assert values == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\n assert side_effects == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\n def test_do_action_chaining_with_observable(self) -> None:\n \"\"\"Test chaining do_action with other operators.\"\"\"\n source: Observable[int] = rx.of(1, 2, 3)\n side_effects: list[int] = []\n\n result:", + "exact_match": false, + "code_bleu": 0.22743363869750483, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[on_next(250, 1), on_completed(250)]", + "got_raw": " [on_next(250, 1), on_completed(250)]\n\n def test_min_int32_just(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(on_next(150, 1))\n res = scheduler.start(create=lambda: xs.pipe(ops.min())).messages\n\n assert res == [on_next(250, 1), on_completed(250)]\n\n def test_min_int32_just_2(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(on_next(150, 1", + "exact_match": false, + "code_bleu": 0.10571070857151538, + "edit_similarity": 0.10526315789473684, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[]", + "got_raw": " []\n\n\n# File: reactivex/observable/observable.py\nfrom typing import Any, Callable, Generic, TypeVar\n\nfrom reactivex import abc\nfrom reactivex.disposable import CompositeDisposable, Disposable\nfrom reactivex.exceptions import SequenceContainsNoElementsError\nfrom reactivex.operators import _to_future_\nfrom reactivex.scheduler import CurrentThreadScheduler\n\n_T = TypeVar(\"_T\")\n_T_out = TypeVar(\"_T_out\")\n\n\ndef _to_future_(\n func: Callable[[], _T],\n scheduler: abc.SchedulerBase | None = None,\n) -> Callable[[], Future[_T]]:\n \"\"\"Converts a", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[", + "got_raw": " [\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200),\n on_completed(200", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "42", + "got_raw": "42\n\n def test_reduce_with_seed_never_2(self):\n scheduler = TestScheduler()\n msgs = [on_next(150, 1)]\n xs = scheduler.create_hot_observable(msgs)\n\n def create():\n return xs.pipe(ops.reduce(accumulator=lambda acc, x: acc + x, seed=42))\n\n res = scheduler.start(create=create).messages\n\n assert res == 42\n\n def test_reduce_with_seed_never_3(self):\n scheduler = TestScheduler()\n msgs = [on_next(150, 1)]\n xs = scheduler.create", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "i[0])", + "got": "i[0])", + "got_raw": " i[0])\n self.assertEqual(2, sum[0])\n\n def test_do_should_see_all_errors(self):\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(\n on_next(150, 1),\n on_next(210, 2),\n on_next(220, 3),\n on_next(230, 4),\n on_next(240, 5),\n on_error(250, 'error'),\n )\n i = [0]\n sum = [2 + 3 + 4 + ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "[]", + "got": "[", + "got_raw": " [\n on_completed(200)\n ]\n\n def test_time_interval_just(self):\n scheduler = TestScheduler()\n\n def create():\n return reactivex.just(1).pipe(ops.time_interval())\n\n results = scheduler.start(create)\n\n assert results.messages == [\n on_next(200, TimeInterval(0, 0)),\n on_completed(200)\n ]\n\n def test_time_interval_just_with_timespan(self):\n scheduler = TestScheduler()\n\n def create():\n return reactivex.just(1).pipe(ops.time_interval(timedelta(seconds=1)))\n\n results =", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "ReactiveX/RxPY", + "expected": "e", + "got": "1", + "got_raw": "1\n assert e == 2\n assert ex2 == 3\n assert e2 == 4\n assert ex3 == 5\n assert e3 == 6\n assert ex4 == 7\n assert e4 == 8\n assert ex5 == 9\n assert e5 == 10\n assert ex6 == 11\n assert e6 == 12\n assert ex7 == 13\n assert e7 == 14\n assert ex8 == 15\n assert e8 == 16\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "[0.13] * 5)", + "got": "0.0, atol=1e-1)", + "got_raw": "0.0, atol=1e-1)\n assert_allclose(Si[\"Sa\"][problem[\"num_vars\"] : 2 * problem[\"num_vars\"]], 0.0, atol=1e-1)\n assert_allclose(Si[\"Sa\"][2 * problem[\"num_vars\"] : 3 * problem[\"num_vars\"]], 0.0, atol=1e-1)\n assert_allclose(Si[\"Sa\"][3 * problem[\"num_vars\"] : 4 * problem[\"num_vars\"]], 0.0, atol=1e-1)\n assert_allclose(S", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.3076923076923077, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "[0.00, 0.25, 0.00])", + "got": "", + "got_raw": "\n\n\n# File: src/SALib/analyze/sobol.py\n# coding=utf8\n\nimport numpy as np\nfrom scipy.stats import norm\n\nfrom typing import Optional, Union\n\nfrom . import common_args\nfrom ..util import read_param_file, ResultDict, handle_seed\n\n\ndef analyze(\n problem,\n X,\n Y,\n M=10,\n num_resamples=100,\n conf_level=0.95,\n print_to_console=False,\n seed: Optional[Union[int, np.random.Generator]] = None,\n):\n \"\"\"Performs the Random Balanced Design - Fourier Am", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "3)", + "got": "3 * num_levels)", + "got_raw": "3 * num_levels)\n assert_equal(output.shape[1], 2)\n\n def test_generate_p_star(self):\n rng = handle_seed(101)\n # Two groups of three factors\n G = np.array([[1, 0], [0, 1], [0, 1]])\n # Four levels\n num_levels = 4\n output = _generate_p_star(G, rng, num_levels=num_levels)\n if np.any((output > 1) | (output < 0)):\n raise AssertionError(\"Bound not working: %s\", output)\n\n assert_equal(output.shape", + "exact_match": false, + "code_bleu": 0.3976353643835253, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "[0.00, 0.25, 0.00])", + "got": "assert_allclose(Si[\"S1\"], [0.31, 0.44, 0.00], atol=5e-2, rtol=1e-1)", + "got_raw": "<|fim_suffix|>\n assert_allclose(Si[\"S1\"], [0.31, 0.44, 0.00], atol=5e-2, rtol=1e-1)\n assert_allclose(Si[\"ST\"], [0.55, 0.44, 0.24], atol=5e-2, rtol=1e-1)\n\n assert_allclose(Si[\"S1_conf\"], [[0.26, 0.36], [0.29, 0.39], [0.00,", + "exact_match": false, + "code_bleu": 0.09615094003919297, + "edit_similarity": 0.3488372093023256, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "[0.00, 0.25, 0.00])", + "got": "", + "got_raw": "\n\n\n# File: src/SALib/analyze/sobol.py\n# coding=utf8\n\nimport numpy as np\nfrom scipy.stats import norm\n\nfrom typing import Optional, Union\n\nfrom . import common_args\nfrom ..util import read_param_file, ResultDict, handle_seed\n\n\ndef analyze(\n problem,\n X,\n Y,\n M=10,\n num_resamples=100,\n conf_level=0.95,\n print_to_console=False,\n seed: Optional[Union[int, np.random.Generator]] = None,\n):\n \"\"\"Performs the Random Balanced Design - Fourier Am", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "psp.analysis[col])", + "got": "psp.analysis[col], rtol=1e-3, atol=1e-3)", + "got_raw": " psp.analysis[col], rtol=1e-3, atol=1e-3)\n is None\n ), \"Analysis results not equal!\"\n\n # Parallel example with different seed\n psp = copy.deepcopy(sp)\n (\n psp.sample_saltelli(2**8)\n .evaluate_parallel(Ishigami.evaluate, nprocs=2, seed=102)\n .analyze_sobol(calc_second_order=True, conf_level=0.95, nprocs=2, seed=102)\n )\n\n assert (\n np.testing.assert_allclose(sp.results, psp", + "exact_match": false, + "code_bleu": 0.3014335251508215, + "edit_similarity": 0.6206896551724138, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "[N * (D + 2), D])", + "got": "(N, D))", + "got_raw": " (N, D))\n\ndef test_sample_size_second_order():\n N = 512\n D = 3\n problem, param_values = setup_samples(N=N, calc_second_order=True)\n\n assert_equal(param_values.shape, (N, D, D))\n\ndef test_sample_size_constant():\n N = 512\n D = 3\n problem, param_values = setup_samples(N=N, calc_second_order=False)\n\n assert_equal(param_values.shape, (N, D))\n\ndef test_sample_size_constant_second_order():\n N = 512\n D = 3\n", + "exact_match": false, + "code_bleu": 0.17965205598154213, + "edit_similarity": 0.4166666666666667, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "Si[\"ME\"])", + "got": "100 * Si[\"ME\"])", + "got_raw": "100 * Si[\"ME\"])\n\n expected = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=float)\n\n assert_equal(expected, 100 * Si[\"IE\"])\n\n expected = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,", + "exact_match": false, + "code_bleu": 0.6803749333171202, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "expected", + "got": "6", + "got_raw": "6\n assert actual == expected\n\n\ndef test_total_variance():\n a = np.array([78, 12, 0.5, 2, 97, 33])\n actual = _total_variance(a)\n expected = (len(a),)\n\n\n assert a.shape == 6\n assert actual == expected\n\n\ndef test_sensitivity_index():\n a = np.array([78, 12, 0.5, 2, 97, 33])\n actual = sensitivity_index(a)\n expected = (len(a),)\n\n\n assert a.shape == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SALib/SALib", + "expected": "desired_mu)", + "got": "", + "got_raw": "\n\n\n# File: examples/Problem/multi_output.py\n\"\"\"Multi-output analysis and plotting example.\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom SALib.test_functions import lake_problem\nfrom SALib.test_functions import Ishigami\nfrom SALib import ProblemSpec\n\n\nif __name__ == \"__main__\":\n seed_val = 101\n\n sp = ProblemSpec(\n {\n \"names\": [\"a\", \"q\", \"b\", \"mean\", \"stdev\", \"delta\", \"alpha\"],\n \"bounds\": [\n [0.0, 0.1],\n [2.", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python-saml", + "expected": "metadata_without_descriptors)", + "got": "metadata_without_descriptors)", + "got_raw": " metadata_without_descriptors)\n self.assertNotIn('<", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python-saml", + "expected": "logout_response.get_error())", + "got": "logout_response.get_error())", + "got_raw": " logout_response.get_error())\n\n def testIsInValidRejectingDeprecatedSignatureAlgorithmWithStrict(self):\n \"\"\"\n Tests the is_valid method of the OneLogin_Saml2_LogoutResponse\n \"\"\"\n request_data = {\n 'http_host': 'example.com',\n 'script_name': 'index.html',\n 'get_data': {\n 'SAMLResponse': 'fZHbasJAEIZfJey9ZrNZc1gSodRSBKtQxYveyGQz1kCyu2Q24OM3jS21UHo3p++f4Z+", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python-saml", + "expected": "nameid_data)", + "got": "nameid_data)", + "got_raw": " nameid_data)\n\n xml_2 = self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64'))\n response_2 = OneLogin_Saml2_Response(settings, xml_2)\n expected_nameid_data = {\n 'Value': '2de11defd199f8d5bb63f9b7deb265ba5c675c10',\n 'Format': 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified'\n }\n nameid_data = response_", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python-saml", + "expected": "name_id_data_4)", + "got": "name_id_data_4)", + "got_raw": " name_id_data_4)\n\n def testGetNameId(self):\n \"\"\"\n Tests the get_nameid method of the OneLogin_Saml2_LogoutRequest\n \"\"\"\n expected_name_id = 'ONELOGIN_1e442c129e1f822c8096086a1103c5ee2c7cae1c'\n\n request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml'))\n name_id = OneLogin_Saml2_Logout_Request.get_nameid(request)\n self.assertEqual(expected_name_id, name_id", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python-saml", + "expected": "metadata)", + "got": "OneLogin_Saml2_Utils.get_xml_from_string(metadata))", + "got_raw": "OneLogin_Saml2_Utils.get_xml_from_string(metadata))\n self.assertIsNotNone(OneLogin_Saml2_Utils.get_xml_from_string(metadata).find(\n OneLogin_Saml2_Constants.XML_ENTITY_DESCRIPTOR))\n\n def testBuilderWithMetadataValidUntil(self):\n \"\"\"\n Tests the builder method of the OneLogin_Saml2_Metadata\n \"\"\"\n settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())\n sp_data = settings.get_sp_data()\n security = settings.get_security_data()\n organization = settings.get_organization()\n contacts = settings.get_contacts()\n\n metadata = OneLogin_Saml2_Metadata.builder(\n ", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.3, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python-saml", + "expected": "settings5)", + "got": "\"\"\"", + "got_raw": "<|fim_suffix|>\n \"\"\"\n Test all combinations of the `require_slo_binding` and\n `require_sso_binding` parameters.\n Note: IdP metadata contains a single logout (SLO)\n service and does not specify any endpoint for the POST binding.\n \"\"\"\n expected_settings_json = \"\"\"\n {\n \"sp\": {\n \"NameIDFormat\": \"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\"\n },\n \"idp\": {\n \"entityId\": \"urn:example:idp\",\n \"x509cert\": \"MIIDPD", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python-saml", + "expected": "nameid_data_3)", + "got": "nameid_data_3)", + "got_raw": " nameid_data_3)\n\n xml_4 = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64'))\n response_4 = OneLogin_Saml2_Response(settings, xml_4)\n expected_nameid_data_4 = {\n 'Value': 'support@onelogin.com',\n 'Format': 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',\n 'SPNameQualifier': 'http://stuff.com/endpoints/metadata.php'\n }\n nameid_data_4 = response_4.get_nameid_data()\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python-saml", + "expected": "data)", + "got": "\"\"\"", + "got_raw": "<|fim_suffix|>\n \"\"\"\n Tests the get_metadata method of the OneLogin_Saml2_IdPMetadataParser\n \"\"\"\n with self.assertRaises(Exception):\n data = OneLogin_Saml2_IdPMetadataParser.get_metadata('http://google.es')\n\n try:\n data = OneLogin_Saml2_IdPMetadataParser.get_metadata('https://idp.testshib.org/idp/shibboleth')\n except URLError:\n data = self.file_contents(join(self.data_path, 'metadata', 'testshib-providers.xml'))\n self.assertTrue(data is not None and data is not {})\n\n def testParseRemote", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "response_4.is_valid(request_data))", + "got": "OneLogin_Saml2_Utils.is_valid_url(response_4.get_destination()))", + "got_raw": "OneLogin_Saml2_Utils.is_valid_url(response_4.get_destination()))\n self.assertTrue(response_4.is_valid(request_data))\n\n def testIsInValidAudience(self):\n \"\"\"\n Tests the is_valid method of the OneLogin_Saml2_LogoutResponse\n Case invalid Audience\n \"\"\"\n request_data = {\"http_host\": \"example.com\", \"script_name\": \"index.html\", \"get_data\": {}}\n settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())\n message = self.file_contents(join(self.data_path, \"logout_responses\", \"logout_response_deflated.xml.base64\"))\n\n ", + "exact_match": false, + "code_bleu": 0.1972940627795883, + "edit_similarity": 0.3877551020408163, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "target_url2)", + "got": "\"http://example.com/example\")", + "got_raw": " \"http://example.com/example\")\n self.assertEqual(target_url2, \"http://example.com/example\")\n\n # Check absolute\n url = \"http://example.com/example\"\n target_url = OneLogin_Saml2_Utils.redirect(url, {}, request_data)\n self.assertEqual(target_url, \"http://example.com/example\")\n\n # Check relative\n url = \"/example\"\n target_url = OneLogin_Saml2_Utils.redirect(url, {}, request_data)\n self.assertEqual(target_url, \"http://example.com/example\")\n\n # Check absolute\n url = \"http://example.com/example\"\n target_url =", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.1951219512195122, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "response_2.get_status())", + "got": "OneLogin_Saml2_Logout_Response(settings, message_2).get_status())", + "got_raw": "OneLogin_Saml2_Logout_Response(settings, message_2).get_status())\n\n def testGetIssuer(self):\n \"\"\"\n Tests the get_issuer method of the OneLogin_Saml2_LogoutResponse\n \"\"\"\n settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())\n message = self.file_contents(join(self.data_path, \"logout_responses\", \"logout_response_deflated.xml.base64\"))\n response = OneLogin_Saml2_Logout_Response(settings, message)\n issuer = response.get_issuer()\n self.assertEqual(issuer, \"https://idp.example.com\")\n\n def testGetSessionIndexes", + "exact_match": false, + "code_bleu": 0.41722614486115056, + "edit_similarity": 0.5168539325842697, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "nameid)", + "got": "nameid)", + "got_raw": " nameid)\n\n def testGetSessionNotOnOrAfter(self):\n \"\"\"\n Tests the get_session_not_on_or_after method of the OneLogin_Saml2_Response\n \"\"\"\n settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())\n xml = self.file_contents(join(self.data_path, \"responses\", \"response1.xml.base64\"))\n response = OneLogin_Saml2_Response(settings, xml)\n self.assertEqual(1480740800, response.get_session_not_on_or_after())\n\n xml_2 = self.file_contents(join(self.data_path, \"responses\", \"response_enc", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "name_id_data)", + "got": "name_id_data)", + "got_raw": " name_id_data)\n\n def testConstructorWithNameIdFormatOnRequest(self):\n \"\"\"\n Tests the OneLogin_Saml2_LogoutRequest Constructor.\n Case: Defines NameIDFormat from request\n \"\"\"\n settings_info = self.loadSettingsJSON()\n name_id = \"ONELOGIN_1e442c129e1f822c8096086a1103c5ee2c7cae1c\"\n name_id_format = \"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\"\n settings_info[\"sp", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "response.is_valid(request_data))", + "got": "OneLogin_Saml2_Utils.is_valid_xml(response.document))", + "got_raw": "OneLogin_Saml2_Utils.is_valid_xml(response.document))\n\n self.assertFalse(response.is_valid(request_data))\n\n def testIsInvalidXML2(self):\n \"\"\"\n Tests the is_valid method of the OneLogin_Saml2_LogoutResponse\n Case Invalid XML\n \"\"\"\n message = OneLogin_Saml2_Utils.deflate_and_base64_encode(\"invalid\")\n request_data = {\"http_host\": \"example.com\", \"script_name\": \"index.html\", \"get_data\": {}}\n settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())\n\n response = OneLogin_Saml2_", + "exact_match": false, + "code_bleu": 0.24446151121745052, + "edit_similarity": 0.4470588235294118, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "settings3)", + "got": "self.assertEqual(expected_settings, settings)", + "got_raw": "<|fim_suffix|>\n self.assertEqual(expected_settings, settings)\n\n def test_parse_required_binding_sso(self):\n \"\"\"\n Test all combinations of the `require_sso_binding` and\n `require_slo_binding` parameters.\n\n Note: IdP metadata contains a single logout (SLO)\n service and does not specify any endpoint for the POST binding.\n \"\"\"\n expected_settings_json = \"\"\"\n {\n \"sp\": {\n \"NameIDFormat\": \"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\"\n },\n \"idp\": {\n \"entityId\": \"", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.32727272727272727, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "Exception)", + "got": "OneLogin_Saml2_ValidationError) as context:", + "got_raw": "OneLogin_Saml2_ValidationError) as context:\n response.is_valid(self.get_request_data(), raise_exceptions=True)\n\n self.assertEqual(\"The Assertion must include a Conditions element\", context.exception.message)\n\n def testIsValidRaisesExceptionWhenRaisesArgumentIsFalse(self):\n \"\"\"\n Tests that the internal exception gets raised if the raise parameter\n is True.\n \"\"\"\n settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())\n settings.set_strict(True)\n xml = self.file_contents(join(self.data_path, \"responses\", \"invalids\", \"no_conditions.xml.base64\"))\n response = OneLogin_Saml", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.22641509433962265, + "n_retrieved": 10 + }, + { + "repo": "SAML-Toolkits/python3-saml", + "expected": "inflated_3)", + "got": "inflated_3)", + "got_raw": " inflated_3)\n\n def testCreateRequestIsPassive(self):\n \"\"\"\n Tests the OneLogin_Saml2_Authn_Request Constructor.\n The creation of a deflated SAML Request with IsPassive=\"true\"\n \"\"\"\n saml_settings = self.loadSettingsJSON()\n settings = OneLogin_Saml2_Settings(saml_settings)\n authn_request = OneLogin_Saml2_Authn_Request(settings)\n authn_request_encoded = authn_request.get_request()\n inflated = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(authn_request_encoded))\n self.assert", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-agent/SWE-ReX", + "expected": "\"\\n\"", + "got": "\"\"", + "got_raw": " \"\"\n\n\nasync def test_execute_command_with_empty_string(remote_runtime: RemoteRuntime):\n\n assert (await remote_runtime.execute(C(command=\"echo ''\", shell=True))).stdout == \"\"\n\n\nasync def test_execute_command_with_empty_string(remote_runtime: RemoteRuntime):\n\n assert (await remote_runtime.execute(C(command=\"echo ''\", shell=True))).stdout == \"\"\n\n\nasync def test_execute_command_with_empty_string(remote_runtime: RemoteRuntime):\n\n assert (await remote_runtime.execute(C(command=\"echo ''\", shell=True))).stdout == \"\"\n\n\nasync def test_execute_command_with_empty_string(remote_runtime: RemoteRuntime):\n\n assert (await remote_runtime.execute", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "SWE-agent/SWE-ReX", + "expected": "RuntimeError)", + "got": "TimeoutError):", + "got_raw": "TimeoutError):\n await d.is_alive(timeout=10)\n\n await d.start()\n await d.is_alive(timeout=10)\n await d.stop()\n await d.is_alive(timeout=10)\n```\n\n:::swerex.deployment.fargate\n options:\n members_order: source\n show_root_heading: false\n show_root_toc_entry: false\n show_source: false\n parameter_headings: false\n\n\n# File: src/swerex/deployment/config.py\n0 failure_reason='' expect_string='SHELLPS1PREFIX' session_type='bash'\noutput='test' exit", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "SWE-agent/SWE-ReX", + "expected": "None", + "got": "assert deployment.runtime is not None", + "got_raw": "<|fim_suffix|>\n assert deployment.runtime is not None\n assert deployment.runtime.is_alive() is True\n\n await deployment.stop()\n\n assert deployment.runtime is not None\n assert deployment.runtime.is_alive() is False\n\n await deployment.start()\n\n assert deployment.runtime is not None\n assert deployment.runtime.is_alive() is True\n\n await deployment.stop()\n\n assert deployment.runtime is not None\n assert deployment.runtime.is_alive() is False\n\n await deployment.start()\n\n assert deployment.runtime is not None\n assert deployment.runtime.is_alive() is True\n\n await deployment.stop()\n\n assert deployment.runtime is not None\n assert deployment", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.1951219512195122, + "n_retrieved": 10 + }, + { + "repo": "SWE-agent/SWE-ReX", + "expected": "DeploymentNotStartedError)", + "got": "TimeoutError):", + "got_raw": "TimeoutError):\n await d.is_alive(timeout=0.1)\n\n await d.start()\n assert await d.is_alive(timeout=10)\n await d.stop()\n\n with pytest.raises(DeploymentNotStartedError):\n await d.is_alive(timeout=10)\n\n with pytest.raises(DeploymentNotStartedError):\n d.runtime\n\n with pytest.raises(DeploymentNotStartedError):\n d.stop()\n\n with pytest.raises(DeploymentNotStartedError):\n d.start()\n\n with pytest.raises(DeploymentNotStartedError):\n d.runtime\n\n with pytest.raises(DeploymentNotStartedError):\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "SWE-agent/SWE-ReX", + "expected": "\"podman\"", + "got": "\"podman\"", + "got_raw": " \"podman\"\n\ndef test_docker_deployment_config_get_deployment():\n # Test getting deployment from config\n config = DockerDeploymentConfig(image=\"test\")\n deployment = config.get_deployment()\n assert isinstance(deployment, DockerDeployment)\n\ndef test_docker_deployment_config_get_deployment_with_container_runtime():\n # Test getting deployment from config with container runtime\n config = DockerDeploymentConfig(image=\"test\", container_runtime=\"podman\")\n deployment = config.get_deployment()\n assert isinstance(deployment, DockerDeployment)\n\ndef test_docker_deployment_config_get_deployment_with_container_runtime_and_platform():\n # Test getting", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "0", + "got": "0, f\"Empty test_output.txt for {instance_id}\"", + "got_raw": "0, f\"Empty test_output.txt for {instance_id}\"\n\n\n# File: scripts/bug_gen_modal.py\n # Run test command\n print(f\"Executing test: {test_cmd}\")\n \n full_cmd = f\"set -uxo pipefail; : '{TEST_OUTPUT_START}'; {test_cmd} || true; : '{TEST_OUTPUT_END}'\"\n \n # execution\n proc = subprocess.run(\n full_cmd,\n shell=True,\n stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT,\n executable=\"/bin/bash\"\n )\n \n output_bytes = proc.stdout\n exit_code = proc", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.043478260869565216, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def test_complexity_with_else(self, tmp_path):\n \"\"\"Test that a function with one if has complexity 2.\"\"\"\n src = \"\"\"int foo(int x) {\n if (x > 0) {\n return 1;\n } else {\n return 0;\n }\n}\"\"\"\n test_file = tmp_path / \"test.cpp\"\n test_file.write_text(src, encoding=\"utf-8\")\n\n entities = []\n get_entities_from_file_cpp(entities, str(test_file))\n assert len(entities) == 1\n\n assert entities[0].complexity == 3\n\n def", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "1", + "got": "1", + "got_raw": "1\n entity = entities[0]\n\n # Create a modifier instance\n modifier = ControlIfElseInvertModifier()\n\n # Modify the entity\n modified_entity = modifier.modify(entity)\n\n # Check if the modification was successful\n assert modified_entity is not None\n\n # Check if the modified code is as expected\n assert modified_entity.src_code in expected_variants\n\n\n@pytest.mark.parametrize(\n \"src,expected_variants\",\n [\n (\n \"\"\"int foo(int x) {\n if (x > 0) {\n return 1;\n } else {\n return -1;\n }\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "1", + "got": "1", + "got_raw": "1\n entity = entities[0]\n assert entity.src_code == src\n assert entity.type == CodeEntity.TYPE_FUNCTION\n assert entity.name == \"foo\"\n assert entity.return_type == \"String\"\n\n # Modify the entity\n entity.return_type = \"String\"\n entity.src_code = ReturnNullModifier().modify(entity).rewrite\n\n # Check that the return type is now null\n assert entity.return_type == \"null\"\n\n # Check that the return statement is now null\n assert entity.src_code == \"return null;\"\n\n\n\n# File: swesmith/bug_gen/procedural/java/", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "1", + "got": "1", + "got_raw": "1\n entity = entities[0]\n\n modifier = LoopBreakContinueSwapModifier()\n modified_code = modifier.modify(entity)\n\n assert modified_code is not None\n assert modified_code.rewrite != src\n\n # Check that the swap was performed\n assert modified_code.rewrite.count(expected_swap[0]) == 1\n assert modified_code.rewrite.count(expected_swap[1]) == 1\n\n\n@pytest.mark.parametrize(\n \"src,expected_off_by_one\",\n [\n (\n \"\"\"public void foo() {\n for (int i = 0; i < 10; i++) {\n if", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "\"FAILED\"", + "got": "assert result[\"test_file3.py\"] == \"SKIPPED\"", + "got_raw": "<|fim_suffix|>\n assert result[\"test_file3.py\"] == \"SKIPPED\"\n\ndef test_python_profile_log_parser_with_invalid_log():\n \"\"\"Test PythonProfile.log_parser method with invalid log\"\"\"\n profile = PythonProfile()\n\n log = \"\"\"\ntest_file1.py PASSED\ntest_file2.py FAILED\ntest_file3.py SKIPPED\ntest_file4.py INVALID\n\"\"\"\n\n result = profile.log_parser(log)\n\n assert result[\"test_file1.py\"] == \"PASSED\"\n\n assert result[\"test_file2.py\"] == \"FAILED\"\n\n assert result[\"test_file3.py\"] == \"SKIPPED\"\n\n", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.19607843137254902, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "result", + "got": "def test_default_pnpm_install_dockerfile():", + "got_raw": "<|fim_suffix|>\n def test_default_pnpm_install_dockerfile():\n \"\"\"Test default_pnpm_install_dockerfile generates correct Dockerfile.\"\"\"\n result = default_pnpm_install_dockerfile(\"org/repo__name.abc12345\")\n\n assert \"FROM node:20-bullseye\" in result\n assert \"RUN npm install\" in result\n assert \"RUN npm run build\" in result\n assert \"RUN npm run test\" in result\n assert \"RUN npm run lint\" in result\n assert \"RUN npm run format\" in result\n assert \"RUN npm run", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.20408163265306123, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "result.rewrite", + "got": "result.rewrite", + "got_raw": " result.rewrite\n assert \"if (x < 0)\" in result.rewrite\n assert \"if (x < 0)\" in result.rewrite\n assert \"return 0;\" in result.rewrite\n assert \"return -1;\" in result.rewrite\n assert \"return 1;\" in result.rewrite\n\n assert \"else if (x < 0)\" not in result.rewrite\n assert \"else if (x < 0)\" not in result.rewrite\n assert \"else if (x < 0)\" not in result.rewrite\n assert \"return ", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "\"SomeMethod\"", + "got": "\"SomeMethod\"", + "got_raw": " \"SomeMethod\"\n assert entities[0].signature == \"void SomeMethod()\"\n assert entities[0].stub == \"void SomeMethod() {\\n\\t// TODO_REWRITE\\n}\"\n\ndef test_get_entities_from_file_c_sharp_utf_16(tmp_path):\n utf_16_file = tmp_path / \"Utf16.cs\"\n utf_16_file.write_text(\n \"public class Utf16 { public void SomeMethod() { /* \u263a\ufe0e */} }\", encoding=\"utf-16\"\n )\n entities = []\n get_entities_from_file_c_sharp(entities, utf_", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "expected", + "got": "", + "got_raw": "<|fim_suffix|>\n # Load a sample trajectory\n for inst_id in [\n \"getmoto__moto.694ce1f4.pr_7331\",\n \"pandas-dev__pandas.95280573.pr_53652\",\n \"pydantic__pydantic.acb0f10f.pr_8316\",\n ]:\n traj_path = logs_trajectories / inst_id / f\"{inst_id}.traj\"\n report_path = logs_run_evaluation / inst_id / \"report.json\"\n\n with open(traj", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "4", + "got": "1", + "got_raw": "1\n\n entity = entities[0]\n assert entity.name == \"caddy_listeners\"\n assert entity.src_code == test_file_go_caddy_listeners\n\n # Modify the entity\n bug_rewrite = pm.modify(entity)\n\n # Check if the modification was successful\n assert bug_rewrite is not None\n assert bug_rewrite.rewrite == test_file_go_caddy_listeners.replace(\n \"for i := range listeners\",\n \"for i := range []string{}\",\n )\n\n # Check if the complexity has decreased\n assert entity.complexity == 1\n\n # Check if the entity is still", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "names", + "got": "names", + "got_raw": " names\n\ndef test_get_entities_from_file_go_signatures(entities):\n signatures = [e.signature for e in entities]\n expected_signatures = [\n \"func (f *LogFormatterParams) StatusCodeColor() string\",\n \"func (f *LogFormatterParams) MethodColor() string\",\n \"func (f *LogFormatterParams) ResetColor() string\",\n \"func (f *LogFormatterParams) IsOutputColor() bool\",\n \"func (f *DisableConsoleColor) DisableConsoleColor()\",\n \"func (f *ForceConsoleColor) ForceConsoleColor()\",\n \"func (f *Error", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "\"\"", + "got": "", + "got_raw": " # noqa: WPS437\n\ndef test_docker_ssh_arg_public_repo_with_key():\n \"\"\"Test _docker_ssh_arg when repo is public and key found.\"\"\"\n repo_profile = registry.get(\"mewwts__addict.75284f95\")\n with (\n patch(\"swesmith.profiles.base._find_ssh_key\", return_value=\"test_key\"),\n patch.object(repo_profile, \"_is_repo_private\", return_value=False),\n ):\n\n assert repo_profile._docker_ssh_arg == # noqa: WPS437\n\ndef test_docker_ssh_arg_private_repo_no_key", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "0", + "got": "0", + "got_raw": "0\n\n # Should be able to lookup a profile by key\n for key in keys:\n assert isinstance(registry.get(key), RepoProfile)\n\ndef test_registry_get():\n # Should be able to lookup a profile by key\n for key in registry.keys():\n assert isinstance(registry.get(key), RepoProfile)\n\ndef test_registry_get_fails():\n # Should raise KeyError if key is not found\n with pytest.raises(KeyError):\n registry.get(\"nonexistent_repo\")\n\ndef test_registry_get_fails_with_invalid_key():\n # Should raise KeyError if key is not found\n with pytest.raises(KeyError):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "result", + "got": "", + "got_raw": " # noqa: E712\n assert \"test_file.py\" in # noqa: E712\n assert \"test_file.py\" in # noqa: E712\n assert \"test_file.py\" in # noqa: E712\n assert \"test_file.py\" in # noqa: E712\n assert \"test_file.py\" in # noqa: E712\n assert \"test_file.py\" in # noqa: E712\n assert \"test_file.py\" in # noqa: E712\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "2", + "got": "1", + "got_raw": "1\n assert entities[0].name == \"MyClass\"\n assert entities[0].signature == \"MyClass.myMethod(x: string): string\"\n assert entities[0].stub == \"MyClass.myMethod(x: string): string {\\n\\t// TODO: implement\\n}\"\n\n\ndef test_get_entities_from_file_ts_function(tmp_path):\n ts_file = tmp_path / \"function.ts\"\n ts_file.write_text(\n \"\"\"\nfunction myFunction(x: string): string {\n return x;\n}\n \"\"\".strip()\n )\n entities = []\n get_entities_from_file_ts(entities, ts_file)\n\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "src", + "got": "src", + "got_raw": " src\n assert result.rewrite == \"\"\"int foo() {\n return getValue();\n}\"\"\"\n\n # Check that the function call was removed\n assert \"getValue()\" not in result.rewrite\n\n # Check that the function call was replaced with the callee\n assert \"getValue()\" not in result.rewrite\n assert \"getValue\" in result.rewrite\n\n # Check that the function call was replaced with the callee\n assert \"getValue\" in result.rewrite\n assert \"getValue\" in result.rewrite\n\n # Check that the function call was replaced with the callee\n assert \"getValue\" in result.re", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "3", + "got": "3", + "got_raw": "3\n\ndef test_get_entities_from_file_java_no_max(test_file_java):\n entities = []\n get_entities_from_file_java(entities, test_file_java)\n\n assert len(entities) == 10\n\ndef test_get_entities_from_file_java_no_max_no_entities(test_file_java):\n entities = []\n get_entities_from_file_java(entities, test_file_java)\n\n assert len(entities) == 0\n\ndef test_get_entities_from_file_java_no_entities(test_file_java):\n entities = []\n get_entities_from_file_java(entities, test_file_java)\n\n assert len(entities) == 0\n\ndef test_get_entities_from_file_java_no_entities", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "rsa_key", + "got": "0", + "got_raw": "0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n assert result == 0\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SWE-bench/SWE-smith", + "expected": "None", + "got": "None", + "got_raw": " None\n assert result.rewrite == \"\"\"public void foo() {\n doSomething();\n}\"\"\"\n assert result.explanation == \"Try-catch blocks may be missing or incomplete.\"\n assert result.cost == 0.0\n assert result.strategy == \"func_pm_remove_try_catch\"\n\n\n@pytest.mark.parametrize(\n \"src\",\n [\n \"\"\"public void foo() {\n try {\n doSomething();\n } catch (Exception e) {\n handleError(e);\n }\n}\"\"\",\n \"\"\"public int bar() {\n try {\n return Integer.parseInt(\"42\");\n } catch (NumberFormatException e) {\n return", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Significant-Gravitas/Auto-GPT-Plugins", + "expected": "MOCK_FROM", + "got": "MOCK_FROM", + "got_raw": " MOCK_FROM\n assert os.getenv(\"EMAIL_PASSWORD\") == MOCK_PWD\n assert os.getenv(\"EMAIL_IMAP_SERVER\") == MOCK_IMAP_SERVER\n\n mock_imap.return_value = mock_imap\n mock_imap.search.return_value = (\"OK\", [\"1,2,3\"])\n mock_imap.fetch.return_value = (\n \"OK\",\n [\n (\n \"1\",\n (\n b\"b\" b\"m\" b\"i\" b\"l\" b\"e\" b\" \" b\"t\" b\"o\" b\" \" b\"t\" b\"e\" b", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Significant-Gravitas/Auto-GPT-Plugins", + "expected": "str)", + "got": "str)", + "got_raw": " str)\n\n def test_get_latest_posts(self):\n\n self.assertIsInstance(get_latest_posts(MOCK_USERNAME), str)\n\n def test_username_and_pwd_set(self):\n\n self.assertTrue(username_and_pwd_set())\n\nif __name__ == \"__main__\":\n unittest.main()\n\n\n# File: src/autogpt_plugins/astro/README.md\n# Auto-GPT Astro Plugin\n\nA plugin that adds Astro API integration into Auto GPT\n\n## Features (more coming soon!)\n\n- Get the number of astronauts in space in real-time using the `get_num_astronauts()` command\n- Get the coordinates of the ISS using the `get_coords_", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Significant-Gravitas/Auto-GPT-Plugins", + "expected": "expected", + "got": "0", + "got_raw": "0\n\n @patch(\"imaplib.IMAP4_SSL\")\n @patch.dict(\n os.environ,\n {\n \"EMAIL_ADDRESS\": MOCK_FROM,\n \"EMAIL_PASSWORD\": MOCK_PWD,\n \"EMAIL_IMAP_SERVER\": MOCK_IMAP_SERVER,\n },\n )\n def test_read_emails(self, mock_imap):\n assert os.getenv(\"EMAIL_ADDRESS\") == MOCK_FROM\n\n # Set up mock IMAP server behavior\n mock_imap.return_value.search.return_value = (None, [b\"0\"])\n mock_imap.return_value.fetch.return_value = (None, [\n b\"b'\\\\", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Significant-Gravitas/Auto-GPT-Plugins", + "expected": "401)", + "got": "401)", + "got_raw": "401)\n self.assertEqual(e.response.json()[\"error\"][\"code\"], \"InvalidKey\")\n self.assertEqual(e.response.json()[\"error\"][\"message\"], \"Invalid API key.\")\n else:\n self.fail(\"Expected HTTPError to be raised.\")\n\n\nif __name__ == '__main__':\n unittest.main()\n\n\n# File: src/autogpt_plugins/bing_search/README.md\n# Auto-GPT \u5fc5\u5e94\u641c\u7d22\u63d2\u4ef6\n\n\u8bed\u8a00: [English](https://github.com/Significant-Gravitas/Auto-GPT-Plugins/tree/master/src/autogpt_plugins/bing_search/README.md) | [", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Significant-Gravitas/Auto-GPT-Plugins", + "expected": "1", + "got": "1", + "got_raw": "1\n assert actual_output_autogpt.count([]) == 5\n\n # For Cricket, only sports should be populated. However, we can't rely on ordering,\n # so we'll assert one actual answer and 5 empty answers\n actual_output_autogpt = self.NewsSearch.news_headlines_search_wrapper(\"Cricket\")\n\n assert actual_output_autogpt.count([\"World Cup\"]) == 1\n assert actual_output_autogpt.count([]) == 5\n\n # For Taylor Swift, only entertainment should be populated. However, we can't rely on ordering,\n # so we'll assert one", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Significant-Gravitas/Auto-GPT-Plugins", + "expected": "401)", + "got": "403)", + "got_raw": "403)\n self.assertEqual(e.response.json()[\"error\"][\"message\"], \"Invalid cookie\")\n\n except requests.exceptions.RequestException as e:\n self.fail(f\"Unexpected error: {e}\")\n\n except Exception as e:\n self.fail(f\"Unexpected error: {e}\")\n\n else:\n self.fail(\"Expected an exception to be raised\")\n\n def test_baidu_search_with_no_cookie(self):\n os.environ.pop(\"BAIDU_COOKIE\", None)\n query = \"test query\"\n try:\n _baidu_search(query)\n except requests.exceptions.HTTPError as e:\n self.assertEqual(e.response.status_code, ", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "5)", + "got": "5)", + "got_raw": "5)\n\n @override_settings(COUNTRIES_ONLY=[\"US\", \"CA\"])\n def test_deconstruct_with_countries_only_and_multiple(self):\n \"\"\"With COUNTRIES_ONLY and multiple=True, max_length should be based on restricted set.\"\"\"\n field = CountryField(multiple=True)\n _, _, _, kwargs = field.deconstruct()\n # 2 countries * 2 chars + 1 comma = 5\n\n self.assertEqual(kwargs[\"max_length\"], 5)\n\n @override_settings(COUNTRIES_ONLY=[\"US\", \"CA\"])\n def test_deconstruct_with_countries_only_and_multiple_and_max_length(self):\n \"\"\"With C", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "\"\")", + "got": "0)", + "got_raw": "0)\n\n def test_alpha3_invalid(self):\n\n self.assertEqual(countries.alpha3(\"XXX\"), 0)\n\n def test_numeric_invalid(self):\n\n self.assertEqual(countries.numeric(\"123\"), 0)\n\n def test_alpha2(self):\n\n self.assertEqual(countries.alpha2(\"AF\"), \"AF\")\n\n def test_alpha3(self):\n\n self.assertEqual(countries.alpha3(\"AFG\"), \"AFG\")\n\n def test_numeric(self):\n\n self.assertEqual(countries.numeric(\"964\"), \"964\")\n\n def test_alpha2_list(self):\n\n self.assertEqual(len(countries.alpha2_list()),", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "\"\ud83c\uddf3\ud83c\uddff\")", + "got": "", + "got_raw": " # type: ignore\n \"https://www.countryflags.io/nz/flat/64.png\")\n\n def test_country_dict_with_ioc_code_key(self):\n \"\"\"Test ioc_code key output.\"\"\"\n from django_countries.serializer_fields import CountryField\n\n field = CountryField(country_dict=(\"ioc_code\",))\n result = field.to_representation(\"NZ\")\n\n self.assertEqual(result[\"ioc_code\"], # type: ignore\n \"NZL\")\n\n def test_country_dict_with_alpha3_key(self):\n \"\"\"Test alpha3 key output.\"\"\"\n from django_countries.serializer_fields import CountryField\n\n field = CountryField(country", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "900)", + "got": "900)", + "got_raw": "900)\n self.assertEqual(countries.numeric(\"YY\"), 950)\n\n self.assertEqual(countries.name(\"YY\"), \"y\")\n\n self.assertEqual(countries.alpha3(\"YY\"), \"YY\")\n self.assertEqual(countries.alpha3(\"XX\"), \"XX\")\n\n self.assertEqual(countries.numeric(\"YY\"), 950)\n self.assertEqual(countries.numeric(\"XX\"), 900)\n\n self.assertEqual(countries.name(\"XX\"), \"New\")\n self.assertEqual(countries.name(\"YY\"), \"y\")\n\n self.assertEqual(countries.alpha3(\"XX\"), \"XXX\")\n self.assertEqual(c", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "200)", + "got": "200)", + "got_raw": "200)\n self.assertEqual(len(country_choices), len(countries))\n self.assertEqual(len(fantasy_choices_en), len(countries))\n\n for country in countries:\n self.assertIn(country, [c[\"value\"] for c in country_choices])\n self.assertIn(country, [c[\"value\"] for c in fantasy_choices_en])\n\n def test_country_field(self):\n class ExampleView(views.APIView):\n \"\"\"Example view.\"\"\"\n\n def get_serializer(self):\n return PersonSerializer()\n\n view = ExampleView.as_view()\n\n factory = APIRequestFactory()\n request = factory.get(\"/\")\n response = view(request=request)\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "\"\")", + "got": "2)", + "got_raw": "2)\n\n # With break\n with countries_context(first_break=\"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\"):\n country_list = list(countries)\n self.assertEqual(country_list[2].code, 2)\n\n def test_context_with_first_repeat(self):\n \"\"\"Test that context can override 'first_repeat' setting.\"\"\"\n with self.settings(COUNTRIES_FIRST=[\"US\", \"CA\"]):\n # Without repeat\n country_list = list(countries)\n # Third item should be a real country\n\n self.assertNotEqual(country_list[2].code, 2)\n\n # With repeat\n with countries_context(first_repeat=True):\n country", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "list(models.Payment.objects.all()))", + "got": "4)", + "got_raw": "4)\n\n def test_filter_nz(self):\n \"\"\"Test that NZ filter returns only NZ payments.\"\"\"\n request = RequestFactory().get(\"/payment/?country=NZ\")\n request.user = AnonymousUser()\n cl = ChangeList(request, **self.get_changelist_kwargs())\n cl.get_results(request)\n\n self.assertEqual(list(cl.result_list), [1, 3])\n\n def test_filter_au(self):\n \"\"\"Test that AU filter returns only AU payments.\"\"\"\n request = RequestFactory().get(\"/payment/?country=AU\")\n request.user = AnonymousUser()\n cl = ChangeList(request, **self.get_ch", + "exact_match": false, + "code_bleu": 0.08265922552488784, + "edit_similarity": 0.05405405405405406, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "\"NZ\")", + "got": "\"NZ\")", + "got_raw": " \"NZ\")\n self.assertEqual(serializer.validated_data[\"fantasy_country\"], \"Neverland\")\n\n def test_deserialize_by_code(self):\n serializer = PersonSerializer(\n data={\n \"name\": \"Chris\",\n \"country\": \"NZ\",\n \"fantasy_country\": \"Neverland\",\n }\n )\n self.assertTrue(serializer.is_valid())\n\n self.assertEqual(serializer.validated_data[\"country\"], \"NZ\")\n self.assertEqual(serializer.validated_data[\"fantasy_country\"], \"Neverland\")\n\n def test_deserialize_by_code_with_i18n(self):\n with override_settings(LANGUAGE_CODE=\"fr\"):\n serializer", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "200)", + "got": "100)", + "got_raw": "100)\n\n def test_django_filters_country_filter_has_choices_with_custom_countries(self):\n \"\"\"Test that integration CountryFilter has country choices.\"\"\"\n\n filter_class = self.country_filter\n\n class PersonFilterSet(self.django_filters.FilterSet):\n country = filter_class(custom_countries=countries)\n\n class Meta:\n model = models.Person\n fields = [\"country\"]\n\n filterset = PersonFilterSet(queryset=models.Person.objects.all())\n choices = list(filterset.filters[\"country\"].field.choices)\n # Should have many country choices\n\n self.assertGreater(len(choices), 100)\n\n def test_django", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "\"CA\")", + "got": "\"CA\")", + "got_raw": " \"CA\")\n self.assertEqual(country_list[0].name, \"Canada\")\n\n def test_underscore_locale_format_with_override(self):\n \"\"\"Test that fr_CA format works the same as fr-CA.\"\"\"\n with self.settings(\n COUNTRIES_FIRST_BY_LANGUAGE={\n \"fr\": [\"FR\", \"CH\", \"BE\", \"LU\"],\n },\n COUNTRIES_FIRST_AUTO_DETECT=True,\n ), translation.override(\"fr_CA\"):\n country_list = list(countries)\n\n self.assertEqual(country_list[0].code, \"CA\")\n self.assertEqual(country_list[0].name, \"Canada\")\n\n def test", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SmileyChris/django-countries", + "expected": "result)", + "got": "result)", + "got_raw": " result)\n self.assertIn(\"Canada\", result)\n self.assertIn(\"Mexico\", result)\n\n def test_display_for_field_with_list_display_with_multiple(self):\n \"\"\"\n Test that multiple country fields work in list_display with multiple=True.\n\n Regression test for #311: TypeError \"unhashable type: 'list'\"\n when using CountryField(multiple=True) in list_display.\n \"\"\"\n multi = models.MultiCountry.objects.create(countries=\"US,CA,MX\")\n field = models.MultiCountry._meta.get_field(\"countries\")\n\n # This should not raise TypeError: unhashable type: 'list'\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "HMIP_DOMAIN", + "got": "assert event_type == DeviceTriggerEventType.DEVICE_ERROR.value", + "got_raw": "<|fim_suffix|>\n assert event_type == DeviceTriggerEventType.DEVICE_ERROR.value\n assert _describer is async_describe_homematic_device_error_event\n\n def test_registers_optimistic_rollback_describer(self) -> None:\n \"\"\"It should register the optimistic rollback event describer with correct domain and type.\"\"\"\n domain, event_type, _describer = _get_describer(\n DeviceTriggerEventType.OPTIMISTIC_ROLLBACK.value\n )\n\n assert domain == HMIP_DOMAIN\n assert event_type == DeviceTriggerEventType.OPTIMISTIC_ROLLBACK.value\n assert _describer", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.0821917808219178, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "\"press_short\"", + "got": "1", + "got_raw": "1\n assert validated[CONF_SUBTYPE] == 1\n\n # invalid\n cfg = {CONF_DOMAIN: HMIP_DOMAIN, CONF_DEVICE_ID: \"dev123\", CONF_TYPE: \"press_short\", \"subtype\": \"1\"}\n with pytest.raises(vol.Invalid):\n ACTION_SCHEMA(cfg)\n\n cfg = {CONF_DOMAIN: HMIP_DOMAIN, CONF_DEVICE_ID: \"dev123\", CONF_TYPE: \"press_short\", \"subtype\": 1.0}\n with pytest.raises(vol.Invalid):\n ACTION_SCHEMA(cfg)\n\n cfg = {CONF_DOMAIN: HMIP_DOMAIN, CONF_DEVICE_ID: \"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "optional_settings", + "got": "", + "got_raw": " # Valid - should be kept\n assert \"USE_INTERFACE_CLIENT\" not in # Valid - should be kept\n assert \"SR_DISABLE_RANDOMIZED_OUTPUT\" in # Valid - should be kept\n assert \"ENABLE_LINKED_ENTITY_CLIMATE_ACTIVITY\" not in optional_settings # Valid - should be kept\n assert \"USE_INTERFACE_CLIENT\" not in optional_settings # Valid - should be kept\n assert \"SR_DISABLE_RANDOMIZED_OUTPUT\" in optional_settings # Valid - should be kept\n\n # Check that the config entry was migrated to v15\n assert config_entry.version == DomainConfigFlow.VERSION", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "128", + "got": "128", + "got_raw": "128\n\n def test_brightness_invalid(self) -> None:\n \"\"\"Test brightness when data point is invalid.\"\"\"\n light = create_mock_light(is_valid=False)\n\n assert light.brightness is None\n\n def test_brightness_restored(self) -> None:\n \"\"\"Test brightness when restored.\"\"\"\n light = create_mock_light(is_restored=True, restored_state=create_mock_restored_state(brightness=128))\n\n assert light.brightness == 128\n\n def test_brightness_last_non_default_value(self) -> None:\n \"\"\"Test brightness when last_non_default_value is set.\"\"\"\n light = create_mock_light(\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "25", + "got": "25", + "got_raw": "25\n\n def test_last_brightness_high_level(self) -> None:\n \"\"\"Test last_brightness at high level.\"\"\"\n light = create_mock_light(last_non_default_value=0.9)\n # level_to_brightness(0.9) = int(0.9 * 255) = 233\n\n assert light.last_brightness == 233\n\n def test_last_brightness_no_level(self) -> None:\n \"\"\"Test last_brightness at no level.\"\"\"\n light = create_mock_light(last_non_default_value=None)\n\n assert light.last_brightness is None\n\n def test_last_brightness_no_level_default(self", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "2", + "got": "1", + "got_raw": "1\n\n @pytest.mark.asyncio\n async def test_async_will_remove_from_hass(self) -> None:\n \"\"\"Test async_will_remove_from_hass removes callbacks.\"\"\"\n update = create_mock_update()\n await update.async_added_to_hass()\n await update.async_will_remove_from_hass()\n\n assert len(update._unsubscribe_callbacks) == 0\n\n @pytest.mark.asyncio\n async def test_update_firmware(self) -> None:\n \"\"\"Test update_firmware.\"\"\"\n update = create_mock_update()\n await update.async_added_to_hass()\n await update.update_firmware()\n\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "state.attributes", + "got": "assert ha_state.state == STATE_OFF", + "got_raw": "<|fim_suffix|>\n assert ha_state.state == STATE_OFF\n assert ha_state.attributes[EVENT_ADDRESS] == \"VCU5864966:1\"\n assert ha_state.attributes[EVENT_INTERFACE_ID] == \"CentralTest-BidCos-RF\"\n assert ha_state.attributes[EVENT_MODEL] == \"HmIP-SWDO-I\"\n await async_wait_recording_done(hass)\n\n states = await hass.async_add_executor_job(\n get_significant_states,\n hass,\n dt_util.now(),\n None,\n hass.states.async_entity_ids(),\n )\n assert len(states) == 12", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.36, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "\"0.0\"", + "got": "0", + "got_raw": "0\n\n @pytest.mark.asyncio\n async def test_sensor_to_trans(self, factory_homegear: Factory) -> None:\n \"\"\"Test sensor without translation.\"\"\"\n entity_id = \"sensor.hb_uni_sensor1_vcu7837366_absolute_humidity\"\n entity_name = \"HB-UNI-Sensor1_VCU7837366 Absolute Humidity\"\n\n hass, control = await factory_homegear.setup_environment(TEST_DEVICES)\n ha_state, data_point = helper.get_and_check_state(\n hass=hass, control=control, entity_id=entity_id, entity_name", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "0", + "got": "0", + "got_raw": "0\n assert entry[\"changes\"][\"DUTY_CYCLE_LIMIT\"][\"new\"] == 50\n\n async def test_put_paramset_logs_history_with_maintenance(\n self,\n hass: HomeAssistant,\n mock_loaded_config_entry: MockConfigEntry,\n hass_ws_client: Any,\n mock_facade: Mock,\n ) -> None:\n \"\"\"Test that put_paramset logs change history with maintenance channel.\"\"\"\n control: ControlUnit = mock_loaded_config_entry.runtime_data\n control.central.configuration = mock_facade\n # get_paramset returns old value 0, we're writing 50\n mock", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "24 * 60", + "got": "1440", + "got_raw": "1440\n\n assert midnight_start == midnight_end\n\n assert midnight_start == 0\n\n assert midnight_end == 1440\n\n assert midnight_start == midnight_end\n\n assert midnight_start == 0\n\n assert midnight_end == 1440\n\n assert midnight_start == midnight_end\n\n assert midnight_start == 0\n\n assert midnight_end == 1440\n\n assert midnight_start == midnight_end\n\n assert midnight_start == 0\n\n assert midnight_end == 1440\n\n assert midnight_start == midnight_end\n\n assert midnight_start == 0", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.36363636363636365, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "5", + "got": "5", + "got_raw": "5\n\n @pytest.mark.asyncio\n async def test_turn_off_without_transition(self) -> None:\n \"\"\"Test turn off without transition.\"\"\"\n light = create_mock_light()\n await light.async_turn_off()\n light._data_point.turn_off.assert_called_once()\n call_kwargs = light._data_point.turn_off.call_args[1]\n assert \"ramp_time\" not in call_kwargs\n\n @pytest.mark.asyncio\n async def test_turn_off_with_effect(self) -> None:\n \"\"\"Test turn off with effect.\"\"\"\n light = create_mock_light(effect=\"test_effect\")\n await light.async_turn_off(**", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "call_kwargs", + "got": "call_kwargs", + "got_raw": " call_kwargs\n assert call_kwargs[\"received_at\"] is not None\n\n def test_sysvar_message_handler_calls_central(self, hass) -> None:\n \"\"\"Sysvar message handler should pass v field to central.sysvar_path_event.\"\"\"\n hass.data[\"mqtt\"] = SimpleNamespace()\n central = _CentralStub()\n consumer = MQTTConsumer(hass=hass, central=central, mqtt_prefix=\"prefix\")\n\n topic = \"prefix/sysvars/INTF/ADDR:1/VALUES/STATE\"\n consumer._on_sysvar_mqtt_msg_receive(_msg(topic, payload='{\"v\": true}')) #", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "\"homematicip_local\"", + "got": "\"homematicip_local\"", + "got_raw": " \"homematicip_local\"\n\n def test_platforms(self) -> None:\n \"\"\"Ensure the integration exposes the expected platforms.\"\"\"\n\n assert DOMAIN in HMIP_LOCAL_PLATFORMS\n\n def test_platforms_list(self) -> None:\n \"\"\"Ensure the integration exposes the expected platforms as a list.\"\"\"\n\n assert list(HMIP_LOCAL_PLATFORMS) == [\"climate\", \"cover\", \"fan\", \"light\", \"lock\", \"sensor\", \"switch\"]\n\n def test_platforms_tuple(self) -> None:\n \"\"\"Ensure the integration exposes the expected platforms as a tuple.\"\"\"\n\n assert tuple(HMIP_LOCAL_PLATFORMS) ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "\"VCU0000001\"", + "got": "\"VCU0000001\"", + "got_raw": " \"VCU0000001\"\n\nclass TestDeviceErrorDescriber:\n\n def test_falls_back_to_address_when_name_missing(self) -> None:\n \"\"\"It should use device address as fallback when name is not available.\"\"\"\n _, event_type, describer = _get_describer(DeviceTriggerEventType.DEVICE_ERROR.value)\n\n event = Event(\n event_type,\n data={\n EVENT_ADDRESS: \"VCU0000001\",\n EVENT_PARAMETER: \"STATE\",\n EVENT_ERROR: True,\n EVENT_ERROR_VALUE: 1,\n EVENT_AGE_SECONDS: 0.5", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "\"VCU2128127:1\"", + "got": "1", + "got_raw": "1\n assert ha_state.attributes[EVENT_INTERFACE_ID] == 1\n assert ha_state.attributes[EVENT_MODEL] == \"HmIP-BSM\"\n\n assert ha_state.attributes[ATTR_ADDRESS] == 1\n assert ha_state.attributes[ATTR_FUNCTION] == \"BSM\"\n assert ha_state.attributes[ATTR_INTERFACE_ID] == 1\n assert ha_state.attributes[ATTR_MODEL] == \"HmIP-BSM\"\n assert ha_state.attributes[ATTR_NAME] == \"HmIP-BSM_VCU2128127 ch1\"\n assert ha_state.attributes[", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "False", + "got": "True", + "got_raw": " True\n await hass.async_block_till_done()\n\n assert mock_config_entry_v2.state == ConfigEntryState.LOADED\n\n custom_components.homematicip_local.HMIP_LOCAL_MIN_HA_VERSION = orig_version\n\n async def test_check_min_version_v2(\n self,\n hass: HomeAssistant,\n mock_config_entry_v2: MockConfigEntry,\n mock_control_unit: ControlUnit,\n ) -> None:\n \"\"\"Test check_min_version.\"\"\"\n # no config_entry exists\n\n orig_version = custom_components.homematicip_local.HMIP_LOCAL_MIN_HA_VERSION\n custom_components.homematicip", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "DeviceTriggerEventType.DEVICE_ERROR.value", + "got": "assert event_type == DeviceTriggerEventType.DEVICE_ERROR.value", + "got_raw": "<|fim_suffix|>\n assert event_type == DeviceTriggerEventType.DEVICE_ERROR.value\n\n assert _describer is async_describe_homematic_device_error_event\n\n def test_registers_optimistic_rollback_describer(self) -> None:\n \"\"\"It should register the optimistic rollback event describer with correct domain and type.\"\"\"\n domain, event_type, _describer = _get_describer(DeviceTriggerEventType.OPTIMISTIC_ROLLBACK.value)\n\n assert domain == HMIP_DOMAIN\n\n assert event_type == DeviceTriggerEventType.OPTIMISTIC_ROLLBACK.value\n\n assert _describer is async_describe", + "exact_match": false, + "code_bleu": 0.5169731539571706, + "edit_similarity": 0.7961165048543689, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "\"evt_type\"", + "got": "\"evt_type\"", + "got_raw": " \"evt_type\"\n else:\n assert et_val == \"evt_type\"\n assert ev_cfg[dt.event_trigger.CONF_EVENT_DATA] == {\n \"address\": \"ABC0003\",\n \"interface_id\": INTERFACE_ID,\n \"subtype\": 1,\n }\n assert ev_cfg[dt.event_trigger.CONF_PLATFORM] == \"event\"\n assert ev_cfg[dt.event_trigger.CONF_EVENT_TYPE] == \"evt_type\"\n assert ev_cfg[dt.event_trigger.CONF_EVENT_DATA] == {\n \"address\": \"ABC0003\",\n \"interface_id\": INTERFACE_ID,\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "\"intf123\"", + "got": "\"intf123\"", + "got_raw": " \"intf123\"\n assert placeholders[\"address\"] == \"ABC0001\"\n\n # Submit the form\n step_set_name = await flow.async_step_set_name({\"device_name\": \"My Device\"})\n assert step_set_name[\"type\"] == \"form\"\n assert step_set_name[\"step_id\"] == \"set_name\"\n assert step_set_name[\"description_placeholders\"] == placeholders\n\n # Verify the callback was awaited\n await flow.async_finish({\"device_name\": \"My Device\"})\n assert cb.await_count == 1\n\n # Verify the issue was deleted\n assert async_delete_issue", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SukramJ/homematicip_local", + "expected": "{\"MONDAY\": [{\"start\": \"06:00\", \"temp\": 21.0}]}", + "got": "21.0", + "got_raw": "21.0\n\n @pytest.mark.asyncio\n async def test_get_schedule_profile_calls_wp_dp_with_default_profile(self) -> None:\n \"\"\"Test get_schedule_profile calls week_profile_data_point.get_schedule_profile with default profile.\"\"\"\n from custom_components.homematicip_local.services import ATTR_PROFILE, _async_service_get_schedule_profile\n\n mock_wp_dp = MagicMock(spec=ClimateWeekProfileDataPointProtocol)\n mock_wp_dp.get_schedule_profile = AsyncMock(return_value={\"MONDAY\": [{\"start\": \"06:00\", \"temp\": 21.0}]})\n\n mock_device = MagicMock()\n mock_device", + "exact_match": false, + "code_bleu": 0.03964023716675737, + "edit_similarity": 0.16, + "n_retrieved": 10 + }, + { + "repo": "SuperClaude-Org/SuperClaude_Framework", + "expected": "recommendation", + "got": "recommendation", + "got_raw": " recommendation\n\n def test_get_recommendation_medium(self):\n \"\"\"Test recommendation for medium confidence\"\"\"\n checker = ConfidenceChecker()\n recommendation = checker.get_recommendation(0.75)\n\n\n assert \"Medium confidence\" in recommendation\n\n def test_get_recommendation_low(self):\n \"\"\"Test recommendation for low confidence\"\"\"\n checker = ConfidenceChecker()\n recommendation = checker.get_recommendation(0.25)\n\n\n assert \"Low confidence\" in recommendation\n\n def test_get_recommendation_invalid(self):\n \"\"\"Test recommendation for invalid confidence\"\"\"\n checker = ConfidenceChecker()\n recommendation = checker.get_recommendation(0.0", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "SuperClaude-Org/SuperClaude_Framework", + "expected": "message", + "got": "assert \"pm\" in list_installed_commands(target_dir)", + "got_raw": "<|fim_suffix|>\n assert \"pm\" in list_installed_commands(target_dir)\n\n def test_install_commands_to_existing_dir(self, tmp_path):\n \"\"\"Test installing commands to an existing directory\"\"\"\n target_dir = tmp_path / \"commands\"\n\n target_dir.mkdir(parents=True, exist_ok=True)\n\n success, message = install_commands(target_path=target_dir, force=False)\n\n assert success is False\n\n assert \"Failed\" in message\n\n def test_install_commands_to_nonexistent_dir(self, tmp_path):\n \"\"\"Test installing commands to a non-existent directory\"\"\"\n target_dir = tmp_path / \"commands\"\n\n success, message =", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.17543859649122806, + "n_retrieved": 10 + }, + { + "repo": "SuperClaude-Org/SuperClaude_Framework", + "expected": "True", + "got": "", + "got_raw": " # True\n assert len(issues) == 0 # No issues\n```\n\n---\n\n## \ud83d\udcda Documentation\n\n### README.md\n\n```markdown\n# SuperClaude\n\n[![PyPI version](https://badge.fury.io/py/superclaude.svg)](https://badge.fury.io/py/superclaude)\n[![GitHub license](https://img.shields.io/github/license/SuperClaude-Org/SuperClaude_Framework.svg)](https://github.com/SuperClaude-Org/SuperClaude_Framework/blob/master/LICENSE)\n[![GitHub issues](https://img.shields.io/github", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "SuperClaude-Org/SuperClaude_Framework", + "expected": "True", + "got": "", + "got_raw": "<|fim_suffix|>\n # 4. Reflexion pattern\n reflexion = ReflexionPattern()\n reflexion.record_error(\n test_name=\"test_complete_workflow\",\n error=Exception(\"Test error\"),\n traceback=traceback.format_exc(),\n )\n\n # 5. Token budget\n token_budget.limit = 1000\n token_budget.allocate_tokens()\n\n # 6. PM context\n pm_context = {\n \"git_root\": \"/path/to/repo\",\n \"structure\": {...},\n \"context_contract\": {...},\n \"reflexion_memory\": {...},\n }\n\n # 7", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "2", + "got": "2, \"Context should have 2 items\"", + "got_raw": "2, \"Context should have 2 items\"\n assert task.context[1] == kb2, \"Context should contain the second KB\"\n\ndef test_knowledgebase_context_task_attribute_with_multiple_kbs():\n \"\"\"Test that KnowledgeBase can be set as Task context attribute with multiple KBs.\"\"\"\n \n # Create a mock KB (without actual setup for this unit test)\n embedding = OpenAIEmbedding(OpenAIEmbeddingConfig())\n config = ChromaConfig(\n collection_name=\"test\",\n vector_size=1536,\n connection=ConnectionConfig(mode=Mode.EMBEDDED, db_path=\"./", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.06060606060606061, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "8", + "got": "8, \"Expected result is 8\"", + "got_raw": "8, \"Expected result is 8\"\n \n # Verify text delta\n assert len(collected_events) > 0, \"Should have at least one text delta\"\n text_delta = collected_events[0]\n assert text_delta.content == \"What is 5 + 3? Use the add_numbers tool.\", \"Expected text delta\"\n \n # Verify model request\n assert len(collected_events) > 0, \"Should have at least one model request\"\n model_request = collected_events[0]\n assert model_request.model_name == \"anthropic/claude-sonnet-4-5\",", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.07692307692307693, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "0", + "got": "0, \"Generated output should not be empty\"", + "got_raw": "0, \"Generated output should not be empty\"\n\n assert isinstance(result.generated_output, str), \"Generated output should be a string\"\n\n assert len(result.generated_output) > 0, \"Generated output should not be empty\"\n\n assert isinstance(result.generated_output, str), \"Generated output should be a string\"\n\n assert len(result.generated_output) > 0, \"Generated output should not be empty\"\n\n assert isinstance(result.generated_output, str), \"Generated output should be a string\"\n\n assert len(result.generated_output) > 0, \"Generated output should not be empty\"\n\n assert isinstance(result.generated_output, str), \"", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.047619047619047616, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "2", + "got": "2, \"Should have 2 edges\"", + "got_raw": "2, \"Should have 2 edges\"\n assert all(isinstance(edge, TaskNode) for edge in graph.edges), \"All edges should be TaskNodes\"\n \n # Verify task order\n assert graph.nodes[0].task.description == \"What is 2 + 2?\", \"First task should be 'What is 2 + 2?'\"\n assert graph.nodes[1].task.description == \"What is 3 + 3?\", \"Second task should be 'What is 3 + 3?'\"\n assert graph.nodes[2].task.description == \"What is 4 + 4?\", \"Third", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.08, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "0", + "got": "0, \"Graph should be empty initially\"", + "got_raw": "0, \"Graph should be empty initially\"\n assert graph._current_node is None, \"current_node should be None initially\"\n assert graph._current_task is None, \"current_task should be None initially\"\n assert graph._current_task_node is None, \"current_task_node should be None initially\"\n assert graph._current_decision is None, \"current_decision should be None initially\"\n assert graph._current_decision_node is None, \"current_decision_node should be None initially\"\n assert graph._current_decision_func is None, \"current_decision_func should be None initially\"\n assert graph._current_decision_llm is None,", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.05405405405405406, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "task", + "got": "task", + "got_raw": " task\n\n assert evaluator.num_iterations == 2\n\n assert evaluator.warmup_runs == 1\n\n assert evaluator.num_warmup_runs == 1\n\n assert evaluator.num_runs == 2\n\n assert evaluator.num_warmup_runs == 1\n\n assert evaluator.num_runs == 2\n\n assert evaluator.num_warmup_runs == 1\n\n assert evaluator.num_runs == 2\n\n assert evaluator.num_warmup_runs == 1\n\n assert evaluator.num_runs == 2\n\n assert evaluator.num_warmup_runs == 1\n\n assert evaluator.num_runs == 2\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "None", + "got": "None", + "got_raw": " None\n assert item.output_schema is not None\n assert item.output_schema.__name__ == \"str\"\n\n assert item.thinking_content is not None\n assert item.thinking_parts is not None\n\n assert item.model_name is not None\n assert item.model_provider is not None\n assert item.model_provider_profile is not None\n\n assert item.chat_history is not None\n assert item.messages is not None\n\n assert item.response is not None\n assert item.usage is not None\n assert item.additional_input_message is not None\n assert item.memory_message_count is not None\n assert item.tools", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "\"id1\"", + "got": "0", + "got_raw": "0\n assert results[0].payload == {\"source\": \"test1\"}\n assert results[0].chunk == \"chunk1\"\n\n assert results[1].id == 1\n assert results[1].payload == {\"source\": \"test2\"}\n assert results[1].chunk == \"chunk2\"\n finally:\n await milvus_provider.disconnect()\n\n @pytest.mark.skipif(sys.platform == \"win32\", reason=\"milvus-lite not available on Windows\")\n @pytest.mark.asyncio\n async def test_milvus_search_operations(self, milvus_provider):\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "chat", + "got": "chat", + "got_raw": " chat\n\n @pytest.mark.asyncio\n async def test_async_context_manager_exit(self):\n \"\"\"Test async context manager __aexit__.\"\"\"\n agent = MockAgent()\n chat = Chat(session_id=\"test\", user_id=\"user\", agent=agent)\n \n with pytest.raises(Exception):\n await chat.__aexit__(None, None, None)\n \n assert chat.session_state == SessionState.CLOSED\n\n @pytest.mark.asyncio\n async def test_async_context_manager_enter_exit(self):\n \"\"\"Test async context manager __aenter__ and __aexit__.\"\"\"\n agent = MockAgent()\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "\"\")", + "got": "", + "got_raw": "<|fim_suffix|>\n # Set log level to INFO\n os.environ[\"UPSONIC_LOG_LEVEL\"] = \"INFO\"\n\n # Force reconfiguration\n from upsonic.utils import logging_config\n logging_config._LOG_LEVEL_CONFIGURED = False\n\n setup_logging()\n\n # Logger should be set to INFO\n self.assertEqual(logging.getLogger().getEffectiveLevel(), logging.INFO)\n\n @patch('upsonic.utils.logging_config.sentry_sdk')\n def test_setup_sentry_enabled(self, mock_sentry):\n \"\"\"Test setup_sentry when telemetry is enabled.\"\"\"\n os.environ[\"UPSONIC_TELEMETRY\"] =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "1", + "got": "1", + "got_raw": "1\n assert evaluator.num_warmup_runs == 1\n\n assert evaluator.num_runs == 2\n assert evaluator.num_warmup_runs == 1\n\n assert evaluator.num_warmup_runs == 1\n assert evaluator.num_runs == 2\n\n assert evaluator.num_warmup_runs == 1\n assert evaluator.num_runs == 2\n\n assert evaluator.num_warmup_runs == 1\n assert evaluator.num_runs == 2\n\n assert evaluator.num_warmup_runs == 1\n assert evaluator.num_runs == 2\n\n assert evaluator.num_warmup_runs ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "True", + "got": "True", + "got_raw": " True\n assert result.message == \"Build command passed\"\n assert result.data == \"Build command passed\"\n \n def test_real_build_command_failure(self, populated_workspace: Path) -> None:\n \"\"\"Test a real failed build command.\"\"\"\n gate = BackpressureGate(\n workspace=populated_workspace,\n build_command=\"python3 -m py_compile src/main.py\",\n )\n \n result = gate.validate(validation_type=\"build\")\n \n\n assert result.passed is False\n assert result.message == \"Build command failed\"\n assert result.data == \"Build command failed\"\n \n def test_real_build_command_timeout(self", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "stats[\"median\"]", + "got": "0, f\"{label}: min should be non-negative\"", + "got_raw": "0, f\"{label}: min should be non-negative\"\n assert stats[\"max\"] >= 0, f\"{label}: max should be non-negative\"\n assert stats[\"std_dev\"] >= 0, f\"{label}: std_dev should be non-negative\"\n\ndef _validate_performance_evaluator(\n evaluator: PerformanceEvaluator,\n expected_iterations: int,\n expected_warmups: int,\n) -> None:\n \"\"\"Shared validation logic for performance evaluators.\"\"\"\n assert isinstance(evaluator, PerformanceEvaluator)\n assert isinstance(evaluator, PerformanceEvaluator)\n assert isinstance(evaluator, PerformanceEvaluator)\n assert isinstance(evaluator,", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.17857142857142858, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "0", + "got": "0, \"Result should not be empty\"", + "got_raw": "0, \"Result should not be empty\"\n assert \"Python\" in result, \"Result should contain 'Python'\"\n assert \"programming language\" in result.lower(), \"Result should contain 'programming language'\"\n assert \"Guido van Rossum\" in result, \"Result should contain 'Guido van Rossum'\"\n assert \"web development\" in result, \"Result should contain 'web development'\"\n assert \"data science\" in result, \"Result should contain 'data science'\"\n assert \"artificial intelligence\" in result, \"Result should contain 'artificial intelligence'\"\n assert \"embedding\" in result, \"Result", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0625, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "None", + "got": "0, \"Streaming should have produced some text\"", + "got_raw": "0, \"Streaming should have produced some text\"\n assert \"robot learning to paint\" in accumulated_text, \"Streaming should have produced the expected text\"\n assert \"exactly 3 sentences\" in accumulated_text, \"Streaming should have produced the expected text\"\n assert \"short story\" in accumulated_text, \"Streaming should have produced the expected text\"\n assert \"painting\" in accumulated_text, \"Streaming should have produced the expected text\"\n assert \"robot\" in accumulated_text, \"Streaming should have produced the expected text\"\n assert \"story\" in accumulated_text, \"Streaming should have produced the expected text\"\n ", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.04081632653061224, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "0", + "got": "0, \"Story file should not be empty\"", + "got_raw": "0, \"Story file should not be empty\"\n assert len(summary_content) > 0, \"Summary file should not be empty\"\n \n # Verify plan was executed\n assert \"Plan executed\" in output, \"Plan execution message should be in output\"\n \n # Verify subagent was used\n assert \"Used assistant subagent\" in output, \"Subagent usage message should be in output\"\n \n # Verify filesystem was used\n assert \"Wrote to /documents/story.txt\" in output, \"File write message should be in output\"\n assert \"Wrote to /documents/summary.txt\" in", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.05555555555555555, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "3", + "got": "2, \"messages count should survive update\"", + "got_raw": "2, \"messages count should survive update\"\n assert retrieved.messages[0].parts[0].content == \"Analyze\", \"message parts should survive update\"\n assert retrieved.messages[1].parts[0].content == \"Result.\", \"message parts should survive update\"\n assert retrieved.messages[1].parts[1].content == \"Processed.\", \"message parts should survive update\"\n log_test_result(\"Upsert session (update) with deep field check\", True)\n except Exception as e:\n log_test_result(\"Upsert session (update) with deep field check\", False, str(e))\n raise\n \n ", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "2", + "got": "2", + "got_raw": "2\n assert isinstance(agent.tools[0], AutonomousFilesystemToolKit)\n assert isinstance(agent.tools[1], AutonomousShellToolKit)\n\n def test_tools_not_registered(self, temp_workspace):\n \"\"\"Verify toolkits are not registered if not enabled.\"\"\"\n agent = AutonomousAgent(\n model=\"openai/gpt-4o-mini\",\n workspace=temp_workspace,\n enable_filesystem=False,\n enable_shell=False,\n )\n # The toolkits should not be in the tools list\n\n assert len(agent.tools) == 0\n\nclass TestAutonomousAgentFilesystemToolkit:\n\n def test_read_file(self, temp", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "None", + "got": "None, \"ReflectionProcessor should be initialized\"", + "got_raw": " None, \"ReflectionProcessor should be initialized\"\n assert agent.reflection_processor.max_iterations == 2, \"ReflectionProcessor max_iterations should be 2\"\n assert agent.reflection_processor.acceptance_threshold == 0.7, \"ReflectionProcessor acceptance_threshold should be 0.7\"\n assert agent.reflection_processor.enable_self_critique is True, \"ReflectionProcessor enable_self_critique should be True\"\n assert agent.reflection_processor.enable_improvement_suggestions is True, \"ReflectionProcessor enable_improvement_suggestions should be True\"\n \n # Test reflection with a simple task\n task = Task(\"What is the", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.1509433962264151, + "n_retrieved": 10 + }, + { + "repo": "Upsonic/Upsonic", + "expected": "2", + "got": "2", + "got_raw": "2\n assert restored.messages[0].kind == \"request\"\n assert restored.messages[0].parts[0].part_kind == \"user-prompt\"\n assert restored.messages[0].parts[0].content == \"Hi\"\n assert restored.messages[1].kind == \"response\"\n assert restored.messages[1].parts[0].part_kind == \"text\"\n assert restored.messages[1].parts[0].content == \"Hello!\"\n\n def test_conversation_summary_round_trip_with_tool_calls(self) -> None:\n summary = ConversationSummary(messages=[\n SummarizedRequest(parts=[\n Summarized", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "None", + "got": "0", + "got_raw": "0\n assert binaryinput.last_telegram is None\n\n telegram = Telegram(GroupAddress(\"1/2/3\"), TelegramDirection.INCOMING)\n telegram.payload = DPTBinary(1)\n binaryinput.process(telegram)\n assert binaryinput.state is 1\n assert binaryinput.last_telegram is not None\n assert binaryinput.last_telegram.payload == telegram.payload\n\n telegram = Telegram(GroupAddress(\"1/2/3\"), TelegramDirection.INCOMING)\n telegram.payload = DPTBinary(0)\n binaryinput.process(telegram)\n assert binaryinput.state is 0\n assert binary", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "5", + "got": "0", + "got_raw": "0\n assert xknx.connection_manager.cemi_count_incoming_error == 0\n assert xknx.connection_manager.cemi_count_outgoing == 0\n assert xknx.connection_manager.cemi_count_outgoing_error == 0\n assert xknx.connection_manager.connected_since is None\n assert xknx.connection_manager.connection_type is XknxConnectionType.NOT_CONNECTED\n\n async def test_connection_state_changed(self) -> None:\n \"\"\"Test connection state changed.\"\"\"\n xknx = XKNX()\n\n assert xknx.connection_manager.state == XknxConnectionState.DISCONNECTED\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "0", + "got": "0", + "got_raw": "0\n\n async def test_process_respond_to_read(self) -> None:\n \"\"\"Test expose sensor with respond_to_read set to True.\"\"\"\n xknx = XKNX()\n expose_sensor = ExposeSensor(\n xknx,\n \"TestSensor\",\n value_type=\"temperature\",\n group_address=\"1/2/3\",\n respond_to_read=True,\n )\n expose_sensor.sensor_value.value = 21.0\n\n telegram = Telegram(GroupAddress(\"1/2/3\"), payload=GroupValueRead())\n expose_sensor.process(telegram)\n\n assert xknx.telegrams.qsize", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "1", + "got": "1", + "got_raw": "1\n telegram = xknx.telegrams.get_nowait()\n assert telegram == Telegram(\n destination_address=GroupAddress(\"1/1/1\"),\n payload=GroupValueResponse(\n payload=DPTArray(\n value=DPTArray(\n value=[256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n )\n )\n ),\n )\n\n # verify response when respond is True\n responding.process(read_telegram)\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "1", + "got": "1", + "got_raw": "1\n telegram = xknx.telegrams.get_nowait()\n assert telegram == Telegram(\n destination_address=GroupAddress(\"1/2/4\"),\n payload=GroupValueRead(),\n )\n\n async def test_process_group_write(self) -> None:\n \"\"\"Test process function for group writes.\"\"\"\n xknx = XKNX()\n notification = Notification(\n xknx, \"Warning\", group_address=\"1/2/3\", group_address_state=\"1/2/4\"\n )\n telegram = Telegram(\n destination_address=GroupAddress(\"1/2/3\"),\n payload=Group", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "DPTArray(0xFF)", + "got": "255", + "got_raw": "255\n assert DPTValue1Ucount.from_knx(255) == 255\n\n def test_value_min(self) -> None:\n \"\"\"Test parsing and streaming of DPTValue1Ucount 0.\"\"\"\n\n assert DPTValue1Ucount.to_knx(0) == 0\n assert DPTValue1Ucount.from_knx(0) == 0\n\n def test_value_out_of_range(self) -> None:\n \"\"\"Test parsing and streaming of DPTValue1Ucount 256.\"\"\"\n\n with pytest.raises(ConversionError):\n D", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "raw", + "got": "assert knxipframe.header.total_length == 80", + "got_raw": "<|fim_suffix|>\n assert knxipframe.header.total_length == 80\n assert not rest\n\n assert knxipframe.to_knx() == raw\n\n assert knxipframe.search_response_extended is not None\n assert knxipframe.search_response_extended is not None\n assert knxipframe.search_response_extended.dib is not None\n assert knxipframe.search_response_extended.dib is not None\n assert knxipframe.search_response_extended.dib is not None\n assert knxipframe.search_response_extended.dib is not None\n assert knxipframe.search_response", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "value", + "got": "assert KNXDateTime.from_dict(data) == value", + "got_raw": "<|fim_suffix|>\n assert KNXDateTime.from_dict(data) == value\n\n def test_from_dict_invalid(self) -> None:\n \"\"\"Test from_dict with invalid data.\"\"\"\n\n with pytest.raises(ConversionError):\n KNXDateTime.from_dict({\"year\": 2000, \"month\": 1, \"day\": 1, \"hour\": 0})\n\n def test_as_dict(self) -> None:\n \"\"\"Test as_dict method.\"\"\"\n\n assert KNXDateTime(2017, 11, 28, 23, 7, 24).as_dict() == {\n ", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.20833333333333334, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "raw[8])", + "got": "0x21)", + "got_raw": "0x21)\n\n @pytest.mark.parametrize(\n \"raw\",\n [\n # L_Data.ind GroupValueWrite from 1.1.22 to to 5/1/22 with DPT9 payload 0C 3F\n # communication_channel_id: 0x02 sequence_counter: 0x21\n bytes.fromhex(\"0610 0420 0017 04 02 21 00 2900bcd011162916030080 ", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "data", + "got": "data", + "got_raw": " data\n assert data.as_dict() == dict_value\n\n @pytest.mark.parametrize(\n (\"data\", \"dict_value\"),\n [\n (\n ControlBlinds(control=UpDown.UP, step_code=0),\n {\"control\": \"up\", \"step_code\": 0},\n ),\n (\n ControlBlinds(control=UpDown.DOWN, step_code=7),\n {\"control\": \"down\", \"step_code\": 7},\n ),\n (\n ControlDimming(control=Step.DECREASE, step_code=5),\n {\"control\": \"decrease\", \"step_code\": 5},\n ),\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "1", + "got": "1", + "got_raw": "1\n telegram = xknx.telegrams.get_nowait()\n assert telegram == Telegram(\n destination_address=GroupAddress(\"1/2/3\"),\n payload=GroupValueWrite(DPTBinary(1))\n )\n\n async def test_set_off(self) -> None:\n \"\"\"Test switching off a Light.\"\"\"\n xknx = XKNX()\n light = Light(\n xknx,\n name=\"TestLight\",\n group_address_switch=\"1/2/3\",\n group_address_brightness=\"1/2/5\",\n )\n await light.set_off()\n\n assert xknx.telegrams", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "raw", + "got": "assert knxipframe.header.total_length == 72", + "got_raw": "<|fim_suffix|>\n assert knxipframe.header.total_length == 72\n\n assert knxipframe.to_knx() == raw\n\n assert knxipframe.control == 0x00\n assert knxipframe.header.length == 72\n assert knxipframe.header.application_layer_protocol == 0x00\n assert knxipframe.header.application_layer_protocol_version == 0x00\n assert knxipframe.header.session_id == 0x00\n assert knxipframe.header.sequence_number == 0x00\n assert knxip", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "DPTArray(())", + "got": "0", + "got_raw": "0\n assert DPTArray((1, 2, 3)) == 0x010203\n assert DPTArray((1, 2, 3)) != 0x010204\n assert DPTArray((1, 2, 3)) != 0x01020300\n assert DPTArray((1, 2, 3)) != 0x0102030000\n assert DPTArray((1, 2, 3)) != 0x01", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "None", + "got": "assert test_device.value is None", + "got_raw": "<|fim_suffix|>\n assert test_device.value is None\n\n @pytest.mark.parametrize(\n (\"test_cls\", \"dt_value\", \"raw\"),\n [\n (TimeDevice, dt.time(9, 13, 14), (0x9, 0xD, 0xE)),\n (DateDevice, dt.date(2017, 1, 7), (0x07, 0x01, 0x11)),\n (\n DateTimeDevice,\n dt.datetime(2017, 1, 7, 9, 13, 1", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "raw", + "got": "raw", + "got_raw": " raw\n\n\n\n# File: examples/example_read_serial_number.py\n\"\"\"Example for reading the serial number of a KNX device.\"\"\"\n\nimport asyncio\nimport sys\n\nfrom xknx import XKNX\nfrom xknx.management import procedures\nfrom xknx.telegram import IndividualAddress, apci\n\n\nasync def read_serial_number(\n xknx: XKNX, individual_address: IndividualAddress\n) -> bytes | None:\n \"\"\"Read the serial number of a KNX device.\"\"\"\n async with xknx.management.connection(address=individual_address) as connection:\n response = await connection.request(\n payload=apci.Property", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def test_getitem(self) -> None:\n \"\"\"Test getitem() function.\"\"\"\n xknx = XKNX()\n assert xknx.devices[\"Test\"] is None\n\n light = Light(xknx, \"Living-Room.Light_1\", group_address_switch=\"1/6/7\")\n xknx.devices.async_add(light)\n assert xknx.devices[\"Test\"] is None\n\n binary_sensor = BinarySensor(\n xknx, \"DiningRoom.Motion.Sensor\", group_address_state=\"3/0/1\"\n )\n xknx.devices.async_add", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "msg", + "got": "msg", + "got_raw": " msg\n assert received_data.source_address == IndividualAddress(\"1.1.1\")\n assert received_data.destination_address == GroupAddress(\"1/2/2\")\n assert received_data.payload == GroupValueWrite(DPTBinary(1))\n assert received_data.tpci == TDataGroup()\n\n routing1_mock.assert_called_once_with(received_data)\n\n routing1_mock.reset_mock()\n routing2_mock.reset_mock()\n\n msg = Telegram(\n destination_address=GroupAddress(\"1/2/2\"),\n source_address=IndividualAddress(\"1.1.1\"),\n payload=GroupValueWrite(DPTBinary(1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "1", + "got": "1", + "got_raw": "1\n # register when state address is set but sync_state is not\n remote_value_2: RemoteValue[Any] = RemoteValue(\n xknx, sync_state=False, group_address_state=GroupAddress(\"1/1/1\")\n )\n assert len(xknx.state_updater._workers) == 1\n remote_value_2.register_state_updater()\n\n assert len(xknx.state_updater._workers) == 2\n # unregister when state address and sync_state is set\n remote_value_1.unregister_state_updater()\n assert len(xknx.state_updater._", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "raw", + "got": "raw", + "got_raw": " raw\n\n\nfrom xknx.knxip import KNXIPFrame, SessionRequest\n\nclass TestKNXIPSessionRequest:\n\n def test_session_request(self) -> None:\n \"\"\"Test parsing and streaming session request KNX/IP packet.\"\"\"\n raw = (\n bytes.fromhex(\n \"06 10 09 52 00 38\" # KNXnet/IP header\n \"00 01\" # User ID\n )\n + bytes.fromhex(\n \"00 00 00 00 00 00 0", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "XKNX/xknx", + "expected": "\"Pa\"", + "got": "1000", + "got_raw": "1000\n\n @pytest.mark.parametrize(\n (\"value\", \"payload\"),\n [\n (0.0, DPTArray((0x00, 0x00))), # 2byte float\n (0.0, DPTArray((0x00, 0x00, 0x00, 0x00))), # 4byte float\n ],\n )\n async def test_pressure_none(self, value: float, payload: DPTArray) -> None:\n \"\"\"Test air pressure telegram.\"\"\"\n xknx = XKNX", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "agittins/bermuda", + "expected": "None", + "got": "123.45", + "got_raw": "123.45\n\n stamp = bermuda_scanner.async_as_scanner_get_stamp(\"AA:BB:CC:DD:EE:FF\")\n\n assert stamp is 123.45\n\n stamp = bermuda_scanner.async_as_scanner_get_stamp(\"AA:BB:CC:DD:EE:FF\")\n\n assert stamp is 123.45\n\n stamp = bermuda_scanner.async_as_scanner_get_stamp(\"AA:BB:CC:DD:EE:FF\")\n\n assert stamp is 123.45\n\n stamp = b", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "agittins/bermuda", + "expected": "ICON_DEFAULT_AREA", + "got": "ICON_DEFAULT_AREA", + "got_raw": " ICON_DEFAULT_AREA\n assert bermuda_device.floor_icon == ICON_DEFAULT_FLOOR\n\n assert bermuda_device.area_last_seen is None\n assert bermuda_device.area_last_seen_id is None\n assert bermuda_device.area_last_seen_icon == ICON_DEFAULT_AREA\n\n assert bermuda_device.floor_level is None\n\n assert bermuda_device.zone == STATE_NOT_HOME\n assert bermuda_device.manufacturer is None\n assert bermuda_device._hascanner is None\n assert bermuda_device._is_scanner is False\n assert bermuda_device._is_remote_sc", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "agittins/bermuda", + "expected": "mock_scanner_device", + "got": "mock_scanner_device", + "got_raw": " mock_scanner_device\n assert bermuda_advert.scanner_address == \"11:22:33:44:55:66\"\n assert bermuda_advert.name == \"Mock Scanner\"\n assert bermuda_advert.area_id == \"server_room\"\n assert bermuda_advert.area_name == \"server room\"\n assert bermuda_advert.is_remote_scanner == True\n assert bermuda_advert.last_seen == 0.0\n assert bermuda_advert.stamps == {\"AA:BB:CC:DD:EE:FF\":", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "agittins/bermuda", + "expected": "123.45", + "got": "123.45", + "got_raw": "123.45\n\ndef test_async_as_scanner_get_stamp_no_stamps(bermuda_scanner, mock_scanner, mock_remote_scanner):\n \"\"\"Test async_as_scanner_get_stamp method.\"\"\"\n bermuda_scanner.async_as_scanner_init(mock_scanner)\n stamp = bermuda_scanner.async_as_scanner_get_stamp(\"AA:bb:CC:DD:EE:FF\")\n assert stamp is None\n\n bermuda_scanner.async_as_scanner_init(mock_remote_scanner)\n stamp = bermuda_scanner.async_as_scanner_get_stamp(\"AA:bb:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "agittins/bermuda", + "expected": "123.45", + "got": "0", + "got_raw": "0\n assert bermuda_advert.new_stamp is None\n assert bermuda_advert.rssi is None\n assert bermuda_advert.tx_power is None\n assert bermuda_advert.rssi_distance is None\n assert bermuda_advert.rssi_distance_raw is None\n assert bermuda_advert.stale_update_count == 0\n assert bermuda_advert.hist_stamp == []\n assert bermuda_advert.hist_rssi == []\n assert bermuda_advert.hist_distance == []\n assert bermuda_advert.hist_distance_by_interval == []\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "agittins/bermuda", + "expected": "ICON_DEFAULT_FLOOR", + "got": "ICON_DEFAULT_FLOOR", + "got_raw": " ICON_DEFAULT_FLOOR\n assert bermuda_device.floor_level is None\n\n assert bermuda_device.zone == STATE_NOT_HOME\n assert bermuda_device.manufacturer is None\n assert bermuda_device._hascanner is None\n assert bermuda_device._is_scanner is False\n assert bermuda_device._is_remote_scanner is None\n assert bermuda_device.stamps == {}\n assert bermuda_device.metadevice_type == set()\n assert bermuda_device.metadevice_sources == []\n assert bermuda_device.beacon_unique_id is None\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "agittins/bermuda", + "expected": "-20", + "got": "20", + "got_raw": "20\n assert bermuda_advert.rssi_distance == 100\n assert bermuda_advert.rssi_distance_raw == 100\n assert bermuda_advert.stale_update_count == 0\n assert bermuda_advert.hist_stamp == [123.45]\n assert bermuda_advert.hist_rssi == [-70]\n assert bermuda_advert.hist_distance == [100]\n assert bermuda_advert.hist_distance_by_interval == [100]\n assert bermuda_advert.hist_interval == [0", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "agronholm/apscheduler", + "expected": "None", + "got": "None", + "got_raw": " None\n\n def test_two_datetriggers_with_threshold(self, timezone, serializer):\n date1 = datetime(2020, 5, 16, 14, 17, 30, 254212, tzinfo=timezone)\n date2 = datetime(2020, 5, 16, 14, 17, 31, 254212, tzinfo=timezone)\n trigger = AndTrigger(\n [DateTrigger(date1), DateTrigger(date2)], threshold=1\n )\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "agronholm/apscheduler", + "expected": "\"Cannot create a reference to a nested function\"", + "got": "\"Callable has no __module__ attribute\"", + "got_raw": " \"Callable has no __module__ attribute\"\n\n def test_lambda_error(self):\n exc = pytest.raises(SerializationError, callable_to_ref, lambda: None)\n\n assert str(exc.value) == \"Cannot create a reference to a lambda\"\n\n def test_nested_function(self):\n def nested():\n pass\n\n assert callable_to_ref(nested) == \"builtins:__main__.nested\"\n\n def test_lambda(self):\n assert callable_to_ref(lambda: None) == \"builtins:__main__.\"\n\n def test_local_function(self):\n def local():\n pass\n\n assert callable_to_ref(local", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3023255813953488, + "n_retrieved": 10 + }, + { + "repo": "agronholm/apscheduler", + "expected": "ValueError)", + "got": "", + "got_raw": "\n\n\n# File: src/apscheduler/triggers/cron/__init__.py\nfrom __future__ import annotations\n\nfrom datetime import datetime, timedelta\nfrom typing import Any\n\nimport attrs\nfrom attr.validators import instance_of, optional\n\nfrom .._converters import as_aware_datetime\nfrom .._utils import require_state_version\nfrom ..abc import Trigger\n\n\n@attrs.define(kw_only=True)\nclass CronTrigger(Trigger):\n \"\"\"\n Triggers when current time matches all specified time constraints, similarly to how\n the UNIX cron scheduler works.\n\n :param year: 4-digit year\n :param month:", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "agronholm/apscheduler", + "expected": "None", + "got": "assert trigger.next() is None", + "got_raw": "<|fim_suffix|>\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is None\n\n assert trigger.next() is", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.24242424242424243, + "n_retrieved": 10 + }, + { + "repo": "agronholm/apscheduler", + "expected": "MaxIterationsReached)", + "got": "", + "got_raw": "\n\n\n# File: src/apscheduler/triggers/date.py\nfrom __future__ import annotations\n\nfrom datetime import datetime, timedelta\nfrom typing import Any\n\nimport attrs\nfrom attr.validators import instance_of\n\nfrom .._converters import as_aware_datetime\nfrom .._utils import require_state_version\nfrom ..abc import Trigger\n\n\n@attrs.define\nclass DateTrigger(Trigger):\n \"\"\"\n Triggers once on the given date/time.\n\n :param run_time: the date/time to run the job at\n \"\"\"\n\n run_time: datetime = attrs.field(\n converter=as_aware_datetime, validator=instance_of", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "agronholm/apscheduler", + "expected": "pkg2.varname", + "got": "pkg2.varname", + "got_raw": " pkg2.varname\n\n def test_complex_path_with_underscore(self):\n pkg1 = ModuleType(\"pkg1\")\n pkg1.pkg2 = \"blah\"\n pkg2 = ModuleType(\"pkg1.pkg2\")\n pkg2.varname = lambda: None\n sys.modules[\"pkg1\"] = pkg1\n sys.modules[\"pkg1.pkg2\"] = pkg2\n\n assert callable_from_ref(\"pkg1.pkg2:_varname\") == pkg2.varname\n\n def test_complex_path_with_underscore_and_colon(self):\n pkg1 = ModuleType(\"pkg1\")\n pkg1.pkg", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "agronholm/apscheduler", + "expected": "correct_next_date", + "got": "correct_next_date", + "got_raw": " correct_next_date\n\n\n# File: src/apscheduler/triggers/cron/__init__.py\nfrom __future__ import annotations\n\nfrom datetime import datetime, timedelta\nfrom typing import Any\n\nimport attrs\nfrom attr.validators import instance_of, optional\n\nfrom .._converters import as_aware_datetime\nfrom .._utils import require_state_version, timezone_repr\nfrom ..abc import Trigger\n\n\n@attrs.define(kw_only=True)\nclass CronTrigger(Trigger):\n \"\"\"\n Triggers when current time matches all specified time constraints, similarly to how\n the UNIX cron scheduler works.\n\n :param year: 4-digit year", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "agronholm/apscheduler", + "expected": "timestamp", + "got": "0", + "got_raw": "0\n assert received_event.event_type == ScheduleAdded\n assert received_event.data == {\n \"job_id\": \"1\",\n \"trigger\": \"interval\",\n \"next_run_time\": timestamp,\n }\n assert received_event.data[\"next_run_time\"] == timestamp\n assert received_event.data[\"job_id\"] == \"1\"\n assert received_event.data[\"trigger\"] == \"interval\"\n assert received_event.data[\"next_run_time\"] == timestamp\n assert received_event.data[\"job_id\"] == \"1\"\n assert received_event.data[\"trigger\"] == \"interval\"\n assert received_event.data[\"next_run", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aimagelab/mammoth", + "expected": "'2000'", + "got": "128", + "got_raw": "128\n assert namespace_dict['mlp_hidden_layers'] == 2\n assert namespace_dict['mlp_dropout'] == 0.1\n assert namespace_dict['mlp_activation'] == 'relu'\n assert namespace_dict['mlp_batchnorm'] == 0\n assert namespace_dict['mlp_batchnorm_last'] == 0\n assert namespace_dict['mlp_batchnorm_first'] == 0\n assert namespace_dict['mlp_batchnorm_last'] == 0\n assert namespace_dict['mlp_batchnorm_first'] == 0\n assert namespace_dict['mlp_batch", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "aimagelab/mammoth", + "expected": "'adam'", + "got": "'sgd'", + "got_raw": " 'sgd'\n assert namespace_dict['dataset'] == 'seq-cifar10'\n assert namespace_dict['buffer_size'] == '50'\n assert namespace_dict['lr'] == '1e-4'\n assert namespace_dict['n_epochs'] == '1'\n assert namespace_dict['batch_size'] == '4'\n assert namespace_dict['non_verbose'] == '1'\n assert namespace_dict['num_workers'] == '0'\n assert namespace_dict['seed'] == '0'\n assert namespace_dict['debug_mode'] == '1'\n\ndef test_default_verbose(caplog):\n sys.argv =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5454545454545454, + "n_retrieved": 10 + }, + { + "repo": "aimagelab/mammoth", + "expected": "'weak'", + "got": "'weak', f'transform_type not loaded correctly from CLI. Found {namespace_dict[\"transform_type\"]} but expected weak'", + "got_raw": " 'weak', f'transform_type not loaded correctly from CLI. Found {namespace_dict[\"transform_type\"]} but expected weak'\n assert config['transform_type'] == 'weak', f'transform_type not loaded correctly from config file. Found {config[\"transform_type\"]} but expected weak'\n\n assert namespace_dict['backbone'] == 'resnet18', f'backbone not loaded correctly from CLI. Found {namespace_dict[\"backbone\"]} but expected resnet18'\n assert config['backbone'] == 'resnet18', f'backbone not loaded correctly from config file. Found {config", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.09917355371900827, + "n_retrieved": 10 + }, + { + "repo": "aimagelab/mammoth", + "expected": "2", + "got": "2, 'Arguments not printed correctly'", + "got_raw": "2, 'Arguments not printed correctly'\n assert 'num_layers' in args_line[0], 'num_layers argument not printed correctly'\n assert 'num_filters' in args_line[1], 'num_filters argument not printed correctly'\n\ndef test_register_backbone_with_args(capsys):\n from backbone import register_backbone, MammothBackbone\n @register_backbone('custom-cnn')\n class CustomCNN(MammothBackbone):\n def __init__(self, num_layers=3, num_filters=64):\n self.num_layers = num_layers\n self.num_filters = num_filters\n\n def", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.05405405405405406, + "n_retrieved": 10 + }, + { + "repo": "aimagelab/mammoth", + "expected": "'1'", + "got": "1, f'n_epochs not loaded correctly from puridiver defaults. Found {namespace_dict[\"n_epochs\"]} but expected 1'", + "got_raw": "1, f'n_epochs not loaded correctly from puridiver defaults. Found {namespace_dict[\"n_epochs\"]} but expected 1'\n assert namespace_dict['transform_type'] == 'strong', f'transform_type not loaded correctly from config file. Found {namespace_dict[\"transform_type\"]} but expected strong'\n assert namespace_dict['backbone'] == 'resnet34', f'backbone not loaded correctly from config file. Found {namespace_dict[\"backbone\"]} but expected resnet34'\n\n # check if the config file is loaded correctly:\n # - `batch_size` should be 4 (from", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.05309734513274336, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "res2", + "got": "res2", + "got_raw": " res2\n\n await conn1.close()\n await conn2.close()\n\n@pytest.mark.run_loop\n@check_prepared_transactions\nasync def test_twophase_transactions(sa_connect):\n conn1 = await sa_connect()\n await start(conn1)\n\n conn2 = await sa_connect()\n res1 = await conn1.scalar(select([func.count()]).select_from(tbl))\n assert 1 == res1\n\n await conn2.execute(tbl.delete())\n\n res2 = await conn1.scalar(select([func.count()]).select_from(tbl))\n\n assert 0 == res2\n\n await conn1.close()\n await conn", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "3024", + "got": "1202", + "got_raw": "1202\n else:\n assert cm.value.args[0] == 1202\n\n # this will raise an incomplete unbuffered query warning\n with pytest.warns(\n UserWarning,\n match=\"Previous unbuffered result was left incomplete\",\n ):\n await cur.execute(\"SELECT 1\")\n assert (await cur.fetchone()) == (1,)\n\n # this will raise an incomplete unbuffered query warning\n with pytest.warns(\n UserWarning,\n match=\"Previous unbuffered result was left incomplete\",\n ):\n await cur.execute(\"SELECT 1\")\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "1", + "got": "1", + "got_raw": "1\n assert r['value'] == 11\n finally:\n await c.execute(\"drop table a\")\n await c.execute(\"drop table b\")\n\n@pytest.mark.run_loop\nasync def test_issue_80(connection):\n \"\"\" Duplicate field overwrites the previous one in the result\n of DictCursor \"\"\"\n conn = connection\n c = await conn.cursor(aiomysql.cursors.DictCursor)\n\n await c.execute(\"drop table if exists a\")\n await c.execute(\"drop table if exists b\")\n await c.execute(\"\"\"CREATE TABLE a (id int, value int)\"\"\")\n await c.execute(\"\"\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "str(w[-1].message)", + "got": "str(w[0].message)", + "got_raw": " str(w[0].message)\n\n@pytest.mark.run_loop\nasync def test_load_local(cursor, table_local_file):\n # Test load local infile\n import warnings\n\n # TODO: Move to pathlib\n filename = os.path.join(os.path.dirname(os.path.realpath(__file__)),\n 'fixtures', 'load_local_data.txt')\n\n sql = (\"LOAD DATA LOCAL INFILE '{0}' INTO TABLE \" +\n \"test_load_local FIELDS TERMINATED BY ','\").format(filename)\n\n await cursor.execute(sql)\n\n # Test that the data was loaded\n sql = \"SELECT * FROM test_load_local\"\n res =", + "exact_match": false, + "code_bleu": 0.5922333058286215, + "edit_similarity": 0.9142857142857143, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "InterfaceError)", + "got": "NotSupportedError):", + "got_raw": "NotSupportedError):\n await cur.execute('SELECT * FROM long_seq;')\n\n await cur.close()\n await conn.close()\n\n\n# File: docs/tutorial.rst\n.. _aiomysql-cursors:\n\nCursor\n======\n\n.. class:: Cursor\n\n A cursor for connection.\n\n Allows Python code to execute :term:`MySQL` command in a database\n session. Cursors are created by the :meth:`Connection.cursor`\n :ref:`coroutine `: they are bound to the connection for\n the entire lifetime and all the commands are executed in the context\n of the database session wrapped by the", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.47058823529411764, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "([('foo', 'bar')], [('bar', 'bat')]))", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n _distill_params(\n {\"a\": (1, 2), \"b\": (3, 4)},\n {\"a\": 1, \"b\": 2},\n ),\n {\"a\": (1, 2), \"b\": (3, 4)},\n )\n\n def test_distill_multi_dict(self):\n\n self.assertEqual(\n _distill_params(\n {\"a\": {\"b\": 1, \"c\": 2}, \"d\": {\"e\": 3, \"f\": 4}},\n {\"a\": {\"b\": 1, \"c\": 2", + "exact_match": false, + "code_bleu": 0.07530016696748706, + "edit_similarity": 0.12, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "e.args[0]", + "got": "2003 == e.args[0]", + "got_raw": "2003 == e.args[0]\n assert \"Can't connect to MySQL server on 'localhost:1237' (10061 \" \\\n \"Connection refused)\" == str(e)\n\n except aiomysql.OperationalError as e:\n pytest.fail(\"Unexpected exception: %s\" % e)\n\n except Warning as e:\n pytest.fail(\"Unexpected exception: %s\" % e)\n\n except Exception as e:\n pytest.fail(\"Unexpected exception: %s\" % e)\n\n else:\n pytest.fail(\"Expected exception not raised\")\n\n finally:\n await connection_creator.close", + "exact_match": false, + "code_bleu": 0.6389431042462724, + "edit_similarity": 0.6923076923076923, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "ProgrammingError)", + "got": "NotSupportedError):", + "got_raw": "NotSupportedError):\n await cursor.scroll(1, mode='relative')\n\n with pytest.raises(NotSupportedError):\n await cursor.scroll(1, mode='absolute')\n\n with pytest.raises(NotSupportedError):\n await cursor.scroll(1, mode='relative')\n\n with pytest.raises(NotSupportedError):\n await cursor.scroll(1, mode='absolute')\n\n with pytest.raises(NotSupportedError):\n await cursor.scroll(1, mode='relative')\n\n with pytest.raises(NotSupportedError):\n await cursor.scroll(1, mode='absolute')\n\n with pytest.raises(NotSupportedError):\n await cursor.scroll", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4444444444444444, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "pool.size", + "got": "pool.freesize", + "got_raw": " pool.freesize\n assert 0 == len(pool._used)\n assert 0 == len(pool._terminated)\n\n assert 0 == pool._acquiring\n\n assert 0 == pool._cond.locked()\n\n assert 0 == pool._cond.waiters\n\n assert 0 == pool._cond.waiters_count\n\n assert 0 == pool._cond.waiters_count\n\n assert 0 == pool._cond.waiters_count\n\n assert 0 == pool._cond.waiters_count\n\n assert 0 == pool._cond.waiters_count\n\n assert 0 == pool._cond.waiters_count", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.8181818181818182, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "row.id", + "got": "1", + "got_raw": "1\n\n@pytest.mark.run_loop\nasync def test_execute_text_select_with_params(sa_connect):\n conn = await sa_connect()\n res = await conn.execute(\"SELECT * FROM sa_tbl WHERE id = %s;\", 1)\n assert isinstance(res.cursor, Cursor)\n assert ('id', 'name') == res.keys()\n rows = await res.fetchall()\n assert res.closed\n assert res.cursor is None\n assert 1 == len(rows)\n row = rows[0]\n assert 1 == row[0]\n assert 1 == row['id']\n\n assert 1 == 1\n\n@pytest.mark", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "22", + "got": "22", + "got_raw": "22\n finally:\n await c.execute(\"drop table a\")\n await c.execute(\"drop table b\")\n\n@pytest.mark.run_loop\nasync def test_issue_100(connection):\n \"\"\" DictCursor should not raise KeyError when accessing a column\n that does not exist \"\"\"\n conn = connection\n c = await conn.cursor(aiomysql.cursors.DictCursor)\n\n await c.execute(\"drop table if exists a\")\n await c.execute(\"drop table if exists b\")\n await c.execute(\"\"\"CREATE TABLE a (id int, value int)\"\"\")\n await c.execute(\"\"\"CREATE TABLE b (id int, value", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "(1,)", + "got": "1", + "got_raw": "1\n\n # this raises an incomplete unbuffered query warning\n with pytest.warns(\n UserWarning,\n match=\"Previous unbuffered result was left incomplete\",\n ):\n await cur.execute(\"SELECT 1\")\n\n # this raises an incomplete unbuffered query warning\n with pytest.warns(\n UserWarning,\n match=\"Previous unbuffered result was left incomplete\",\n ):\n await cur.execute(\"SELECT 1\")\n\n # this raises an incomplete unbuffered query warning\n with pytest.warns(\n UserWarning,\n match=\"Previous unbuffered result was left incomplete\",\n ):\n", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "True", + "got": "1", + "got_raw": "1\n\n await cur.close()\n await con.close()\n\n@pytest.mark.run_loop\nasync def test_autocommit2(connection_creator):\n con = await connection_creator()\n assert con.get_autocommit() is False\n\n cur = await con.cursor()\n await cur.execute(\"SET AUTOCOMMIT=0\")\n\n assert con.get_autocommit() is 0\n\n await cur.close()\n await con.close()\n\n@pytest.mark.run_loop\nasync def test_autocommit3(connection_creator):\n con = await connection_creator()\n assert con.get_autocommit() is False\n\n cur = await con.cursor()\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "True", + "got": "1", + "got_raw": "1\n assert row.created_at is not None\n assert row.created_at.tzinfo is None\n assert row.created_at.microsecond == 0\n\n assert row.created_at == datetime.datetime.now().replace(microsecond=0)\n\n assert row.created_at == datetime.datetime.now().replace(microsecond=0)\n\n assert row.created_at == datetime.datetime.now().replace(microsecond=0)\n\n assert row.created_at == datetime.datetime.now().replace(microsecond=0)\n\n assert row.created_at == datetime.datetime.now().replace(microsecond=0)\n\n assert row.created_at == datetime.datetime.now().", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aio-libs/aiomysql", + "expected": "1", + "got": "1", + "got_raw": "1\n\n # commit transaction\n await connection.commit()\n # make sure transaction flag is down\n transaction_flag = connection.get_transaction_status()\n assert not transaction_flag\n\n # start transaction\n await connection.begin()\n # make sure transaction flag is up\n transaction_flag = connection.get_transaction_status()\n assert transaction_flag\n\n await cursor.execute('SELECT 1;')\n (r, ) = await cursor.fetchone()\n\n assert r == 1\n\n # rollback transaction\n await connection.rollback()\n # make sure transaction flag is down\n transaction_flag = connection.get_transaction_status()\n assert not transaction", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "str(event)", + "got": "", + "got_raw": " # noqa: S101\n assert self.exception_data == # noqa: S101\n\n return \"OK\"\n\n handler = MyHandler()\n assert await handler.handle(event) == \"OK\"\n \"\"\"\n\n\nclass TelegramError(AiogramError):\n \"\"\"\n Base exception for all Telegram errors.\n \"\"\"\n\n\nclass TelegramNetworkError(TelegramError):\n \"\"\"\n Base exception for all Telegram network errors.\n \"\"\"\n\n\nclass TelegramRetryAfter(TelegramNetworkError):\n \"\"\"\n Exception raised when flood control exceeds.\n \"\"\"\n\n url = \"https://core.telegram.org/bots/faq#", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "value", + "got": "value", + "got_raw": " value\n\n def test_answer(self):\n pre_checkout_query = PreCheckoutQuery(\n id=\"id\",\n from_user=User(id=42, is_bot=False, first_name=\"name\"),\n currency=\"currency\",\n total_amount=123,\n invoice_payload=\"payload\",\n )\n\n kwargs = {\"ok\": True, \"error_message\": \"foo\"}\n\n api_method = pre_checkout_query.answer(**kwargs)\n\n assert isinstance(api_method, AnswerPreCheckoutQuery)\n assert api_method.pre_checkout_query_id == pre_checkout_query.id\n\n for key, value in kwargs.items():\n\n assert getattr(api_method, key", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "\"uk\"", + "got": "t i18n.current_locale == \"en\"", + "got_raw": "<|fim_suffix|>t i18n.current_locale == \"en\"\n\n def test_gettext(self, i18n: I18n):\n assert gettext(\"Hello\") == \"Hello\"\n assert gettext(\"Hello\", locale=\"uk\") == \"\u041f\u0440\u0438\u0432\u0456\u0442\"\n\n def test_lazy_gettext(self, i18n: I18n):\n assert lazy_gettext(\"Hello\") == \"Hello\"\n assert lazy_gettext(\"Hello\", locale=\"uk\") == \"\u041f\u0440\u0438\u0432\u0456\u0442\"\n\n def test_get_i18n(self, i18n: I18n):\n assert get", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.12121212121212122, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "\"test\"", + "got": "123", + "got_raw": "123\n\n def test_init_subclass_prefix_not_required(self):\n\n assert MyCallback.__prefix__ is None\n\n def test_init_subclass_prefix_not_required_with_default(self):\n\n assert MyCallback.__prefix__ is None\n\n def test_init_subclass_prefix_not_required_with_default_and_default_prefix(self):\n\n assert MyCallback.__prefix__ == 123\n\n def test_init_subclass_prefix_not_required_with_default_and_default_prefix_and_default_prefix(self):\n\n assert MyCallback.__prefix__ == 123\n\n def test_init_subclass_prefix_not_required_with_default_and_default_prefix_and_default_prefix_and_default", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "\"true\"", + "got": "bot.session.prepare_value(Default(\"protect_content\"), bot=bot, files={}) == True", + "got_raw": " bot.session.prepare_value(Default(\"protect_content\"), bot=bot, files={}) == True\n\n assert bot.session.prepare_value(Default(\"link_preview_is_disabled\"), bot=bot, files={}) == False\n\n def test_prepare_value_defaults_replace_with_files(self):\n bot = MockedBot(\n default=DefaultBotProperties(\n parse_mode=ParseMode.HTML,\n protect_content=True,\n link_preview_is_disabled=True,\n )\n )\n assert bot.session.prepare_value(Default(\"parse_mode\"), bot=bot, files={\"parse_mode\": \"HTML\"}) == \"HTML\"\n\n assert bot.session.prepare_value(Default(\"", + "exact_match": false, + "code_bleu": 0.04449945957170705, + "edit_similarity": 0.09302325581395349, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "prepare_result.result", + "got": "prepare_result.result", + "got_raw": " prepare_result.result\n assert bot.get_request().method == \"POST\"\n assert bot.get_request().url == \"https://api.telegram.org/bot12345/approveChatJoinRequest\"\n assert bot.get_request().json() == {\n \"chat_id\": -42,\n \"user_id\": 42,\n }\n\n async def test_bot_method_with_timeout(self, bot: MockedBot):\n prepare_result = bot.add_result_for(ApproveChatJoinRequest, ok=True, result=None)\n\n response: bool = await bot.approve_chat_join_request(\n chat_id=-42,\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "None", + "got": "assert my_model._bot is None", + "got_raw": "<|fim_suffix|>\n assert my_model._bot is None\n\n def test_via_model_post_init(self):\n my_model = MyModel()\n assert my_model._bot is None\n\n my_model = MyModel(context={})\n assert my_model._bot is None\n\n my_model = MyModel(context={\"bot\": MockedBot()})\n assert my_model._bot is MockedBot()\n\n def test_via_as(self):\n my_model = MyModel()\n assert my_model._bot is None\n\n my_model = my_model.as_(MockedBot())\n assert my_model._bot is MockedBot()\n\n my_model", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "generator.bar", + "got": "generator.bar", + "got_raw": " generator.bar\n\n def test_getattr_with_value(self):\n generator = FlagGenerator()\n assert isinstance(generator.foo, FlagDecorator)\n assert isinstance(generator.bar, FlagDecorator)\n\n assert generator.foo is not generator.foo\n\n assert generator.foo is not generator.bar\n\n def test_getattr_with_value(self):\n generator = FlagGenerator()\n assert isinstance(generator.foo, FlagDecorator)\n assert isinstance(generator.bar, FlagDecorator)\n\n assert generator.foo is not generator.foo\n\n assert generator.foo is not generator.bar\n\n def test_getattr_with_value(self):\n generator = FlagGenerator()\n assert isinstance(generator.foo,", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "prepare_result.result", + "got": "prepare_result.result", + "got_raw": " prepare_result.result\n assert request.method == \"copyMessages\"\n assert request.params == {\n \"chat_id\": randint(1000, 9999),\n \"from_chat_id\": randint(1000, 9999),\n \"message_ids\": [\n randint(1000, 4999),\n randint(5000, 9999),\n ],\n }\n\n async def test_bot_method_with_request_timeout(self, bot: MockedBot):\n prepare_result = bot.add_result_for(\n CopyMessages,\n ok=True,\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "json.dumps", + "got": "json.dumps", + "got_raw": " json.dumps\n assert session.timeout == 60.0\n\n def test_default_props(self):\n session = CustomSession()\n assert session.api == PRODUCTION\n assert session.json_loads == json.loads\n\n assert session.json_dumps == json.dumps\n assert session.timeout == 60.0\n\n def test_default_props(self):\n session = CustomSession()\n assert session.api == PRODUCTION\n assert session.json_loads == json.loads\n\n assert session.json_dumps == json.dumps\n assert session.timeout == 60.0\n\n def test_default_props(self):\n ", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "\"baz\"", + "got": "assert await storage.get_value(storage_key=storage_key, dict_key=\"foo\") is None", + "got_raw": "<|fim_suffix|>\n assert await storage.get_value(storage_key=storage_key, dict_key=\"foo\") is None\n\n assert await storage.set_data(key=storage_key, data={\"foo\": \"bar\"}) == {\"foo\": \"bar\"}\n assert await storage.get_data(key=storage_key) == {\"foo\": \"bar\"}\n assert await storage.get_value(storage_key=storage_key, dict_key=\"foo\") == \"bar\"\n\n assert await storage.update_data(key=storage_key, data={\"foo\": \"baz\"}) == {\"foo\": \"baz\"}\n assert await storage.get_data(key=storage_key) == {\"foo\": \"baz", + "exact_match": false, + "code_bleu": 0.06468490584192432, + "edit_similarity": 0.047619047619047616, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "1", + "got": "1", + "got_raw": "1\n assert isinstance(handler.filters[0], FilterObject)\n assert handler.filters[0].callback == lambda event: True\n\n assert handler.flags == {}\n\n assert handler.check(Update(update_id=1)) == (True, {})\n\n async def test_callback(self):\n handler = HandlerObject(callback1, filters=[FilterObject(lambda event: True)])\n\n assert handler.awaitable\n assert handler.callback == callback1\n\n assert len(handler.filters) == 1\n assert isinstance(handler.filters[0], FilterObject)\n assert handler.filters[0].callback == lambda event: True\n\n assert handler.flags ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "event.user_chat_id", + "got": "42", + "got_raw": "42\n assert api_method.from_user_id == 42\n assert api_method.user_chat_id == 42\n assert api_method.date == datetime.datetime.now()\n else:\n assert api_method.chat_id == -42\n assert api_method.from_user_id == 42\n assert api_method.user_chat_id == 42\n assert api_method.date == datetime.datetime.now()\n\n def test_answer_aliases_not_found(self):\n event = ChatJoinRequest(\n chat=Chat(id=-42, type=\"channel\"),\n from_user=User(id=42, is_bot=False, first", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "id(markup)", + "got": "0", + "got_raw": "0\n assert id(markup) == 0\n\n def test_add_row(self):\n builder = ReplyKeyboardBuilder()\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder.add(KeyboardButton(text=\"test\"))\n builder", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "3", + "got": "2", + "got_raw": "2\n assert len(SubScene.__scene_config__.actions) == 2\n\n # Assert handlers are correctly set\n assert len(SubScene.__scene_config__.handlers) == 2\n assert len(SubScene.__scene_config__.actions) == 2\n\n # Assert handlers are correctly set\n assert len(SubScene.__scene_config__.handlers) == 2\n assert len(SubScene.__scene_config__.actions) == 2\n\n # Assert handlers are correctly set\n assert len(SubScene.__scene_config__.handlers) == 2\n assert len(SubScene.__scene_config__.actions) ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "\"or\"", + "got": "\"World\"", + "got_raw": " \"World\"\n assert entities == [MessageEntity(MessageEntityType.BOLD, 8, 5)]\n\n def test_getitem_slice_inside_parent(self):\n node = Text(\"Hello, \", Bold(\"World\"), \"!\")\n new_node = node[8:]\n assert isinstance(new_node, Text)\n text, entities = new_node.render()\n\n assert text == \"World\"\n assert entities == [MessageEntity(MessageEntityType.BOLD, 8, 5)]\n\n def test_getitem_slice_outside_parent(self):\n node = Text(\"Hello, \", Bold(\"World\"), \"!\")\n new_node = node[:8]\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.7272727272727273, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "1", + "got": "1", + "got_raw": "1\n size += chunk_size\n\n assert size == 10\n\n async def test_stream_content_timeout(self, aresponses: ResponsesMockServer):\n aresponses.add(\n aresponses.ANY, aresponses.ANY, \"get\", aresponses.Response(status=200, body=b\"\\f\" * 10)\n )\n\n async with AiohttpSession() as session:\n stream = session.stream_content(\n \"https://www.python.org/static/img/python-logo.png\",\n timeout=0.001,\n chunk_size=1,\n raise_for_status=True,\n )\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "event", + "got": "42", + "got_raw": "42\n assert handler.key == 42\n assert handler.event == event\n assert handler.event.update_id == 42\n assert handler.event.update_id == event.update_id\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler.event is event\n assert handler", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "None", + "got": "None", + "got_raw": " None\n assert bot.session.prepare_value(UNSET_DISABLE_WEB_PAGE_PREVIEW, bot=bot, files={}) is False\n assert bot.session.prepare_value(UNSET_PROTECT_CONTENT, bot=bot, files={}) is False\n\n def test_prepare_value_defaults_set(self):\n bot = MockedBot()\n\n assert bot.session.prepare_value(UNSET_PARSE_MODE, bot=bot, files={}) is ParseMode.HTML\n assert bot.session.prepare_value(UNSET_DISABLE_WEB_PAGE_PREVIEW, bot=bot, files={}) is True\n assert bot.session.prepare_value(UNSET_PROTECT_CONTENT, bot=", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aiogram/aiogram", + "expected": "node", + "got": "node", + "got_raw": " node\n assert new_node == node\n assert new_node == \"Hello, World!\"\n\n def test_getitem_slice(self):\n node = Text(\"Hello, \", Bold(\"World\"), \"!\")\n new_node = node[1:3]\n\n assert new_node is not node\n assert new_node == node[1:3]\n assert new_node == \"World\"\n\n def test_getitem_slice_negative(self):\n node = Text(\"Hello, \", Bold(\"World\"), \"!\")\n new_node = node[-3:-1]\n\n assert new_node is not node\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexmojaki/futurecoder", + "expected": "\"Settings\"", + "got": "\"Settings\"", + "got_raw": " \"Settings\"\n settings_button.click()\n assert driver.find_element(By.CSS_SELECTOR, \".menu-popup .btn.btn-primary\").text.strip() == \"Developer mode\"\n\n # Click on developer mode\n settings_button.click()\n assert driver.find_element(By.CSS_SELECTOR, \".menu-popup .btn.btn-primary\").text.strip() == \"Developer mode\"\n settings_button.click()\n assert driver.find_element(By.CSS_SELECTOR, \".menu-popup .btn.btn-primary\").text.strip() == \"Developer mode\"\n settings_button.click()\n assert driver.find_element(By.CSS_SELECTOR, \".menu-popup .btn.btn-primary\").text.strip() == \"Developer", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexmojaki/futurecoder", + "expected": "8)", + "got": "8)", + "got_raw": "8)\n assert_equal(quadruple(3), 12)\n assert_equal(quadruple(4), 16)\n assert_equal(quadruple(5), 20)\n assert_equal(quadruple(6), 24)\n assert_equal(quadruple(7), 28)\n assert_equal(quadruple(8), 32)\n assert_equal(quadruple(9), 36)\n assert_equal(quadruple(10), 40)\n\n final_text = \"\"\"\nWell done! You've just written a function that takes one argument and returns a", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexmojaki/futurecoder", + "expected": "parsons", + "got": "parsons", + "got_raw": " parsons\n\n # Click 'Show solution' again\n get_hint_button = driver.find_element(By.CSS_SELECTOR, \".hints-popup .btn-primary\")\n assert get_hint_button.text == \"Show solution\"\n scroll_to_bottom(driver)\n get_hint_button.click()\n\n # Solution is now visible\n assert driver.find_elements(By.CSS_SELECTOR, \".gradual-solution\")\n assert driver.find_elements(By.CSS_SELECTOR, \".parsons-droppable\")\n\ndef get_hint_button(driver):\n return driver.find_element(By.CSS_SELECTOR, \".hints-popup .btn-primary\")\n\ndef get_hint_button_text(driver):\n return get_hint_button(driver).", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexmojaki/futurecoder", + "expected": "\"step_name_here\"", + "got": "\"Solution\"", + "got_raw": " \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__name__ != \"Solution\"\n assert cls.__", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3076923076923077, + "n_retrieved": 10 + }, + { + "repo": "alexmojaki/futurecoder", + "expected": "not parsons", + "got": "not parsons)", + "got_raw": "not parsons)\n assert bool(driver.find_elements(By.CSS_SELECTOR, \".parsons-droppable\")) == parsons\n\n # Solution is visible\n assert driver.find_elements(By.CSS_SELECTOR, \".gradual-solution\")[0].text == \"\"\"\\\nfor i in range(len(things)):\n if to_find == things[i]:\n print(i)\n break\"\"\"\n\n # Click 'Show solution' again\n get_hint_button = driver.find_element(By.CSS_SELECTOR, \".hints-popup .btn-primary\")\n assert get_hint_button.text == \"Show solution\"\n scroll_to_bottom(driver)\n get_hint_button.click()\n\n #", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.9565217391304348, + "n_retrieved": 10 + }, + { + "repo": "alexmojaki/futurecoder", + "expected": "vc2)", + "got": "vc2)", + "got_raw": " vc2)\n elif isinstance(t1, ast.AST):\n assert t1.__class__ == t2.__class__\n for field in t1._fields:\n assert hasattr(t1, field)\n assert hasattr(t2, field)\n assert getattr(t1, field) == getattr(t2, field)\n else:\n assert t1 == t2\n\n def get_solution(self):\n return dict(\n tokens=[],\n maskedIndices=[],\n mask=[],\n lines=None,\n )\n\nclass MessageStep(Step):\n def check(self):\n if self.solution:\n return self.solution.check()\n\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "\"tracked\"", + "got": "assert result.rlm_calls[0].response == \"tracked\"", + "got_raw": "<|fim_suffix|>\n assert result.rlm_calls[0].response == \"tracked\"\n\n def test_rlm_query_batched(self):\n \"\"\"rlm_query_batched should return list of responses.\"\"\"\n completions = [_make_completion(\"tracked\") for _ in range(3)]\n subcall_fn = MagicMock(return_value=completions)\n repl = LocalREPL(subcall_fn=subcall_fn)\n result = repl.execute_code(\"rlm_query_batched(['test', 'test2'])\")\n assert len(result.rlm_calls) == 2\n assert result.rlm_calls[0].response == \"tracked\"\n ", + "exact_match": false, + "code_bleu": 0.10390302174233558, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "None", + "got": "assert usage.prompt_token_count == 10", + "got_raw": "<|fim_suffix|>\n assert usage.prompt_token_count == 10\n assert usage.candidates_token_count == 5\n\n def test_track_cost(self):\n \"\"\"Test _track_cost method.\"\"\"\n with patch(\"rlm.clients.gemini.genai.Client\"):\n client = GeminiClient(api_key=\"test-key\")\n client._track_cost(\n response=MagicMock(usage_metadata=MagicMock(prompt_token_count=10, candidates_token_count=5)),\n model=\"test-model\",\n )\n assert client.model_call_counts[\"test-model\"] == 1\n assert client.model_input_tokens[\"test-model\"] == ", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.04878048780487805, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "\"\"", + "got": "assert result.stdout == \"Document A content + Document B content\"", + "got_raw": "<|fim_suffix|>\n assert result.stdout == \"Document A content + Document B content\"\n\n def test_contexts_accessible_in_code_with_index(self):\n \"\"\"Test that multiple contexts can be accessed in code execution with index.\"\"\"\n repl = LocalREPL()\n repl.add_context(\"Document A content\", context_index=0)\n repl.add_context(\"Document B content\", context_index=1)\n\n result = repl.execute_code(\"combined = f'{context_0} + {context_1}'\")\n\n assert result.stderr == \"\"\n assert result.stdout == \"Document A content + Document B content\"\n\n def test_contexts_accessible_in_code", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.05970149253731343, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "2", + "got": "2", + "got_raw": "2\n assert blocks[0].code == \"a = 1\"\n assert blocks[0].result.stdout == \"1\"\n assert blocks[1].code == \"b = 2\"\n assert blocks[1].result.stdout == \"2\"\n\n def test_single_code_block(self):\n text = \"\"\"```repl\na = 1\n```\nEnd.\"\"\"\n blocks = find_code_blocks(text)\n\n assert len(blocks) == 1\n assert blocks[0].code == \"a = 1\"\n assert blocks[0].result.stdout == \"1\"\n\n def test_no_code_blocks", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "6", + "got": "6", + "got_raw": "6\n assert repl.locals.get(\"b\") == 4\n assert repl.locals.get(\"c\") == 100\n assert repl.locals.get(\"d\") == 200\n\n def test_described_tools(self):\n \"\"\"Described tools should be available in the REPL.\"\"\"\n repl = LocalREPL(custom_tools=custom_tools())\n\n repl.execute_code(\"a = double(5)\")\n repl.execute_code(\"b = concat('hello', 'world')\")\n repl.execute_code(\"c = CONFIG['key']\")\n repl.execute_code(\"d = CONSTANT\")\n\n assert repl.locals.get(\"a\") ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "captured_child_params", + "got": "", + "got_raw": " # File: rlm/core/rlm.py\n \"\"\"\n current_prompt = message_history + [\n {\n \"role\": \"assistant\",\n \"content\": \"Please provide a final answer to the user's question based on the information provided.\",\n }\n ]\n response = lm_handler.completion(current_prompt)\n\n if self.logger:\n self.logger.log(\n RLMIteration(\n prompt=current_prompt,\n response=response,\n final_answer=response,\n code_blocks=[],\n )\n )\n\n return response\n\n def _fallback_answer(self, message: str | dict[str, Any]) -> str:\n \"\"\"\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "True", + "got": "rlm = RLM(", + "got_raw": "<|fim_suffix|>\n rlm = RLM(\n backend=\"openai\",\n backend_kwargs={\"model_name\": \"test\"},\n environment=\"local\",\n persistent=True,\n )\n\n assert rlm.persistent is True\n\n def test_invalid_environment(self):\n \"\"\"Invalid environment should raise.\"\"\"\n with pytest.raises(ValueError):\n rlm = RLM(\n backend=\"openai\",\n backend_kwargs={\"model_name\": \"test\"},\n environment=\"invalid\",\n persistent=True,\n )\n\n def test_invalid_backend(self):\n \"\"\"Invalid backend should raise.\"\"\"\n with pytest.raises(ValueError):\n rlm = RLM(\n backend=\"", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "2", + "got": "2", + "got_raw": "2\n assert subcall_fn.call_args_list[0][1][\"model\"] == \"custom-model\"\n assert subcall_fn.call_args_list[1][1][\"model\"] == \"custom-model\"\n\n def test_batched_with_no_model_override(self):\n \"\"\"rlm_query_batched should use the root model if no model is provided.\"\"\"\n subcall_fn = MagicMock(return_value=_make_completion(\"ok\"))\n repl = LocalREPL(subcall_fn=subcall_fn)\n repl.execute_code(\"rlm_query_batched(['q1', 'q2'])\")\n\n assert subcall_fn.call_count == 2\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "out.stdout", + "got": "out", + "got_raw": " out\n\n def test_history_restored_after_overwrite(self):\n \"\"\"If the model does history = 'something', the next execution still sees the real history.\"\"\"\n repl = LocalREPL(context_payload=\"original context content\")\n assert repl.locals[\"history\"] == \"original history content\"\n\n repl.execute_code('history = \"hijacked\"')\n assert repl.locals[\"history\"] == \"original history content\"\n\n out = repl.execute_code(\"print(history)\")\n\n assert \"original history content\" in out\n\n def test_context_and_history_restored_after_overwrite(self):\n \"\"\"If the model does context = '", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.46153846153846156, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "second_env", + "got": "second_env", + "got_raw": " second_env\n\n def test_environment_reused_in_persistent_mode_with_sub_calls(self):\n \"\"\"Verify the same environment instance is reused across completion calls.\"\"\"\n responses = [\"FINAL(answer from call)\"]\n\n with patch.object(rlm_module, \"get_client\") as mock_get_client:\n mock_lm = create_mock_lm(responses)\n mock_get_client.return_value = mock_lm\n\n with RLM(\n backend=\"openai\",\n backend_kwargs={\"model_name\": \"test\"},\n persistent=True,\n ) as rlm:\n rlm.completion(\"First context\")\n first_env = rlm._persistent_env", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "0", + "got": "0", + "got_raw": "0\n\n def test_cleanup_clears_temp_dir(self):\n \"\"\"Test that cleanup clears the temp directory.\"\"\"\n repl = LocalREPL()\n repl.execute_code(\"x = 42\")\n assert os.path.exists(repl.temp_dir)\n repl.cleanup()\n\n assert not os.path.exists(repl.temp_dir)\n\n def test_cleanup_clears_pending_llm_calls(self):\n \"\"\"Test that cleanup clears pending LLM calls.\"\"\"\n repl = LocalREPL()\n repl.execute_code(\"x = 42\")\n assert len(repl._pending_llm_calls) == 1\n repl.cleanup()\n\n assert len", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "[]", + "got": "0", + "got_raw": "0\n\n def test_batched_single_prompt(self):\n \"\"\"rlm_query_batched with single prompt should return single response.\"\"\"\n subcall_fn = MagicMock()\n repl = LocalREPL(subcall_fn=subcall_fn)\n repl.execute_code(\"answers = rlm_query_batched(['test'])\")\n\n assert repl.locals[\"answers\"] == \"test\"\n\n def test_batched_multiple_prompts(self):\n \"\"\"rlm_query_batched with multiple prompts should return multiple responses.\"\"\"\n subcall_fn = MagicMock()\n repl = LocalREPL(subcall_fn=subcall_fn)\n repl.execute_code(\"answers = rlm_query", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "alexzhang13/rlm", + "expected": "\"4\"", + "got": "4", + "got_raw": "4\n assert result.execution_time == 3.0\n assert result.metadata is None\n assert result.usage_summary.to_dict() == {\n \"model_usage_summaries\": {\n \"test-model\": {\n \"total_calls\": 3,\n \"total_input_tokens\": 100,\n \"total_output_tokens\": 50,\n }\n }\n }\n\n def test_multi_iteration_after_final(self):\n \"\"\"depth=1 should iterate multiple times after finding FINAL().\"\"\"\n with patch.object(rlm_module, \"get_client\") as mock_get_client:\n mock_lm = create_mock_lm(\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "alisaifee/flask-limiter", + "expected": "response.status_code", + "got": "200 == response.status_code", + "got_raw": "200 == response.status_code\n assert \"ok\" == response.data.decode(\"utf-8\")\n\n timeline.advance(1)\n response = cli.get(\"/t1\")\n\n assert 200 == 200 == response.status_code\n assert \"okmaybe\" == response.data.decode(\"utf-8\")\n\n timeline.advance(1)\n response = cli.get(\"/t1\")\n\n assert 429 == 429 == response.status_code\n assert \"ratelimit exceeded 1/second\" == response.data.decode(\"utf-8\")\n\n timeline.advance(1)\n response", + "exact_match": false, + "code_bleu": 0.4111336169005197, + "edit_similarity": 0.851063829787234, + "n_retrieved": 10 + }, + { + "repo": "alisaifee/flask-limiter", + "expected": "1", + "got": "1", + "got_raw": "1\n assert limiter._in_memory_fallback[0] == \"1/minute\"\n\n assert len(limiter._fallback_storage) == 1\n assert limiter._fallback_storage._storage == redis_connection\n\n assert len(limiter._fallback_limiter) == 1\n assert limiter._fallback_limiter._storage == redis_connection\n\n assert len(limiter._fallback_limiter._limits) == 1\n assert limiter._fallback_limiter._limits[0].key == \"1/minute\"\n\n assert len(limiter._fallback_limiter._limits[0].window) == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alisaifee/flask-limiter", + "expected": "MemoryStorage", + "got": "MemoryStorage", + "got_raw": " MemoryStorage\n assert type(limiter._limiter) is MovingWindowRateLimiter\n assert type(limiter._limiter) is MovingWindowRateLimiter\n assert type(limiter._limiter) is MovingWindowRateLimiter\n assert type(limiter._limiter) is MovingWindowRateLimiter\n assert type(limiter._limiter) is MovingWindowRateLimiter\n assert type(limiter._limiter) is MovingWindowRateLimiter\n assert type(limiter._limiter) is MovingWindowRateLimiter\n assert type(limiter._limiter) is MovingWindowRate", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alisaifee/flask-limiter", + "expected": "b\"tres\"", + "got": "b\"tres\"", + "got_raw": " b\"tres\"\n\n cli.get(\"/t1\")\n resp = cli.get(\"/t1\")\n assert 429 == resp.status_code\n assert resp.data == b\"uno\"\n cli.get(\"/t2\")\n resp = cli.get(\"/t2\")\n assert 429 == resp.status_code\n assert resp.data == b\"dos\"\n cli.get(\"/t3\")\n resp = cli.get(\"/t3\")\n assert 429 == resp.status_code\n\n assert resp.data == b\"tres\"\n\n cli.get(\"/t1\")\n resp = cli.get(\"/t1", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "alisaifee/flask-limiter", + "expected": "result.output", + "got": "result.output", + "got_raw": " result.output\n\ndef test_limiter(kitchensink_factory):\n app = Flask(__name__)\n limiter = Limiter(\n lambda: \"127.0.0.1\",\n app=app,\n default_limits=[\"2 per minute\", \"1 per second\"],\n storage_uri=\"memory://\",\n strategy=\"fixed-window\",\n )\n runner = app.test_cli_runner()\n result = runner.invoke(cli, [\"config\"])\n\n assert \"enabled\" in result.output\n assert \"2 per minute\" in result.output\n assert \"1 per second\" in result.output\n assert \"fixed-window\"", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "True", + "got": "", + "got_raw": " # noqa: E711\n assert actual_func._pydantic_resolve_query.name == 'users'\n assert actual_func._pydantic_resolve_query.description == '\u83b7\u53d6\u6240\u6709\u7528\u6237'\n\n def test_query_config(self):\n \"\"\"\u6d4b\u8bd5 QueryConfig\"\"\"\n _diagram = ErDiagram(configs=[\n Entity(\n kls=UserEntityForConfig,\n relationships=[],\n queries=[\n QueryConfig(method=get_all_users, name='users')\n ]\n )\n ])\n\n # \u83b7\u53d6\u7ed1\u5b9a\u7684\u65b9\u6cd5\n bound_method = UserEntityForConfig.get_all_users\n\n # \u9a8c\u8bc1\u5143\u6570\u636e\u88ab\u6b63\u786e\u8bbe\u7f6e\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "2", + "got": "2", + "got_raw": "2\n assert len(result.users[1].friends) == 2\n assert len(result.users[2].friends) == 2\n assert len(result.users[3].friends) == 2\n assert len(result.users[4].friends) == 2\n assert len(result.users[5].friends) == 2\n assert len(result.users[6].friends) == 2\n assert len(result.users[7].friends) == 2\n assert len(result.users[8].friends) == 2\n assert len(result.users[9].friends) == 2\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "(annotation,)", + "got": "[annotation]", + "got_raw": " [annotation]\n assert shelling_type(annotation) == annotation\n assert get_class_field_annotations(annotation) == {}\n\n\n@pytest.mark.parametrize(\n \"annotation\",\n [\n List[int],\n List[Optional[int]],\n List[Union[int, str]],\n List[Dict[str, int]],\n List[Tuple[int, str]],\n List[Set[int]],\n List[Union[int, str]],\n List[Dict[str, int]],\n List[Tuple[int, str]],\n List[Set[int]],\n List[Union[int, str]],\n List[Dict[str, int]],\n List[Tuple[int, str]],\n ", + "exact_match": false, + "code_bleu": 0.3388507513536918, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "[('world', False)]", + "got": "[('world', False)]", + "got_raw": " [('world', False)]\n\n assert pydantic_resolve.utils.class_util.get_class_field_annotations(B) == {'hello': str}\n assert pydantic_resolve.utils.class_util.get_class_field_annotations(C) == {'hello': str}\n assert pydantic_resolve.utils.class_util.get_class_field_annotations(D) == {}\n assert pydantic_resolve.utils.class_util.get_class_field_annotations(E) == {'world': str}\n\n assert pydantic_resolve.utils.class_util.get_class_field_annotations(B, True) == {'hello': str}\n assert pydantic_resolve.utils.class_util.get_class_field_annotations(C, True) == {'hello", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "[('hello', True)]", + "got": "['hello']", + "got_raw": " ['hello']\n assert list(pydantic_resolve.utils.class_util.get_fields_default_value_not_provided(C)) == ['hello']\n assert list(pydantic_resolve.utils.class_util.get_fields_default_value_not_provided(D)) == ['hello']\n assert list(pydantic_resolve.utils.class_util.get_fields_default_value_not_provided(E)) == ['hello', 'world']\n\n assert list(pydantic_resolve.utils.class_util.get_class_field_annotations(B)) == {'hello': str}\n assert list(pydantic_resolve.utils.class_util.get_class_field_annotations(C)) == {'hello': str}\n assert list(p", + "exact_match": false, + "code_bleu": 0.23026498539075899, + "edit_similarity": 0.6923076923076923, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "None", + "got": "class User(BaseModel):", + "got_raw": "<|fim_suffix|>\n class User(BaseModel):\n id: int\n name: str\n\n class Order(BaseModel):\n id: int\n user_id_str: str\n\n class OrderResponse(Order):\n user: Annotated[Optional[User], LoadBy('user_id_str')] = None\n\n MyResolver = config_resolver('MyResolver', er_diagram=diagram)\n\n # Create order with None user_id_str\n order = OrderResponse(id=1, user_id_str=None)\n\n # Should use field_none_default and return None for user\n result = await MyResolver().resolve(order)\n\n assert", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.07692307692307693, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n result = await Resolver().resolve(c)\n assert result.model_dump() == expected\n\n assert METADATA_CACHE == {\n 'Container': {\n 'name': 'hello',\n }\n }\n```\n\n## test case\n\n```python\nclass A(BaseModel):\n name: str\n\nclass B(BaseModel):\n name: str\n\nclass C(BaseModel):\n items: List[Union[A, B]] = []\n def resolve(self):\n return [A(name='n'), B(name='n')]\n\n@pytest.mark.asyncio\nasync def test_case():\n c = C(items=[A(name='n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "ImportError)", + "got": "", + "got_raw": "\n\n\n# File: docs/graphql.zh.md\n from pydantic_resolve import base_entity\n TestBase = base_entity()\n\n class SimpleEntity(BaseModel, TestBase):\n __relationships__ = []\n id: int\n name: str\n\n @query(name='simple')\n async def get_all(cls, limit: int = 10) -> List['SimpleEntity']:\n return [\n SimpleEntity(id=1, name='Alice'),\n SimpleEntity(id=2, name='Bob'),\n ][:limit]\n\n self.er_diagram = TestBase.get_diagram()\n config_global_resolver(self.er", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "\"a\"", + "got": "1", + "got_raw": "1\n assert d[0].user_ids == [1]\n assert d[0].user_ids_str == '1,2'\n assert d[1].user.name == 2\n assert d[1].user_ids == [2]\n assert d[1].user_ids_str == '2'\n\nclass BizCase1(BaseModel, BaseEntity):\n id: int\n name: str\n user_id: int\n user_ids: Optional[List[int]] = None\n user_ids_str: Optional[str] = None\n\n __relationships__ = [\n Relationship(field='user_id', target_k", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "TypeError)", + "got": "ResolverTargetAttrNotFound):", + "got_raw": "ResolverTargetAttrNotFound):\n await Resolver().resolve(earth)\n\n earth = EarthGood()\n earth = await Resolver().resolve(earth)\n assert earth.name == \"earth\"\n assert earth.sprints[0].name == \"sprint1\"\n assert earth.members[0].name == \"mike\"\n assert earth.members[1].name == \"jerry\"\n assert earth.members[2].name == \"tom\"\n assert earth.members[3].name == \"jack\"\n assert earth.members[4].name == \"kikodo\"\n assert earth.members[5].name == \"john\"\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.21052631578947367, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "[\"foo1\", \"foo2\"]", + "got": "1", + "got_raw": "1\n assert d[0].foos_in_list == [Foo(id=1, name=\"foo1\"), Foo(id=2, name=\"foo2\")]\n assert d[0].foos_in_dict == {\"foo1\": Foo(id=1, name=\"foo1\"), \"foo2\": Foo(id=2, name=\"foo2\")}\n assert d[0].foos_in_set == {Foo(id=1, name=\"foo1\"), Foo(id=2, name=\"foo2\")}\n assert d[0].foos_in_tuple == (Foo(id=1, name=\"foo1\"), Foo", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n@pytest.mark.asyncio\nasync def test_resolver_factory_of_er_relationship_not_found_with_loader():\n MyResolver = config_resolver('MyResolver', er_diagram=diagram)\n d = BizCase6(id=1, user_id=1)\n expected = (\n 'Relationship from \"\" to '\n '\"typing.Optional[tests.er_diagram.test_er_diagram.User]\" using \"user_id_0\", biz: \"None\", not found'\n )\n with pytest.raises(AttributeError) as excinfo:\n await MyResolver().resolve(d)\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "address_def['required']", + "got": "assert 'city' in address_def['required']", + "got_raw": "<|fim_suffix|>\n assert 'city' in address_def['required']\n assert 'city' in address_def['properties']\n\n # Address class: both street and city should be required\n assert 'street' in address_def['required']\n assert 'street' in address_def['properties']\n assert 'city' in address_def['required']\n assert 'city' in address_def['properties']\n\n # Person class: name is required, address is a nested model\n assert 'name' in schema['required']\n assert 'address' in schema['required']\n assert 'address' in schema['properties']\n\n #", + "exact_match": false, + "code_bleu": 0.5169731539571706, + "edit_similarity": 0.7301587301587301, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "True", + "got": "1", + "got_raw": "1\n assert a.details_compare_2 is 2\n assert a.details_compare_3 is 3\n assert a.details_compare_4 is 4\n assert a.details_compare_5 is 5\n assert a.details_compare_6 is 6\n assert a.details_compare_7 is 7\n assert a.details_compare_8 is 8\n assert a.details_compare_9 is 9\n assert a.details_compare_10 is 10\n assert a.details_compare_11 is 11\n assert a.details_compare_12 is 12", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\nasync def batch_load_fn(keys):\n return [1 for k in keys]\n\n@pytest.mark.asyncio\nasync def test_type_definition():\n c = Container()\n resolver = Resolver()\n result = await resolver.resolve(c)\n expected = {\n 'items': [\n {'id': '1-', 'n': 1},\n {'id': '2+', 'name': 'Item 2', 'n': 1}\n ],\n }\n\n assert result.model_dump() == expected\n\nasync def batch_load_fn(keys):\n return [1 for k in keys]\n\n@pytest.mark.asyncio\nasync def test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "['b1', 'b2']", + "got": "2", + "got_raw": "2\n assert a.c1.detail == '1-1'\n assert a.c2.detail == '2-1'\n\n@pytest.mark.asyncio\nasync def test_collector_2():\n a = A()\n a = await Resolver().resolve(a)\n\n assert a.names == 2\n assert a.c1.detail == '1-1'\n assert a.c2.detail == '2-2'\n\n@pytest.mark.asyncio\nasync def test_collector_3():\n a = A()\n a = await Resolver().resolve(a)\n\n assert a.names == 2\n assert a.c1.detail == '", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "User", + "got": "", + "got_raw": " # noqa: E711\n assert entity.relationships[0].loader is None\n\ndef test_resolve_ref_with_string_reference():\n \"\"\"Test that string references (for same-module references) work as expected.\"\"\"\n Base = base_entity()\n\n class MyEntity(BaseModel, Base):\n __relationships__ = [\n # String reference - should be resolved automatically\n Relationship(field='user_id', target_kls='User', loader=None)\n ]\n id: int\n user_id: int\n\n diagram = Base.get_diagram()\n assert len(diagram.configs) == 1\n entity = diagram", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "3", + "got": "3", + "got_raw": "3\n```\n\n## v1.1\n\n### v1.1.1 (2023.6.17)\n\n- fix, `__pydantic_resolve_collect__` and `__pydantic_resolve_expose__` can be used in the same model.\n\n### v1.1.0 (2023.6.16)\n\n- add `__pydantic_resolve_collect__` and `__pydantic_resolve_expose__` to the model.\n\nmore detail: `tests/pydantic_v1/resolver/test_43_union_bad.py`\n\n- test_mapper_6", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n assert counter[\"book\"] == 3\n\n # test loader instance cache\n results = await Resolver().resolve(students)\n assert counter[\"book\"] == 3\n\n # test loader instance cache\n results = await Resolver().resolve(students)\n assert counter[\"book\"] == 3\n\n # test loader instance cache\n results = await Resolver().resolve(students)\n assert counter[\"book\"] == 3\n\n # test loader instance cache\n results = await Resolver().resolve(students)\n assert counter[\"book\"] == 3\n\n # test loader instance cache\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "allmonday/pydantic-resolve", + "expected": "2", + "got": "1", + "got_raw": "1\n assert len(result.foos_special) == 1\n assert len(result.bars_default) == 1\n\n # Should use FooLoader for default biz\n assert result.foos_default[0].name == \"foo1\"\n assert result.foos_special[0].name == \"foo2\"\n\n # Should use BarLoader for special biz\n assert result.foos_default[0].name == \"foo1\"\n assert result.foos_special[0].name == \"foo2\"\n\n # Should use BarLoader for bar_default biz\n assert result.bars_default", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "0", + "got": "0", + "got_raw": "0\n assert x[0].size == 0\n assert x[0].created_at == datetime(2023, 1, 1, 12, 0, 0, tzinfo=timezone.utc)\n assert x[0].usage_data == {}\n assert x[0].scope == 'local'\n assert x[0].mountpoint == ''\n assert x[0].short_name == 'vol1'\n\n assert x[1].ref_count == 0\n assert x[1].size == 0\n assert x[1].created_at == datetime", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "'DU scanner stopped.')", + "got": "", + "got_raw": " # pragma: no cover\n 'Doku container mounts:'\n )\n\n mock_logger.return_value.info.assert_any_call( # pragma: no cover\n ' /var/lib/docker/overlay2/1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n\n # Verify schedule.every was called twice\n assert mock_schedule.call_count == 2\n\n # Verify schedule.every was called with the correct interval\n assert mock_schedule.call_args_list[0][0][0] == 60\n assert mock_schedule.call_args_list[1][0][0] == 60 * 5\n\n # Verify schedule.every was called with the correct function\n assert mock_schedule.call_args_list[0][0][1] == mock_system_scanner.return_value.scan\n assert mock_schedule.call_args_list[1][0][1] == mock_logfiles_sc", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "[ call('/host/path', obj, ANY), call('/host/path', obj, ANY), call('/host/path', obj, ANY), ])", + "got": "_kvstore_set.assert_any_call('/host/path', obj, ANY)", + "got_raw": "_kvstore_set.assert_any_call('/host/path', obj, ANY)\n mock_kvstore_set.assert_any_call('/container/path', obj, ANY)\n\n # check what was logged\n assert scanner.logger.debug.call_count == 2\n scanner.logger.debug.assert_any_call('Bind mount /host/path of container container1...')\n scanner.logger.debug.assert_any_call('Bind mount /container/path of container container1...')\n\n # check what was logged\n assert scanner.logger.error.call_count == 0\n\ndef test_bind_mounts_scanner_error(mock_docker_client, mock_is_stop, docker_mount):\n # mock Doku", + "exact_match": false, + "code_bleu": 0.22621675605289085, + "edit_similarity": 0.3835616438356164, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "LOGGER_NAME)", + "got": "LOGGER_NAME)", + "got_raw": "LOGGER_NAME)\n mock_logger.handlers = []\n mock_logger.addHandler.assert_called_once_with(mock_handler)\n\n mock_formatter_class.assert_called_once_with(fmt='%(levelprefix)s %(message)s', use_colors=not settings.IN_DOCKER)\n mock_handler.setFormatter.assert_called_once_with(mock_formatter)\n\n if in_docker:\n assert mock_logger.level == logging.INFO\n else:\n assert mock_logger.level == logging.DEBUG\n\n\n@pytest.mark.parametrize('log_level', ['debug', 'info', 'warning', 'error', 'critical'])\ndef test_get_logger(log_level):\n # Set the log level for the test\n logging", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "2", + "got": "2", + "got_raw": "2\n assert mock_sleep.call_count == 10\n\n\n# File: app/scan/scanner.py\nimport time\nimport fnmatch\nfrom collections.abc import Callable\nfrom pathlib import Path\n\nfrom docker.models.containers import Container\nfrom peewee import SqliteDatabase\nfrom playhouse.kv import KeyValue\nfrom pydantic import ValidationError\n\nimport settings\nfrom scan.utils import get_size, du_available, pretty_size\nfrom contrib import kvstore\nfrom contrib.logger import get_logger\nfrom contrib.types import (\n DockerSystemDF,\n DockerMount,\n DockerContainerLog,\n DockerBindMounts,\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "Path('/dest/subdir/file.txt')", + "got": "Path('/dest/subdir/file.txt')", + "got_raw": " Path('/dest/subdir/file.txt')\n\n@patch('pathlib.Path.exists')\ndef test_map_host_path_to_container_no_match(mock_exists):\n mock_exists.return_value = False\n result = map_host_path_to_container('/source', '/dest', '/source/subdir/file.txt')\n\n assert result is None\n\n@patch('pathlib.Path.exists')\ndef test_map_host_path_to_container_no_match_with_log_path(mock_exists):\n mock_exists.return_value = False\n result = map_host_path_to_container('/source', '/dest', '/host/path/logs/subdir/file.txt')\n\n assert result is None\n\n@patch('pathlib", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "[ call('image', images, ANY), call('container', DockerContainerList.model_validate(df_data['Containers']), ANY), call('volume', volumes, ANY), call('build_cache', DockerBuildCacheList.model_validate(df_data['BuildCache']), ANY), call('root_mount', docker_mount, ANY), ])", + "got": "_kvstore_set.assert_has_calls([", + "got_raw": "_kvstore_set.assert_has_calls([\n call('images', images, ANY),\n call('containers', images.root[0], ANY),\n call('volumes', volumes, ANY),\n call('build_cache', DockerBuildCacheList.model_validate(df_data['BuildCache']), ANY),\n ])\n\ndef test_logfiles_scanner(mock_docker_client, docker_mount):\n # mock log files\n mock_log_files = [\n DockerContainerLog.model_validate({\n 'id': '123456789abcdef',\n 'name': 'container1',\n 'image': 'image1',\n 'path", + "exact_match": false, + "code_bleu": 0.025364680896492103, + "edit_similarity": 0.03322259136212625, + "n_retrieved": 10 + }, + { + "repo": "amerkurev/doku", + "expected": "'main:app'", + "got": "", + "got_raw": " # pragma: no cover\n assert kwargs['host'] == '0.0.0.0'\n assert kwargs['port'] == 9090\n assert kwargs['workers'] == 1\n assert kwargs['reload'] is False\n assert kwargs['log_level'] == logging.INFO\n assert kwargs['access_log'] is True\n assert kwargs['server_header'] is False\n assert kwargs['ssl_cert_reqs'] == ssl.CERT_NONE\n assert kwargs['ssl_ca_certs'] is None\n assert kwargs['ssl_ciphers'] == 'TLSv1'\n assert", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "amosjyng/langchain-visualizer", + "expected": "\"ell\"", + "got": "0", + "got_raw": "0\n assert s.strip().strip(\"ho\").strip(\" \") == \"hello\"\n assert s.strip().strip(\"ho\").strip(\" \") == \"hello\"\n assert s.strip().strip(\"ho\").strip(\" \") == \"hello\"\n assert s.strip().strip(\"ho\").strip(\" \") == \"hello\"\n assert s.strip().strip(\"ho\").strip(\" \") == \"hello\"\n assert s.strip().strip(\"ho\").strip(\" \") == \"hello\"\n assert s.strip().strip(\"ho\").strip(\" \") == \"hello\"\n assert s.strip().strip(\"ho\").strip(\" \") == \"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "amosjyng/langchain-visualizer", + "expected": "results[-1]", + "got": "results[0]", + "got_raw": " results[0]\n assert \"43\" in results[1]\n assert \"stratus\" in results[2]\n\ndef test_vcr():\n \"\"\"Check that the chain can run normally\"\"\"\n with vcr.use_cassette(\"tests/cassettes/router_demo.yaml\"):\n results = asyncio.get_event_loop().run_until_complete(router_demo())\n assert len(results) == 3\n\n assert \"heavy rain\" in results[0]\n assert \"43\" in results[1]\n assert \"stratus\" in results[2]", + "exact_match": false, + "code_bleu": 0.4065061985236918, + "edit_similarity": 0.8571428571428571, + "n_retrieved": 10 + }, + { + "repo": "amosjyng/langchain-visualizer", + "expected": "( \"hello \", FValue(source=\"foo\", value=\"world\", formatted=\"world\"), )", + "got": "", + "got_raw": " # type: ignore\n [\n FValue(\n source=\"foo\",\n value=\"world\",\n formatted=\"world\",\n )\n ]\n\n assert s.parts[0].source == \"foo\"\n assert s.parts[0].value == \"world\"\n assert s.parts[0].formatted == \"world\"\n\n assert s.parts[0].source == \"foo\"\n assert s.parts[0].value == \"world\"\n assert s.parts[0].formatted == \"world\"\n\n assert s.parts[0].source == \"foo\"\n assert s.parts[0].value == \"world\"\n assert", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "amosjyng/langchain-visualizer", + "expected": "result.strip()", + "got": "result", + "got_raw": " result\n\ndef test_llm_usage_succeeds_with_vcr():\n \"\"\"Check that the chain can run normally\"\"\"\n with vcr.use_cassette(\"tests/cassettes/mrkl_chat_demo.yaml\"):\n result = asyncio.get_event_loop().run_until_complete(mrkl_chat_demo())\n\n assert \"Jagged Little Pill\" in result\n\ndef test_llm_usage_fails():\n \"\"\"Check that the chain can run normally\"\"\"\n llm = ChatOpenAI(temperature=0)\n llm1 = OpenAI(temperature=0)\n search = SerpAPIWrapper()\n llm_math_chain", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.6, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "logs", + "got": "logs", + "got_raw": " logs\n assert \"PLAY [role1\" in logs\n assert \"PLAY [role2\" in logs\n assert \"PLAY [role3\" in logs\n assert \"PLAY [role4\" in logs\n assert \"PLAY [role5\" in logs\n assert \"PLAY [role6\" in logs\n assert \"PLAY [role7\" in logs\n assert \"PLAY [role8\" in logs\n assert \"PLAY [role9\" in logs\n assert \"PLAY [role10\" in logs\n assert \"PLAY [", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "\"leonardo\"", + "got": "12345", + "got_raw": "12345\n assert m.ports == [\"8080\"]\n assert m.buildah_from_extra_args == \"--from=base\"\n assert m.buildah_run_extra_args == \"--buildah-run-args\"\n assert m.podman_run_extra_args == \"--podman-run-args\"\n assert m.python_interpreter == \"/usr/bin/python3\"\n\ndef test_set_all_params_with_defaults():\n \"\"\" test that we can set all the parameters with defaults \"\"\"\n p = PbVarsParser(full_conf_pb_path)\n b, m = p.get_build_and_metadata()\n b.playbook_path = \"/", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "\"ls\"", + "got": "12345", + "got_raw": "12345\n assert b.build_user == 12345\n assert b.target_image == \"some_image\"\n assert b.metadata.name == \"some_name\"\n assert b.metadata.labels == {\"key\": \"value\"}\n assert b.metadata.environment == {\"X\": \"Y\"}\n assert b.metadata.working_dir == \"/path\"\n\n assert b.buildah_from_extra_args == \"--from=base\"\n assert b.squash\n assert b.debug\n assert b.verbose\n assert b.pulled\n assert b.buildah_run_extra_args == \"--hostname=foo\"\n assert b", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "\"quay.io/biocontainers/python:3\"", + "got": "\"fedora:28\"", + "got_raw": " \"fedora:28\"\n assert data[\"target_image\"][\"name\"] == \"asdqwe\"\n assert data[\"target_image\"][\"environment\"][\"X\"] == \"Y\"\n assert data[\"target_image\"][\"labels\"][\"key\"] == \"value\"\n assert data[\"target_image\"][\"working_dir\"] == \"/path\"\n\ndef test_expand_pb_vars_with_unknown_keys():\n p = PbVarsParser(playbook_with_unknown_keys)\n with pytest.raises(ABValidationError):\n p.expand_pb_vars()\n\ndef test_expand_pb_vars_with_wrong_type():\n p = PbVarsParser(playbook_wrong_type)\n with pytest.raises(ABValidationError", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.23255813953488372, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "4", + "got": "1", + "got_raw": "1\n assert build.layers[0].name == \"base\"\n assert build.layers[0].is_cached is False\n assert build.layers[0].is_layered is False\n assert build.layers[0].is_cached is False\n assert build.layers[0].is_layered is False\n assert build.layers[0].is_cached is False\n assert build.layers[0].is_layered is False\n assert build.layers[0].is_cached is False\n assert build.layers[0].is_layered is False\n assert build.layers[0].is_cached is False\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "\"challet\"", + "got": "\"myproject\"", + "got_raw": " \"myproject\"\n assert data[\"target_image\"][\"cmd\"] == \"/bin/bash\"\n assert data[\"target_image\"][\"environment\"] == {\"X\": \"Y\"}\n assert data[\"target_image\"][\"labels\"] == {\"key\": \"value\"}\n assert data[\"target_image\"][\"working_dir\"] == \"/path\"\n\n assert data[\"ansible_bender\"][\"base_image\"] == \"quay.io/biocontainers/python:3\"\n assert data[\"ansible_bender\"][\"verbose_layer_names\"]\n assert data[\"ansible_bender\"][\"working_container\"][\"volumes\"] == [f\"{playbook_dir}:/src:Z\"]\n\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "\"y\"", + "got": "\"y\"", + "got_raw": " \"y\"\n assert inspect_data[\"Config\"][\"Env\"] == [\"asd=\" + data_dir]\n assert inspect_data[\"Config\"][\"WorkingDir\"] == data_dir\n assert inspect_data[\"Config\"][\"Entrypoint\"] == [\"python\"]\n assert inspect_data[\"Config\"][\"Cmd\"] == [\"-c\", \"print('hello world')\"]\n assert inspect_data[\"Config\"][\"Labels\"][\"io.buildah.version\"] == \"1.12.0\"\n assert inspect_data[\"Config\"][\"Labels\"][\"io.buildah.system\"] == \"ansible-bender\"\n assert inspect_data[\"Config\"][\"Labels\"][\"io.buildah.builder\"] ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "0", + "got": "1", + "got_raw": "1\n assert build.build_volumes[0] == {\n \"src\": \"/tmp/playbook-and-inventory\",\n \"dest\": \"/src\"\n }\n\n assert build.builder_name == \"buildah\"\n assert build.cache_tasks == False\n\n assert build.working_container == {\n \"user\": \"1000\",\n \"volumes\": [\n {\n \"src\": \"/tmp/playbook-and-inventory\",\n \"dest\": \"/src\"\n }\n ]\n }\n\n assert build.working_dir == \"/src\"\n\n assert build.ansible_connection == \"local\"\n assert build.ansible", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ansible-community/ansible-bender", + "expected": "cmd_e", + "got": "cmd_e", + "got_raw": " cmd_e\n assert co[\"Entrypoint\"] == entrypoint_e\n assert co[\"ExposedPorts\"] == {p_80: {}, p_443: {}}\n assert co[\"Volumes\"] == [runtime_volume]\n assert co[\"User\"] == \"0\"\n assert co[\"Hostname\"] == \"ab-\" + random_word(8)\n\n\ndef test_build_basic_image_with_all_params_no_cache(tmpdir, target_image):\n workdir_path = \"/etc\"\n l_a_b = \"A=B\"\n l_x_y = \"x=y\"\n e_a_b = \"A=B\"\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "snapshot( { \"anyOf\": [ {\"type\": \"string\"}, { \"type\": \"integer\", \"description\": \"{minimum: 1}\", }, ] } )", + "got": "{", + "got_raw": " {\n \"type\": \"string\",\n \"anyOf\": [\n {\"type\": \"string\"},\n {\"type\": \"integer\", \"minimum\": 1},\n ]\n }\n\ndef test_oneof_schema():\n schema = {\n \"oneOf\": [\n {\"type\": \"string\"},\n {\"type\": \"integer\", \"minimum\": 1},\n ]\n }\n result = transform_schema(schema)\n\n assert result == {\n \"type\": \"string\",\n \"oneOf\": [\n {\"type\": \"string\"},\n {\"type\": \"integer\", \"minimum\": 1},\n ]\n }\n\n", + "exact_match": false, + "code_bleu": 0.022869367596206176, + "edit_similarity": 0.019230769230769232, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "obj2", + "got": "1", + "got_raw": "1\n assert obj2 == 2\n\n assert obj1 is not obj2\n\n assert obj1 is not None\n assert obj2 is not None\n\n assert obj1 is not obj1\n assert obj2 is not obj2\n\n assert obj1 is not obj2\n assert obj2 is not obj1\n\n assert obj1 is not obj1\n assert obj2 is not obj2\n\n assert obj1 is not obj2\n assert obj2 is not obj1\n\n assert obj1 is not obj1\n assert obj2 is not obj2\n\n assert obj", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "custom_schema", + "got": "custom_schema", + "got_raw": " custom_schema\n\n def test_custom_input_schema_with_model(self) -> None:\n class SomeModel(BaseModel):\n x: int\n\n def some_function(model: SomeModel) -> str:\n return str(model.x * 2)\n\n custom_schema: InputSchema = {\n \"additionalProperties\": False,\n \"type\": \"object\",\n \"properties\": {\"x\": {\"type\": \"number\", \"description\": \"A number to double\"}},\n \"required\": [\"x\"],\n }\n\n function_tool = beta_tool(some_function, input_schema=custom_schema)\n\n\n assert function_tool.input_schema == custom_schema", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "snapshot({\"type\": \"string\"})", + "got": "{\"type\": \"str\", \"format\": None}", + "got_raw": " {\"type\": \"str\", \"format\": None}\n\n\ndef test_string_schema_with_format():\n schema = {\"type\": \"string\", \"format\": \"email\"}\n result = transform_schema(schema)\n\n assert result == {\"type\": \"str\", \"format\": \"email\"}\n\n\ndef test_string_schema_with_format_and_pattern():\n schema = {\"type\": \"string\", \"format\": \"email\", \"pattern\": r\"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$\"}\n result = transform_schema(schema)\n\n assert result == ", + "exact_match": false, + "code_bleu": 0.2777619034011791, + "edit_similarity": 0.5084745762711864, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "snapshot({\"type\": \"null\"})", + "got": "", + "got_raw": " # pyright: ignore[reportUnknownMemberType]\n assert result == # pyright: ignore[reportUnknownMemberType]\n assert result == # pyright: ignore[reportUnknownMemberType]\n assert result == # pyright: ignore[reportUnknownMemberType]\n assert result == # pyright: ignore[reportUnknownMemberType]\n assert result == # pyright: ignore[reportUnknownMemberType]\n assert result == # pyright: ignore[reportUnknownMemberType]\n assert result == # pyright: ignore[reportUnknownMemberType]\n assert result == ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "\"json_schema\"", + "got": "\"json_schema\"", + "got_raw": " \"json_schema\"\n assert body[\"output_config\"][\"format\"][\"schema\"] == {\"type\": \"object\"}\n\n def test_create_converts_output_format_to_output_config_with_output_schema(self, client: Anthropic, respx_mock: MockRouter) -> None:\n \"\"\"Verify .create() converts output_format to output_config.format in request body.\"\"\"\n respx_mock.post(\"/v1/messages?beta=true\").mock(\n return_value=httpx.Response(\n 200,\n json={\n \"id\": \"msg_123\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "{\"prop\": None}", + "got": "", + "got_raw": " # type: ignore[no-any-return]\n assert await transform({\"required_prop\": None}, DateDictWithRequiredAlias, use_async) == # type: ignore[no-any-return]\n assert await transform({\"required_prop\": None}, DateDictWithRequiredAlias, use_async) == # type: ignore[no-any-return]\n assert await transform({\"required_prop\": None}, DateDictWithRequiredAlias, use_async) == # type: ignore[no-any-return]\n assert await transform({\"required_prop\": None}, DateDictWithRequiredAlias, use_async) == # type: ignore[no-any-return", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "\"foo\"", + "got": "\"foo\"", + "got_raw": " \"foo\"\n assert foo(b=\"foo\") == \"foo\"\n assert foo(a=\"foo\", b=\"bar\") == \"foo\"\n assert foo(b=\"bar\", a=\"foo\") == \"foo\"\n assert foo(a=\"foo\", b=\"bar\", c=\"baz\") == \"foo\"\n assert foo(b=\"bar\", a=\"foo\", c=\"baz\") == \"foo\"\n assert foo(b=\"bar\", c=\"baz\", a=\"foo\") == \"foo\"\n assert foo(c=\"baz\", a=\"foo\", b=\"bar\") == \"foo\"\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "\"in[]=foo&in[]=bar\"", + "got": "", + "got_raw": " # type: ignore\n assert unquote(serialise({\"in\": [\"foo\", \"bar\", \"baz\"]})) == # type: ignore\n assert unquote(serialise({\"in\": [\"foo\", \"bar\", \"baz\", \"qux\"]})) == # type: ignore\n assert unquote(serialise({\"in\": [\"foo\", \"bar\", \"baz\", \"qux\", \"quux\"]})) == # type: ignore\n assert unquote(serialise({\"in\": [\"foo\", \"bar\", \"baz\", \"qux\", \"quux\", \"quuz\"]})) == ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "\"8\"", + "got": "8", + "got_raw": "8\n\n def test_function_call_with_invalid_input(self) -> None:\n def add_numbers(a: int, b: int) -> str:\n \"\"\"Add two numbers together.\"\"\"\n return str(a + b)\n\n function_tool = beta_tool(add_numbers)\n with pytest.raises(TypeError):\n function_tool.call({\"a\": \"five\", \"b\": 3})\n\n def test_function_call_with_invalid_input_type(self) -> None:\n def add_numbers(a: int, b: int) -> str:\n \"\"\"Add two numbers together.\"\"\"\n return str(a + b)\n\n function_tool = beta_tool(add_numbers)\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "type(None)", + "got": "", + "got_raw": " # type: ignore[no-any-return]\n assert extract_type_var_from_base(typ, index=2, generic_bases=generic_bases) == # type: ignore[no-any-return]\n assert extract_type_var_from_base(typ, index=2, generic_bases=generic_bases) == # type: ignore[no-any-return]\n\n assert extract_type_var_from_base(typ, index=3, generic_bases=generic_bases) == # type: ignore[no-any-return]\n assert extract_type_var_from_base(typ, index=3, generic_bases=generic_bases) == # type: ignore[no-any-return", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "checking_client.beta.messages.tool_runner)", + "got": "", + "got_raw": "\n\n\n# File: examples/tools.py\nfrom __future__ import annotations\n\nfrom typing import Any, Dict, List, Optional, cast\n\nfrom anthropic import Anthropic\nfrom anthropic.lib.tools import BetaAbstractMemoryTool\nfrom anthropic.types.beta import (\n BetaMessageParam,\n BetaContentBlockParam,\n BetaMemoryTool20250818Command,\n BetaContextManagementConfigParam,\n BetaMemoryTool20250818ViewCommand,\n BetaMemoryTool20250818CreateCommand,\n BetaMemoryTool20250818Delete", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "\"a[b]=c\"", + "got": "", + "got_raw": " # noqa: ARG001\n \"a%5B%7B%22b%22%3A%22c%22%7D%5D\"\n\n assert unquote(stringify({\"a\": {\"b\": \"c\"}})) == # noqa: ARG001\n \"a%5B%7B%22b%22%3A%22c%22%7D%5D\"\n\n assert unquote(stringify({\"a\": {\"b\": \"c\"}})) == # noqa: ARG001\n \"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "snapshot( { \"type\": \"string\", \"description\": \"\"\"\\ User email {default: user@example.com}\\ \"\"\", \"format\": \"email\", } )", + "got": "{", + "got_raw": " {\n \"type\": \"string\",\n \"format\": \"email\",\n \"default\": \"user@example.com\",\n \"description\": \"User email\",\n }\n\ndef test_string_schema_with_format_and_default_and_required():\n schema = {\n \"type\": \"string\",\n \"format\": \"email\",\n \"default\": \"user@example.com\",\n \"description\": \"User email\",\n \"required\": True,\n }\n result = transform_schema(schema)\n\n assert result == {\n \"type\": \"string\",\n \"format\": \"email\",\n \"default\": \"user@example.com\",\n \"description\":", + "exact_match": false, + "code_bleu": 0.031294924079018974, + "edit_similarity": 0.01694915254237288, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "{\"foo\": \"bar\"}", + "got": "{\"foo\": \"bar\"}", + "got_raw": " {\"foo\": \"bar\"}\n\ndef test_removes_files_from_input_with_paths() -> None:\n query = {\"foo\": \"bar\", \"files\": [\"foo.txt\"]}\n assert extract_files(query, paths=[\"foo.txt\"]) == []\n\n assert query == {\"foo\": \"bar\"}\n\ndef test_removes_files_from_input_with_paths_and_files() -> None:\n query = {\"foo\": \"bar\", \"files\": [\"foo.txt\"]}\n assert extract_files(query, paths=[\"foo.txt\"]) == []\n\n assert query == {\"foo\": \"bar\"}\n\ndef test_removes_files_from_input_with_paths_and_files_and_files()", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "tracked_types", + "got": "", + "got_raw": " # type: ignore\n assert block_type in tracked_types # type: ignore\n\ndef test_basic_message_stream() -> None:\n router = MockRouter()\n\n router.post(\"/v1/messages\").respond(\n json=get_response(EXPECTED_BASIC_MESSAGE),\n headers={\"Content-Type\": \"application/json\"},\n )\n\n with sync_client as client:\n stream = BetaMessageStream(client, max_tokens=1024, model=\"claude-3-opus-latest\")\n events = list(stream)\n\n assert_basic_response(events, EXPECTED_BASIC_MESSAGE)\n\ndef test_tool_use_message_stream() -> None:\n router", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "profiles[0][\"region\"]", + "got": "\"us-east-2\"", + "got_raw": " \"us-east-2\"\n\ndef test_region_infer_from_env(\n mock_aws_config: None, # noqa: ARG001\n profiles: t.List[AwsConfigProfile],\n) -> None:\n client = AnthropicBedrock(\n aws_region=\"us-east-1\",\n )\n\n assert client.aws_region == \"us-east-1\"\n\ndef test_region_infer_from_env_with_default(\n mock_aws_config: None, # noqa: ARG001\n profiles: t.List[AwsConfigProfile],\n) -> None:\n client = AnthropicBedrock()\n\n assert", + "exact_match": false, + "code_bleu": 0.07142857142857142, + "edit_similarity": 0.1875, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "bytes", + "got": "ConcreteBaseAPIResponse", + "got_raw": " ConcreteBaseAPIResponse\n\ndef test_extract_response_type_concrete_subclasses_with_options() -> None:\n\n assert extract_response_type(ConcreteBaseAPIResponse, FinalRequestOptions) == ConcreteBaseAPIResponse\n\ndef test_extract_response_type_concrete_subclasses_with_options_and_base() -> None:\n\n assert extract_response_type(ConcreteBaseAPIResponse, FinalRequestOptions, BaseAPIResponse) == ConcreteBaseAPIResponse\n\ndef test_extract_response_type_concrete_subclasses_with_options_and_base_and_base() -> None:\n\n assert extract_response_type(ConcreteBaseAPIResponse, FinalRequestOptions, BaseAPIResponse, BaseAPIResponse) ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.21428571428571427, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "{\"foo\": \"bar\"}", + "got": "", + "got_raw": " # type: ignore[no-any-return]\n {\"foo\": \"bar\"}\n\n # bytes are left as-is\n\n assert await transform({\"foo\": b\"bar\"}, TypedDictBase64Input, use_async) == # type: ignore[no-any-return]\n {\"foo\": b\"bar\"}\n\n # pathlib.PathLike are left as-is\n\n assert await transform({\"foo\": SAMPLE_FILE_PATH}, TypedDictBase64Input, use_async) == # type: ignore[no-any-return]\n {\"foo\": SAMPLE_FILE_PATH}\n\n # io.IOBase are left as-is\n\n assert await transform", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "anthropics/anthropic-sdk-python", + "expected": "2", + "got": "2", + "got_raw": "2\n assert calls[0].response.status_code == 500\n assert calls[0].response.json() == {\"error\": \"server error\"}\n assert calls[0].response.headers[\"retry-after-ms\"] == \"10\"\n assert calls[1].response.status_code == 200\n assert calls[1].response.json() == {\"foo\": \"bar\"}\n\n @pytest.mark.respx()\n def test_messages_retries_with_retry_after_ms(self, respx_mock: MockRouter) -> None:\n request_url = \"https://region-aiplatform.googleapis.com/v1/projects", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "{}", + "got": "{}", + "got_raw": " {}\n\n def test_get_openapi_schema(self):\n \"\"\"Test get_openapi_schema with a simple schema.\"\"\"\n class PetIn(Schema):\n name = fields.String(required=True, validate=fields.Length(min=1, max=10))\n category = fields.String(required=True, validate=fields.OneOf(['dog', 'cat']))\n\n adapter = MarshmallowAdapter(PetIn())\n\n openapi_schema = adapter.get_openapi_schema()\n\n\n assert openapi_schema == {\n 'type': 'object',\n 'properties': {\n 'name': {\n 'type': 'string',\n 'required': True,\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "3", + "got": "3", + "got_raw": "3\n\n def test_validate_input_form(self):\n \"\"\"Test validate_input for form location.\"\"\"\n from flask import Flask\n from werkzeug.test import EnvironBuilder\n from flask import request\n\n app = Flask(__name__)\n app.config['VALIDATION_ERROR_STATUS_CODE'] = 422\n app.config['VALIDATION_ERROR_DESCRIPTION'] = 'Validation error'\n adapter = MarshmallowAdapter(PetSchema())\n\n with app.test_request_context():\n builder = EnvironBuilder(\n method='POST', data={'name': 'Fluffy', 'age': 3}, content_type='application/x-www-form", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "204", + "got": "204", + "got_raw": "204\n assert rv.data == b''\n\n rv = client.delete('/bar')\n\n assert rv.status_code == 204\n assert rv.data == b''\n\n rv = client.get('/openapi.json')\n assert rv.status_code == 200\n osv.validate(rv.json)\n assert 'content' not in rv.json['paths']['/foo']['delete']['responses']['204']\n assert 'content' not in rv.json['paths']['/bar']['delete']['responses']['204']\n\n\ndef test_output_with_empty_dict_as_schema_and_spec(app, client):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "200", + "got": "200", + "got_raw": "200\n assert rv.mimetype == 'application/yaml'\n assert rv.data == b'{\"info\": {\"title\": \"APIFlask\", \"version\": \"0.1.0\"}, \"tags\": [], \"paths\": {}, \"openapi\": \"3.0.3\"}\\n'\n\n\ndef test_yaml_spec_with_custom_path():\n app = APIFlask(__name__, spec_path='/custom.yaml')\n app.config['SPEC_FORMAT'] = 'yaml'\n client = app.test_client()\n\n rv = client.get('/custom.yaml')\n\n assert rv.status_code == 200\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "100", + "got": "10", + "got_raw": "10\n assert rv.json['total'] == 2000\n assert rv.json['next'] == '/pets?page=2&per_page=20'\n assert rv.json['prev'] == ''\n assert rv.json['current'] == '/pets?page=1&per_page=20'\n assert rv.json['first'] == '/pets?page=1&per_page=20'\n assert rv.json['last'] == '/pets?page=100&per_page=20'\n assert rv.json['current'] == '/pets?page=1&per_page=20'\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "result.output", + "got": "rv.data.decode('utf-8')", + "got_raw": " rv.data.decode('utf-8')\n else:\n assert '\"title\": \"APIFlask\",' in rv.data.decode('utf-8')\n\n\ndef test_spec_format_default(app, client, cli_runner):\n result = cli_runner.invoke(spec_command)\n rv = client.get('/openapi.json')\n assert rv.status_code == 200\n assert '\"title\": \"APIFlask\",' in rv.data.decode('utf-8')\n\n\ndef test_spec_format_default_with_config(app, client, cli_runner):\n app.config['SPEC_FORMAT'] = 'yaml'\n result = cli_runner.invoke(spec_command)\n rv =", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.2777777777777778, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "servers", + "got": "assert rv.json['info']['contact'] == contact", + "got_raw": "<|fim_suffix|>\n assert rv.json['info']['contact'] == contact\n assert rv.json['info']['license'] == license\n assert rv.json['info']['termsOfService'] == terms_of_service\n assert rv.json['info']['externalDocs'] == external_docs\n assert rv.json['servers'] == servers\n<|fim_middle|>servers\n assert rv.json['info']['description'] == description", + "exact_match": false, + "code_bleu": 0.08032276872815308, + "edit_similarity": 0.19607843137254902, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "'tags'", + "got": "'tags'", + "got_raw": " 'tags'\n assert rv.json['paths']['/users']['get']['parameters'][0]['in'] == 'query'\n assert rv.json['paths']['/users']['get']['parameters'][0]['schema']['type'] == 'string'\n assert rv.json['paths']['/users']['get']['parameters'][0]['schema']['format'] == 'delimited-list'\n assert rv.json['paths']['/users']['get']['parameters'][0]['schema']['items']['type'] == 'string'\n assert rv.json['paths']['/users']['get']['parameters'][0]['schema']['items']['format'] == 'delimited-list", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "app.info['description']", + "got": "assert rv.json['info']['contact']['name'] == 'API Support'", + "got_raw": "<|fim_suffix|>\n assert rv.json['info']['contact']['name'] == 'API Support'\n assert rv.json['info']['contact']['url'] == 'http://www.example.com/support'\n assert rv.json['info']['contact']['email'] == 'support@example.com'\n assert rv.json['info']['license']['name'] == 'Apache 2.0'\n assert rv.json['info']['license']['url'] == 'http://www.apache.org/licenses/LICENSE-2.0.html'\n assert rv.json['info']['termsOfService'] == 'http://example.com'\n assert rv.json['info']['title'] ==", + "exact_match": false, + "code_bleu": 0.09147827112247602, + "edit_similarity": 0.19753086419753085, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "'foo'", + "got": "'foo'", + "got_raw": " 'foo'\n assert rv.json['paths']['/{foo}/bar']['get']['parameters'][0]['in'] == 'path'\n assert rv.json['paths']['/{foo}/bar']['get']['parameters'][0]['required'] == True\n assert rv.json['paths']['/{foo}/bar']['get']['parameters'][0]['schema']['$ref'] == '#/components/schemas/Foo'\n\n assert rv.json['paths']['/{foo}/{bar}']['get']['parameters'][0]['name'] == 'foo'\n assert rv.json['paths']['/{foo}/{bar}']['get']['parameters'][0]['in", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "123", + "got": "123", + "got_raw": "123\n assert rv.json['status'] == 'not_found'\n\n\ndef test_abort_with_http_error(app, client):\n @app.get('/bar')\n def bar():\n raise HTTPError(404, message='missing')\n\n rv = client.get('/bar')\n assert rv.status_code == 404\n assert rv.json['message'] == 'missing'\n assert rv.json['detail'] == {}\n assert rv.json['code'] == 404\n assert rv.json['status'] == 'not_found'\n\n\ndef test_abort_with_abort(app, client):\n @app.get('/", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "data", + "got": "data", + "got_raw": " data\n\n def test_serialize_output_file_schema(self):\n \"\"\"Test serialize_output with FileSchema.\"\"\"\n adapter = MarshmallowAdapter(FileSchema())\n\n data = {'file': 'data'}\n output = adapter.serialize_output(data)\n\n # FileSchema should pass through data unchanged\n\n assert output == data\n\n def test_serialize_output_schema(self):\n \"\"\"Test serialize_output with a schema.\"\"\"\n adapter = MarshmallowAdapter(Schema())\n\n data = {'any': 'data'}\n output = adapter.serialize_output(data)\n\n # Schema should pass through data unchanged\n\n assert output == data\n\n def test_serialize_output_schema", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "'Unknown'", + "got": "1234", + "got_raw": "1234\n\ndef test_get_reason_phrase():\n rv = get_reason_phrase(404, 'Not Found')\n\n assert rv == 'Not Found'\n\ndef test_pagination_builder():\n pagination = PaginationModel(\n total=100,\n pages=10,\n per_page=10,\n page=1,\n next_num=2,\n prev_num=10,\n has_next=True,\n has_prev=False\n )\n\n rv = pagination_builder(pagination)\n\n assert rv == {\n 'total': 100,\n 'pages': 10,\n 'per", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "{}", + "got": "rv.json['paths']['/bar']['get']['responses']['200']['content']['image/png'] ==", + "got_raw": "rv.json['paths']['/bar']['get']['responses']['200']['content']['image/png'] ==\n {'schema': {'$ref': '#/components/schemas/File'}})\n\n\n@pytest.mark.parametrize('schema', [{}, EmptySchema])\ndef test_empty_schema_with_file(app, client, schema):\n @app.route('/foo')\n @app.output(schema, status_code=204)\n def empty_reposonse():\n return ''\n\n @app.route('/bar')\n @app.output(schema, content_type='image/png')\n def empty_schema():\n return ''\n\n rv = client.get('/openapi.json", + "exact_match": false, + "code_bleu": 0.03925345689749394, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "content", + "got": "", + "got_raw": " # noqa: WPS432\n assert 'schema' in content['image/png']\n assert content['image/png']['schema']['type'] == 'string'\n assert content['image/png']['schema']['format'] == 'binary'\n\n rv = client.get('/openapi.yaml')\n assert rv.status_code == 200\n content = rv.json['paths']['/image']['get']['responses']['200']['content']\n\n assert 'image/png' in # noqa: WPS432\n assert 'schema' in content['image/png']\n assert content['image/png']['schema", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "201", + "got": "201", + "got_raw": "201\n assert rv.json == {'id': 123, 'name': 'foo'}\n\n rv = client.get('/baz', query_string={'id': 1})\n assert rv.status_code == 202\n assert rv.json == {'id': 123, 'name': 'baz'}\n\n rv = client.get('/baz', query_string={'id': 2})\n assert rv.status_code == 202\n assert rv.headers['Location'] == '/baz'\n\n rv = client.get('/baz', query_string={'id': 3})\n assert rv.status_code", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "['Parent']", + "got": "['parent']", + "got_raw": " ['parent']\n assert rv.json['paths']['/parent/child/']['get']['tags'] == ['parent', 'child']\n\n\n# File: src/apiflask/app.py\n *Version changed: 2.0.0*\n\n - Remove the deprecated `redoc_path` parameter.\n\n *Version changed: 1.2.0*\n\n - Add `spec_plugins` parameter.\n\n *Version changed: 1.1.0*\n\n - Add `docs_ui` parameter.\n\n *Version changed: 0.7.0*\n\n - Add `openapi_blueprint_url_prefix` parameter", + "exact_match": false, + "code_bleu": 0.49999999999999994, + "edit_similarity": 0.9, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "200", + "got": "200", + "got_raw": "200\n assert rv.data == b'Hello, World!'\n\n@pytest.mark.parametrize('client', examples, indirect=True)\ndef test_say_hello_with_name(client):\n rv = client.get('/?name=John')\n\n assert rv.status_code == 200\n assert rv.data == b'Hello, John!'\n\n@pytest.mark.parametrize('client', examples, indirect=True)\ndef test_say_hello_with_name_and_age(client):\n rv = client.get('/?name=John&age=25')\n\n assert rv.status_code == 200\n assert rv.data == b'Hello,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "TypeError)", + "got": "InvalidSchema):", + "got_raw": "InvalidSchema):\n osv.validate_spec(app.spec)\n\n elif base_schema == None:\n\n with pytest.raises(InvalidSchema):\n osv.validate_spec(app.spec)\n\n else:\n\n osv.validate_spec(app.spec)\n\n\n@pytest.mark.parametrize(\n 'base_response_data_key',\n [\n 'data',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n 'data_key',\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.16, + "n_retrieved": 10 + }, + { + "repo": "apiflask/apiflask", + "expected": "1", + "got": "1", + "got_raw": "1\n param = params[0]\n assert param['name'] == 'enum'\n assert param['in'] == 'query'\n assert param['schema'] == {\n 'type': 'string',\n 'enum': ['foo', 'bar', 'baz'],\n }\n\n def test_schema_to_parameters_with_list(self):\n \"\"\"Test schema_to_parameters handles list validation.\"\"\"\n helper = OpenAPIHelper()\n schema = ListSchema()\n\n params = helper.schema_to_parameters(schema, location='query')\n\n\n assert len(params) == 1\n param = params[0]\n assert param['name'] ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "email_change.new_value", + "got": "email_change.new_value", + "got_raw": " email_change.new_value\n assert user.email_changed_at is not None\n assert user.email_changed_by == user\n assert user.email_changed_at > user.email_changed_at\n assert user.email_changed_at > time.time() - 10\n\n return assertion\n\ndef test_register_email_signer():\n user = User.objects.create(username=\"test\", email=\"test@example.com\")\n email_change = EmailChange.objects.create(user=user, new_value=\"test2@example.com\")\n signer = RegisterEmailSigner(\n {\n \"user_id\": user.pk,\n \"email\": email_change.new_value,\n }\n )\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "response)", + "got": "200, response)", + "got_raw": "200, response)\n\n\ndef test_retrieve_not_authenticated(\n settings_minimal,\n api_view_provider,\n api_factory,\n):\n request = api_factory.create_get_request()\n response = api_view_provider.view_func(request)\n\n assert_response_is_ok(401, response)\n\n\ndef test_retrieve_not_authenticated_with_token(\n settings_minimal,\n api_view_provider,\n api_factory,\n):\n request = api_factory.create_get_request()\n request.META['HTTP_AUTHORIZATION'] = 'Token 1234567890'\n response = api_view_provider.view_func(request)\n\n assert", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.782608695652174, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "1", + "got": "1", + "got_raw": "1\n assert signal_sent.call_args[0][0] == user\n assert signal_sent.call_args[1] == {\"request\": request}\n\n assert_response_status_is_ok(response)\n\n\ndef test_bad_request_signal(\n settings_with_register_verification,\n api_view_provider,\n api_factory,\n inactive_user,\n):\n user = inactive_user\n assert not user.is_active\n request = prepare_request(api_factory, user)\n\n with patch(\"rest_registration.signals.user_activated.send\") as signal_sent:\n response = api_view_provider.view_func(request)\n\n assert signal_sent.call_count == 0\n\n assert_response_status", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "302", + "got": "302", + "got_raw": "302\n assert response['Location'] == SUCCESS_URL\n\n user.refresh_from_db()\n assert user.is_active\n\n\ndef test_bad_request(\n settings_with_verification_redirects_urls,\n settings_with_register_verification_redirects,\n view_provider,\n http_client,\n inactive_user,\n signed_data,\n):\n user = inactive_user\n assert not user.is_active\n response = http_client.get(view_provider.view_url, data=signed_data)\n\n assert response.status_code == 302\n assert response['Location'] == FAILURE_URL\n\n user.refresh_from_db()\n assert not user.is_active\n\n\ndef", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "[JWTAuthentication]", + "got": "", + "got_raw": " # type: ignore\n [\n \"tests.testapps.custom_authtokens.auth.JWTAuthentication\",\n ]\n\n assert api_settings.DEFAULT_PERMISSION_CLASSES == # type: ignore\n [\n \"rest_registration.permissions.AllowAny\",\n ]\n\n assert api_settings.DEFAULT_RENDERER_CLASSES == # type: ignore\n [\n \"rest_framework.renderers.JSONRenderer\",\n ]\n\n assert api_settings.DEFAULT_PARSER_CLASSES == # type: ignore\n [\n \"rest_framework.parsers.JSONParser\",\n ]\n\n assert api_settings.DEFAULT_THROTTLE_RATES == # type: ignore\n {\n \"default\": \"10", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "timer)", + "got": "0)", + "got_raw": "0)\n assert_no_url_in_text(sent_email.body, REGISTER_EMAIL_VERIFICATION_URL)\n assert_one_url_line_in_text(sent_email.body, VERIFICATION_FROM_EMAIL)\n assert_one_url_line_in_text(sent_email.body, str(timer))\n assert_one_url_line_in_text(sent_email.body, str(timer))\n assert_one_url_line_in_text(sent_email.body, str(timer))\n assert_one_url_line_in_text(sent_email.body, str(timer))\n assert_one_url_line_in_text(sent_email.body, str(timer))\n assert_one_url_line_in_text(sent_email.body, str(timer))\n assert_one_url_line_in_text(sent_email.body", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "\"Knuth\"", + "got": "\"Knuth\"", + "got_raw": " \"Knuth\"\n\ndef test_patch_names_not_authenticated(\n settings_minimal,\n api_view_provider,\n api_factory,\n):\n request = api_factory.create_patch_request(\n {\n \"first_name\": \"Donald\",\n \"last_name\": \"Knuth\",\n }\n )\n response = api_view_provider.view_func(request)\n assert response.status_code == 401\n\ndef test_patch_names_not_authenticated_with_token(\n settings_minimal,\n api_view_provider,\n api_factory,\n):\n request = api_factory.create_patch_request(\n {\n \"first_name\": \"Donald\",\n \"last_name\": \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "url)", + "got": "_url = build_custom_verification_url(sent_email.signer)", + "got_raw": "_url = build_custom_verification_url(sent_email.signer)\n assert_valid_verification_url(veri_url)\n assert_one_url_in_brackets_in_text(sent_email.body, veri_url)\n # Check verification time.\n assert timer.time_taken < 1.0\n\n\n@pytest.mark.django_db\n@override_rest_registration_settings(\n {\n \"USER_VERIFICATION_ID_FIELD\": \"username\",\n }\n)\ndef test_ok_with_username_as_verification_id_and_email(\n settings_with_register_verification,\n api_view_provider,\n api_factory,\n):\n # Using username is not recommended if it can change for a given user.\n data =", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.13559322033898305, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "[ ErrorCode.LOGIN_FIELDS_NOT_UNIQUE, ])", + "got": "1, ErrorCode.LOGIN_FIELDS_NOT_UNIQUE)", + "got_raw": "1, ErrorCode.LOGIN_FIELDS_NOT_UNIQUE)\n\n\n@override_rest_registration_settings({\n 'USER_LOGIN_FIELDS': ['email', 'username'],\n})\ndef test_when_all_login_fields_unique_then_check_passes():\n errors = simulate_checks()\n\n assert not errors\n\n\n@override_rest_registration_settings({\n 'USER_LOGIN_FIELDS': ['email', 'username'],\n 'USER_LOGIN_FIELDS_UNIQUE_CHECK_ENABLED': False,\n})\ndef test_when_login_fields_unique_check_disabled_then_check_passes():\n errors = simulate_checks()\n\n assert not errors\n\n\n@override_rest_registration_settings({\n 'USER_LOGIN_FIELDS': ['email', 'username'],\n 'USER_LOGIN_FIELDS_UNIQUE", + "exact_match": false, + "code_bleu": 0.38999497748983175, + "edit_similarity": 0.9210526315789473, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "new_email", + "got": "new_email", + "got_raw": " new_email\n assert_no_email_sent(sent_emails)\n\n\n@override_rest_registration_settings(\n {\n \"REGISTER_EMAIL_VERIFICATION_ENABLED\": True,\n }\n)\ndef test_verify_ok(\n user,\n email_change,\n api_view_provider,\n api_factory,\n):\n new_email = email_change.new_value\n request = api_factory.create_post_request(\n {\n \"email\": new_email,\n }\n )\n force_authenticate(request, user=user)\n with capture_sent_emails() as sent_emails:\n response = api_view_provider.view_func(request)\n assert_response_is_ok(response)\n user.refresh_from_db()\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "apragacz/django-rest-registration", + "expected": "expected_path", + "got": "expected_path", + "got_raw": " expected_path\n if signer_cls is None:\n signer_cls = URLParamsSigner\n signer = signer_cls(verification_data)\n if timer is not None:\n timer.start()\n try:\n signer.verify()\n except Exception as exc:\n pytest.fail(str(exc))\n if timer is not None:\n timer.stop()\n\n\ndef _parse_verification_url(url: str, expected_fields: Optional[Iterable[str]] = None) -> Tuple[str, Dict[str, str]]:\n parsed_url = urlparse(url)\n path = parsed_url.path\n query = parsed_url.query\n if expected_fields is not None:\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "mat_constrained_expected)", + "got": "", + "got_raw": " # type: ignore\n mat_constrained_expected, atol=1e-6)\n\ndef test_mat_to_xyz_unconstrained() -> None:\n \"\"\"Unit test for unconstrained Tait-Bryan angles and converting to rotation matrix.\"\"\"\n rotation_matrix: NDArrayFloat = np.array(\n [ # (45, 0, 90) about the xyz axes (roll, pitch, yaw).\n [0.0000000, -0.7071068, 0.7071068],\n [1.00000", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "3", + "got": "3", + "got_raw": "3\n assert polyline.waypoints[1].x == 4\n assert polyline.waypoints[1].y == 5\n assert polyline.waypoints[1].z == 6\n assert polyline.waypoints[2].x == 7\n assert polyline.waypoints[2].y == 8\n assert polyline.waypoints[2].z == 9\n assert polyline.waypoints[3].x == 9\n assert polyline.waypoints[3].y == 10\n assert polyline.waypoints[3].z == 11\n\n def test_from_array_with_z", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "range_m_expected", + "got": "10.0", + "got_raw": "10.0\n\n range_m_per_cell_expected = (0.1, 0.1, 0.1)\n\n assert ndgrid.range_m_per_cell == 0.1\n\n range_m_per_cell_expected = (10.0, 10.0, 10.0)\n\n assert ndgrid.range_m_per_cell == 10.0\n\n range_m_per_cell_expected = (10.0, 10.0, 10.0)\n\n assert ndgrid.range_m_per_cell == 10.0\n\n range_m_per_cell_expected =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "[93269500]", + "got": "93269500", + "got_raw": "93269500\n assert lane_segment.left_neighbor_id is None\n assert lane_segment.right_neighbor_id == 93269520\n\n def test_from_dict_with_missing_fields(self) -> None:\n \"\"\"Ensure object is generated correctly from a dictionary with missing fields.\"\"\"\n json_data = {\n \"id\": 93269421,\n \"is_intersection\": False,\n \"lane_type\": \"VEHICLE\",\n \"left_lane_boundary\": [\n {\"x\": 873.97, \"y\": -101.7", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.8888888888888888, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "(4, 4, 3)", + "got": "(grid_h, grid_w, 3)", + "got_raw": " (grid_h, grid_w, 3)\n assert np.all(bev_img_interp[0, 0] == RED_RGB)\n assert np.all(bev_img_interp[0, 3] == RED_RGB)\n assert np.all(bev_img_interp[3, 3] == BLUE_RGB)\n assert np.all(bev_img_interp[3, 0] == RED_RGB)\n\ndef test_interp_dense_grid_from_sparse_float() -> None:\n \"\"\"Interpolate *float* vals using linear interpolation, with color data points provided in 4 corners of a square.\n\n ___ __\n |Red ", + "exact_match": false, + "code_bleu": 0.38260294162784475, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "track_uuid_expected", + "got": "track_uuid_expected", + "got_raw": " track_uuid_expected\n\n assert cuboids.as_tensor(cuboid_mode=CuboidMode.XYZLWH_QWXYZ).shape == (\n 1000,\n 10,\n )\n\n assert cuboids.as_tensor(cuboid_mode=CuboidMode.XYZLWH_QWXYZ).shape == (\n 1000,\n 10,\n )\n\n assert cuboids.as_tensor(cuboid_mode=CuboidMode.XYZLWH_QWXYZ).shape == (\n 1000,\n 10,\n )\n\n assert cuboids.as_tensor(cuboid_mode", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "2", + "got": "2", + "got_raw": "2\n assert polyline.waypoints[0].x == 874.01\n assert polyline.waypoints[0].y == -105.15\n assert polyline.waypoints[0].z == -19.58\n assert polyline.waypoints[1].x == 890.58\n assert polyline.waypoints[1].y == -104.26\n assert polyline.waypoints[1].z == -19.58\n\n def test_from_json_data(self) -> None:\n \"\"\"Ensure object is generated correctly from a", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "timestamp_ns_expected", + "got": "315968663259918000", + "got_raw": "315968663259918000\n\ndef test_sweep_from_feather_with_missing_data(dummy_sweep: Sweep) -> None:\n \"\"\"Test loading a sweep from a feather file with missing data.\"\"\"\n xyz_expected: NDArrayFloat = np.array(\n [[-22.1875, 20.484375, 0.55029296875], [-20.609375, 19.1875, 1.30078", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "np.dtype(np.uint8)", + "got": "assert cropped_video.dtype == np.uint8", + "got_raw": "<|fim_suffix|>\n assert cropped_video.dtype == np.uint8\n\n assert np.allclose(cropped_video, video)\n\ndef test_crop_video_to_even_dims_with_odd_dims() -> None:\n \"\"\"Ensure we can crop a video tensor along the height and width dimensions to assure even dimensions.\n\n Dummy data is 55 frames of (501,501) RGB video.\n \"\"\"\n video: NDArrayByte = generate_dummy_rgb_video(N=55, H=501, W=501)\n\n cropped_video = video_utils.crop_video_to_even_dims(video)\n\n assert cropped_video.shape == (", + "exact_match": false, + "code_bleu": 0.31239399369202553, + "edit_similarity": 0.5357142857142857, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "lidar_tensor[:, 1:3])", + "got": "assert_close(lidar.as_tensor(), lidar_tensor)", + "got_raw": "<|fim_suffix|>\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as_tensor(), lidar_tensor)\n\n assert_close(lidar.as", + "exact_match": false, + "code_bleu": 0.14991106946711685, + "edit_similarity": 0.3939393939393939, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "4", + "got": "drivable_area.area_boundary[0].x, drivable_area.area_boundary[0].y, drivable_area.area_boundary[0].z) == (905.09, -148.95, -19.19)", + "got_raw": "drivable_area.area_boundary[0].x, drivable_area.area_boundary[0].y, drivable_area.area_boundary[0].z) == (905.09, -148.95, -19.19)\n assert (drivable_area.area_boundary[1].x, drivable_area.area_boundary[1].y, drivable_area.area_boundary[1].z) == (919.48, -150.0, -18.86)\n assert (drivable_area.area_boundary[2].x, drivable_area.area_boundary", + "exact_match": false, + "code_bleu": 0.0266785298043081, + "edit_similarity": 0.015267175572519083, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "IndexError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n cuboid_list[5:10]\n\n with pytest.raises(NotImplementedError):\n cuboid_list[5:10:2]\n\n with pytest.raises(NotImplementedError):\n cuboid_list[5:10:2, 10:20]\n\n with pytest.raises(NotImplementedError):\n cuboid_list[5:10, 10:20:2]\n\n with pytest.raises(NotImplementedError):\n cuboid_list[5:10, 10:20:2, 10:20]\n\n with", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "expected_result_identity", + "got": "0.0 <= expected_result_identity <= 0.01", + "got_raw": "0.0 <= expected_result_identity <= 0.01\n assert 0.0 <= expected_result_det <= 0.01\n\n summary_identity = _get_summary_identity()\n summary_det = _get_summary_assignment()\n\n assert summary_identity[\"ATE\"][\"translation\"][\"mean\"] == pytest.approx(\n expected_result_identity\n )\n assert summary_det[\"ATE\"][\"translation\"][\"mean\"] == pytest.approx(\n expected_result_det\n )\n\ndef test_rotation_error() -> None:\n \"\"\"Test that ATE is 0 for the self-compared results.\"\"\"\n expected_result_identity: float = 0", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.7619047619047619, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "city_SE3_ego_expected.rotation.matrix())", + "got": "Se3.from_quaternion(quat_wxyz_tensor), city_SE3_ego)", + "got_raw": "Se3.from_quaternion(quat_wxyz_tensor), city_SE3_ego)\n\ndef test_tensor_from_frame() -> None:\n \"\"\"Test converting a data-frame into a tensor.\"\"\"\n frame = _build_dummy_frame()\n\n quat_wxyz_tensor = torch.as_tensor(\n frame[list(QWXYZ_COLUMNS)].to_numpy().astype(np.float32)\n )\n translation = torch.as_tensor(\n frame[list(TRANSLATION_COLUMNS)].to_numpy().astype(np.float32)\n )\n quat_wxyz = Quaternion(quat_wxyz_tensor)\n rotation = So3(quat_wxyz)\n city_SE3_ego", + "exact_match": false, + "code_bleu": 0.17747405280050263, + "edit_similarity": 0.2826086956521739, + "n_retrieved": 10 + }, + { + "repo": "argoverse/av2-api", + "expected": "None", + "got": "assert mod.tag_version_from_ref(\"refs/tags/v0.1.0\") == \"0.1.0\"", + "got_raw": "<|fim_suffix|>\n assert mod.tag_version_from_ref(\"refs/tags/v0.1.0\") == \"0.1.0\"\n\ndef test_tag_version_from_ref_v_prefix() -> None:\n mod = _load_module()\n\n assert mod.tag_version_from_ref(\"refs/tags/v0.1.0\") == \"0.1.0\"\n assert mod.tag_version_from_ref(\"refs/tags/v0.1.0.1\") == \"0.1.0.1\"\n assert mod.tag_version_from_ref(\"refs/tags/v0.1.0.1.2\") == \"0.1.0", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "arogozhnikov/einops", + "expected": "x.dtype", + "got": "x.dtype", + "got_raw": " x.dtype\n assert result.shape == x.shape\n\ndef test_rearrange_consistency_numpy_2():\n shape = [1, 2, 3, 5, 7, 11]\n x = np.arange(np.prod(shape)).reshape(shape)\n for pattern in [\n \"a b c d e f -> a b c d e f\",\n \"b a c d e f -> a b d e f c\",\n \"a b c d e f -> f e d c b a\",\n \"a b c d e f -> (f e) d (c b a)\",\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "arogozhnikov/einops", + "expected": "(10 * 30 * 40, 10)", + "got": "2 * tuple(x.shape[1:])", + "got_raw": "2 * tuple(x.shape[1:])\n\n def test7(x):\n # parsing parameters\n t = rearrange(x, \"b c h w -> (b h w) c\")\n t = t[:, ::2] # replacement for dot-product, just changes size of second axis\n\n assert tuple(t.shape) == 2 * tuple(x.shape[1:])\n\n def test8(x):\n # parsing parameters\n t = rearrange(x, \"b c h w -> (b h w) c\")\n t = t[:, ::2] # replacement for dot-product, just changes size", + "exact_match": false, + "code_bleu": 0.1235622127262679, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "arogozhnikov/einops", + "expected": "einops.EinopsError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n einops.repeat(np.ones((2, 3, 4)), 'b c h w -> b c h w c', c=2)\n\n with pytest.raises(NotImplementedError):\n einops.repeat(np.ones((2, 3, 4)), 'b c h w -> b c h w c', c=2)\n\n with pytest.raises(NotImplementedError):\n einops.repeat(np.ones((2, 3, 4)), 'b c h w -> b c h w c', c=2)\n\n with pytest.raises(NotImplementedError):\n einops.repeat", + "exact_match": false, + "code_bleu": 0.3388507513536918, + "edit_similarity": 0.45, + "n_retrieved": 10 + }, + { + "repo": "arogozhnikov/einops", + "expected": "EinopsError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n _EinmixDebugger(\"b c h w -> b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\", \"b c h w\",", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.48484848484848486, + "n_retrieved": 10 + }, + { + "repo": "arogozhnikov/einops", + "expected": "result[2, 3, 1]", + "got": "12", + "got_raw": "12\n assert x2[0, 1, 2] == 6\n assert x2[0, 2, 0] == 0\n\n assert result[1, 2] == 12\n assert result[0, 1] == 6\n assert result[0, 0] == 0\n\n x2 = np.arange(2 * 3 * 4).reshape([2, 3, 4])\n result = rearrange(x2, \"a b c -> b c a\")\n\n assert x2[1, 2", + "exact_match": false, + "code_bleu": 0.0625, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "arogozhnikov/einops", + "expected": "(10, 10, 30, 40)", + "got": "(10, 10, 30, 40)", + "got_raw": " (10, 10, 30, 40)\n\n # parsing pattern\n t = rearrange(x, \"b c h w -> (b h w) c\")\n t = t[:, ::2] # replacement for dot-product, just changes size of second axis\n assert tuple(t.shape) == (10 * 30 * 40, 10)\n\n y = rearrange(t, \"(b h w) c2 -> b c2 h w\", **parse_shape(x, \"b _ h w\"))\n\n assert tuple(y.shape) == (1", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "arogozhnikov/einops", + "expected": "dict(a=1, b=20, c=30, d=40)", + "got": "10", + "got_raw": "10\n assert parsed2 != 10\n\n assert parsed1[\"a\"] == parsed2[\"a\"] == 10\n assert parsed1[\"b\"] == parsed2[\"b\"] == 20\n assert parsed1[\"c\"] == parsed2[\"c\"] == 30\n assert parsed1[\"d\"] == parsed2[\"d\"] == 40\n\n assert parsed1[\"a\"] == parsed2[\"a\"] == 10\n assert parsed1[\"b\"] == parsed2[\"b\"] == 20\n assert parsed1[\"c\"] ==", + "exact_match": false, + "code_bleu": 0.027777777777777776, + "edit_similarity": 0.13793103448275862, + "n_retrieved": 10 + }, + { + "repo": "arogozhnikov/einops", + "expected": "ValueError, match=r\"^Einsum pattern\")", + "got": "NotImplementedError, match=r\"^Invalid axis name\"):", + "got_raw": "NotImplementedError, match=r\"^Invalid axis name\"):\n einsum(\n create_tensor(5, 1),\n \"i j -> i\",\n )\n\n with pytest.raises(NotImplementedError, match=r\"^Invalid axis name\"):\n einsum(\n create_tensor(5, 1),\n \"i j -> i j\",\n )\n\n with pytest.raises(NotImplementedError, match=r\"^Invalid axis name\"):\n einsum(\n create_tensor(5, 1),\n \"i j -> i j k\",\n )\n\n with pytest.raises(NotImplementedError, match=r\"^Invalid axis name\"):\n", + "exact_match": false, + "code_bleu": 0.46713797772820004, + "edit_similarity": 0.5287356321839081, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "second_id", + "got": "assert first_id != second_id", + "got_raw": "<|fim_suffix|>\n assert first_id != second_id\n\ndef test_get_anonymous_id_returns_random_id_if_no_cache() -> None:\n # Clear the cache before the first call\n import askui.telemetry.anonymous_id\n\n askui.telemetry.anonymous_id._anonymous_id = None\n\n # First call to get_anonymous_id will generate a new ID\n first_id = get_anonymous_id()\n\n # Second call should generate a different ID\n second_id = get_anonymous_id()\n\n assert first_id != second_id\n\ndef test_get_anonymous_id_returns_random_id_if_no_cache_and_no_device_id()", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.4864864864864865, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "1", + "got": "1", + "got_raw": "1\n assert cache_writer.messages[0].role == \"assistant\"\n assert isinstance(cache_writer.messages[0].content, list)\n assert len(cache_writer.messages[0].content) == 1\n assert cache_writer.messages[0].content[0].type == \"tool_use\"\n assert cache_writer.messages[0].content[0].id == \"test_id\"\n assert cache_writer.messages[0].content[0].name == \"test_tool\"\n assert cache_writer.messages[0].content[0].input == {\"param\": \"value\"}\n assert cache_writer.messages[0].content[0", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "entry", + "got": "", + "got_raw": " # noqa: E721\n assert \"id\" in # noqa: E721\n assert \"input\" in # noqa: E721\n assert \"type\" in # noqa: E721\n assert \"tool_use\" in entry[\"type\"] # noqa: E721\n\n # Check tool use input\n input_data = entry[\"input\"]\n assert \"action\" in input_data # noqa: E721\n assert \"text\" in input_data # noqa: E721\n assert \"coordinate\" in", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "OSError)", + "got": "NotADirectoryError):", + "got_raw": "NotADirectoryError):\n load_image_source(path_fixtures_github_com__icon)\n\n with pytest.raises(NotADirectoryError):\n load_image_source(path_fixtures_github_com__icon / \"invalid_dir\")\n\n with pytest.raises(NotADirectoryError):\n load_image_source(path_fixtures_github_com__icon / \"invalid_dir\" / \"invalid_file.png\")\n\n with pytest.raises(NotADirectoryError):\n load_image_source(path_fixtures_github_com__icon / \"invalid_dir\" / \"invalid_file.png\" / \"invalid_file.png\")\n\n with pytest.raises(NotADirectoryError):\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.42857142857142855, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "rendered", + "got": "rendered", + "got_raw": " rendered\n assert \"\" in rendered\n assert \"\" in rendered\n assert \"\" in rendered\n\n # Verify all parts are present\n\n assert \"Test capability\" in rendered\n assert \"Test device\" in rendered\n assert \"Test UI\" in rendered\n assert \"Test report format\" in rendered\n assert \"Test rules\" in rendered\n\ndef test_act_system_prompt_renders_default_system_prompt() -> None:\n \"\"\"Test that ActSystemPrompt renders the default system prompt.\"\"\"\n prompt = ActSystemPrompt()\n\n rendered = str(prompt)\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "sorted(files)", + "got": "files", + "got_raw": " files\n\ndef test_list_resource_paths_desc(tmp_path: Path) -> None:\n files = [\"b.json\", \"a.json\", \"c.json\"]\n _create_json_files(tmp_path, files)\n result = list_resource_paths(tmp_path, ListQuery(order=\"desc\"))\n\n assert [f.name for f in result] == files[::-1]\n\ndef test_list_resource_paths_asc_non_json(tmp_path: Path) -> None:\n files = [\"b.json\", \"a.json\", \"c.json\"]\n _create_non_json_files(tmp_path, files)\n result = list_resource_paths(tmp_path, ListQuery(order=\"asc\"))\n\n", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.5555555555555556, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "scenario.tags", + "got": "[\"tag1\"]", + "got_raw": " [\"tag1\"]\n\n assert modified.steps == [ScenarioStep(keyword=\"Given\", text=\"something\")]\n\n assert modified.examples == []\n\ndef test_modify_scenario_full(\n create_tool: CreateScenarioTool,\n modify_tool: ModifyScenarioTool,\n feature: Feature,\n) -> None:\n scenario = create_tool(_create_params(feature.id))\n modified = modify_tool(\n scenario.id,\n _modify_params(\n name=\"OnlyName\",\n tags=[\"tag2\"],\n steps=[ScenarioStep(keyword=\"Then\", text=\"changed\")],\n examples=[ScenarioExample(name=\"ex1\", parameters={\"k\": \"v\"})", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "\"PNG\"", + "got": "1", + "got_raw": "1 # PNG format\n assert png_img.size == img.size\n\n # Test JPEG format\n jpeg_base64 = image_to_base64(img, format_=\"JPEG\")\n jpeg_img = base64_to_image(jpeg_base64)\n\n assert jpeg_img.format == 66 # JPEG format\n assert jpeg_img.size == img.size\n\n # Test GIF format\n gif_base64 = image_to_base64(img, format_=\"GIF\")\n gif_img = base64_to_image(gif_base64)\n\n assert gif_img.format == 71 #", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "[]", + "got": "0", + "got_raw": "0\n\ndef test_serialize_text_with_content(\n askui_serializer: AskUiLocatorSerializer,\n) -> None:\n text = Text(\"test\")\n result = askui_serializer.serialize(text)\n assert result[\"instruction\"] == \"text similar to \\\"test\\\"\"\n\n assert result[\"customElements\"] == 0\n\ndef test_serialize_text_with_content_and_threshold(\n askui_serializer: AskUiLocatorSerializer,\n) -> None:\n text = Text(\"test\", threshold=0.5)\n result = askui_serializer.serialize(text)\n assert result[\"instruction\"] == \"text similar to \\\"test\\\"\"\n\n assert result", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "\"\"", + "got": "0", + "got_raw": "0\n assert truncate_long_strings(\" \") == 1\n assert truncate_long_strings(\"a\") == 1\n assert truncate_long_strings(\"ab\") == 2\n assert truncate_long_strings(\"abc\") == 3\n assert truncate_long_strings(\"abcd\") == 4\n assert truncate_long_strings(\"abcde\") == 5\n assert truncate_long_strings(\"abcdef\") == 6\n assert truncate_long_strings(\"abcdefg\") == 7\n assert truncate_long_strings(\"abcdefgh\") == 8\n assert truncate_long_strings(\"abcdefghi\") == 9\n assert truncate_long", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "dumped", + "got": "dumped", + "got_raw": " dumped\n\ndef test_notgivenfield_deserialization() -> None:\n m = DummyModel(value=1)\n assert m.value == 1\n\n m = DummyModel(value=NOT_GIVEN)\n assert m.value == NOT_GIVEN\n\n with pytest.raises(ValidationError):\n DummyModel(value=\"not a number\")\n\ndef test_notgivenfield_deserialization_with_default() -> None:\n m = DummyModel(value=NOT_GIVEN)\n assert m.value == NOT_GIVEN\n\n m = DummyModel()\n assert m.value == 0\n\ndef test_notgivenfield_deserialization_with_default_and_not_given() -> None", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "mock_toolbox", + "got": "", + "got_raw": " # noqa: WPS437\n mock_toolbox\n\n # After setting toolbox, should be able to access it\n assert hasattr(tool, \"_toolbox\")\n\n assert tool._toolbox == # noqa: WPS437\n mock_toolbox\n\n\ndef test_execute_cached_execution_get_toolbox() -> None:\n \"\"\"Test that get_toolbox returns the toolbox reference.\"\"\"\n tool = ExecuteCachedTrajectory()\n mock_toolbox = MagicMock(spec=ToolCollection)\n\n tool.set_toolbox(mock_toolbox)\n\n # After setting toolbox, should be able to access it\n assert hasattr(tool, \"_toolbox", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "\"OnlyName\"", + "got": "\"OnlyName\"", + "got_raw": " \"OnlyName\"\n assert modified.description is None\n assert modified.tags == [\"tag1\", \"tag2\"]\n\ndef test_modify_feature_full(\n create_tool: CreateFeatureTool,\n modify_tool: ModifyFeatureTool,\n) -> None:\n feature = create_tool(_create_params())\n modified = modify_tool(feature.id, _modify_params())\n\n assert modified.name == \"Modified Feature\"\n assert modified.description == \"new desc\"\n assert modified.tags == [\"tag3\"]\n\ndef test_modify_feature_not_found(\n create_tool: CreateFeatureTool,\n modify_tool: ModifyFeatureTool,\n) -> None:\n with pytest", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "second_id", + "got": "second_id", + "got_raw": " second_id\n\n\ndef test_get_device_id_returns_hashed_id(mocker: MockerFixture) -> None:\n # First call to get_device_id will set the cache\n mocker.patch(\"askui.telemetry.device_id._device_id\", None)\n mocker.patch(\n \"machineid.hashed_id\",\n return_value=\"02c2431a4608f230d2d759ac888d773d274229ebd9c9093249752dd839ee3ea3\",\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "params.steps", + "got": "1", + "got_raw": "1\n assert scenario.steps[0].keyword == \"Given\"\n assert scenario.steps[0].text == \"foo\"\n\ndef test_create_scenario_maximal(\n create_tool: CreateScenarioTool, feature: Feature\n) -> None:\n params = _create_params(\n feature.id,\n tags=[\"tag1\", \"tag2\"],\n examples=[ScenarioExample(name=\"ex1\", parameters={\"k\": \"v\"})],\n steps=[\n ScenarioStep(keyword=\"Given\", text=\"foo\"),\n ScenarioStep(keyword=\"When\", text=\"bar\"),\n ScenarioStep(keyword=\"Then\", text=\"baz\"),\n ],\n )\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "img", + "got": "0", + "got_raw": "0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != 0\n assert new_img != ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "ValueError)", + "got": "UnexpectedResponseError) as exc_info:", + "got_raw": "UnexpectedResponseError) as exc_info:\n openrouter_model.get(\n query=\"test query\",\n source=image_source_github_login_screenshot,\n response_schema=ResponseSchemaBase,\n get_settings=GetSettings(),\n )\n\n assert exc_info.value.message == \"Unexpected response from Anthropic API\"\n assert exc_info.value.content == [\n {\n \"type\": \"text\",\n \"text\": \"Invalid JSON {\",\n }\n ]\n\ndef test_no_response_from_model(\n mock_openai_client: Mock,\n openrouter_model: OpenRouterModel,\n image_source_github_login_screenshot: ImageSource,\n", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.2916666666666667, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "0", + "got": "1", + "got_raw": "1\n assert NOT_GIVEN != \"1\"\n assert NOT_GIVEN != True\n assert NOT_GIVEN != False\n assert NOT_GIVEN != None\n assert NOT_GIVEN != []\n assert NOT_GIVEN != {}\n assert NOT_GIVEN != set()\n assert NOT_GIVEN != frozenset()\n assert NOT_GIVEN != object()\n\n assert NOT_GIVEN != NotGiven(1)\n assert NOT_GIVEN != NotGiven(\"1\")\n assert NOT_GIVEN != NotGiven(True)\n assert NOT_GIVEN != NotGiven(False)\n assert NOT_GIVEN != NotGiven(None)\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "result_traj[0]", + "got": "", + "got_raw": " # noqa: WPS437\n assert \"cache1.json\" not in result_traj # noqa: WPS437\n\ndef test_execute_cached_trajectory_tool() -> None:\n \"\"\"Test that ExecuteCachedTrajectoryTool executes cached trajectories.\"\"\"\n with tempfile.TemporaryDirectory() as temp_dir:\n cache_dir = Path(temp_dir)\n\n # Create a cache file\n (cache_dir / \"cache.json\").write_text(\"{}\", encoding=\"utf-8\")\n\n # Create a tool with the cache file\n tool = ExecuteCachedTrajectory(\n CachedExecutionToolSettings(delay_time_between_action=0.", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "askui/python-sdk", + "expected": "0", + "got": "0", + "got_raw": "0\n\n def test_load_pdf_from_bytes(self, path_fixtures_dummy_pdf: pathlib.Path) -> None:\n with open(path_fixtures_dummy_pdf, \"rb\") as f:\n loaded = load_source(f.read())\n assert isinstance(loaded.root, bytes | pathlib.Path)\n with loaded.reader as r:\n assert len(r.read()) > 0\n\n def test_load_pdf_from_base64(self, path_fixtures_dummy_pdf: pathlib.Path) -> None:\n with open(path_fixtures_dummy_pdf, \"rb\") as f:\n loaded = load_source(base64.b64encode(f.read()).", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n\n@pytest.mark.parametrize(\n ('s', 'expected'),\n (\n (\n '\"\"', (\n ('\"\"', None),\n ),\n ),\n (\n '\"%%\"', (\n ('\"', (None, None, None, None, '%')),\n ('\"', None),\n ),\n ),\n (\n '\"%s\"', (\n ('\"', (None, None, None, None, 's')),\n ('\"', None),\n ),\n ),\n (\n '\"%s two! %s\"', (\n ('\"', (None, None, None, None, 's')),\n (' two! ', (None", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "s", + "got": "s", + "got_raw": " s\n\n\n@pytest.mark.parametrize(\n 's',\n (\n # Don't touch syntax errors\n '\"{0}\"format(1)',\n pytest.param(\"'{}'.format(1)\", id='already upgraded'),\n # Don't touch invalid format strings\n \"'{'.format(1)\", \"'}\".format(1)\",\n # Don't touch non-format strings\n \"x = ('{0} {1}',)\\n\",\n # Don't touch non-incrementing integers\n \"'{0} {0}'.format(1)\",\n # Formats can be embedded in formats, leave these alone?\n \"'{", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "expected", + "got": "0", + "got_raw": "0\n assert s == expected\n\n\n@pytest.mark.parametrize(\n ('s', 'expected'),\n (\n pytest.param(\n 'from functools import lru_cache\\n\\n'\n '@lru_cache(maxsize=10)\\n'\n 'def foo():\\n'\n ' pass\\n',\n 'from functools import lru_cache\\n\\n'\n '@lru_cache(maxsize=10)\\n'\n 'def foo():\\n'\n ' pass\\n',\n id='call with maxsize',\n ),\n pytest.param(\n 'from functools import lru_cache\\n\\n'\n '@", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "s", + "got": "s", + "got_raw": " s\n\n\n@pytest.mark.parametrize(\n 's',\n (\n pytest.param(\n 'type(1)\\n',\n id='int',\n ),\n pytest.param(\n 'type(1.0)\\n',\n id='float',\n ),\n pytest.param(\n 'type(1j)\\n',\n id='complex',\n ),\n pytest.param(\n 'type(\"foo\")\\n',\n id='str',\n ),\n pytest.param(\n 'type(b\"foo\")\\n',\n id='bytes',\n ),\n pytest.param(\n 'type(True)\\n',\n id='bool", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "s", + "got": "0", + "got_raw": "0\n\n\n@pytest.mark.parametrize(\n ('s', 'min_version', 'expected'),\n (\n (\n 'from __future__ import annotations',\n (3,),\n 'from __future__ import annotations',\n ),\n (\n 'from __future__ import annotations',\n (3, 10),\n 'from __future__ import annotations',\n ),\n (\n 'from __future__ import annotations',\n (3, 11),\n 'from __future__ import annotations',\n ),\n (\n 'from __future__ import annotations',\n (3, 12),\n 'from __", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "s", + "got": "'x = (',", + "got_raw": "<|fim_suffix|>\n 'x = (',\n # does not inherit from `object`\n 'class C(B): pass',\n ),\n)\ndef test_fix_classes_noop(s):\n\n assert _fix_plugins(s, settings=Settings()) == s\n\n\n@pytest.mark.parametrize(\n 's',\n (\n # syntax error\n 'x = (',\n # does not inherit from `object`\n 'class C(B): pass',\n ),\n)\ndef test_fix_classes_noop(s):\n\n assert _fix_plugins(s, settings=Settings()) == s\n\n\n@pytest.mark.parametrize(\n 's',\n (\n # syntax error\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "s", + "got": "'except (AssertionError,): ...\\n',", + "got_raw": "<|fim_suffix|>\n 'except (AssertionError,): ...\\n',\n id='unrelated exception type as tuple',\n ),\n pytest.param(\n 'try: ...\\n'\n 'except OSError: ...\\n',\n id='already rewritten name',\n ),\n pytest.param(\n 'try: ...\\n'\n 'except (TypeError, OSError): ...\\n',\n id='already rewritten tuple',\n ),\n pytest.param(\n 'from .os import error\\n'\n 'raise error(1)\\n',\n id='same name as rewrite but relative import',\n ),\n pytest.param(\n 'from os import", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.05714285714285714, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "expected", + "got": "assert ret == expected", + "got_raw": "<|fim_suffix|>\n assert ret == expected\n\n\n@pytest.mark.parametrize(\n ('s', 'expected'),\n (\n pytest.param(\n 'from six.moves import map, getcwd\\n',\n 'from os import getcwd\\n',\n id='removes six.moves',\n ),\n pytest.param(\n 'from six.moves import map, getcwd\\n'\n 'from six.moves import map, getcwd\\n',\n 'from os import getcwd\\n'\n 'from os import getcwd\\n',\n id='removes six.moves multiple times',\n ),\n pytest.param(\n 'from six.moves import map, getcwd", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.5333333333333333, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n assert _fix_plugins(s, settings=Settings(min_version=(3, 11))) == expected\n\n assert _fix_plugins(s, settings=Settings(min_version=(3, 11))) == expected\n\n assert _fix_plugins(s, settings=Settings(min_version=(3, 11))) == expected\n\n assert _fix_plugins(s, settings=Settings(min_version=(3, 11))) == expected\n\n assert _fix_plugins(s, settings=Settings(min_version=(3, 11))) == expected\n\n assert _fix_plugins(s, settings=Settings(min", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "s", + "got": "s", + "got_raw": " s\n\n\n@pytest.mark.parametrize(\n 's, expected',\n (\n # remove r\n ('open(\"foo\", \"r\")', 'open(\"foo\")'),\n ('open(\"foo\", \"rU\")', 'open(\"foo\")'),\n ('open(\"foo\", \"rt\")', 'open(\"foo\")'),\n ('open(\"foo\", \"rUb\")', 'open(\"foo\", \"rb\")'),\n # remove t\n ('open(\"foo\", \"U\")', 'open(\"foo\", \"r\")'),\n ('open(\"foo\", \"Ur\")', 'open(\"foo\", \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asottile/pyupgrade", + "expected": "s", + "got": "'x.encode(\"utf-8\")',", + "got_raw": "<|fim_suffix|>\n 'x.encode(\"utf-8\")',\n # the codec / string is an f-string\n 'str.encode(f\"{c}\")', '\"foo\".encode(f\"{c}\")',\n pytest.param('wat.encode(b\"unrelated\")', id='unrelated .encode(...)'),\n ),\n)\ndef test_binary_literals_noop(s):\n\n assert _fix_tokens(s) == s\n\n\n@pytest.mark.parametrize(\n 's',\n (\n '\"\u2603\".encode(\"UTF-8\")',\n '\"\\\\u2603\".encode(\"UTF-8\")',\n '\"\\\\U0001f", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "est_targets.shape", + "got": "est_targets.shape", + "got_raw": " est_targets.shape\n assert reordered_est.dtype == est_targets.dtype\n assert reordered_est.device == est_targets.device\n\n loss = SinkPITLossWrapper(good_batch_loss_func)\n loss(est_targets, targets)\n loss_value, reordered_est = loss(est_targets, targets, return_est=True)\n\n assert reordered_est.shape == est_targets.shape\n assert reordered_est.dtype == est_targets.dtype\n assert reordered_est.device == est_targets.device\n\n@pytest.mark.parametrize(\"batch_size\", [1, 2, 8])\n@pytest.mark.parametrize(\"n_src\", [2, 5, 10])\n@pytest.mark", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "RuntimeError)", + "got": "", + "got_raw": "\n\n\n# File: asteroid/masknn/base.py\n torch.nn.Module):\n \"\"\"nn.Module subclass that holds a model under self.whoever\"\"\"\n\n def __init__(self, sub_model):\n super().__init__()\n self.whoever = sub_model\n\n model = SuperModule(nn.Sequential(nn.Linear(10, 10)))\n # Keys in state_dict will be whoever.0.weight, whoever.0.bias\n state_dict = model.state_dict()\n # We want to load it in model_2 (has keys 0.weight, 0.bias)\n model_2 = nn.Sequential(nn", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "model(y))", + "got": "model(y))", + "got_raw": " model(y))\n\n\n@pytest.mark.parametrize(\"cls\", (norms.GlobLN, norms.FeatsGlobLN, norms.ChanLN))\ndef test_lns_traced(cls):\n chan_size = 10\n model = cls(channel_size=chan_size)\n x = torch.randn(1, chan_size, 12)\n\n traced = torch.jit.trace(model, x)\n\n y = torch.randn(3, chan_size, 18, 12)\n\n assert_close(traced(y), model(y))\n\n\n@pytest.mark.parametrize(\"cls\", (norms.GlobLN, norms.Feats", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "mixtures.shape", + "got": "est_targets.shape", + "got_raw": " est_targets.shape\n assert reordered_mix.shape[1] == n_mix * factor\n\n # mix_it_generalized / With and without return estimates\n loss = MixITLossWrapper(good_batch_loss_func, generalized=True)\n loss(est_targets, mixtures)\n loss_value, reordered_mix = loss(est_targets, mixtures, return_est=True)\n\n assert reordered_mix.shape == est_targets.shape\n assert reordered_mix.shape[1] == n_mix * factor\n\n # best_part_mixit / With and without return estimates\n loss = MixITLossWrapper(good_batch_loss_func, generalized=False)\n ", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "(batch, n_frames, 2 * n_units)", + "got": "(batch, n_frames, n_units * 2)", + "got_raw": " (batch, n_frames, n_units * 2)\n assert model.n_layers == n_layers\n assert model.dropout == dropout\n assert model.bidirectional is True\n assert model.rnn1.rnn_type == rnn_type\n assert model.rnn2.rnn_type == rnn_type\n\n\n@pytest.mark.parametrize(\"rnn_type\", [\"LSTM\", \"GRU\", \"RNN\"])\n@pytest.mark.parametrize(\"dropout\", [0.0, 0.2])\ndef test_mulcat_rnn(rnn_type, dropout):\n n_units, n_layers = 20, 3\n model = rec.MulCatRNN", + "exact_match": false, + "code_bleu": 0.5873949094699213, + "edit_similarity": 0.8666666666666667, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "arbitrary_last_dim)", + "got": "arbitrary_last_dim=arbitrary_last_dim)", + "got_raw": " arbitrary_last_dim=arbitrary_last_dim)\n assert_loss_checks_shape(singlesrc, (3, 1000), arbitrary_last_dim=arbitrary_last_dim)\n assert_loss_checks_shape(multisrc, (3, 2, 1000), arbitrary_last_dim=arbitrary_last_dim)\n\n@pytest.mark.parametrize(\"loss\", loss_properties)\ndef test_sisdr_and_mse_shape_checks_no_batch(loss):\n pairwise, singlesrc, multisrc, arbitrary_last_dim = loss\n\n assert_loss_checks_shape(pairwise, (1000,), no_batch_ok=True, arbitrary_last_dim", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "min_idx_hun)", + "got": "0, min_idx_hun)", + "got_raw": "0, min_idx_hun)\n\n@pytest.mark.parametrize(\"n_src\", [2, 4, 5, 6, 8])\ndef test_best_perm_match_hungarian(n_src):\n pwl = torch.randn(2, n_src, n_src)\n\n min_loss, min_idx = PITLossWrapper.find_best_perm_factorial(pwl)\n min_loss_hun, min_idx_hun = PITLossWrapper.find_best_perm_hungarian(pwl)\n\n assert_close(min_loss, min_loss_hun)\n\n assert_close(min_idx, 0, min_idx_hun)\n\n@pytest.mark.parametrize(\"n_src\",", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.8888888888888888, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "type(asteroid_optim)", + "got": "type(asteroid_optim)", + "got_raw": " type(asteroid_optim)\n\ndef test_get_str_returns_instance_with_dict():\n torch_optim = optim.Adam(global_model.parameters(), lr=1e-3)\n asteroid_optim = optimizers.get(\"adam\")(global_model.parameters(), lr=1e-3)\n\n assert type(torch_optim) == type(asteroid_optim)\n\ndef test_get_str_returns_instance_with_dict_and_kwargs():\n torch_optim = optim.Adam(global_model.parameters(), lr=1e-3)\n asteroid_optim = optimizers.get(\"adam\", lr=1e-3)(global_model.parameters())\n\n assert type(torch_opt", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "w_src_wrapper(est_targets, targets, return_est=True)[1])", + "got": "", + "got_raw": "\n\n\n# File: asteroid/losses/mse.py\n >>> # singlesrc_mse / multisrc_mse support both 'pw_pt' and 'perm_avg'.\n >>> loss_func = PITLossWrapper(singlesrc_mse, pit_from='pw_pt')\n >>> loss = loss_func(est_targets, targets)\n \"\"\"\n\n def forward(self, est_targets, targets):\n if targets.size() != est_targets.size() or targets.ndim < 2:\n raise TypeError(\n f\"Inputs must be of shape [batch, *], got {targets.size()} and {est_targets.size()} instead\"\n )\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "consistent_est_sources.sum(dim))", + "got": "0.5 * (est_sources + consistent_est_sources))", + "got_raw": "0.5 * (est_sources + consistent_est_sources))\n\n\n@pytest.mark.parametrize(\"mix_shape\", [[2, 1600], [2, 130, 10]])\n@pytest.mark.parametrize(\"dim\", [1, 2])\n@pytest.mark.parametrize(\"n_src\", [1, 2, 3])\ndef test_consistency_withweight(mix_shape, dim, n_src):\n mix = torch.randn(mix_shape)\n est_shape = mix_shape[:dim] + [n_src] + mix_shape[dim:]\n est_sources = torch.randn(est_shape)\n src_weights = torch.randn(n_src", + "exact_match": false, + "code_bleu": 0.239802967618271, + "edit_similarity": 0.6233766233766234, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "w_sum / n_src)", + "got": "1.0)", + "got_raw": "1.0)\n assert_close(w_mean, 1.0)\n assert_close(w_sum, 1.0)\n\ndef test_permreduce_bad():\n from functools import partial\n\n n_src = 3\n sources = torch.randn(10, n_src, 8000)\n est_sources = torch.randn(10, n_src, 8000)\n wo_reduce = PITLossWrapper(pairwise_mse, pit_from=\"pw_mtx\")\n w_mean_reduce = PITLossWrapper(\n pairwise_mse,\n pit_from=\"pw_mtx\",\n # perm_reduce=partial(torch", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "asteroid-team/asteroid", + "expected": "cnn.torch_complex_from_reim(inp.real + 1, inp.imag + 1))", + "got": "1 + inp)", + "got_raw": "1 + inp)\n\n with pytest.raises(ValueError):\n cnn.OnReIm(Identity, 1, 1)\n\n with pytest.raises(ValueError):\n cnn.OnReIm(Identity, 1, 1, 1)\n\n with pytest.raises(ValueError):\n cnn.OnReIm(Identity, 1, 1, 1, 1)\n\n with pytest.raises(ValueError):\n cnn.OnReIm(Identity, 1, 1, 1, 1, 1)\n\n with pytest.raises(ValueError):\n cnn.OnReIm(Identity, 1, 1, 1, 1,", + "exact_match": false, + "code_bleu": 0.10630611807174645, + "edit_similarity": 0.21875, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "ValueError)", + "got": "DelegatedError) as cm:", + "got_raw": "DelegatedError) as cm:\n d.get_token(\"client_id\", \"client_secret\", \"audience\")\n\n self.assertEqual(cm.exception.status_code, 400)\n self.assertEqual(cm.exception.body, \"Invalid client_id\")\n\n @mock.patch(\"auth0.authentication.delegated.Delegated.post\")\n def test_get_token(self, mock_post):\n d = Delegated(\"my.domain.com\", \"cid\")\n\n mock_post.return_value = mock.Mock(status_code=200, json=lambda: {\"access_token\": \"token\"})\n\n token = d.get_token(\"client_id\", \"client_secret", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.42424242424242425, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "{ \"client_id\": \"cid\", \"client_secret\": \"csecret\", \"email\": \"a@b.com\", \"send\": \"snd\", \"connection\": \"email\", })", + "got": ".assertEqual(kwargs[\"json\"], {", + "got_raw": ".assertEqual(kwargs[\"json\"], {\n \"client_id\": \"cid\",\n \"email\": \"a@b.com\",\n \"send\": \"snd\",\n \"client_secret\": \"csecret\",\n })\n\n @mock.patch(\"auth0.authentication.rest.RestClient.post\")\n def test_send_email_with_client_credentials(self, mock_post):\n p = Passwordless(\"my.domain.com\", \"cid\")\n\n p.email(email=\"a@b.com\", send=\"snd\")\n\n args, kwargs = mock_post.call_args\n\n self.assertEqual(args[0], \"https://my.domain.com/passwordless/start\")\n\n self.assertEqual(kwargs[\"json", + "exact_match": false, + "code_bleu": 0.06112056398322239, + "edit_similarity": 0.21428571428571427, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "[(\"hello_world[hello]\", \"world\")]", + "got": "[", + "got_raw": " [\n (\"hello_world\", {\"hello\": \"world\"})\n ]\n\n assert encode_query({\"hello_world\": {\"hello\": \"world\"}}) == [\n (\"hello_world\", {\"hello\": \"world\"})\n ]\n\n assert encode_query({\"hello_world\": {\"hello\": \"world\"}}) == [\n (\"hello_world\", {\"hello\": \"world\"})\n ]\n\n assert encode_query({\"hello_world\": {\"hello\": \"world\"}}) == [\n (\"hello_world\", {\"hello\": \"world\"})\n ]\n\n assert encode_query({\"hello_world\": {\"hello\": \"world\"}}) == [\n (\"hello", + "exact_match": false, + "code_bleu": 0.08494336535733721, + "edit_similarity": 0.058823529411764705, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "fnmatch(kwargs[\"data\"][\"client_assertion\"], \"*.*.*\"))", + "got": "", + "got_raw": "\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n# File: reference.md\n\n\n#", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "{\"client_id\": \"cid\", \"token\": \"tkn\"})", + "got": "{", + "got_raw": " {\n \"client_id\": \"cid\",\n \"token\": \"tkn\",\n })\n\n self.assertEqual(kwargs[\"headers\"][\"content-type\"], \"application/json\")\n\n # apps with a token\n a = RevokeToken(\"my.domain.com\", \"cid\", \"tkn\")\n\n a.revoke_refresh_token(token=\"tkn\")\n\n args, kwargs = mock_post.call_args\n\n self.assertEqual(args[0], \"https://my.domain.com/oauth/revoke\")\n\n self.assertEqual(kwargs[\"data\"], {\n \"client_id\": \"cid\",\n \"token\": \"tkn\",\n })\n\n self.assertEqual(kwargs[\"", + "exact_match": false, + "code_bleu": 0.05946035575013606, + "edit_similarity": 0.05263157894736842, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "{ \"client_id\": \"cid\", \"email\": \"a@b.com\", \"connection\": \"conn\", })", + "got": ".assertEqual(kwargs[\"json\"], {", + "got_raw": ".assertEqual(kwargs[\"json\"], {\n \"email\": \"a@b.com\",\n \"connection\": \"conn\",\n })\n\n @mock.patch(\"auth0.authentication.rest.RestClient.post\")\n def test_create(self, mock_post):\n d = Database(\"my.domain.com\", \"cid\")\n\n # ignores the password argument\n d.create(email=\"a@b.com\", password=\"pswd\", connection=\"conn\")\n\n args, kwargs = mock_post.call_args\n\n self.assertEqual(args[0], \"https://my.domain.com/dbconnections/create\")\n\n self.assertEqual(kwargs[\"json\"], {\n \"email\": \"a@b", + "exact_match": false, + "code_bleu": 0.09371819810760766, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "{ \"client_id\": \"cid\", \"email\": \"a@b.com\", \"send\": \"snd\", \"connection\": \"email\", })", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n kwargs[\"json\"],\n {\n \"email\": \"a@b.com\",\n \"send\": \"snd\",\n },\n )\n\n @mock.patch(\"auth0.authentication.rest.RestClient.post\")\n def test_send_sms(self, mock_post):\n p = Passwordless(\"my.domain.com\", \"cid\")\n\n p.sms(phone_number=\"+1234567890\", send=\"snd\")\n\n args, kwargs = mock_post.call_args\n\n self.assertEqual(args[0], \"https://my.domain.com/passwordless/start\")\n\n self.assertEqual(\n kwargs[\"json\"],\n {\n \"phone", + "exact_match": false, + "code_bleu": 0.05998702781459941, + "edit_similarity": 0.12631578947368421, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "403)", + "got": "403)", + "got_raw": "403)\n self.assertEqual(context.exception.body, '{\"error\": \"mfa_required\", \"error_description\": \"Multifactor authentication required\", \"mfa_token\": \"Fe26...Ha\"}')\n\n @mock.patch(\"requests.request\")\n def test_post_error_mfa_required_with_mfa_token(self, mock_request):\n ab = AuthenticationBase(\"auth0.com\", \"cid\", telemetry=False)\n\n mock_request.return_value.status_code = 403\n mock_request.return_value.text = '{\"error\": \"mfa_required\", \"error_description\": \"Multifactor authentication required\", \"mfa_token\":", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "args[0])", + "got": "args[0])", + "got_raw": " args[0])\n self.assertEqual({\"grant_type\": \"authorization_code\", \"code\": \"code\", \"client_id\": \"cid\", \"client_secret\": \"secret\", \"redirect_uri\": \"http://localhost:8080/callback\"}, kwargs[\"json\"])\n self.assertEqual({\"access_token\": \"atk\", \"id_token\": \"idt\", \"refresh_token\": \"ref\", \"expires_in\": 3600}, kwargs[\"json\"][\"response\"])\n\n @mock.patch(\"auth0.authentication.social.Social.post\")\n def test_login_with_client_secret_basic(self, mock_post):\n s = Social(\"a.b", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "auth0/auth0-python", + "expected": "\"Request data does not match expected data after JSON serialization.\")", + "got": ".assertEqual(actual_data, expected_data)", + "got_raw": ".assertEqual(actual_data, expected_data)\n\n @mock.patch(\"auth0.authentication.rest.RestClient.post\")\n def test_with_authorization_details_and_redirect_uri(self, mock_post):\n g = BackChannelLogin(\"my.domain.com\", \"cid\", client_secret=\"clsec\")\n g.back_channel_login(\n binding_message=\"This is a binding message.\",\n login_hint= json.dumps({\"format\": \"iss_sub\", \"iss\": \"https://my.domain.auth0.com/\", \"sub\": \"auth0|USER_ID\"}),\n scope=\"openid\",\n authorization_details=[\n {\n \"type\":\"payment_initiation\",\"locations\":[\"https", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "aymenfurter/microagents", + "expected": "closest_agent)", + "got": "closest_agent)", + "got_raw": " closest_agent)\n self.assertEqual(similarity, 1.0)\n\n def test_calculate_similarity_threshold(self):\n self.mock_openai_wrapper.get_embedding.side_effect = [\n {'data': [{'embedding': [0.1, 0.2, 0.3]}]},\n {'data': [{'embedding': [0.4, 0.5, 0.6]}]},\n {'data': [{'embedding': [0.7, 0.8, 0.9]}]}\n ]\n\n self.agent_similarity.calculate_similarity_threshold()\n\n self.assertEqual(self.agent_similarity.similarity_threshold, 0.9", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aymenfurter/microagents", + "expected": "self.mock_openai_wrapper)", + "got": "self.mock_openai_wrapper)", + "got_raw": " self.mock_openai_wrapper)\n\n def test_load_agent_non_existing(self):\n purpose = 'test'\n self.mock_persistence.fetch_agent.return_value = None\n\n with patch('agents.agent_serializer.AgentSerializer.from_dict') as mock_from_dict:\n self.manager.load_agent(purpose, self.mock_agent_lifecycle, self.mock_openai_wrapper)\n\n\n mock_from_dict.assert_not_called()\n\n def test_save_agent(self):\n agent = Mock()\n self.manager.save_agent(agent)\n\n self.mock_persistence.save_agent.assert_called_once_with(agent)\n\n def test_remove_agent(self):\n purpose = 'test'\n self.manager.remove_agent", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aymenfurter/microagents", + "expected": "purposes)", + "got": "purposes)", + "got_raw": " purposes)\n self.assertIn('purpose2', purposes)\n\n def test_remove_agent(self):\n agent_dict = {'purpose': 'purpose1', 'data': 'data1', 'id': 'test_id'}\n self.persistence.save_agent(agent_dict)\n\n self.persistence.remove_agent('purpose1')\n\n self.assertEqual(self._count_agents_in_db(), 0)\n\n def test_save_agent(self):\n agent_dict = {'purpose': 'purpose1', 'data': 'data1', 'id': 'test_id'}\n self.persistence.save_agent(agent_dict)\n\n self.assertEqual(self._count_agents_in_db(), 1)\n\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "aymenfurter/microagents", + "expected": "self.dummy_agent)", + "got": "", + "got_raw": "\n\n\n# File: agents/agent_lifecycle.py\nimport logging\nfrom typing import List\nfrom agents.microagent import MicroAgent\nfrom integrations.openaiwrapper import OpenAIAPIWrapper\nfrom agents.agent_similarity import AgentSimilarity\nfrom agents.agent_persistence_manager import AgentPersistenceManager\nfrom numpy import ndarray\nfrom prompt_management.prompts import (\n PRIME_PROMPT, PRIME_NAME, \n PROMPT_ENGINEERING_SYSTEM_PROMPT, \n PROMPT_ENGINEERING_TEMPLATE, EXAMPLES\n)\n\nlogger = logging.getLogger()\n\nDEFAULT_MAX_AGENTS = 2000\nPRIME_AGENT_WEIGHT = 25", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "Mu)", + "got": "0, 'Mu', 'Mu')", + "got_raw": "0, 'Mu', 'Mu')\n self.assert_message_to_parent(X, 0, 'Lambda', 'Lambda')\n self.assert_message_to_parent(X, 0, 'A', 'A')\n self.assert_message_to_parent(X, 0, 'V', 'V')\n\n def test_message_to_parents_2(self):\n r\"\"\" Check gradient passed to inputs parent node \"\"\"\n N = 3\n D = 2\n\n Mu = Gaussian(np.random.randn(D), random.covariance(D))\n Lambda = Wishart(D, random.covariance(D))\n A = Gaussian(np.random.randn(D", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.35294117647058826, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "())", + "got": "f((), (2,), (3,)),", + "got_raw": " f((), (2,), (3,)),\n (6,))\n self.assertEqual( f((), (), (3,)),\n (3,))\n self.assertEqual( f((), (), ()),\n ())\n\n # Test broadcasting\n self.assertEqual( f((2,3,4),\n (5,6,7),\n (8,9,10)),\n (120,120,120))\n self.assertEqual( f((2,3,4),\n (5,6,7),\n (8,9,10)),\n (120,12", + "exact_match": false, + "code_bleu": 0.1203921753741131, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "np.einsum('mn->', 0.5*np.ones(np.shape(tau))))", + "got": "", + "got_raw": "\n\n\n# File: bayespy/inference/vmp/nodes/gaussian.py\n################################################################################\n# Copyright (C) 2011-2014 Jaakko Luttinen\n#\n# This file is licensed under the MIT License.\n################################################################################\n\n\nimport numpy as np\n\nfrom bayespy.utils import misc\nfrom bayespy.utils import random\nfrom bayespy.utils import linalg\n\nfrom .node import Node\nfrom .deterministic import Deterministic\nfrom .gaussian import GaussianMoments\nfrom .gaussian import GaussianGammaMoments\nfrom .ml import DeltaMoments\n\n\nclass Gaussian(D", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "())", + "got": "3)", + "got_raw": "3)\n self.assertEqual(X_alpha.shape, (3,3))\n self.assertEqual(X_alpha.ndim, 2)\n self.assertEqual(X_alpha.name, \"X_alpha\")\n\n # Test 1-ndim Gaussian-Gamma\n X_alpha = GaussianGamma([1,2], [0.1, 0.2], [0.02, 0.03], [0.03, 0.04], ndim=1)\n\n # Simple construction\n X_alpha = GaussianGamma([1,2,3], np.identity(3), 2, 10)\n\n ", + "exact_match": false, + "code_bleu": 0.35818997727451396, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "(5,))", + "got": "(5,))", + "got_raw": " (5,))\n\n X = MyNode(plates=(3,4,5), dims=((),))\n Y = X[2,1,3]\n\n self.assertEqual(Y.plates, ())\n\n X = MyNode(plates=(3,4,5), dims=((),))\n Y = X[2,1,3,4]\n\n self.assertEqual(Y.plates, ())\n\n X = MyNode(plates=(3,4,5), dims=((),))\n Y = X[2,1,3,4,5]\n\n self.assertEqual(Y.plates, ())\n\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(m[0].shape, (3,))\n\n # Observed and broadcasting\n Z = 2\n X = GaussianARD(0, 1, shape=(), plates=(3,))\n F = Gate(Z, X)\n Y = GaussianARD(F, 1)\n Y.observe(np.random.randn(3))\n m = F._message_to_parent(0)\n\n self.assertEqual(len(m), 1)\n self.assertEqual(m[0].shape, (3,))\n\n # Unobserved and non-broadcasting\n Z = 2\n X = GaussianARD", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "Lambda)", + "got": ".assert_message_to_parent(X, Lambda)", + "got_raw": ".assert_message_to_parent(X, Lambda)\n\n self.assert_message_to_parent(X, alpha)\n\n self.assert_message_to_parent(X, beta)\n\n self.assert_moments(\n X,\n postprocess=lambda u: [\n u[0],\n u[1] + linalg.transpose(u[1], ndim=ndim),\n u[2],\n u[3]\n ],\n rtol=1e-5,\n atol=1e-6,\n eps=1e-8\n )\n\n self.assert_moments(\n X,\n postprocess=lambda u: [\n u[", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.32558139534883723, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "np.einsum('mn,ni->i', tau*y, a))", + "got": "es", + "got_raw": "es\n\n\n# File: bayespy/inference/vmp/nodes/deterministic.py\n################################################################################\n# Copyright (C) 2011-2014 Jaakko Luttinen\n#\n# This file is licensed under the MIT License.\n################################################################################\n\n\nimport numpy as np\n\nfrom bayespy.utils import misc\n\nfrom .node import Node\nfrom .gaussian import Gaussian, GaussianMoments\nfrom .gaussian import GaussianGammaMoments\nfrom .ml import DeltaMoments\n\n\nclass Deterministic(Node):\n r\"\"\"\n Node for deterministic functions of other nodes.\n\n The node is similar to `numpy", + "exact_match": false, + "code_bleu": 0.038461538461538464, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "4)", + "got": "2)", + "got_raw": "2)\n self.assertEqual(u[0].shape, (3,3))\n self.assertEqual(u[1].shape, (3,))\n\n # Test with random values\n mu = random.randn(3)\n Lambda = random.randn(3,3)\n a = random.randn()\n b = random.randn()\n X_alpha = GaussianGamma(mu, Lambda, a, b)\n u = X_alpha._message_to_child()\n\n self.assertEqual(len(u), 2)\n self.assertEqual(u[0].shape, (3,3))\n self.assertEqual(u[1].shape, (3,))\n\n #", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "(9,))", + "got": "7)", + "got_raw": "7)\n self.assertEqual(Y.dims, ( (), () ))\n\n # Three parents with shapes\n X1 = GaussianARD(0, 1, plates=(2,4), shape=(4,6))\n X2 = GaussianARD(0, 1, plates=(3,4), shape=(4,6))\n X3 = GaussianARD(0, 1, plates=(4,4), shape=(4,6))\n Y = Concatenate(X1, X2, X3)\n self.assertEqual(Y.plates, 7)\n self.assertEqual(Y.dims, ( (4,6", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "true_plates)", + "got": "true_plates,", + "got_raw": " true_plates,\n msg=\"Constructed incorrect plates\")\n\n self.assertEqual(X.mu.shape, (true_shape, true_shape+true_shape),\n msg=\"Constructed incorrect mu shape\")\n\n self.assertEqual(X.alpha.shape, (true_shape,),\n msg=\"Constructed incorrect alpha shape\")\n\n self.assertEqual(X.alpha.plates, true_plates,\n msg=\"Constructed incorrect alpha plates\")\n\n self.assertEqual(X.alpha.dims, (true_shape,),\n msg=\"Constructed incorrect alpha dims\")\n\n self.assertEqual(X.alpha.plotter, kwargs.get('plotter', None),\n msg=\"Constructed incorrect alpha plotter\")\n\n self.assertEqual(X.mu.plotter,", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.9166666666666666, + "n_retrieved": 10 + }, + { + "repo": "bayespy/bayespy", + "expected": "ValueError)", + "got": "", + "got_raw": "\n\n\n# File: bayespy/inference/vmp/nodes/bernoulli.py\n################################################################################\n# Copyright (C) 2014 Jaakko Luttinen\n#\n# This file is licensed under the MIT License.\n################################################################################\n\n\n\"\"\"\nA module for the Bernoulli distribution node\n\"\"\"\n\nimport numpy as np\n\nfrom .binomial import (BinomialMoments,\n BinomialDistribution)\nfrom .expfamily import ExponentialFamily\nfrom .beta import BetaMoments\nfrom .node import Moments\n\n\nclass BernoulliMoments(BinomialMoments):\n r\"\"\"\n Class for the moments of Bern", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "TypeHint(None)", + "got": "TypeHint(None)", + "got_raw": " TypeHint(None)\n\n # Assert that subscripting this wrapper by a non-integer index yields a\n # :exc:`TypeError` exception.\n with pytest.raises(TypeError):\n typehint[0.5]\n\n # Assert that subscripting this wrapper by a non-integer index yields a\n # :exc:`TypeError` exception.\n with pytest.raises(TypeError):\n typehint[None]\n\n # Assert that subscripting this wrapper by a non-integer index yields a\n # :exc:`TypeError` exception.\n with pytest.raises(TypeError):\n typehint[object]\n\n # Assert that subscripting this wrapper", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "Class", + "got": "", + "got_raw": " # pyright: ignore\n FORWARDREF_ABSOLUTE\n assert FORWARDREF_RELATIVE.__type_beartype__ is # pyright: ignore\n FORWARDREF_RELATIVE\n assert FORWARDREF_MODULE_ABSOLUTE.__type_beartype__ is # pyright: ignore\n FORWARDREF_MODULE_ABSOLUTE\n assert FORWARDREF_MODULE_CLASS.__type_beartype__ is # pyright: ignore\n FORWARDREF_MODULE_CLASS\n\n # ....................{ PASS ~ type }....................\n # Assert that the type of these forward reference proxies has the expected\n # values.\n assert FORWARDREF_ABS", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "NoneTypes", + "got": "NoneTypes", + "got_raw": " NoneTypes\n\n # Assert that indexing this factory with \"NoneType\" again returns the same\n # tuple implicitly created and cached by the prior indexation.\n\n assert NoneTypeOr[NoneType] is NoneTypes\n\n # Assert that indexing this factory with \"NoneType\" again returns the same\n # tuple implicitly created and cached by the prior indexation.\n\n assert NoneTypeOr[NoneType] is NoneTypes\n\n # Assert that indexing this factory with \"NoneType\" again returns the same\n # tuple implicitly created and cached by the prior indexation.\n\n assert NoneTypeOr[None", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "beartype()", + "got": "", + "got_raw": "\n\n\n# File: beartype/_check/checkmake.py\n # Else, this object is a PEP-compliant type hint currently unsupported by\n # the :func:`beartype.beartype` decorator.\n raise BeartypeDecorHintPepUnsupportedException(\n hint_sane=hint_sane,\n exception_prefix=exception_prefix,\n )\n\n# ....................{ FACTORIES ~ code : raiser }....................\n@callable_cached\ndef make_code_raiser_func_pep484_noreturn_check(\n conf: BeartypeConf) -> CodeGenerated:\n '''\n Pure-P", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "None", + "got": "None", + "got_raw": " None\n\n # Assert this getter returns \"None\" when the passed number of stack frames\n # to ignore is an absurdly large negative integer guaranteed to either:\n # * Trigger a C-based integer overflow.\n # * *NOT* trigger such an overflow but still exceed the total number of\n # stack frames on the current call stack.\n\n assert get_frame_or_none(-maxsize) is None\n\n # Assert this getter returns \"None\" when the passed number of stack frames\n # to ignore is an absurdly large negative integer guaranteed to either:\n # * Trigger a C-based integer overflow", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "{}", + "got": "{}", + "got_raw": " {}\n\n # Assert this function merges two mappings with the same keys into a new\n # mapping with the same keys.\n\n assert merge_mappings(\n {FAREWELL_O_HIAWATHA: IN_THE_LODGE_OF_HIAWATHA},\n {FAREWELL_O_HIAWATHA: IN_THE_LODGE_OF_HIAWATHA},\n ) == {FAREWELL_O_HIAWATHA: IN_THE_LODGE_OF_HIAWATHA}\n\n # Assert this function merges two mappings with different keys into a new\n # mapping with the same keys.\n\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "''", + "got": "", + "got_raw": " # type: ignore[assignment]\n f'{TEST_TARGET_STR}The sky'\n assert str(warnings_info[3].message) == # type: ignore[assignment]\n f'{TEST_TARGET_STR}The sky'\n\n # Assert that the expected warning messages were issued.\n assert str(warnings_info[0].message) == f'{TEST_TARGET_STR}The sky'\n assert str(warnings_info[1].message) == 'the Poet kept mute conference'\n\n assert str(warnings_info[2].message) == # type: ignore[assignment]\n f'{TEST_TARGET_STR}The sky", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "'package_name'", + "got": "", + "got_raw": "\n\n\n# File: beartype/_check/code/_pep/pep484/codepep484typevar.py\n#!/usr/bin/env python3\n# --------------------( LICENSE )--------------------\n# Copyright (c) 2014-2026 Beartype authors.\n# See \"LICENSE\" for further details.\n\n'''\nBeartype :pep:`484`-compliant **type variable type-checking code factories**\n(i.e., low-level callables dynamically generating pure-Python code snippets\ntype-checking arbitrary objects against type variables).\n\nThis private submodule is *not*", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "(str, int)", + "got": "", + "got_raw": " # type: ignore[return-value]\n hint=List[bool], args_len=2, exception_prefix='') == (bool, bool)\n\n # Assert this getter returns the expected child type hints for a PEP 484-\n # and 585-compliant type hint properly subscripted by an arbitrary number of\n # child type hints.\n\n assert get_hint_pep484585_args( # type: ignore[return-value]\n hint=List[bool], args_len=3, exception_prefix='') == (bool, bool, bool)\n\n # Assert this getter returns", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "'Shook'", + "got": "who_had_power) == 'shook'", + "got_raw": "who_had_power) == 'shook'\n\n # .....................{ FAIL }....................\n # Assert that calling this PEP 695-parametrized callable with invalid\n # parameters raises the expected exception.\n\n with raises(BeartypeCallHintParamViolation):\n shook_horrid(1234567890)\n\n# File: beartype/_check/code/_pep/pep484585/codepep484585generic.py\n#!/usr/bin/env python3\n# --------------------( LICENSE )--------------------\n# Copyright (c) ", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.375, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "None", + "got": "None", + "got_raw": " None\n assert get_type_filename_or_none(ClassModuleNameFake) is None\n\n\n# File: beartype/_util/cls/utilclsget.py\n #FIXME: This is a bit of a hack. We should probably just use the\n #beartype._util.cls.utilclsget.get_type_filename_or_none() function\n #instead of this one. But we can't do that until we've refactored the\n #beartype._util.cls.utilclsget.get_type_filename_or_none() function into\n #the beartype._util.cls.utilclsget.get_type_filename() function", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "84 + 1j", + "got": "0.0) == 0.0 + 1j", + "got_raw": "0.0) == 0.0 + 1j\n\n # ....................{ FAIL }....................\n # Assert that calling this coroutine passed an arbitrary float returns the\n # expected complex number *WITH* raising an exception.\n\n with raises(BeartypeCallHintParamViolation) as exc_info:\n await _shone(0.0)\n assert exc_info.value.args[0] == (\n 'beartype.roar.BeartypeCallHintParamViolation: @beartyped '\n '_shone() parameter not_a_sound_was_heard=0.0 violates type hint '\n '", + "exact_match": false, + "code_bleu": 0.2984745896009823, + "edit_similarity": 0.43478260869565216, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "True", + "got": "", + "got_raw": " # type: ignore[call-overload]\n func=now_float_above_thy_darkness)\n assert not is_func_pep484_notypechecked( # type: ignore[call-overload]\n func=and_now_rest)\n\n\n# File: beartype/_check/code/_pep/pep484/codepep484typevar.py\n# ....................{ IMPORTS }....................\nfrom beartype.typing import (\n Optional,\n Union,\n)\nfrom beartype._cave._cavefast import NotImplementedType\nfrom beartype._cave._", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "beartype(isha)", + "got": "", + "got_raw": " # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha is # type: ignore[assignment]\n assert isha", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "INDENT_LEVEL_TO_CODE[2]", + "got": "INDENT_LEVEL_TO_CODE[2]", + "got_raw": " INDENT_LEVEL_TO_CODE[2]\n\n assert INDENT_LEVEL_TO_CODE[3] is INDENT_LEVEL_TO_CODE[3]\n\n # Assert this dictionary raises a TypeError exception if passed an invalid\n # integer.\n with raises(TypeError):\n INDENT_LEVEL_TO_CODE[0.5]\n\n with raises(TypeError):\n INDENT_LEVEL_TO_CODE['a']\n\n with raises(TypeError):\n INDENT_LEVEL_TO_CODE[None]\n\n with raises(TypeError):\n INDENT_LEVEL_TO_CODE[True]\n\n with raises(TypeError):\n INDENT_LEVEL_TO_CODE[False]\n\n with raises(TypeError):\n INDENT_LEVEL_TO", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "data_type", + "got": "", + "got_raw": " # pyright: ignore\n data_type.Module\n assert get_object_module_or_none(data_type.Function) is # pyright: ignore\n data_type.Module\n\n # ....................{ FAIL }....................\n # Assert this getter returns the expected module for:\n # * A built-in class.\n # * A built-in function.\n\n assert get_object_module_or_none(int) is # pyright: ignore\n data_type.Module\n assert get_object_module_or_none(len) is # pyright: ignore\n data_type.Module\n\n # ....................{ FAIL }....................\n #", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "is_stdout_terminal()", + "got": "", + "got_raw": " # <---- assert this is True.\n assert is_stdout_terminal() is # <---- assert this is True.\n assert is_str_ansi(str(violation)) is False # <---- assert this is False.\n\n # Violation configured to conditionally contain ANSI escape sequences only\n # when standard output is attached to a non-interactive terminal.\n violation = get_func_pith_violation(\n call_meta=minify_decor_meta_kwargs(\n func=she_drew_back, conf=BeartypeConf(is_color=None)), **kwargs)\n\n # Assert this violation message contains ANSI escape sequences only when\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "TypeIs", + "got": "TypeIs", + "got_raw": " TypeIs\n\n # Else, the active Python interpreter targets Python < 3.13, the\n # \"typing.TypeIs\" attribute is guaranteed to not exist. In this case...\n else:\n # Assert that attempting to dynamically import the \"typing.Annotated\"\n # attribute (guaranteed to be unimportable under this Python version)\n # raises the expected exception.\n with raises(_BeartypeUtilModuleException):\n import_typing_attr('TypeIs')\n\n # ....................{ VERSION }....................\n # If the active Python interpreter targets Python >= 3.13, the", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "''", + "got": "0", + "got_raw": "0\n\n # Assert that truncating a string of length 1 returns the string itself.\n\n assert truncate_str(text='a', max_length=1) == 'a'\n\n # Assert that truncating a string of length 2 returns the string itself.\n\n assert truncate_str(text='ab', max_length=2) == 'ab'\n\n # Assert that truncating a string of length 3 returns the string itself.\n\n assert truncate_str(text='abc', max_length=3) == 'abc'\n\n # Assert that truncating a string of length 4 returns the string itself.\n\n assert truncate_str(text='abcd", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/beartype", + "expected": "iter", + "got": "iter", + "got_raw": " iter\n\n # Assert this function returns unwrapped callables unmodified.\n assert unwrap_func_all(in_a_station_of_the_metro) is (\n in_a_station_of_the_metro)\n\n # Assert this function returns unwrapped callables unmodified.\n assert unwrap_func_all(in_a_station_of_the_metro_line_two) is (\n in_a_station_of_the_metro_line_two)\n\n # Assert this function returns unwrapped callables unmodified.\n assert unwrap_func_all(iter) is iter\n\n # Assert this function returns unwrapped callables unmodified.\n assert unwrap_func_all(in_a_station_of_the_m", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "1", + "got": "1", + "got_raw": "1\n assert m != \"1\"\n assert m != object()\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "()", + "got": "0", + "got_raw": "0\n\n assert promote(1) == 1\n\n assert promote(1.0) == 1.0\n\n assert promote(1, 2) == 3\n\n assert promote(1, 2.0) == 3.0\n\n assert promote(1.0, 2) == 3.0\n\n assert promote(1.0, 2.0) == 3.0\n\n assert promote(1, 2, 3) == 6\n\n assert promote(1, 2, 3.0) == 6.0\n\n", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "\"Docs\"", + "got": "\"Docs\"", + "got_raw": " \"Docs\"\n\n with pytest.raises(TypeError):\n f(1)\n\n @dispatch\n def f(x):\n \"\"\"Docs\"\"\"\n\n\n assert f.__doc__ == \"Docs\"\n\n assert f(1) == 1\n\n with pytest.raises(TypeError):\n f(1.0)\n\n @dispatch\n def f(x: int):\n \"\"\"Docs\"\"\"\n\n\n assert f.__doc__ == \"Docs\"\n\n assert f(1) == 1\n\n with pytest.raises(TypeError):\n f(1.0)\n\n @dispatch\n def f(x: int):\n \"\"\"Docs\"\"\"\n\n\n assert f", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "Method(int, Signature(int), function_name=\"int\", return_type=int)", + "got": "1", + "got_raw": "1\n assert m != 2\n assert m != \"1\"\n assert m != \"2\"\n assert m != \"int\"\n assert m != \"int()\"\n\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int\", return_type=int)\n assert m != Method(int, Signature(int), function_name=\"int", + "exact_match": false, + "code_bleu": 0.029411764705882353, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "v", + "got": "3", + "got_raw": "3\n assert T(3) == 3\n assert T((3, 4)) == (3, 4)\n\n assert T() == 3\n assert T(3) == 3\n assert T((3, 4)) == (3, 4)\n\n assert T() == 3\n assert T(3) == 3\n assert T((3, 4)) == (3, 4)\n\n assert T() == 3\n assert T(3) == 3\n assert T((3, 4)) == (3, ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "C", + "got": "", + "got_raw": " # Covariance\n assert type(D(1, 2, 3, 4)) is # Covariance\n assert type(E(1, 2, 3, 4, 5)) is # Covariance\n\n assert type_unparametrized(A(1)) is A\n assert type_unparametrized(B(1, 2)) is B\n assert type_unparametrized(C(1, 2, 3)) is C\n assert type_unparametrized(D(1, 2, 3, 4)) is D\n assert type", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "\"f(int)\"", + "got": "\"f(int)\"", + "got_raw": " \"f(int)\"\n assert _render_function_call(\"f\", plum.Signature(int, int)) == \"f(int, int)\"\n\n assert _render_function_call(\"f\", plum.Signature(int, int, int)) == \"f(int, int, int)\"\n assert _render_function_call(\"f\", plum.Signature(int, int, int, int)) == \"f(int, int, int, int)\"\n\n assert _render_function_call(\"f\", plum.Signature(int, int, int, int, int)) == \"f(int, int, int, int, int)\"\n assert _render", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "Number(2)", + "got": "1", + "got_raw": "1\n\n assert Number(1) < Number(2)\n\n assert Number(1) <= Number(1)\n\n assert Number(1) <= Number(2)\n\n assert Number(1) > Number(0)\n\n assert Number(1) >= Number(1)\n\n assert Number(1) >= Number(0)\n\n assert Number(1) != Number(2)\n\n assert Number(1) != 2\n\n assert Number(1) != Number(1.0)\n\n assert Number(1) != 1.0\n\n assert Number(1) != Number(1.0)\n\n ", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "None", + "got": "assert resolve_type_hint(pseudo_int) is int", + "got_raw": "<|fim_suffix|>\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(pseudo_int) is int\n assert resolve_type_hint(p", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.0425531914893617, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "\"1\"", + "got": "1", + "got_raw": "1\n\n with pytest.raises(plum.NotFoundLookupError) as excinfo:\n f(1.0)\n\n assert str(excinfo.value) == \"f(1.0) could not be resolved.\"\n\n with pytest.raises(plum.NotFoundLookupError) as excinfo:\n f(\"1.0\")\n\n assert str(excinfo.value) == \"f('1.0') could not be resolved.\"\n\n with pytest.raises(plum.AmbiguousLookupError) as excinfo:\n f(1)\n\n assert str(excinfo.value) == \"f(1) is ambiguous.\"\n\n with pytest.raises(plum.A", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "\"/path/to/file\"", + "got": "\"/path/to/file\"", + "got_raw": " \"/path/to/file\"\n\ndef test_repr_type():\n assert repr_type(A) == \"A\"\n assert repr_type(B) == \"B\"\n assert repr_type(C) == \"C\"\n assert repr_type(D) == \"D\"\n assert repr_type(E) == \"E\"\n assert repr_type(F) == \"F\"\n assert repr_type(G) == \"G\"\n assert repr_type(H) == \"H\"\n assert repr_type(I) == \"I\"\n assert repr_type(J) == \"J\"\n assert repr_type(K) == \"K\"\n assert repr_type(L) == \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "1", + "got": "1", + "got_raw": "1\n assert f(2) == 2\n with pytest.raises(plum.NotFoundLookupError):\n f(-1)\n```\n\n```python\n>>> f(1)\n1\n\n>>> f(2)\n2\n\n>>> try: f(-1)\n... except Exception as e: print(f\"{type(e).__name__}: {e}\")\nNotFoundLookupError: `f(-1)` could not be resolved.\nClosest candidates are the following:\n f(x: Annotated[int, 0] at ...>])\n @ ...\n```\n\n##", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "t2", + "got": "assert promote(n, n) == (n, n)", + "got_raw": "<|fim_suffix|>\n assert promote(n, n) == (n, n)\n\n # Also test a more complicated scenario where the types are equal, but\n # not identical.\n t1 = typing.Union[int, float] # noqa: UP007\n t2 = typing.Union[float, int] # noqa: UP007\n\n assert t1 is not t2\n\n # Test that the promotion rule is properly added.\n assert _promotion_rule._pending_registrations == {\n (t1, t2): Num,\n (t2, t1): Num,\n", + "exact_match": false, + "code_bleu": 0.07432998184513635, + "edit_similarity": 0.0625, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "\"f(1)\"", + "got": "1", + "got_raw": "1\n assert _render_function_call(\"f\", (1, 2)) == \"f(1, 2)\"\n assert _render_function_call(\"f\", (1, 2, 3)) == \"f(1, 2, 3)\"\n assert _render_function_call(\"f\", (1, 2, 3, 4)) == \"f(1, 2, 3, 4)\"\n assert _render_function_call(\"f\", (1, 2, 3, 4, 5)) == \"f(1, 2, 3,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "copy(m)", + "got": "copy(m)", + "got_raw": " copy(m)\n assert m == copy(copy(m))\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m == copy(m)\n assert m ==", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "(1, 1)", + "got": "2", + "got_raw": "2\n assert promote(1.0, 1.0) == 2.0\n\n assert promote(1, 1.0) == 2.0\n assert promote(1.0, 1) == 2.0\n\n assert promote(1, 1.0, 1.0) == 3.0\n assert promote(1.0, 1.0, 1) == 3.0\n\n assert promote(1, 1.0, 1.0, 1.0) == 4.0\n assert", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "\"float or str\"", + "got": "\"float or str\"", + "got_raw": " \"float or str\"\n\n with pytest.raises(plum.NotFoundLookupError):\n f(1.0)\n\n with pytest.raises(plum.NotFoundLookupError):\n f(\"1.0\")\n\n with pytest.raises(plum.NotFoundLookupError):\n f(\"1\")\n\n with pytest.raises(plum.NotFoundLookupError):\n f(1.0, 1.0)\n\n with pytest.raises(plum.NotFoundLookupError):\n f(1, 1.0)\n\n with pytest.raises(plum.NotFoundLookupError):\n f(1, 1)\n```\n\n## Dispatchers and Multiple Dispatch\n\n`Dispatcher` is a", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "\"first\\n\\nsecond\"", + "got": "", + "got_raw": "\n\n\n\n\n\n# File: src/plum/_resolver.py\n # `self._doc` remains a string.\n self._doc = value if value else \"\"\n\n @property\n def methods(self) -> MethodList:\n \"\"\"list[:class:`.method.Method`]: All available methods.\"\"\"\n self._resolve_pending_registrations()\n return self._resolver.methods\n\n def dispatch(\n self: Self, method: Callable[..., Any] | None = None, precedence: int = 0\n ) -> Self | Callable[[Callable[..., Any]], Self]:\n \"\"\"Decorator to extend the function with another signature.\n\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "beartype/plum", + "expected": "2", + "got": "2", + "got_raw": "2\n\n assert f(1) == 1\n # Check that cache is used.\n assert len(f._cache) == 1\n\n assert len(f._resolver) == 2\n\n # Clear the cache.\n plum.clear_all_cache()\n\n assert len(f._cache) == 0\n assert len(f._resolver) == 0\n\n assert f(1) == 1\n # Check that cache is used.\n assert len(f._cache) == 1\n\n assert len(f._resolver) == 2\n\n assert f(1.0) == 2\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "tables", + "got": "", + "got_raw": " # Check if the table exists\n assert \"admin_session\" in # Check if the table exists\n assert \"admin_event_log\" in # Check if the table exists\n assert \"admin_audit_log\" in # Check if the table exists\n finally:\n if config is not None:\n await config.admin_engine.dispose()\n os.remove(admin_db_path)\n\n@pytest.mark.asyncio\nasync def test_get_admin_session(async_session):\n \"\"\"Test getting the admin session.\"\"\"\n admin_base = create_admin_base()\n config = DatabaseConfig(\n base=admin_base,\n session=async_session,\n admin_db", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "0", + "got": "0", + "got_raw": "0\n assert result[\"total_count\"] == len(test_data)\n\n # Test filtering by category_id\n result = await crud.get_multi(\n async_session, category_id=1, filter_by=\"category_id\", filter_value=1\n )\n assert len(result[\"data\"]) == 1\n assert result[\"total_count\"] == 1\n\n # Test filtering by price\n result = await crud.get_multi(\n async_session, price__gt=100, filter_by=\"price\", filter_value=100\n )\n assert len(result[\"data\"]) == 1\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "DocumentModel", + "got": "assert model_config[\"crud\"].create == DocumentCreate", + "got_raw": "<|fim_suffix|>\n assert model_config[\"crud\"].create == DocumentCreate\n assert model_config[\"crud\"].update == DocumentUpdate\n assert model_config[\"crud\"].select == DocumentSelect\n\n # Verify that the router was included\n admin.app.include_router.assert_called_once_with(\n admin.models[DocumentModel.__name__][\"crud\"].router,\n prefix=f\"/{DocumentModel.__name__}\",\n include_in_schema=False,\n dependencies=[Depends(get_user_dependency)],\n response_model=None,\n )\n\n # Verify that the admin site was included\n admin.app.include_router.assert_called_once_with(\n admin.admin_site", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.27692307692307694, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "full_fields", + "got": "", + "got_raw": " # \u2705 search_vector included in full schema\n\ndef test_password_transformer():\n \"\"\"Test that password_transformer works as expected.\"\"\"\n # Test that password_transformer works as expected\n password_transformer = PasswordTransformer(\n password_field=\"password\",\n hashed_field=\"hashed_password\",\n hash_function=lambda password: password + \"hashed\",\n required_fields=[\"username\"],\n )\n\n # Test that password_transformer works as expected\n assert password_transformer.transform_create_data(\n {\"username\": \"testuser\", \"password\": \"testpassword\"}\n ) == {\n \"username\": \"testuser\",\n \"hashed", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "3", + "got": "3", + "got_raw": "3\n assert event_integration.event_service.log_auth_event.call_count == 1\n assert event_integration.event_service.log_security_event.call_count == 1\n\n @pytest.mark.asyncio\n async def test_event_logging_failure(\n self, event_integration, mock_db, mock_request\n ):\n \"\"\"Test event logging failure.\"\"\"\n event_integration.event_service.log_event.side_effect = Exception(\n \"Test event logging failure\"\n )\n\n # Log a model event\n await event_integration.log_model_event(\n db=mock_db,\n event_type=EventType.CREATE,\n model=MockModel,\n user_id=1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "3", + "got": "3", + "got_raw": "3\n assert mock_pipeline.execute.call_count == 1\n assert deleted_count == 3\n\n @pytest.mark.asyncio\n async def test_delete_pattern_no_keys(self, redis_storage, mock_redis):\n \"\"\"Test deleting keys matching a pattern from Redis when no keys are found.\"\"\"\n mock_redis.scan_iter = MagicMock(return_value=AsyncIterator([]))\n\n deleted_count = await redis_storage.delete_pattern(\"login:*\")\n\n mock_redis.scan_iter.assert_called_once_with(match=\"login:*\")\n assert deleted_count == 0\n\n @pytest.mark.asyncio\n async def test_delete_pattern_error(self, redis_storage,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "\"AdminAuditLog\"", + "got": "\"AdminAuditLog\"", + "got_raw": " \"AdminAuditLog\"\n assert AuditLogModel.__tablename__ == \"admin_audit_log\"\n assert AuditLogModel.id.__name__ == \"id\"\n assert AuditLogModel.id.__tablename__ == \"admin_audit_log\"\n assert AuditLogModel.id.__table_args__ == {\"extend_existing\": True}\n assert AuditLogModel.id.__table_args__[\"extend_existing\"] == True\n assert AuditLogModel.id.__table_args__[\"extend_existing\"] == True\n assert AuditLogModel.id.__table_args__[\"extend_existing\"] == True\n assert AuditLogModel.id.__table_args__[\"extend_existing\"] == True\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "\"/login\"", + "got": "", + "got_raw": "\n\n\n\n\n\n# File: crudadmin/admin_interface/crud_admin.py\n def __init__(\n self,\n session: Callable[[], AsyncSession],\n SECRET_KEY: str,\n mount_path: str,\n db_config: DatabaseConfig,\n initial_admin: Optional[Dict[str, Any]] = None,\n setup_on_initialization: bool = True,\n track_events: bool = False,\n track_sessions_in_db: bool = False,\n session_backend: str = \"database\",\n redis_config: Optional[Union[RedisConfig, Dict[str, Any]]] = None,\n memcached_config: Optional[Union", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "\"int\"", + "got": "\"int\"", + "got_raw": " \"int\"\n assert pk_info[\"type_name\"] == \"int\"\n\ndef test_uuid_primary_key_detection(db_config, user_model):\n \"\"\"Test that UUID primary keys work correctly.\"\"\"\n pk_info = db_config.get_primary_key_info(user_model)\n\n assert pk_info is not None\n assert pk_info[\"name\"] == \"id\"\n # User model uses UUID primary key\n assert pk_info[\"type\"] is uuid.UUID\n\n assert pk_info[\"type_name\"] == \"uuid\"\n assert pk_info[\"type_name\"] == \"uuid\"\n\ndef test_non_primary_key_detection(db_config, user_model):\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "\"redis\"", + "got": "session_backends.REDIS", + "got_raw": " session_backends.REDIS\n\n # Check Redis configuration was set\n\n assert admin._redis_config == redis_config\n\n # Check initial admin user was set\n\n assert admin._initial_admin == {\"username\": \"admin\", \"password\": \"secure_password123\"}\n\n # Check session management settings were set\n\n assert admin._max_sessions_per_user == 3\n assert admin._session_timeout_minutes == 15\n assert admin._cleanup_interval_minutes == 5\n\n # Check secure cookies settings were set\n\n assert admin._secure_cookies == True\n assert admin._enforce_https == True\n\n", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.06896551724137931, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "None", + "got": "tates(self):", + "got_raw": "<|fim_suffix|>tates(self):\n \"\"\"Test compare_states with removed fields in new state.\"\"\"\n old_state = {\"id\": 1, \"name\": \"test\"}\n new_state = {\"id\": 1, \"name\": \"test\"}\n\n result = compare_states(old_state, new_state)\n\n assert \"email\" not in result\n\n assert result[\"email\"][\"old\"] is None\n assert result[\"email\"][\"new\"] is None\n\n def test_compare_states_no_changes(self):\n \"\"\"Test compare_states with no changes.\"\"\"\n old_state = {\"id\": 1, \"name\": \"test\"}\n new_state", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "2", + "got": "2", + "got_raw": "2\n assert result[\"total_count\"] == 5\n\n # Test second page\n result = await crud.get_multi(async_session, offset=2, limit=2)\n\n assert len(result[\"data\"]) == 2\n assert result[\"total_count\"] == 5\n\n # Test last page\n result = await crud.get_multi(async_session, offset=4, limit=2)\n\n assert len(result[\"data\"]) == 1\n assert result[\"total_count\"] == 5\n\n # Test invalid offset\n with pytest.raises(ValueError):\n await crud.get_multi(async_session, offset=5", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "expected_value", + "got": "expected_value", + "got_raw": " expected_value\n\n @pytest.mark.asyncio\n async def test_use_redis_sessions_with_password_parameter(self, async_session):\n \"\"\"Test Redis sessions configuration with password parameter.\"\"\"\n secret_key = \"test-secret-key-for-testing-only-32-chars\"\n db_config = create_test_db_config(async_session)\n\n redis_config = RedisConfig(\n host=\"redis-server\",\n port=6380,\n db=2,\n password=\"redis_pass\",\n )\n\n admin = CRUDAdmin(\n session=async_session,\n SECRET_KEY=secret_key,\n db_config=db_config,\n setup_on_initialization=False", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "str(config.admin_engine.url)", + "got": "", + "got_raw": " # noqa: E501\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None\n assert config.get_admin_db() is not None", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "mock_event", + "got": "1", + "got_raw": "1\n\n @pytest.mark.asyncio\n async def test_log_model_event_success_with_audit(\n self, event_integration, mock_db, mock_request\n ):\n \"\"\"Test successful model event logging with audit log creation.\"\"\"\n mock_event = MockEventLogModel()\n event_integration.event_service.log_event.return_value = mock_event\n\n result = await event_integration.log_model_event(\n db=mock_db,\n event_type=EventType.CREATE,\n model=MockModel,\n user_id=1,\n session_id=\"test-session\",\n request=mock_request,\n resource_id=\"123\",\n details={\"action", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/crudadmin", + "expected": "session_id)", + "got": "", + "got_raw": "\n\n\n# File: crudadmin/session/manager.py\n async def validate_session(\n self, session_id: str, update_activity: bool = True\n ) -> Optional[SessionData]:\n \"\"\"Validate if a session is active and not timed out.\n\n Args:\n session_id: The session ID\n update_activity: Whether to update the last activity timestamp\n\n Returns:\n The session data if valid, None otherwise\n \"\"\"\n if not session_id:\n return None\n\n try:\n session_data = await self.storage.get(session_id, SessionData)\n if session_data is None:\n logger.warning", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "ModelTest", + "got": "ModelTest", + "got_raw": " ModelTest\n assert builder.sort_processor == SortProcessor(ModelTest)\n assert builder.join_builder == JoinBuilder(ModelTest)\n\n def test_build_base_select(self):\n \"\"\"Test build_base_select method\"\"\"\n builder = SQLQueryBuilder(ModelTest)\n stmt = builder.build_base_select()\n\n assert isinstance(stmt, Select)\n assert stmt.froms[0].table == ModelTest.__table__\n\n def test_apply_filters(self):\n \"\"\"Test apply_filters method\"\"\"\n builder = SQLQueryBuilder(ModelTest)\n filters = [ModelTest.name == \"test\"]\n stmt = builder.build_base_select()\n stmt = builder.apply_filters(stmt,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "None", + "got": "None", + "got_raw": " None\n```\n\n## Error Handling\n\nFastCRUD provides mechanisms to handle common database errors, ensuring robust API behavior.\n\n\n\n# File: docs/usage/crud.md\n--\n tests/sqlalchemy/conftest.py:model_project\n tests/sqlalchemy/conftest.py:model_participant\n tests/sqlalchemy/conftest.py:model_proj_parts_assoc\n --8<--\n ```\n\n```python\nproject_crud = FastCRUD(Project)\nprojects_count = await project_crud.count(\n db=session,\n joins_config=[\n JoinConfig(\n model=Participant,\n join_on=ProjectsParticipantsAssociation.project_id == Project", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "names", + "got": "", + "got_raw": "<|fim_suffix|>\n # Test with multiple like patterns using list syntax\n result = await crud.get_multi(\n async_session, name__or={\"like\": [\"Alice%\", \"Frank%\"]}\n )\n\n assert (\n len(result[\"data\"]) == 4\n ) # Alice Johnson, Alice Cooper, Frank Miller, Frank Sinatra\n names = [item[\"name\"] for item in result[\"data\"]]\n assert all(name.startswith(\"Alice\") or name.startswith(\"Frank\") for name in names)\n\n # Test with case-insensitive multiple patterns\n result = await crud.get_multi(\n async_session, name__or", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "result", + "got": "result", + "got_raw": " result\n assert result[\"next_cursor\"] is not None\n```\n\n## Using `get_joined` and `get_multi_joined` for multiple models\n\nTo facilitate complex data relationships, `get_joined` and `get_multi_joined` can be configured to handle joins with multiple models. This is achieved using the `joins_config` parameter, where you can specify a list of `JoinConfig` instances, each representing a distinct join configuration.\n\nAdditionally, `get_multi_joined` supports counting related objects using the `counts_config` parameter with `CountConfig` instances. This allows you to efficiently get counts of related", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "result", + "got": "", + "got_raw": " # noqa: E712\n assert \"id\" in result[\"data\"][0]\n assert \"name\" in result[\"data\"][0]\n assert \"tier_id\" not in result[\"data\"][0]\n assert \"tier_name\" not in result[\"data\"][0]\n\n # Verify the result data\n assert result[\"data\"][0][\"id\"] == 1\n assert result[\"data\"][0][\"name\"] == \"Charlie\"\n assert result[\"data\"][0][\"tier_id\"] == 1\n assert result[\"data\"][0][\"tier_name\"] == \"Premium\"\n\n # Verify", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "sorted(tier_ids)", + "got": "assert len(result[\"data\"]) == 1, \"Should fetch only one record\"", + "got_raw": "<|fim_suffix|>\n assert len(result[\"data\"]) == 1, \"Should fetch only one record\"\n\n assert result[\"data\"][0][\"name\"] == \"Item 1\", \"Should fetch the correct record\"\n\n assert result[\"total_count\"] == 1, \"Should fetch only one record\"\n\n assert result[\"has_more\"] == False, \"Should not have more records\"\n\n assert result[\"page\"] == 1, \"Should be on the first page\"\n\n assert result[\"items_per_page\"] == 1, \"Should fetch only one record\"\n\n assert result[\"total_pages\"] == 1, \"Should", + "exact_match": false, + "code_bleu": 0.10571070857151538, + "edit_similarity": 0.12658227848101267, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "5", + "got": "5", + "got_raw": "5\n\n records = await crud.get_multi(db=async_session, id__gt=5, id__lt=10)\n for record in records[\"data\"]:\n\n assert 5 < record[\"id\"] < 10\n\n records = await crud.get_multi(db=async_session, id__gt=5, id__lt=10, limit=2)\n for record in records[\"data\"]:\n\n assert 5 < record[\"id\"] < 10\n\n records = await crud.get_multi(db=async_session, id__gt=5, id__lt=10, limit", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "2", + "got": "2", + "got_raw": "2\n assert author_data[\"articles\"][0][\"id\"] == 1\n assert author_data[\"articles\"][0][\"title\"] == \"Article 1\"\n assert author_data[\"articles\"][0][\"content\"] == \"Content 1\"\n assert author_data[\"articles\"][0][\"author_id\"] == 1\n assert author_data[\"articles\"][0][\"published_date\"] == \"2023-01-01\"\n\n assert author_data[\"articles\"][1][\"id\"] == 2\n assert author_data[\"articles\"][1][\"title\"] == \"Article 2\"\n assert author_data", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "len(test_data) - 1", + "got": "1", + "got_raw": "1\n\n count_in = await crud.count(async_session, tier_id__in=[1, 2])\n assert count_in == len([item for item in test_data if item[\"tier_id\"] in [1, 2]])\n\n count_not_in = await crud.count(async_session, tier_id__not_in=[1, 2])\n assert count_not_in == len([item for item in test_data if item[\"tier_id\"] not in [1, 2]])\n\n count_gte = await crud.count(async_session, tier_id__gte=1)\n assert count_gte == len([item for item in", + "exact_match": false, + "code_bleu": 0.09910059291689341, + "edit_similarity": 0.10526315789473684, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "5", + "got": "5", + "got_raw": "5\n assert len(result_with_joins_config[\"data\"]) == 5\n assert len(result_with_join_model[\"data\"]) == len(result_with_joins_config[\"data\"])\n\n\n# File: tests/sqlalchemy/conftest.py\n async def test_get_multi_joined_total_count_with_join_model(\n async_session, test_data, test_data_tier\n ):\n \"\"\"Test that total_count is correct when using join_model parameter.\"\"\"\n # Setup test data\n for tier_item in test_data_tier:\n async_session.add(TierModel(**tier_item))\n await async_session.commit()\n\n for user_item", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "result", + "got": "", + "got_raw": " # ...\n\n\n# File: fastcrud/core/join_processing.py\n \"\"\"\n Extract foreign key column and parent primary key column from join condition.\n\n Args:\n join_on: SQLAlchemy join condition (e.g., Article.author_id == Author.id)\n related_model: The related model (e.g., Article)\n primary_model: The primary/parent model (e.g., Author)\n\n Returns:\n Tuple of (foreign_key_column, parent_pk_column)\n\n Raises:\n ValueError: If cannot extract foreign key info from join condition\n \"\"\"\n try:\n left = join_on.left\n right = join_on.right", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "1", + "got": "1", + "got_raw": "1\n assert data[0][\"children\"] is not None\n assert len(data[0][\"children\"]) == 1\n\n # Verify the bug: should get 2 children but only gets 1\n assert result is not None\n assert \"data\" in result\n data = result[\"data\"]\n\n assert len(data) == 1\n assert data[0][\"children\"] is not None\n assert len(data[0][\"children\"]) == 1\n\n # Verify the bug: should get 2 children but only gets 1\n assert result is not None\n assert \"data", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "1", + "got": "1", + "got_raw": "1\n assert data[\"items_per_page\"] == 5\n\n response = client.get(\"/test/get_multi?itemsPerPage=5&page=2\")\n assert response.status_code == 200\n data = response.json()\n\n assert data[\"page\"] == 2\n assert data[\"items_per_page\"] == 5\n\n response = client.get(\"/test/get_multi?itemsPerPage=5&page=2&offset=10\")\n assert response.status_code == 200\n data = response.json()\n\n assert data[\"page\"] == 2\n assert data[\"items_per_page", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "UserModel", + "got": "", + "got_raw": " # type: ignore\n assert crud.model == # type: ignore\n assert crud.model == # type: ignore\n assert crud.model == # type: ignore\n assert crud.model == # type: ignore\n assert crud.model == # type: ignore\n\n # The schema types should be properly typed\n assert crud.create_schema == # type: ignore\n assert crud.update_schema == # type: ignore\n assert crud.update_internal_schema == # type: ignore\n assert crud.delete_schema == # type: ignore\n assert crud.select_schema == # type", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "0", + "got": "0", + "got_raw": "0\n\n # With built-in gt (>), tier_id__gt=2 should exclude tier_id=2\n result = await crud.get_multi(async_session, tier_id__gt=2)\n\n assert all(item[\"tier_id\"] != 2 for item in result[\"data\"])\n\n assert len(result[\"data\"]) == 0\n```\n\n### Using Custom Filters with FastCRUD\n\n```python\nfrom fastcrud import FastCRUD\n\n# Create FastCRUD instance with custom filters\ncrud = FastCRUD(\n MyModel,\n custom_filters={\n \"year\": year_filter,\n \"double_gt\": double", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "data", + "got": "result = sort_nested_list(data, [\"id\"], [\"asc\"])", + "got_raw": "<|fim_suffix|>\n result = sort_nested_list(data, [\"id\"], [\"asc\"])\n\n assert result == [{\"id\": 1}, {\"id\": 2}]\n\n def test_multiple_sort_columns(self):\n \"\"\"Test multiple sort columns.\"\"\"\n data = [{\"id\": 2, \"name\": \"B\"}, {\"id\": 1, \"name\": \"A\"}]\n result = sort_nested_list(data, [\"name\", \"id\"], [\"asc\", \"desc\"])\n\n assert result == [{\"id\": 1, \"name\": \"A\"}, {\"id\": 2, \"name\": \"B\"}]\n\n def test", + "exact_match": false, + "code_bleu": 0.08839374326825923, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "1", + "got": "1", + "got_raw": "1\n assert filters[\"name\"] == \"John Doe\"\n\n@pytest.mark.asyncio\nasync def test_parse_filters_multiple_conditions(test_model):\n fast_crud = FastCRUD(test_model)\n\n filters = fast_crud._filter_processor.parse_filters(name=\"John Doe\", age=30)\n\n assert len(filters) == 2\n assert filters[\"name\"] == \"John Doe\"\n assert filters[\"age\"] == 30\n\n@pytest.mark.asyncio\nasync def test_parse_filters_invalid_condition(test_model):\n fast_crud = FastCRUD(test_model)\n\n with pytest.raises(ValueError):\n fast_crud._", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "\"456\"", + "got": "456", + "got_raw": "456\n\ndef test_create_dynamic_filters_type_conversion_with_custom_types():\n class CustomType(TypeDecorator):\n impl = PostgresUUID\n\n filter_config = FilterConfig(uuid_field=None, int_field=None, str_field=None)\n column_types = {\n \"uuid_field\": CustomType,\n \"int_field\": int,\n \"str_field\": str,\n }\n\n filters_func = create_dynamic_filters(filter_config, column_types)\n\n test_uuid = \"123e4567-e89b-12d3-a456-426614174000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "0", + "got": "0", + "got_raw": "0\n\n count_eq = await crud.count(async_session, id__eq=1)\n\n assert count_eq == 1\n\n count_lt = await crud.count(async_session, id__lt=1)\n\n assert count_lt == 0\n\n count_gte = await crud.count(async_session, id__gte=1)\n\n assert count_gte == 1\n\n count_lte = await crud.count(async_session, id__lte=1)\n\n assert count_lte == 1\n\n count_in = await crud.count(async_session, id__in=[1, 2, 3])\n\n assert count_in", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benavlabs/fastcrud", + "expected": "tester_data[\"uuid\"]", + "got": "tester_data[\"uuid\"]", + "got_raw": " tester_data[\"uuid\"]\n assert data[\"created_at\"] == tester_data[\"created_at\"]\n assert data[\"updated_at\"] == tester_data[\"updated_at\"]\n assert data[\"deleted_at\"] == tester_data[\"deleted_at\"]\n```\n\n**Dependency Injection** - Dependencies are passed as arguments:\n```python\nfrom fastapi import Depends\nfrom fastapi.testclient import TestClient\nfrom sqlalchemy.ext.asyncio import AsyncSession\nfrom fastapi import FastAPI\nfrom fastcrud import FastCRUD\nfrom .models import Item\nfrom .database import session as db\nfrom .item.schemas import CreateItemSchema, ItemSchema", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benbusby/whoogle-search", + "expected": "200", + "got": "200", + "got_raw": "200\n assert rv.data == b'
Item ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benbusby/whoogle-search", + "expected": "hrefs", + "got": "assert rv._status_code == 200", + "got_raw": "<|fim_suffix|>\n assert rv._status_code == 200\n data = json.loads(rv.data)\n assert data['query'] == 'whoogle'\n assert isinstance(data['results'], list)\n hrefs = {item['href'] for item in data['results']}\n\n assert 'https://example.com/page' in hrefs\n assert 'https://example.org/other' in hrefs\n assert 'https://example.org/other' not in data['results'][0]['text']\n assert 'https://example.org/other' not in data['results'][0]['title']\n assert", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.058823529411764705, + "n_retrieved": 10 + }, + { + "repo": "benbusby/whoogle-search", + "expected": "valid_lang_keys", + "got": "valid_lang_keys, f\"Invalid language key: {translation_key}\"", + "got_raw": " valid_lang_keys, f\"Invalid language key: {translation_key}\"\n # Ensure the translation is using a valid language value\n assert translation_key in valid_lang_keys, f\"Invalid language key: {translation_key}\"\n # Ensure the translation is using a valid language value\n assert translation_key in valid_lang_keys, f\"Invalid language key: {translation_key}\"\n # Ensure the translation is using a valid language value\n assert translation_key in valid_lang_keys, f\"Invalid language key: {translation_key}\"\n # Ensure the translation is using a valid language value\n assert translation_key in ", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.40540540540540543, + "n_retrieved": 10 + }, + { + "repo": "benbusby/whoogle-search", + "expected": "1", + "got": "1", + "got_raw": "1\n assert calls[0]['follow_redirects'] is True\n assert calls[0]['proxies'] == proxies\n\n # Ensure the client was created with the same proxies\n assert client.proxies == proxies\n\n # Ensure the client was created with the same follow_redirects\n assert client._client.follow_redirects is True\n\n # Ensure the client was created with the same http2\n assert client._client.http2 is True\n\n # Ensure the client was created with the same timeout\n assert client._client.timeout == 15.0\n\n # Ensure the client was created with", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "benbusby/whoogle-search", + "expected": "302", + "got": "200", + "got_raw": "200\n assert rv._content_type == 'text/html; charset=utf-8'\n\ndef test_get_results(client):\n rv = client.get(f'/{Endpoint.search}')\n\n assert rv._status_code == 200\n assert rv._content_type == 'text/html; charset=utf-8'\n\ndef test_get_results_with_query(client):\n rv = client.get(f'/{Endpoint.search}?q=test')\n\n assert rv._status_code == 200\n assert rv._content_type == 'text/html; charset=utf-8'\n\ndef test_get_results_with_query_and_params(client):\n rv =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "benbusby/whoogle-search", + "expected": "''.join(divs)", + "got": "divs", + "got_raw": " divs\n finally:\n results_mod.SITE_ALTS = original_site_alts\n\ndef test_no_duplicate_alt_prefix_google(monkeypatch):\n original_site_alts = copy.deepcopy(results_mod.SITE_ALTS)\n try:\n # Simulate user setting alt to www.google.com\n monkeypatch.setitem(results_mod.SITE_ALTS, 'google.com', 'www.google.com')\n\n html = '''\n
\n www.google.com\n
www.google.com
\n
www.google.com 0.5\n assert fbn.accuracy(fmodel, x, y) > 0.5\n assert fbn.accuracy(fmodel, x, y) > 0.5\n assert fbn.accuracy(fmodel, x, y) > 0.5\n assert fbn.accuracy(fmodel, x, y) > 0.5\n assert fbn.accuracy(fmodel, x, y) > 0.5\n assert fbn.accuracy(fmodel, x, y) > ", + "exact_match": false, + "code_bleu": 0.05, + "edit_similarity": 0.06896551724137931, + "n_retrieved": 10 + }, + { + "repo": "bethgelab/foolbox", + "expected": "(10, 5, 3)", + "got": "10, \"first three dimensions should be 10\"", + "got_raw": "10, \"first three dimensions should be 10\"\n assert x.shape[3] == k, f\"fourth dimension should be {k}\"\n\ndef test_atleast_kd_4d(dummy: ep.Tensor, k: int) -> None:\n x = ep.zeros(dummy, (10, 5, 3, 2))\n x = fbn.devutils.atleast_kd(x, k)\n\n assert x.shape[:3] == 10, \"first three dimensions should be 10\"\n assert x.shape[3] == k, f\"fourth dimension should be", + "exact_match": false, + "code_bleu": 0.2548300960720116, + "edit_similarity": 0.19607843137254902, + "n_retrieved": 10 + }, + { + "repo": "bethgelab/foolbox", + "expected": "fbn.accuracy( fmodel, x, target_classes )", + "got": "0.5", + "got_raw": "0.5\n\n assert fbn.accuracy(fmodel, advs, y) > fbn.accuracy(fmodel, x, y)\n\n assert fbn.accuracy(fmodel, advs, target_classes) > 0.5\n\n assert fbn.accuracy(fmodel, advs, y) > fbn.accuracy(fmodel, x, y)\n\n assert fbn.accuracy(fmodel, advs, target_classes) > 0.5\n\n assert fbn.accuracy(fmodel, advs, y) > fbn.accuracy(fmodel, x, y)\n\n assert fbn.accuracy(fmodel, advs, target", + "exact_match": false, + "code_bleu": 0.05, + "edit_similarity": 0.045454545454545456, + "n_retrieved": 10 + }, + { + "repo": "bethgelab/foolbox", + "expected": "ValueError, match=\"starting_points\")", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n BinarizationRefinementAttack(threshold=0.5, included_in=\"upper\", distance=Distance.Linf)\n\n\ndef test_binarization_attack_with_distance(\n fmodel_and_data_ext_for_attacks: ModeAndDataAndDescription,\n) -> None:\n\n # get a model with thresholding\n (fmodel, x, y), _, low_dimensional_input = fmodel_and_data_ext_for_attacks\n\n # binarization doesn't work well for imagenet models\n if not low_dimensional_input:\n pytest.skip()\n\n x = (x - fmodel.bounds.lower)", + "exact_match": false, + "code_bleu": 0.2259005009024612, + "edit_similarity": 0.2807017543859649, + "n_retrieved": 10 + }, + { + "repo": "bethgelab/foolbox", + "expected": "repr(distances[p])", + "got": "repr(p)", + "got_raw": " repr(p)\n assert str(p) in str(p)\n\n@pytest.mark.parametrize(\"p\", [0, 1, 2, ep.inf])\ndef test_distance_call(p: float) -> None:\n\n reference, perturbed = reference_perturbed(p, ep.arange(10, 100, dtype=np.float32))\n assert ep.allclose(perturbed, reference + p)\n\n@pytest.mark.parametrize(\"p\", [0, 1, 2, ep.inf])\ndef test_distance_clip_perturbation(p: float) -> None:\n\n reference, perturbed = reference_perturbed(p,", + "exact_match": false, + "code_bleu": 0.307019980521012, + "edit_similarity": 0.56, + "n_retrieved": 10 + }, + { + "repo": "bethgelab/foolbox", + "expected": "ValueError, match=\"channel_axis\")", + "got": "NotImplementedError, match=\"data_format\"):", + "got_raw": "NotImplementedError, match=\"data_format\"):\n fbn.attacks.GenAttack(reduced_dims=(2, 2)).run(\n fmodel, x, fbn.TargetedMisclassification(y), epsilon=0.3, data_format=\"foo\"\n )\n\n\n with pytest.raises(ValueError, match=\"reduced_dims\"):\n fbn.attacks.GenAttack(reduced_dims=(2, 2)).run(\n fmodel, x, fbn.TargetedMisclassification(y), epsilon=0.3\n )\n\n\n with pytest.raises(ValueError, match=\"reduced_dims\"):\n fbn.attacks.GenAttack(reduced_dims", + "exact_match": false, + "code_bleu": 0.3655552228545123, + "edit_similarity": 0.5333333333333333, + "n_retrieved": 10 + }, + { + "repo": "bethgelab/foolbox", + "expected": "2", + "got": "2", + "got_raw": "2\n assert logits.shape[0] == x.shape[0]\n assert logits.shape[1] == fmodel.num_classes\n\n assert logits.shape[1] == fmodel.num_classes\n assert logits.shape[0] == x.shape[0]\n\n assert logits.shape[1] == fmodel.num_classes\n assert logits.shape[0] == x.shape[0]\n\n assert logits.shape[1] == fmodel.num_classes\n assert logits.shape[0] == x.shape[0]\n\n assert logits.shape[1] == fmodel.num_classes\n assert logits.shape[0] == x", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bethgelab/foolbox", + "expected": "x.shape", + "got": "x.shape", + "got_raw": " x.shape\n assert clipped.shape == x.shape\n assert success.shape == x.shape\n\n assert raw.dtype == x.dtype\n assert clipped.dtype == x.dtype\n assert success.dtype == x.dtype\n\n assert raw.ndim == x.ndim\n assert clipped.ndim == x.ndim\n assert success.ndim == x.ndim\n\n assert raw.shape[0] == x.shape[0]\n assert clipped.shape[0] == x.shape[0]\n assert success.shape[0] == x.shape[0]\n\n assert raw.shape[1:] == x.shape[1:]\n assert clipped.shape[1:] == x", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "[\"metrics\"]", + "got": "assert result == [\"tablemetricflowapi\"]", + "got_raw": "<|fim_suffix|>\n assert result == [\"tablemetricflowapi\"]\n\ndef test_metricflow_dialect_get_columns() -> None:\n \"\"\"\n Test ``MetricFlowDialect.get_columns`` method.\n \"\"\"\n dialect = MetricFlowDialect()\n mock_connection = MagicMock()\n\n result = dialect.get_columns(mock_connection)\n\n assert result == [\n {\n \"name\": \"order_id__ordered_at__month\",\n \"type\": get_sqla_type(String),\n \"nullable\": True,\n \"default\": None,\n \"comment\": \"order_id__ordered_at__month\",\n },\n {\n \"name\": \"order", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "\"11\"", + "got": "14", + "got_raw": "14\n assert token.format(datetime(2021, 11, 12, 13, 14, 15, 16), tokens) == 14\n assert token.format(datetime(2021, 11, 12, 13, 14, 15, 16), tokens) == 14\n assert token.format(datetime(2021, 11, 12, 13, 14, 15, 16), tokens) == 14", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "{}", + "got": "", + "got_raw": " # noqa: E712\n {\n \"Sheet title\": \"Sheet1\",\n \"Spreadsheet title\": \"Sheet1\",\n }\n\ndef test_get_metadata_with_headers(\n mocker: MockerFixture,\n simple_sheet_adapter: requests_mock.Adapter,\n) -> None:\n \"\"\"\n Test ``get_metadata`` with headers.\n \"\"\"\n mocker.patch(\n \"shillelagh.adapters.api.gsheets.adapter.get_credentials\",\n return_value=\"SECRET\",\n )\n\n session = requests.Session()\n session.mount(\"https://\", simple_sheet_adapter)\n mocker.patch(\n \"shillelagh.adapters.api.gsheets", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "[0, 1]", + "got": "2 * [0, 1]", + "got_raw": "2 * [0, 1]\n\n rows = apply_limit_and_offset(iter(range(10)), limit=2, offset=2)\n\n assert list(rows) == 2 * [2, 3]\n\n rows = apply_limit_and_offset(iter(range(10)), limit=2, offset=2, requested_columns={\"a\": \"b\"})\n\n assert list(rows) == 2 * [2, 3]\n\n rows = apply_limit_and_offset(iter(range(10)), limit=2, offset=2, requested_columns={\"a\": \"b\", \"c\": \"d\"})\n\n assert list", + "exact_match": false, + "code_bleu": 0.6803749333171202, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "()", + "got": "", + "got_raw": " # pragma: no cover\n assert kwargs == # pragma: no cover\n\ndef test_metricflow_dialect_create_connect_args_custom_host() -> None:\n \"\"\"\n Test ``MetricFlowDialect.create_connect_args`` with custom host.\n \"\"\"\n dialect = MetricFlowDialect()\n url = make_url(\"metricflow://custom_host/123?service_token=test_token\")\n\n with mock.patch(\n \"shillelagh.backends.apsw.dialects.metricflow.registry\",\n ) as mock_registry:\n mock_registry.loaders = {}\n\n args, kwargs = dialect.create_connect_args(url)\n\n\n assert args", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "Exception)", + "got": "ImpossibleFilterError):", + "got_raw": "ImpossibleFilterError):\n combine_time_filters(bounds)\n\n bounds = {\n \"time\": Impossible(),\n \"time_epoch\": Range(\n None,\n datetime(2020, 1, 1, tzinfo=timezone.utc).timestamp(),\n ),\n }\n with pytest.raises(ImpossibleFilterError):\n combine_time_filters(bounds)\n\n bounds = {\n \"time\": Impossible(),\n \"time_epoch\": Impossible(),\n }\n with pytest.raises(ImpossibleFilterError):\n combine_time_filters(bounds)\n\n bounds = {\n \"time\": Impossible(),\n \"time_epoch\": Impossible(),\n }\n with pytest.raises", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "[{\"a\": 1.0, \"b\": 2.0, \"rowid\": 0}]", + "got": "1", + "got_raw": "1\n\n assert adapter.get_columns() == {\n \"a\": Float(\n filters=[Range, Equal, NotEqual, IsNull, IsNotNull],\n order=Order.NONE,\n exact=True,\n ),\n \"b\": Float(\n filters=[Range, Equal, NotEqual, IsNull, IsNotNull],\n order=Order.NONE,\n exact=True,\n ),\n }\n\n assert list(adapter.get_data({}, [])) == 1\n\n assert adapter.get_columns() == {\n \"a\": Float(\n filters=[Range, Equal, NotEqual, IsNull, IsNotNull],\n order=Order.NONE", + "exact_match": false, + "code_bleu": 0.03333333333333333, + "edit_similarity": 0.05714285714285714, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "3", + "got": "3", + "got_raw": "3\n assert gsheets_adapter._row_ids == {\n 0: {\"cnt\": \"10\", \"country\": \"UK\"},\n 3: {\"cnt\": 11, \"country\": \"PY\"},\n }\n assert simple_sheet_adapter.last_request.json() == {\n \"range\": \"Sheet1\",\n \"majorDimension\": \"ROWS\",\n \"values\": [[\"PY\", 11]],\n }\n\n row_id = gsheets_adapter.insert_row({\"country\": \"PY\", \"cnt\": 11, \"rowid\": 3})\n\n assert row_id == 3\n assert gs", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "InvalidPattern)", + "got": "InvalidPattern):", + "got_raw": "InvalidPattern):\n list(tokenize(\"dd/mm/yyyy -> (dd/mm/yyyy)\", classes))\n\n\n with pytest.raises(InvalidPattern):\n list(tokenize(\"dd/mm/yyyy -> (dd/mm/yyyy)\", classes))\n\n\n with pytest.raises(InvalidPattern):\n list(tokenize(\"dd/mm/yyyy -> (dd/mm/yyyy)\", classes))\n\n\n with pytest.raises(InvalidPattern):\n list(tokenize(\"dd/mm/yyyy -> (dd/mm/yyyy)\", classes))\n\n\n with pytest.raises(InvalidPattern):\n list(tokenize(\"dd/mm/yyyy -> (dd/mm/yyyy)\", classes))\n\n\n with pytest.raises(InvalidPattern):\n list(tokenize(\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.967741935483871, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "1", + "got": "10", + "got_raw": "10\n assert end != \"10\"\n assert end != \"10]\"\n assert end != \"10)\"\n assert end != \"10]0\"\n assert end != \"10)0\"\n assert end != \"10]0)\"\n assert end != \"10)0]\"\n\n assert end != build_endpoint(\"10)\")\n assert end != build_endpoint(\"10]0)\")\n assert end != build_endpoint(\"10)0]\")\n assert end != build_endpoint(\"10]0)0\")\n assert end != build_endpoint(\"10)0]", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "{}", + "got": "", + "got_raw": " # type: ignore\n\n\ndef test_convert_rows_to_sqlite() -> None:\n \"\"\"\n Test ``convert_rows_to_sqlite``.\n \"\"\"\n columns = {\n \"id\": Integer(),\n \"name\": String(),\n \"age\": Integer(),\n }\n rows = [\n {\"id\": 1, \"name\": \"Alice\", \"age\": 25},\n {\"id\": 2, \"name\": \"Bob\", \"age\": 30},\n ]\n\n expected = [\n {\"id\": 1, \"name\": \"Alice\", \"age\": 25},\n {\"id\":", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "[(\"bob\", \"Italy\")]", + "got": "", + "got_raw": " # type: ignore[no-any-return]\n [\n (\"bob\", \"Italy\"),\n ]\n\n\ndef test_csvfile() -> None:\n \"\"\"\n Test CSV file adapter.\n \"\"\"\n connection = connect(\":memory:\", [\"csvfile\"])\n cursor = connection.cursor()\n\n sql = \"\"\"\n SELECT * FROM \"test.csv\"\n \"\"\"\n data = list(cursor.execute(sql))\n\n assert data == # type: ignore[no-any-return]\n [\n (1, 15.2, \"Diamond_St\"),\n (2, 13.1, \"Blacktail_Loop\"),\n (3, ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "0", + "got": "0", + "got_raw": "0\n assert cursor.Rowid() == 1\n assert cursor.Rowid() == 2\n assert cursor.Rowid() == 3\n assert cursor.Rowid() == 4\n assert cursor.Rowid() == 5\n assert cursor.Rowid() == 6\n assert cursor.Rowid() == 7\n assert cursor.Rowid() == 8\n assert cursor.Rowid() == 9\n assert cursor.Rowid() == 10\n assert cursor.Rowid() == 11\n assert cursor.Rowid() == 12\n assert cursor", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "[(version,)]", + "got": "", + "got_raw": " # type: ignore[no-any-return]\n [(version,)]\n\ndef test_version_from_python() -> None:\n \"\"\"\n Test calling ``version`` from Python.\n \"\"\"\n assert version() == distribution(\"shillelagh\").version\n\ndef test_get_metadata_from_sql() -> None:\n \"\"\"\n Test calling ``get_metadata`` from SQL.\n \"\"\"\n connection = connect(\":memory:\")\n cursor = connection.cursor()\n cursor.execute(\"SELECT get_metadata('https://docs.google.com/spreadsheets/d/1/edit#gid=0')\")\n metadata = json.loads(cursor.fetchall()[0][0])\n\n assert metadata[\"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "{\"column1\": {(Operator.EQ, 3)}}", + "got": "", + "got_raw": " # pylint: disable=protected-access\n defaultdict(set, {\"column1\": {(Operator.EQ, 3)}})\n\n assert get_all_bounds([quals[1]]) == # pylint: disable=protected-access\n defaultdict(set, {\"column2\": {(Operator.LIKE, \"test%\")}})\n\n assert get_all_bounds([quals[2]]) == # pylint: disable=protected-access\n defaultdict(set, {\"column3\": {(Operator.GT, 10)}})\n\n assert get_all_bounds(quals) == # pylint: disable=protected-access\n defaultdict(set, {\n \"column", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "[]", + "got": "", + "got_raw": " # pylint: disable=use-implicit-booleaness-not-comparison\n\n\n# File: src/shillelagh/adapters/api/weatherapi.py\n return (\n parsed.netloc == \"api.weatherapi.com\"\n and parsed.path == \"/v1/history.json\"\n and \"q\" in query_string\n and (\"key\" in query_string or \"api_key\" in kwargs)\n )\n\n @staticmethod\n def parse_uri(uri: str) -> Union[tuple[str], tuple[str, str]]:\n parsed = urllib.parse.urlparse(uri)\n query_string = urllib.parse.parse_qs(parsed.query)\n location =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "[{\"rowid\": 0}]", + "got": "", + "got_raw": " # nopycln: type: # pylint: disable=use-implicit-booleaness-not-comparison\n [\n {\n \"id\": \"https://api.weatherapi.com/v1/history.json?q=London\",\n \"time\": \"2021-01-01T00:00:00Z\",\n \"data\": {\n \"current\": {\n \"last_updated\": \"2021-01-01T00:00:00Z\",\n \"last_updated_epoch\": 1609459200,\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "\"1.0\"", + "got": "1.0", + "got_raw": "1.0\n assert Number().format(None) is None\n\ndef test_number_filter() -> None:\n \"\"\"\n Test that numbers are converted correctly.\n \"\"\"\n assert Number().parse(\"1.0\") == 1.0\n assert Number().parse(None) is None\n\n assert Number().format(1.0) == 1.0\n assert Number().format(None) is None\n\ndef test_number_filter() -> None:\n \"\"\"\n Test that numbers are converted correctly.\n \"\"\"\n assert Number().parse(\"1.0\") == 1.0\n assert Number().parse(None", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "[(\"Sam\", \"(949) 555-1234\", \"Irvine\", \"Solutions Architect\")]", + "got": "assert data == [", + "got_raw": "<|fim_suffix|>\n assert data == [\n {\"Name\": \"Sam\", \"PhoneNumber\": \"(949) 555-1234\", \"City\": \"Irvine\", \"Occupation\": \"Solutions Architect\"},\n {\"Name\": \"John\", \"PhoneNumber\": \"(949) 555-1235\", \"City\": \"Irvine\", \"Occupation\": \"Solutions Architect\"},\n ]\n\ndef test_s3select_json(boto3: MagicMock) -> None:\n \"\"\"\n Test the adapter.\n \"\"\"\n connection = connect(\":memory:\")\n cursor = connection.cursor()\n\n", + "exact_match": false, + "code_bleu": 0.12409640285041212, + "edit_similarity": 0.10526315789473684, + "n_retrieved": 10 + }, + { + "repo": "betodealmeida/shillelagh", + "expected": "\"5\"", + "got": "5", + "got_raw": "5\n assert token.format(datetime(2021, 11, 12, 13, 14, 5, 16), tokens) == 5\n assert token.format(datetime(2021, 11, 12, 13, 14, 5, 16), tokens) == 5\n assert token.format(datetime(2021, 11, 12, 13, 14, 5, 16), tokens) == 5\n assert token.format(datetime(", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "1", + "got": "1", + "got_raw": "1\n assert json[0][\"id\"] == invoice[\"id\"]\n assert json[0][\"status\"] == invoice[\"status\"]\n assert json[0][\"exception_status\"] == invoice[\"exception_status\"]\n assert json[0][\"sent_amount\"] == invoice[\"sent_amount\"]\n assert json[0][\"created\"] == invoice[\"created\"]\n assert json[0][\"updated\"] == invoice[\"updated\"]\n assert json[0][\"order_id\"] == invoice[\"order_id\"]\n assert json[0][\"currency\"] == invoice[\"currency\"]\n assert json[0][\"price\"] == invoice[\"price\"]\n assert json", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "1", + "got": "1", + "got_raw": "1\n payment = payments[0]\n self._check_key(payment, \"created\", datetime)\n self._check_key(payment, \"recommended_fee\", Decimal)\n self._check_key(payment, \"id\", str)\n self._check_key(payment, \"address\", str)\n self._check_key(payment, \"currency\", str)\n self._check_key(payment, \"amount\", Decimal)\n self._check_key(payment, \"fee\", Decimal)\n self._check_key(payment, \"fee_currency\", str)\n self._check_key(payment, \"fee_amount\", Decimal)\n self._check_key(payment, \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "\"test\"", + "got": "1", + "got_raw": "1\n assert tor_service.parse_hidden_service(\"HiddenServiceDir test 1\") == 1\n assert tor_service.parse_hidden_service(\"HiddenServiceDir test 2\") == 2\n assert tor_service.parse_hidden_service(\"HiddenServiceDir test 3\") == 3\n assert tor_service.parse_hidden_service(\"HiddenServiceDir test 4\") == 4\n assert tor_service.parse_hidden_service(\"HiddenServiceDir test 5\") == 5\n assert tor_service.parse_hidden_service(\"HiddenServiceDir test 6\") == 6\n assert tor_service.parse_hidden_service(\"HiddenServiceDir test", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "method)", + "got": "tate: dict[str, Any]) -> None:", + "got_raw": "<|fim_suffix|>tate: dict[str, Any]) -> None:\n data = super().create_data(state)\n self._add_related(data, state)\n return data\n\n def expected_resp(self, state: dict[str, Any]) -> dict[str, Any]:\n data = super().expected_resp(state)\n self._add_related(data, state)\n return data\n\n def check_data(self, data: dict[str, Any]) -> None:\n super().check_data(data)\n self.check_payments(data)\n\n def check_payments(self, data: dict[str, Any]) -> None:\n self._check_key(data, \"", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.16216216216216217, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "\"BTC (\u26a1)\"", + "got": "1", + "got_raw": "1\n assert resp.json()[\"paid_amount\"] == truncate(LNPAY_AMOUNT, 8)\n assert resp.json()[\"paid_amount_confirmed\"] == truncate(LNPAY_AMOUNT, 8)\n assert resp.json()[\"paid_amount_unconfirmed\"] == \"0.00000000\"\n assert resp.json()[\"paid_amount_pending\"] == \"0.00000000\"\n assert resp.json()[\"paid_amount_total\"] == truncate(LNPAY_AMOUNT, 8)\n assert resp.json()[\"paid_amount_total_confirmed\"] == truncate(LNPAY_AMOUNT, 8)\n assert resp", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "\"Bitcart Merchants API\"", + "got": "\"Bitcart Merchants API\"", + "got_raw": " \"Bitcart Merchants API\"\n\n assert tor_service.get_service_name(\"Bitcart-Merchants-API-2\") == \"Bitcart Merchants API 2\"\n\n assert tor_service.get_service_name(\"Bitcart-Merchants-API-3\") == \"Bitcart Merchants API 3\"\n\n assert tor_service.get_service_name(\"Bitcart-Merchants-API-4\") == \"Bitcart Merchants API 4\"\n\n assert tor_service.get_service_name(\"Bitcart-Merchants-API-5\") == \"Bitcart Merchants API 5\"\n\n assert tor_service.get_service_name(\"Bitcart-Merchants", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "\"-\"", + "got": "0", + "got_raw": "0\n assert code[6] == 1\n assert code[7] == 2\n assert code[8] == 3\n assert code[9] == 4\n assert code[10] == 5\n\n assert code[0] in TFA_RECOVERY_ALPHABET\n assert code[1] in TFA_RECOVERY_ALPHABET\n assert code[2] in TFA_RECOVERY_ALPHABET\n assert code[3] in TFA_RECOVERY_ALPHABET\n assert code[4] in TFA_RECOVERY", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "j", + "got": "", + "got_raw": " # pragma: no cover\n assert \"updated\" in # pragma: no cover\n assert \"id\" in # pragma: no cover\n assert \"email\" in # pragma: no cover\n assert \"username\" in # pragma: no cover\n assert \"is_superuser\" in # pragma: no cover\n assert \"is_active\" in # pragma: no cover\n assert \"preferences\" in # pragma: no cover\n assert \"last_login\" in # pragma: no cover\n assert \"last_login_ip\" in # pragma: no cover\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitcart/bitcart", + "expected": "\"Hello {{var}}!\"", + "got": "\"Hello {{var}}!\"", + "got_raw": " \"Hello {{var}}!\"\n\n assert template.render(var=\"World\") == \"Hello World!\"\n\n assert template.render(var=123) == \"Hello 123!\"\n\n assert template.render(var=123.456) == \"Hello 123.456!\"\n\n assert template.render(var=True) == \"Hello True!\"\n\n assert template.render(var=False) == \"Hello False!\"\n\n assert template.render(var=None) == \"Hello None!\"\n\n assert template.render(var=[]) == \"Hello []!\"\n\n assert template.render(var=[]) == \"Hello []!\"\n\n assert template.render(var", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "deserialized.state", + "got": "0", + "got_raw": "0\n assert deserialized.state == 0\n\n assert linear8bit.weight.has_fp16_weights\n assert deserialized.weight.has_fp16_weights\n\n assert linear8bit.weight.quant_state is None\n assert deserialized.weight.quant_state is None\n\n assert linear8bit.weight.quant_state is None\n assert deserialized.weight.quant_state is None\n\n assert linear8bit.weight.quant_state is None\n assert deserialized.weight.quant_state is None\n\n assert linear8bit.weight.quant_state is None\n assert deserialized.weight.quant_state is None\n\n assert linear8bit.weight.quant_state is None", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "None", + "got": "", + "got_raw": "<|fim_suffix|>\n # 1. torch.ops.bitsandbytes.quantize_4bit(w, 64, \"nf4\", uint8) \u2192 CUDA kernel\n # 2. If compress_statistics: quantize absmax with quantize_blockwise\n # 3. Build QuantState(absmax, shape, dtype, blocksize, code, nested_state)\n # \u2193\n # self.data = w_4bit # Packed 4-bit tensor\n # self.quant_state = quant_state\n # self.bnb_quantized = True\n # self.module = layer\n # self", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "fx_ours)", + "got": "", + "got_raw": "<|fim_suffix|>\n # TODO: Remove, this is no longer implemented\n linear_custom.state.force_no_igemmlt = True\n\n linear_custom.weight = bnb.nn.Int8Params(\n linear.weight.data.clone(),\n requires_grad=False,\n has_fp16_weights=False,\n ).to(linear.weight.dtype)\n linear_custom.bias = linear.bias\n linear_custom = linear_custom.to(device)\n linear = linear.half().to(device)\n\n x_ref = x.clone().to(device).requires_grad_(True)\n x_ours = x.clone().to(device).requires_grad_(True)\n fx_ref", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "deq_c)", + "got": "A_noncontig, rtol=0.1, atol=0.02)", + "got_raw": " A_noncontig, rtol=0.1, atol=0.02)\n torch.testing.assert_close(deq_c, A_contig, rtol=0.1, atol=0.02)\n\n @pytest.mark.parametrize(\"device\", get_available_devices())\n @pytest.mark.parametrize(\"dtype\", [torch.float16, torch.bfloat16, torch.float32], ids=id_formatter(\"dtype\"))\n @pytest.mark.parametrize(\"quant_type\", [\"fp4\", \"nf4\"])\n @pytest.mark.parametrize(\"blocksize\", [64, 128, 25", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "dict_keys_after", + "got": "dict_keys_after", + "got_raw": " dict_keys_after\n assert dict_keys_before == dict_keys_copy\n\n # check that the quantization state is preserved\n assert param.quant_state == copy_param.quant_state\n\n # check that the data is preserved\n assert param.data.data_ptr() == copy_param.data.data_ptr()\n\n # check that the quantization state is preserved\n assert param.quant_state == copy_param.quant_state\n\n # check that the data is preserved\n assert param.data.data_ptr() == copy_param.data.data_ptr()\n\n # check that the quantization state is preserved\n assert param.quant_state == copy_param.quant_state\n\n #", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "RuntimeError)", + "got": "", + "got_raw": "\n\n\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md\n# File: agents/api_surface.md", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "n_cases", + "got": "1", + "got_raw": "1\n assert outputs[0] == text\n\n@pytest.mark.parametrize(\"DQ\", TRUE_FALSE, ids=id_formatter(\"dq\"))\n@pytest.mark.parametrize(\"inference_kernel\", TRUE_FALSE, ids=id_formatter(\"inference_kernel\"))\n@pytest.mark.parametrize(\"dtype\", [torch.float16], ids=describe_dtype)\n@pytest.mark.slow\ndef test_pi_2(requires_cuda, model_and_tokenizer, inference_kernel, DQ, dtype):\n fixture_config, model, tokenizer = model_and_tokenizer\n\n generation_config = transformers.GenerationConfig(\n max_new_tokens=20,\n do_sample=True,\n top_p=", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "ref_output.device", + "got": "", + "got_raw": "<|fim_suffix|>\n # Create a small network with Linear4bit layers\n net = torch.nn.Sequential(\n *[\n bnb.nn.Linear4bit(\n dim,\n dim,\n bias=bias,\n compute_dtype=compute_dtype,\n compress_statistics=compress_statistics,\n quant_type=quant_type,\n )\n for _ in range(4)\n ]\n ).to(device)\n\n # Create input tensor\n x = torch.randn(batch_size, dim, dtype=compute_dtype, device=device)\n\n # Get reference output before compilation\n with torch.no_grad():\n ref_output = net(x)\n\n #", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "A1)", + "got": "127.0 / maxA)", + "got_raw": "127.0 / maxA)\n torch.testing.assert_close(C2a, 127.0 / maxB)\n\n C1b, stats1b, _ = F.int8_vectorwise_quant(A, threshold=6.0)\n C2b, stats2b, _ = F.int8_vectorwise_quant(B, threshold=6.0)\n A1, maxA = self.vectorwise_quant(A, dim=1)\n B1, maxB = self.vectorwise_quant(B, dim=1)\n\n torch.testing.assert_close(maxA.flatten().float(), stats1b)\n ", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "deep_copy.state", + "got": "0", + "got_raw": "0\n assert deep_copy.state == 0\n\n assert linear8bit.quant_state == 0\n assert deep_copy.quant_state == 0\n\n assert linear8bit.bnb_quantized == False\n assert deep_copy.bnb_quantized == False\n\n assert linear8bit.module is None\n assert deep_copy.module is None\n\ndef test_linear8bit_pickle(linear8bit):\n with TemporaryDirectory() as tmpdir:\n path = os.path.join(tmpdir, \"linear8bit.pkl\")\n with open(path, \"wb\") as f:\n pickle.dump(linear8bit, f)\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bitsandbytes-foundation/bitsandbytes", + "expected": "\"libbitsandbytes_rocm72\"", + "got": "assert get_cuda_bnb_library_path(cuda120_spec).stem == \"libbitsandbytes_cuda120.so\"", + "got_raw": "<|fim_suffix|>\n assert get_cuda_bnb_library_path(cuda120_spec).stem == \"libbitsandbytes_cuda120.so\"\n\n # Check that the library path is correct\n assert get_cuda_bnb_library_path(cuda120_spec).exists()\n\n # Check that the library path is correct\n assert get_cuda_bnb_library_path(cuda120_spec).exists()\n\n # Check that the library path is correct\n assert get_cuda_bnb_library_path(cuda120_spec).exists()\n\n # Check that the library path is correct\n assert get_cuda_bnb_library_path(cuda12", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.37383177570093457, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "1", + "got": "1", + "got_raw": "1\n assert result_data[\"records\"][0][\"b\"] == \"x\"\n\n async def test_json_filters_with_complex_filter(self, mcp_server):\n \"\"\"Test that JSON-stringified filters with complex filters work.\"\"\"\n tool = mcp_server._tool_manager._tools[\"query_model\"]\n\n result = await tool.run(\n {\n \"model_name\": \"test\",\n \"dimensions\": '[\"b\"]',\n \"measures\": '[\"count\"]',\n \"filters\": '[{\"field\": \"b\", \"operator\": \"=\", \"value\": \"x\"}, {\"field\": \"a\", \"operator\": \">\",", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "2", + "got": "2", + "got_raw": "2\n\n # Should have two colors (X and Y)\n\n assert len(spec[\"color\"]) == 2\n\n def test_bar_chart_single_series(self, backend, sample_data):\n \"\"\"Test bar chart with single series.\"\"\"\n spec = backend.generate_spec(\n sample_data,\n chart_type=\"bar\",\n x=\"category\",\n y=\"value\",\n )\n\n # Should have one series\n\n assert len(spec[\"series\"]) == 1\n\n def test_line_chart(self, backend, sample_data):\n \"\"\"Test line chart.\"\"\"\n spec = backend.generate_spec(\n sample_data,\n chart_type=\"line", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "1", + "got": "1", + "got_raw": "1\n assert timestamps[0].name == \"statement_date\"\n assert timestamps[0].is_event_timestamp\n assert timestamps[0].is_time_dimension\n assert timestamps[0].smallest_time_grain == \"TIME_GRAIN_DAY\"\n\ndef test_find_event_timestamp_dimensions_with_no_timestamp():\n \"\"\"Test that find_event_timestamp_dimensions returns an empty list when no event timestamp dimensions are found.\"\"\"\n t = ibis.memtable({\"x\": [100, 200]})\n dims_defs = {\n \"x\": Dimension(expr=lambda tbl: tbl.x, description=\"regular dim\"),\n }\n semantic", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "3", + "got": "3", + "got_raw": "3\n assert result[0][\"event_count\"] == 6\n assert result[0][\"total_page_views\"] == 6\n assert result[0][\"duration_minutes\"] == 15\n\n assert result[1][\"event_count\"] == 3\n assert result[1][\"total_page_views\"] == 3\n assert result[1][\"duration_minutes\"] == 15\n\n assert result[2][\"event_count\"] == 1\n assert result[2][\"total_page_views\"] == 1\n assert result[2][\"duration_minutes\"] == 15\n\n def test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "1", + "got": "1", + "got_raw": "1\n assert result.set_index(\"orders.customer_id\").loc[102, \"customers.item_count\"] == 1\n assert result.set_index(\"orders.customer_id\").loc[103, \"customers.item_count\"] == 1\n\n def test_explicit_prefix_overrides_short_name_with_pre_aggregation(\n self, ecommerce_tables,\n ):\n \"\"\"Test that explicit prefixed names work even when short names exist.\"\"\"\n orders_tbl = ecommerce_tables[\"orders\"]\n customers_tbl = ecommerce_tables[\"customers\"]\n\n orders_st = (\n to_semantic_table(orders_tbl, \"orders\")\n .with_dimensions", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "{\"/page\"}", + "got": "e_routes_from_app_tsx(tmp_path)", + "got_raw": "<|fim_suffix|>e_routes_from_app_tsx(tmp_path)\n\n assert routes == {\"/page\"}\n assert redirects == {}\n\n def test_extract_routes_from_app_tsx_with_redirect(self, tmp_path):\n \"\"\"Test that redirects are correctly extracted.\"\"\"\n app_tsx_path = tmp_path / \"App.tsx\"\n app_tsx_path.write_text(\n \"\"\"\n } />\n } />\n \"\"\"\n )\n\n routes, redirects = extract_routes_from_app_tsx(tmp_path)\n\n assert routes == {\"/page", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.1, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "\"DONE\"", + "got": "\"DONE\"", + "got_raw": " \"DONE\"\n\ndef test_safe_eval_multiline_with_leading_newline_and_model_name():\n \"\"\"Test multiline query starting with the model name on first line.\"\"\"\n\n class MockModel:\n def filter(self, fn):\n return self\n\n def group_by(self, *args):\n return self\n\n def aggregate(self, *args):\n return \"DONE\"\n\n # Query that starts with model on its own line\n query = \"\"\"model\n.filter(lambda t: t.x > 0)\n.group_by('y')\n.aggregate('z')\"\"\"\n\n result = safe_eval(query, context={\"model\": MockModel()})\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "edges", + "got": "", + "got_raw": " # noqa: WPS323\n assert (\"price\", \"revenue\") in # noqa: WPS323\n assert (\"revenue\", \"total_revenue\") in # noqa: WPS323\n assert (\"revenue\", \"avg_revenue\") in # noqa: WPS323\n\n # Check edge types\n edge_types = {edge[\"source\"], edge[\"target\"]: edge[\"type\"] for edge in graph_dict[\"edges\"]}\n assert edge_types[\"quantity\", \"revenue\"] == \"column\"\n assert edge_types[\"price\", \"re", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "None", + "got": "assert bsl.tools == {", + "got_raw": "<|fim_suffix|>\n assert bsl.tools == {\n \"list_models\": mock_list_models,\n \"get_model\": mock_get_model,\n \"get_time_range\": mock_get_time_range,\n \"query_model\": mock_query_model,\n }\n\n @patch(\"boring_semantic_layer.agents.tools.from_yaml\")\n def test_init_with_profile(self, mock_from_yaml, tmp_path, mock_models):\n from boring_semantic_layer.agents.tools import BSLTools\n\n mock_from_yaml.return_value = mock_models\n model_file = tmp_path / \"test.yml\"\n model_file.write_text(\"test\")\n\n bsl", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.08, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "dims", + "got": "tions, and measures.", + "got_raw": "<|fim_suffix|>tions, and measures.\n\n## Example: Joining Two Tables\n\nLet's join two semantic tables: `flights` and `carriers`.\n\n```join_two_tables\n# Create sample data\ncon = ibis.duckdb.connect(\":memory:\")\nflights_data = ibis.memtable({\n \"flight_id\": [1, 2, 3],\n \"carrier_code\": [\"AA\", \"UA\", \"DL\"],\n \"aircraft_id\": [101, 102, 103],\n \"distance\": [1000, 1500, 8", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "1", + "got": "10", + "got_raw": "10\n\n def test_index_then_mutate(self, flights_semantic):\n \"\"\"Test mutating index results.\"\"\"\n result = flights_semantic.index(\"carrier\").mutate(\n avg=lambda t: t.total_distance / t.flight_count\n ).execute()\n\n assert len(result) == 10\n\n def test_index_then_order_by(self, flights_semantic):\n \"\"\"Test ordering index results.\"\"\"\n result = flights_semantic.index(\"carrier\").order_by(lambda t: t.weight.desc()).execute()\n\n assert result[0][\"fieldValue\"] == \"AA\"\n\n def test_index_then_limit(self, flights_sem", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "\"dev\"", + "got": "\"dev\"", + "got_raw": " \"dev\"\n assert bsl.profile_file == tmp_path / \"profiles.yml\"\n assert bsl.chart_backend == \"altair\"\n assert bsl.models == mock_models\n\n @patch(\"boring_semantic_layer.agents.tools.from_yaml\")\n def test_init_with_profile_file(self, mock_from_yaml, tmp_path, mock_models):\n from boring_semantic_layer.agents.tools import BSLTools\n\n mock_from_yaml.return_value = mock_models\n model_file = tmp_path / \"test.yml\"\n model_file.write_text(\"test\")\n profile_file = tmp_path / \"profiles.yml\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "result.columns", + "got": "", + "got_raw": " # premium segment\n assert \"avg_clv\" in # free segment\n\n assert result[\"avg_clv\"][\"premium\"] > result[\"avg_clv\"][\"free\"]\n\n def test_customer_lifetime_value_with_custom_dimension(self, ecommerce_data):\n \"\"\"Calculate CLV by customer segment with a custom dimension.\"\"\"\n users_tbl = ecommerce_data[\"users\"]\n orders_tbl = ecommerce_data[\"orders\"]\n\n # Join users and orders\n joined = users_tbl.join(\n orders_tbl,\n users_tbl.user_id == orders_tbl.user_id,\n how=\"left\",\n )\n\n users_st = (\n to_semantic_table(j", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "0", + "got": "0", + "got_raw": "0\n assert result_data[\"records\"][0][\"b\"] == \"x\"\n assert result_data[\"records\"][0][\"count\"] == 1\n\n async def test_end_to_end_claude_desktop_query_with_join(self, mcp_server):\n \"\"\"Test a complete end-to-end query simulating Claude Desktop behavior with joins.\"\"\"\n tool = mcp_server._tool_manager._tools[\"query_model\"]\n\n # Simulate what Claude Desktop actually sends\n result = await tool.run(\n {\n \"model_name\": \"test\",\n \"dimensions\": '[\"b\"]',\n \"measures\": '[\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "\"line\"", + "got": "1", + "got_raw": "1\n\n def test_detect_bar_chart_categorical(self):\n \"\"\"Test bar chart for categorical data.\"\"\"\n result = detect_chart_type_generic([\"carrier\"], [\"count\"], \"carrier\")\n\n assert result == 2\n\n def test_detect_heatmap_two_dimensions(self):\n \"\"\"Test heatmap for two categorical dimensions.\"\"\"\n result = detect_chart_type_generic([\"carrier\", \"month\"], [\"count\"], \"carrier\")\n\n assert result == 3\n\n def test_detect_multi_measure_grouped(self):\n \"\"\"Test multi-measure grouped chart.\"\"\"\n result = detect_chart_type_generic([\"carrier\", \"month\"], [\"count\", \"avg_distance\"], \"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "0", + "got": "0", + "got_raw": "0\n assert df[\"carrier\"].nunique() == 2\n assert df[\"month\"].nunique() == 2\n assert df[\"flight_count\"].sum() > 0\n assert df[\"avg_distance\"].mean() > 0\n\ndef test_multiple_filters_with_measures(flights):\n \"\"\"Test chaining multiple operations including filter and with_measures.\"\"\"\n semantic_flights = (\n to_semantic_table(flights, \"flights\")\n .with_dimensions(carrier=lambda t: t.carrier)\n .with_measures(flight_count=lambda t: t.count(), avg_distance=lambda t: t", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "5", + "got": "5", + "got_raw": "5\n\n # Bob: 1 session, 1 user, 3 hits (1 + 2 + 2)\n bob_result = result[result.user == \"bob\"]\n assert bob_result[\"session_count\"].iloc[0] == 1\n assert bob_result[\"user_count\"].iloc[0] == 1\n\n assert bob_result[\"hits_count\"].iloc[0] == 3\n\n # Carol: 0 sessions, 1 user, 0 hits\n carol_result = result[result.user == \"carol\"]\n assert carol_result[\"session_count\"].iloc[0] ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "7", + "got": "7", + "got_raw": "7\n\n def test_double_counting_join_chain_correct(self, models):\n \"\"\"Join chain task_count is unaffected by the leaf-level measure.\"\"\"\n joined = self._build_chain(models)\n df = joined.aggregate(\"tasks.task_count\").execute()\n\n\n assert df[\"tasks.task_count\"].iloc[0] == 7\n\n def test_double_counting_join_chain_correct(self, models):\n \"\"\"Join chain task_count is unaffected by the leaf-level measure.\"\"\"\n joined = self._build_chain(models)\n df = joined.aggregate(\"tasks.task_count\").execute()\n\n\n assert df[\"tasks.task_count\"].iloc[0] == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "\"value\"", + "got": "0", + "got_raw": "0\n assert result_df.columns.tolist() == [\"carrier\", \"measure\", \"value\"]\n\n assert result_df.iloc[0][\"carrier\"] == \"AA\"\n assert result_df.iloc[0][\"measure\"] == \"count\"\n assert result_df.iloc[0][\"value\"] == 10\n\n assert result_df.iloc[1][\"carrier\"] == \"AA\"\n assert result_df.iloc[1][\"measure\"] == \"avg_delay\"\n assert result_df.iloc[1][\"value\"] == 5.2\n\n assert result_df.iloc[2][\"carrier\"] == \"UA\"\n assert result_df.iloc[2", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "boringdata/boring-semantic-layer", + "expected": "0", + "got": "0", + "got_raw": "0\n assert data[\"records\"][0][\"carrier\"] == \"AA\"\n assert data[\"records\"][0][\"flight_count\"] == 10\n\n @pytest.mark.asyncio\n async def test_query_with_prefixed_fields_on_composed_model(self, sample_models):\n \"\"\"Test that model-prefixed fields resolve for composed models.\"\"\"\n mcp = MCPSemanticModel(models=sample_models)\n\n async with Client(mcp) as client:\n result = await client.call_tool(\n \"query_model\",\n {\n \"model_name\": \"flights\",\n \"dimensions\": [\"flights.origin\"],\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "test())", + "got": "test())", + "got_raw": " test())\n\n def test_template(self):\n tpl = Jinja2Template('start {{var}} end')\n self.assertEqual(touni('start middle end'), tpl.render(var='middle'))\n\n def test_template_with_dict(self):\n tpl = Jinja2Template('start {{var}} end')\n self.assertEqual(touni('start middle end'), tpl.render(dict(var='middle')))\n\n def test_template_with_dict_and_kwargs(self):\n tpl = Jinja2Template('start {{var}} end')\n self.assertEqual(touni('start middle end'), tpl.render(dict(var='middle'), var='middle", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "lines)", + "got": "lines)", + "got_raw": " lines)\n\n def test_fuzzy_lineiter2(self):\n \"\"\" Test all possible buffer sizes \"\"\"\n minbuflen = 9 # boundary size of '--foo--\\r\\n'\n data = b'data\\rdata\\ndata\\r\\ndata\\n\\rdata\\r\\n'.replace(b'data', b'X'*minbuflen*2)\n lines = data.split(b\"\\r\\n\")[:-1]\n for tail in (b\"\", b\"tail\"):\n for buffer_size in range(minbuflen, len(data+tail)+1):\n splits = list(bottle._MultipartParser(\n BytesIO(data", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "404)", + "got": "404)", + "got_raw": "404)\n self.assertEqual(rs.status_line, '404 Not Found')\n\n rs.status = '404 Not Found'\n self.assertEqual(rs.status, rs.status_line)\n self.assertEqual(rs.status_code, 404)\n self.assertEqual(rs.status_line, '404 Not Found')\n\n rs.status = '404'\n self.assertEqual(rs.status, rs.status_line)\n self.assertEqual(rs.status_code, 404)\n self.assertEqual(rs.status_line, '404 Not Found')\n\n rs.status = '404 Not Found'\n self.assertEqual(rs.status, rs", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "test())", + "got": "test())", + "got_raw": " test())\n\n def test_template_decorator(self):\n @mako_template\n def test():\n return 'start ${var} end'\n\n self.assertEqual(touni('start middle end'), test())\n\n def test_template_decorator_with_options(self):\n @mako_template(lookup=['./views/'])\n def test():\n return 'start ${var} end'\n\n self.assertEqual(touni('start middle end'), test())\n\n def test_template_decorator_with_options_and_options(self):\n @mako_template(lookup=['./views/'], strict_undefined=True)\n def test():\n return 'start ${var", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "list(m.iterallitems()))", + "got": "m.allitems())", + "got_raw": " m.allitems())\n self.assertEqual(6, m.get('a', 0))\n self.assertEqual(5, m.get('a', 0, 1))\n self.assertEqual(6, m.get('a', 0, 1, int))\n self.assertEqual(0, m.get('b', 0, 1, int))\n self.assertEqual(0, m.get('b', 0, 1, str))\n self.assertEqual(0, m.get('b', 0, 1, float))\n\n self.assertEqual(5, m.get('a', 0, 1,", + "exact_match": false, + "code_bleu": 0.3259486816232673, + "edit_similarity": 0.7222222222222222, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "m.getall('a'))", + "got": "m.getall('a'))", + "got_raw": " m.getall('a'))\n self.assertEqual(6, m.get('a'))\n self.assertEqual(5, m.get('a', 5))\n self.assertEqual(5, m.get('a', 6, 0))\n self.assertEqual(6, m.get('a', 6, 1))\n self.assertEqual(5, m.get('a', 6, -1))\n self.assertEqual(5, m.get('a', 6, 2))\n self.assertEqual(6, m.get('a', 6, 3))\n self.assertEqual(5, m.get('a', ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "my_decorator in self.app.plugins)", + "got": "plugins[0] in self.app.plugins)", + "got_raw": "plugins[0] in self.app.plugins)\n\n def test_install_class(self):\n installed = self.app.install(my_decorator)\n self.assertEqual(my_decorator, installed)\n\n self.assertTrue(plugins[0] in self.app.plugins)\n\n def test_install_instance(self):\n installed = self.app.install(plugins[0])\n self.assertEqual(plugins[0], installed)\n\n self.assertTrue(plugins[0] in self.app.plugins)\n\n def test_install_multiple(self):\n installed = self.app.install(plugins[0], plugins[1])\n self.assertEqual(plugins[0], installed[0])\n self.assertEqual(plugins[1", + "exact_match": false, + "code_bleu": 0.6132297420585351, + "edit_similarity": 0.65625, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "ValueError)", + "got": "", + "got_raw": "\n\n\n# File: bottle.py\n def add(self, rule, method, target, name=None):\n \"\"\" Add a new rule or replace the target for an existing rule. \"\"\"\n anons = [] # Generated names of anonymous wildcards\n keys = [] # Names of keys\n pattern = '' # Regular expression pattern with named groups\n filters = [] # Lists of wildcard input filters\n builder = [] # Data structure for the URL builder\n is_static = True\n\n for key, mode, conf in self._itertokens(rule):\n if mode:\n is_static =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "'aaa)(?:_bbb)')", + "got": "'(?:aaa)(?:_bbb)')", + "got_raw": " '(?:aaa)(?:_bbb)')\n self.assertEqual(_re_flatten(r\"(aaa)bbb\"), '(?:aaa)bbb')\n self.assertEqual(_re_flatten(r\"(aaa)(_bbb)\"), '(?:aaa)(?:_bbb)')\n self.assertEqual(_re_flatten(r\"(aaa)(_bbb)\"), '(?:aaa)(?:_bbb)')\n self.assertEqual(_re_flatten(r\"(aaa)(_bbb)\"), '(?:aaa)(?:_bbb)')\n self.assertEqual(_re_flatten(r\"(aaa)(_bbb)\"), '(?:aaa)(?:_bbb)')\n self.assertEqual(_re_flatten(r\"(aaa)(_bbb)", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.9090909090909091, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "KeyError)", + "got": "NotImplementedError, d.__setitem__, 'key', 'value')", + "got_raw": "NotImplementedError, d.__setitem__, 'key', 'value')\n self.assertRaises(NotImplementedError, d.__delitem__, 'key')\n self.assertRaises(NotImplementedError, d.__contains__, 'key')\n self.assertRaises(NotImplementedError, d.__iter__, 'key')\n self.assertRaises(NotImplementedError, d.__len__, 'key')\n self.assertRaises(NotImplementedError, d.__getitem__, 'key')\n self.assertRaises(NotImplementedError, d.__delitem__, 'key')\n self.assertRaises(NotImplementedError, d.__contains__, 'key')\n self.assertRaises(NotImplemented", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.23333333333333334, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "byte_iter.closed)", + "got": "unicode_iter.closed)", + "got_raw": "unicode_iter.closed)\n self.assertTrue(byte_iter.closed)\n\n def test_iterator_with_close_and_yield(self):\n class MyIter(object):\n def __init__(self, data):\n self.data = data\n self.closed = False\n def close(self): self.closed = True\n def __iter__(self): return iter(self.data)\n\n byte_iter = MyIter([tob('abc'), tob('def')])\n unicode_iter = MyIter([touni('abc'), touni('def')])\n\n for test_iter in (byte_iter, unicode_iter):\n @self.app.route('/')\n def test", + "exact_match": false, + "code_bleu": 0.668740304976422, + "edit_similarity": 0.7567567567567568, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "test2())", + "got": "test2())", + "got_raw": " test2())\n\n def test_view_decorator_issue_407(self):\n with chdir(__file__):\n @view('stpl_no_vars')\n def test():\n pass\n self.assertEqual(touni('hihi'), test())\n @view('aaa {{x}}', x='bbb')\n def test2():\n pass\n\n self.assertEqual(touni('aaa bbb'), test2())\n\n def test_view_decorator_issue_407(self):\n with chdir(__file__):\n @view('stpl_no_vars')\n def test():\n pass\n self.assertEqual(toun", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "\"text\")", + "got": "\"text\")", + "got_raw": " \"text\")\n self.assertEqual(p[1].value, test_text)\n\n def test_chunked(self):\n ''' Chunked transfer encoding is supported. '''\n test_file = bottle.tob('abc'*1024)\n test_text = u'Test text\\n with\\r\\n \u00fcml\u00e4uts!'\n boundary = '---------------------------186454651713519341951581030105'\n request = BytesIO(bottle.tob('\\r\\n').join(map(bottle.tob,[\n '--' + boundary,\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "plugin2 not in self.app.plugins)", + "got": "2 in self.app.plugins)", + "got_raw": "2 in self.app.plugins)\n self.assertTrue(plugin2 in self.app.plugins)\n\n def test_uninstall_by_instance(self):\n plugin = self.app.install(MyPlugin())\n plugin2 = self.app.install(MyPlugin())\n self.app.uninstall(plugin)\n self.assertTrue(plugin not in self.app.plugins)\n\n self.assertTrue(2 in self.app.plugins)\n self.assertTrue(plugin2 in self.app.plugins)\n\n def test_uninstall_by_name(self):\n plugin = self.app.install(MyPlugin())\n plugin2 = self.app.install(MyPlugin())\n self.app.uninstall('myplugin')\n self.assertTrue(plugin not in self.app.plugins)\n\n", + "exact_match": false, + "code_bleu": 0.7674133523292893, + "edit_similarity": 0.8148148148148148, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "t)", + "got": "t)", + "got_raw": " t)\n\n def test_string_with_unicode(self):\n \"\"\" Templates: Mako string with unicode\"\"\"\n t = MakoTemplate('start ${var} end').render(var=u'var')\n\n self.assertEqual('start var end', t)\n\n def test_string_with_unicode_in_dict(self):\n \"\"\" Templates: Mako string with unicode in dict\"\"\"\n t = MakoTemplate('start ${var} end').render({'var': u'var'})\n\n self.assertEqual('start var end', t)\n\n def test_string_with_unicode_in_dict_and_unicode_in_string(self):\n \"\"\" Templates: Mako string with unicode in", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "test_file)", + "got": "test_file)", + "got_raw": " test_file)\n self.assertEqual(p[0].filename, 'random.png')\n self.assertEqual(p[0].name, 'file1')\n self.assertEqual(p[0].content_type, 'image/png')\n self.assertEqual(p[0].headerlist, [\n ('Content-Disposition', 'form-data; name=\"file1\"; filename=\"random.png\"'),\n ('Content-Type', 'image/png'),\n ('', ''),\n ('', ''),\n ('', ''),\n ('', ''),\n ('', ''),\n ('', ''),\n ('', ''),\n ('', ''),\n ('', ''),\n ('', ''),\n ('', ''),\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "good)", + "got": "good)", + "got_raw": " good)\n\n def test_filename(self):\n self.assertFilename('foo', 'foo')\n self.assertFilename('foo/bar', 'foo/bar')\n self.assertFilename('foo/bar.txt', 'foo/bar.txt')\n self.assertFilename('foo/bar.txt', 'foo/bar.txt')\n self.assertFilename('foo/bar.txt', 'foo/bar.txt')\n self.assertFilename('foo/bar.txt', 'foo/bar.txt')\n self.assertFilename('foo/bar.txt', 'foo/bar.txt')\n self.assertFilename('foo/bar.txt', 'foo/bar.txt')\n self.assertFilename('foo/bar.txt', 'foo/bar.txt')\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "True)", + "got": "True)", + "got_raw": " True)\n self.assertEqual(rm.path, [tempdir])\n self.assertEqual(rm.cache, {'./test2/': tempdir})\n self.assertEqual(rm.lookup('./test2/'), tempdir)\n self.assertEqual(rm.lookup('./test2/'), tempdir)\n self.assertEqual(rm.lookup('./test2/'), tempdir)\n self.assertEqual(rm.lookup('./test2/'), tempdir)\n self.assertEqual(rm.lookup('./test2/'), tempdir)\n self.assertEqual(rm.lookup('./test2/'), tempdir)\n self.assertEqual(rm.lookup('./test2/'), tempdir)\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bottlepy/bottle", + "expected": "'value3')", + "got": "'value3')", + "got_raw": " 'value3')\n\n def test_load_module(self):\n c = ConfigDict()\n c.load_module('config')\n self.assertEqual(c['debug'], True)\n self.assertEqual(c['sqlite.db'], ':memory:')\n\n def test_load_dict(self):\n c = ConfigDict()\n c.load_dict({\n 'autojson': False,\n 'sqlite': { 'db': ':memory:' },\n 'myapp': {\n 'param': 'value',\n 'param2': 'value2'\n }\n })\n self.assertEqual(c['myapp.param'], 'value')\n self.assertEqual(c['myapp.param", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "3", + "got": "3", + "got_raw": "3\n\n signal1.set(2)\n await asyncio.sleep(0)\n assert execution_count == 4\n\n signal2.set(\"test\")\n await asyncio.sleep(0)\n assert execution_count == 5\n\n signal1.set(3)\n await asyncio.sleep(0)\n assert execution_count == 6\n\n signal2.set(\"test\")\n await asyncio.sleep(0)\n assert execution_count == 7\n\n signal1.set(4)\n await asyncio.sleep(0)\n assert execution_count == 8\n\n signal2.set(\"test\")\n await asyncio.sleep(0)\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "15", + "got": "15", + "got_raw": "15\n\n # Change source\n\n source.set(10)\n\n # Value is not updated yet\n\n assert computed.get() == 15\n\n # Access again\n\n assert computed.get() == 30\n\n # Value is updated\n\n assert computed.get() == 30\n\n # Change source again\n\n source.set(15)\n\n # Value is not updated yet\n\n assert computed.get() == 30\n\n # Access again\n\n assert computed.get() == 45\n\n # Value is updated\n\n assert computed.get() == 45\n\n #", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "3.0", + "got": "3.0", + "got_raw": "3.0\n\n assert stats[\"min\"] == 1\n\n assert stats[\"max\"] == 5\n\n # Update the signal\n numbers.set([10, 20, 30, 40, 50])\n\n # The statistics should be updated automatically\n stats = statistics()\n assert stats[\"sum\"] == 150\n\n assert stats[\"avg\"] == 30.0\n\n assert stats[\"min\"] == 10\n\n assert stats[\"max\"] == 50\n\n # Add a new signal\n new_signal = Signal([6", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "cleanup_ran", + "got": "", + "got_raw": " # Cleanup 1 should run\n assert \"cleanup2\" in # Cleanup 2 should run\n assert \"cleanup3\" in # Cleanup 3 should run\n```\n\n## Important Notes\n\n### \u26a0\ufe0f Effect Retention (Critical!)\n**Effects must be assigned to a variable to prevent garbage collection.** This is the most common mistake when using reaktiv:\n\n```python\n# \u274c WRONG - effect gets garbage collected immediately and won't work\nEffect(lambda: print(\"This will never print\"))\n\n# \u2705 CORRECT - effect stays active\nmy_effect = Effect(lambda: print(\"This works!", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "4", + "got": "4", + "got_raw": "4\n\n # Pattern 2: Advanced computation function with PreviousState\n counter = Signal(2)\n doubled = LinkedSignal(lambda: counter() * 2, equal=lambda a, b: a == b)\n\n assert doubled() == 4\n\n # Pattern 3: Advanced computation function with PreviousState and custom equality\n counter = Signal(2)\n doubled = LinkedSignal(\n lambda: counter() * 2, equal=lambda a, b: a == b, previous_state=PreviousState(4, 2)\n )\n\n assert doubled() == 4\n\n # Pattern 4:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "10.1", + "got": "10.1", + "got_raw": "10.1\n # Tracker should emit the new value\n assert notifications == [10.1]\n\n # Large change (100 -> 1000) => 10.0 -> 100.0\n base.set(1000)\n # Computed value should update internally\n\n assert computed.get() == 100.0\n # Tracker should emit the new value\n assert notifications == [10.1, 100.0]\n\n # Change back to within tolerance (1000 -> 1001", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "3", + "got": "3", + "got_raw": "3\n assert b() == 4\n assert c() == 6\n assert d() == 10\n\n # Check the effect was triggered correctly\n assert len(triggers) == 3\n assert triggers[2] == \"d=11\" # d = (a+1) + (a*2) = (3+1) + (3*2) = 4 + 6 = 10\n\n # Clean up\n eff.dispose()\n\ndef test_diamond_dependency_effect_trigger_async():\n \"\"\"Test effect triggering with diamond-shaped dependency graph in async context", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "40", + "got": "40", + "got_raw": "40\n\n\n# File: src/reaktiv/signal.py\n\"\"\"Signal implementation.\n\nMigrated to Edge-based dependency tracking and minimal scheduler.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport threading\nfrom typing import Callable, Generic, Optional, TypeVar, Union, cast, overload\n\nfrom ._debug import debug_log\nfrom . import graph\nfrom .scheduler import start_batch, end_batch\nfrom .thread_safety import is_thread_safety_enabled\n\nT = TypeVar(\"T\")\n\n\nclass Signal(Generic[T]):\n \"\"\"A reactive writable signal that notifies dependents when its value changes.\n \n Signal is the core building", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "3", + "got": "3", + "got_raw": "3\n assert \"cleanup1\" in cleanup_ran\n assert \"cleanup2\" in cleanup_ran\n assert \"cleanup3\" in cleanup_ran\n\n\ndef test_dispose():\n \"\"\"Effect should dispose on GC.\"\"\"\n cleanup_ran = []\n signal = Signal(0)\n \n def effect_fn(on_cleanup):\n signal()\n on_cleanup(lambda: cleanup_ran.append(\"cleanup1\"))\n on_cleanup(lambda: cleanup_ran.append(\"cleanup2\"))\n on_cleanup(lambda: cleanup_ran.append(\"cleanup3\"))\n \n effect = Effect(effect_fn)\n del effect\n gc.collect()\n \n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "10", + "got": "10", + "got_raw": "10\n\n # Create effects that depend on invalid signals (should raise an error)\n def invalid_effect():\n effect_calls.append(a())\n\n with pytest.raises(Exception) as e:\n Effect(invalid_effect)\n\n assert str(e.value) == \"Circular dependency detected\"\n\n # Create effects that depend on invalid signals (should raise an error)\n def invalid_effect():\n effect_calls.append(b())\n\n with pytest.raises(Exception) as e:\n Effect(invalid_effect)\n\n assert str(e.value) == \"Circular dependency detected\"\n\n # Create effects that depend on invalid signals (should raise an error)\n def invalid_effect", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "0", + "got": "0", + "got_raw": "0\n\n # First access triggers dependency tracking\n\n computed()\n\n assert len(computed._dependencies) == 1\n\n # Second access doesn't trigger dependency tracking\n\n computed()\n\n assert len(computed._dependencies) == 1\n\n # Changing source triggers dependency tracking\n\n source.set(20)\n\n assert len(computed._dependencies) == 2\n\n # Changing source again doesn't trigger dependency tracking\n\n source.set(20)\n\n assert len(computed._dependencies) == 2\n\n # Changing source again triggers dependency tracking\n\n source.set(30)\n\n assert len(computed", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "buiapp/reaktiv", + "expected": "1", + "got": "1", + "got_raw": "1\n assert compute_bc_mock.call_count == 1\n assert compute_independent_mock.call_count == 1\n\n # Batch updates\n with batch():\n a.set(4)\n b.set(5)\n c.set(6)\n\n # Verify that computations are batched and only run once\n assert compute_ab_mock.call_count == 1\n assert compute_bc_mock.call_count == 1\n assert compute_independent_mock.call_count == 1\n\n # Verify that the batched updates affect the computed signals\n assert computed_ab.get() == 9 # 4 + 5", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "None", + "got": "\"max_tokens\": 4096,", + "got_raw": "<|fim_suffix|> \"max_tokens\": 4096,\n \"temperature\": 0.5,\n \"top_p\": 1,\n \"top_k\": 0,\n \"max_retries\": 10,\n },\n \"doubao\": {\n \"api_key\": \"doubao-key\",\n \"model\": \"doubao-model\",\n \"max_tokens\": 8192,\n \"temperature\": 0.5,\n \"top_p\": 1,\n \"max_retries\": 20,\n },\n },\n \"mcp_servers\": {\"test_server", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.17391304347826086, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "\"new content\")", + "got": "", + "got_raw": " # type: ignore\n self.test_file, \"new content\"\n )\n self.assertEqual(result.error_code, 0)\n self.assertEqual(result.output, f\"File created successfully at: {self.test_file}\")\n\n async def test_create_file_exists(self):\n self.mock_file_system(exists=True)\n result = await self.tool.execute(\n ToolCallArguments(\n {\n \"command\": \"create\",\n \"path\": str(self.test_file),\n \"file_text\": \"new content\",\n }\n )\n )\n\n self.mock_write.assert_not_called()\n self.assertEqual(result.error_code, -1)\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "written_data[\"config\"])", + "got": "t_called_once()", + "got_raw": "<|fim_suffix|>t_called_once()\n written_data = mock_json_dump.call_args[0][0]\n\n self.assertEqual(written_data, self.sample_data)\n\n @patch(\"json.dump\")\n async def test_set_config_key(self, mock_json_dump):\n \"\"\"Test setting a key in an object.\"\"\"\n self.mock_file_read()\n result = await self.tool.execute(\n ToolCallArguments(\n {\n \"operation\": \"set\",\n \"file_path\": self.test_file_path,\n \"json_path\": \"$.config.enabled\",\n \"value\": True,\n }\n )\n )\n self.assertEqual(result.error_code, ", + "exact_match": false, + "code_bleu": 0.2710806010829534, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "\"\")", + "got": "", + "got_raw": " # pyright: ignore[reportUnknownMemberType]\n \"The weather in Boston is sunny and warm.\")\n self.assertEqual(response.usage.input_tokens, 30)\n self.assertEqual(response.usage.output_tokens, 15)\n self.assertEqual(response.finish_reason, \"TOOL_CALL\")\n self.assertEqual(response.tool_calls[0].name, \"get_weather\")\n self.assertEqual(response.tool_calls[0].arguments, {\"location\": \"Boston\"})\n\n @patch(\"trae_agent.utils.google_client.genai.Client\")\n def test_google_chat_with_tool_call_and_tool_result(self, mock_genai_client):\n \"\"\"\n Test the", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "\"Bob\")", + "got": "2)", + "got_raw": "2)\n\n @patch(\"json.dump\")\n async def test_remove_user_by_name(self, mock_json_dump):\n \"\"\"Test removing an element from a list by its name.\"\"\"\n self.mock_file_read()\n result = await self.tool.execute(\n ToolCallArguments(\n {\n \"operation\": \"remove\",\n \"file_path\": self.test_file_path,\n \"json_path\": \"$.users[1].name\",\n }\n )\n )\n self.assertEqual(result.error_code, 0)\n\n mock_json_dump.assert_called_once()\n written_data = mock_json_dump.call_args[0][0]\n self.assertEqual", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "\"A test tool\")", + "got": "\"A test tool\")", + "got_raw": " \"A test tool\")\n\n def test_get_name(self):\n\n self.assertEqual(self.tool.get_name(), \"test_tool\")\n\n def test_get_parameters(self):\n\n self.assertEqual(self.tool.get_parameters(), [\n ToolParameter(name=\"param1\", type=\"string\", description=\"First parameter\", required=True),\n ToolParameter(name=\"param2\", type=\"integer\", description=\"Second parameter\", required=False),\n ])\n\n async def test_execute(self):\n\n # simulate tool call\n tool_call = ToolCall(name=\"test_tool\", arguments={\"param1\": \"value1\", \"param2\": 123})\n\n # simulate", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "restart_result.output.lower())", + "got": "restart_result.system)", + "got_raw": " restart_result.system)\n\n # Ensure new session is created\n self.assertIsNotNone(self.tool._session)\n\n async def test_execute_command(self):\n # Test with a valid command\n result = await self.tool.execute(ToolCallArguments({\"command\": \"echo hello\"}))\n\n self.assertEqual(result.output, \"hello\")\n\n # Test with an invalid command\n with self.assertRaises(ToolError):\n await self.tool.execute(ToolCallArguments({\"command\": \"invalid command\"}))\n\n async def test_execute_command_with_restart(self):\n # Test with a valid command\n result = await self.tool.execute(ToolCallArguments({\"", + "exact_match": false, + "code_bleu": 0.25406637407730737, + "edit_similarity": 0.6923076923076923, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "\"Charlie\")", + "got": "t_called_once()", + "got_raw": "<|fim_suffix|>t_called_once()\n written_data = mock_json_dump.call_args[0][0]\n self.assertEqual(len(written_data[\"users\"]), 2)\n\n self.assertEqual(written_data[\"users\"][1][\"name\"], \"Bob\")\n\n @patch(\"json.dump\")\n async def test_remove_user(self, mock_json_dump):\n \"\"\"Test removing an object from a list.\"\"\"\n self.mock_file_read()\n result = await self.tool.execute(\n ToolCallArguments(\n {\n \"operation\": \"remove\",\n \"file_path\": self.test_file_path,\n \"json_path\": \"$.users[0]\", #", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.32, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "self.agent.cli_console)", + "got": "", + "got_raw": "\n\n\n# File: trae_agent/agent/trae_agent.py\n# Copyright (c) 2025 ByteDance Ltd. and/or its affiliates\n# SPDX-License-Identifier: MIT\n\n\"\"\"TraeAgent for software engineering tasks.\"\"\"\n\nimport asyncio\nimport contextlib\nimport os\nimport subprocess\nfrom typing import override\n\nfrom trae_agent.agent.agent_basics import AgentError, AgentExecution\nfrom trae_agent.agent.base_agent import BaseAgent\nfrom trae_agent.prompt.agent_prompt import TRAE_AGENT_SYSTEM_PROMPT\nfrom trae_agent.tools import tools_registry\nfrom trae_agent.tools.base import Tool,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "\"test_provider\")", + "got": "\"test_provider\")", + "got_raw": " \"test_provider\")\n\n def test_get_name(self):\n self.assertEqual(self.tool.get_name(), \"test_tool\")\n\n def test_get_description(self):\n self.assertEqual(self.tool.get_description(), \"A test tool\")\n\n def test_get_parameters(self):\n expected_parameters = [\n ToolParameter(\n name=\"param1\",\n type=\"string\",\n description=\"First parameter\",\n required=True,\n ),\n ToolParameter(\n name=\"param2\",\n type=\"integer\",\n description=\"Second parameter\",\n required=False,\n ),\n ]\n self.assertEqual(self.tool.get_parameters(), expected_parameters)\n\n async def test_execute(self", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "bytedance/trae-agent", + "expected": "\"true\")", + "got": "1)", + "got_raw": "1)\n self.assertEqual(self.agent.patch_path, self.test_patch_path)\n\n def test_execute_task(self):\n # Mock the LLMClient's chat method to return a dummy response\n mock_llm_response = LLMResponse(\n content=\"Test response\",\n tool_calls=[ToolCall(name=\"task_done\", arguments={})],\n usage=LLMUsage(prompt_tokens=10, completion_tokens=5, total_tokens=15),\n )\n self.llm_client_patcher.start().client.chat.return_value = mock_llm_response\n\n # Mock the LLMClient's supports_tool_calling method to return", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "200", + "got": "200", + "got_raw": "200\n\n # Send our notification\n response = self.client.post(\n \"/notify/{}\".format(key),\n {\n \"body\": \"test message\",\n \"title\": \"test title\",\n \"type\": \"info\",\n \"emoji\": \"test_emoji\",\n },\n )\n\n assert response.status_code == 200\n\n # Check our response\n assert response.content == b\"test message\"\n\n # Check our notification\n assert N_MGR.get(key).get(\"test_emoji\") == \"test_emoji\"\n\n @mock.patch(\"requests.post\")\n def test_state", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "405", + "got": "405", + "got_raw": "405\n\n def test_post_not_supported_no_key(self):\n \"\"\"\n Test POST requests without key\n \"\"\"\n response = self.client.post(\"/json/urls\")\n # 405 as posting is not allowed\n\n assert response.status_code == 405\n\n def test_post_not_supported_no_key_no_content(self):\n \"\"\"\n Test POST requests without key and no content\n \"\"\"\n response = self.client.post(\"/json/urls\", content_type=\"application/json\")\n # 405 as posting is not allowed\n\n assert response.status_code == 405\n\n def test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "{ \"persistent_storage\": False, \"can_write_config\": True, \"can_write_attach\": True, \"details\": [\"OK\"], }", + "got": "{", + "got_raw": " {\n \"persistent_storage\": False,\n \"can_write_config\": True,\n \"can_write_attach\": True,\n \"details\": [\n \"STORE_PERMISSION_ISSUE\",\n ],\n }\n\n # Test a case where we simply do not define a persistent store path\n # health checks will always disable persistent storage\n with override_settings(APPRISE_STORAGE_DIR=\"\"), \\\n mock.patch(\"apprise.PersistentStore.flush\", return_value=False):\n result = healthcheck(lazy=False)\n\n assert result == {\n \"persistent_storage\": False,\n \"can_write_config\": True,\n \"can_write_attach\":", + "exact_match": false, + "code_bleu": 0.02973017787506803, + "edit_similarity": 0.019230769230769232, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "payload", + "got": "payload", + "got_raw": " payload\n assert payload[\"error\"] == \"The site has been configured to deny this request\"\n\n def test_manage_cfg_list_denied_content_type_text(self):\n \"\"\"\n /cfg/ denied case should return text when requested.\n \"\"\"\n response = self.client.get(\"/cfg/\", HTTP_ACCEPT=\"text/plain\")\n assert response.status_code == 403\n assert response[\"Content-Type\"].startswith(\"text/plain\")\n payload = response.content.decode(\"utf-8\")\n\n assert payload == \"The site has been configured to deny this request\"\n\n def test_manage_cfg_list_denied_content_type_html(self):\n \"\"\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "403", + "got": "403", + "got_raw": "403\n assert response.content == b\"403 - Forbidden - The site has been configured to deny this request\"\n\n @override_settings(APPRISE_CONFIG_LOCK=False)\n def test_del_with_lock_false(self):\n \"\"\"\n Test deleting a configuration by URLs with lock set won't work\n \"\"\"\n # our key to use\n key = \"test_delete_with_lock_false\"\n\n # We simply do not have permission to do so\n response = self.client.post(\"/del/{}\".format(key))\n\n assert response.status_code == 200\n assert response.content == b\"Successfully removed configuration", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "1", + "got": "1", + "got_raw": "1\n\n # The URL is present\n assert response.json()[\"urls\"][0][\"url\"] == \"mailto://user:pass@yahoo.ca\"\n\n # The URL is present\n assert response.json()[\"urls\"][0][\"uid\"] == \"00000000\"\n\n # The URL is present\n assert response.json()[\"urls\"][0][\"tags\"] == []\n\n # Now we should be able to see our content\n response = self.client.get(\"/json/urls/{}\".format(key))\n assert response.status_code == 200\n assert response[\"Content-Type\"].startswith(\"application/json", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "True", + "got": "True", + "got_raw": " True\n\n # Test the handling of underlining disk/write exceptions\n with patch(\"gzip.open\") as mock_gzopen:\n mock_gzopen.side_effect = OSError()\n # We'll fail to write our key now\n assert not acc_obj.put(key, content, ConfigFormat.TEXT.value)\n\n # Test the handling of underlining disk/read exceptions\n with patch(\"gzip.open\") as mock_gzopen:\n mock_gzopen.side_effect = OSError()\n # We'll fail to read our key now\n assert acc_obj.get(key) == (None, None)\n\n # Tidy up our", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "1", + "got": "1", + "got_raw": "1\n assert mock_notify.call_args[0][0] == \"mailto://user:pass@yahoo.ca\"\n assert mock_notify.call_args[0][1] == \"test notifiction\"\n assert mock_notify.call_args[0][2] == apprise.NotifyType.INFO.value\n assert mock_notify.call_args[0][3] == apprise.NotifyFormat.TEXT.value\n assert mock_notify.call_args[0][4] == None\n assert mock_notify.call_args[0][5] == None\n assert mock_notify.call_args[0][6] == None\n assert mock_notify.call_args[", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "caronc/apprise-api", + "expected": "1", + "got": "1", + "got_raw": "1\n assert isinstance(result[0], Attachment)\n assert result[0].filename == \"attach.txt\"\n assert result[0].size == 13\n\n # Get ourselves a file to work with\n files_request = {\"file1\": SimpleUploadedFile(\"attach.txt\", b\"content here\", content_type=\"text/plain\")}\n result = parse_attachments(None, files_request)\n assert isinstance(result, list)\n\n assert len(result) == 1\n assert isinstance(result[0], Attachment)\n assert result[0].filename == \"attach.txt\"\n assert result[0].size == 1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "3", + "got": "3", + "got_raw": "3\n\ndef test_multi_repo_summarize_languages():\n \"\"\"Test summarize returns accurate languages.\"\"\"\n with tempfile.TemporaryDirectory() as tmpdir:\n repo = create_test_repo(\n tmpdir,\n \"repo\",\n {\n \"a.py\": \"\",\n \"b.py\": \"\",\n \"c.js\": \"\",\n \"d.js\": \"\",\n \"e.js\": \"\",\n },\n )\n\n multi = MultiRepo([repo])\n\n summaries = multi.summarize()\n\n assert summaries[\"repo\"][\"languages\"][\"Python\"] == 2\n assert summaries[\"repo\"][\"languages\"][\"JavaScript\"] == 3\n\ndef test_multi", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "1", + "got": "1", + "got_raw": "1\n assert first_hunk.new_end == 9\n assert first_hunk.old_start == 1\n assert first_hunk.old_end == 7\n\n # Second hunk: lines 15-16 (was 15-17, now 15-18)\n second_hunk = src_file.hunks[1]\n\n assert second_hunk.new_start == 15\n assert second_hunk.new_end == 18\n assert second_hunk.old_start == 15\n assert second_hunk.old_end == 17\n\n # Test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "5", + "got": "5", + "got_raw": "5\n\n def test_grep_custom_timeout(self, repo):\n \"\"\"Test that grep respects custom timeout.\"\"\"\n # Set env var to 60s\n with os.environ({\"KIT_GREP_TIMEOUT\": \"60\"}):\n results = repo.grep(\"TODO\", max_results=5)\n\n assert len(results) == 5\n\n def test_grep_early_termination(self, repo):\n \"\"\"Test that grep early terminates on large codebases.\"\"\"\n # Set env var to 10s\n with os.environ({\"KIT_GREP_TIMEOUT\": \"10\"}):\n results = repo.grep", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "1", + "got": "1", + "got_raw": "1\n assert change.files[0].path == \"src/utils.py\"\n assert change.files[0].content == \"def helper():\\n return 42\\n\"\n\n def test_review_multiple_file_changes(self, mock_config, complex_git_repo):\n \"\"\"Test reviewing multiple file changes.\"\"\"\n reviewer = LocalDiffReviewer(mock_config, complex_git_repo)\n\n # Make multiple file changes\n os.chdir(complex_git_repo)\n (complex_git_repo / \"src\" / \"auth.py\").write_text(\"\"\"\nclass User:\n def __init__(self, username, email):\n self.username = username\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "2", + "got": "2", + "got_raw": "2\n assert \"new_file.txt\" in files\n assert \"README.md\" in files\n\n def test_get_changed_files_no_changes(self, mock_config, temp_git_repo):\n \"\"\"Test getting list of changed files with no changes.\"\"\"\n reviewer = LocalDiffReviewer(mock_config, temp_git_repo)\n\n # Get changed files\n files = reviewer._get_changed_files(\"HEAD~1\", \"HEAD\")\n\n assert len(files) == 0\n\n def test_get_changed_files_no_changes_no_diff(self, mock_config, temp_git_repo):\n \"\"\"Test getting list of changed files with no changes and no diff.\"\"\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "{}", + "got": "0", + "got_raw": "0\n assert server._repo_paths == []\n assert server._repo_ids == []\n assert server._repo_paths == []\n assert server._repo_ids == []\n assert server._repo_paths == []\n assert server._repo_ids == []\n assert server._repo_paths == []\n assert server._repo_ids == []\n assert server._repo_paths == []\n assert server._repo_ids == []\n assert server._repo_paths == []\n assert server._repo_ids == []\n assert server._repo_paths == []\n assert server._repo_ids == []\n assert server._repo_paths == []\n assert server._repo_ids", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "graph", + "got": "", + "got_raw": " # type: ignore\n assert \"mypackage.module2\" in # type: ignore\n assert \"mypackage\" in # type: ignore\n assert \"mypackage.module1\" in graph[\"mypackage\"][\"dependencies\"] # type: ignore\n assert \"mypackage.module2\" in graph[\"mypackage\"][\"dependencies\"] # type: ignore\n assert \"mypackage\" in graph[\"mypackage.module1\"][\"dependencies\"] # type: ignore\n assert \"mypackage\" in graph[\"mypackage.module2\"][\"dependencies\"] # type: ignore\n\ndef test_dependency_analyzer_external():\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "canon2", + "got": "assert canon2 == \"d41d8cd98f00b204e9800998ecf8427e\"", + "got_raw": "<|fim_suffix|>\n assert canon2 == \"d41d8cd98f00b204e9800998ecf8427e\"\n\n def test_path_to_id_deterministic_with_ref(self):\n \"\"\"Test that path_to_id function is deterministic with ref.\"\"\"\n # Create a temporary directory for testing\n with tempfile.TemporaryDirectory() as temp_dir:\n # Initialize a git repo in the temp directory\n subprocess.run([\"git\", \"init\"], cwd=temp_dir, check=True, capture_output=True)\n subprocess.run(\n [\"git\", \"config\", \"", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.21052631578947367, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "result.output", + "got": "result.stdout", + "got_raw": " result.stdout\n assert \"Generate a concise summary of a GitHub PR\" in result.stdout\n assert \"Show git repository metadata\" in result.stdout\n assert \"Show file tree\" in result.stdout\n assert \"Extract surrounding code context for a specific line\" in result.stdout\n assert \"Generate intelligent commit messages and commit staged changes\" in result.stdout\n assert \"Show symbol chunks\" in result.stdout\n assert \"Show commit message\" in result.stdout\n assert \"Show commit message with context\" in result.stdout\n assert \"Show commit message with context and symbols\" in result.stdout\n assert \"Show", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.7692307692307693, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "prompt", + "got": "", + "got_raw": " # Check for local diff in prompt\n assert \"test.py\" in prompt # Check for file name in prompt\n assert \"test\" in prompt # Check for function name in prompt\n assert \"added\" in prompt # Check for addition count in prompt\n assert \"1\" in prompt # Check for addition count in prompt\n assert \"2\" in prompt # Check for deletion count in prompt\n assert \"0\" in prompt # Check for deletion count in prompt\n assert \"1\" in prompt # Check for total files in prompt\n assert \"2\" in prompt", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "1", + "got": "1", + "got_raw": "1\n assert fixes[0].old_line == 13\n assert fixes[0].new_line == 25\n\ndef test_line_ref_fix_snaps_to_nearest_above():\n \"\"\"When target is between valid lines, snap to nearest (prefer higher on tie).\"\"\"\n # Valid lines in bar.py: 10, 11, 12, 13, 51, 52, 53\n comment = \"See bar.py:55\" # 55 is between 51 and 53; closer to 53\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "data", + "got": "t(\"aws_vpc.main\", \"cidr_block\")", + "got_raw": "<|fim_suffix|>t(\"aws_vpc.main\", \"cidr_block\")\n assert \"aws_subnet.public\" in data\n assert \"aws_subnet.private\" in data\n\n os.remove(export_file)\n\ndef test_terraform_dependency_analyzer_export_with_output():\n \"\"\"Test the export functionality of the TerraformDependencyAnalyzer with output.\"\"\"\n with tempfile.TemporaryDirectory() as tmpdir:\n with open(f\"{tmpdir}/resources.tf\", \"w\") as f:\n f.write(\"\"\"\nresource \"aws_vpc\" \"main\" {\n cidr_block = \"10.0.0.0/16\"\n}\n\nresource", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.11428571428571428, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "\"*.py\"", + "got": "tch(\"kit.package_search.httpx.Client\")", + "got_raw": "<|fim_suffix|>tch(\"kit.package_search.httpx.Client\")\n def test_hybrid_search_with_all_parameters(self, mock_httpx, client):\n \"\"\"Test hybrid search with all optional parameters.\"\"\"\n # Setup mock\n mock_response = MagicMock()\n mock_response.headers = {\"content-type\": \"text/event-stream\"}\n mock_response.text = 'data: {\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{\"content\":[{\"type\":\"text\",\"text\":\"{\\\\\"results\\\\\":[]}\"}],\"isError\":false}}'\n mock_response.raise_for_status = MagicMock()\n\n mock_client = MagicMock()\n mock_client.post.return_value", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "url", + "got": "url", + "got_raw": " url\n\n def test_sanitize_http_url(self):\n \"\"\"Test that HTTP URLs are sanitized.\"\"\"\n http_urls = [\n \"http://github.com/user/repo\",\n \"http://localhost:3000/repo\",\n \"http://gitlab.com/org/project\",\n \"git@github.com:user/repo.git\", # This will remain unchanged as it's not HTTP(S)\n ]\n\n for url in http_urls:\n result = sanitize_url(url)\n\n assert result == url\n\n def test_sanitize_https_url(self):\n \"\"\"Test that HTTPS URLs are sanitized.\"\"\"\n https_urls = [\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "graph", + "got": "", + "got_raw": " # Check internal files are found\n assert \"utils/helper.js\" in graph[\"main.js\"][\"dependencies\"] # Check internal files are found\n assert \"lodash\" in graph[\"utils/helper.js\"][\"dependencies\"] # Check internal files are found\n\n # Check external files are found\n assert \"express\" in graph[\"main.js\"][\"dependencies\"] # Check external files are found\n assert \"helper\" in graph[\"main.js\"][\"dependencies\"] # Check external files are found\n assert \"lodash\" in graph[\"utils/helper.js\"][\"dependencies\"] # Check external files are found\n\n # Check cycles", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "3", + "got": "3", + "got_raw": "3\n assert all(len(results1[fp]) == 1 for fp in files)\n\n # Second batch analysis\n results2 = analyzer.analyze_changed_files(files)\n\n assert len(results2) == 3\n assert all(len(results2[fp]) == 1 for fp in files)\n\n def test_analyze_changed_files_single(self):\n \"\"\"Test single file analysis.\"\"\"\n with tempfile.TemporaryDirectory() as temp_dir:\n repo_path = Path(temp_dir)\n\n # Create a single file\n test_file = repo_path / \"test.py\"\n test_file.write_text(\"def func(): pass\")\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "id4", + "got": "", + "got_raw": " # Different URLs should be different\n assert id1 != id4\n\n def test_local_path(self):\n \"\"\"Test deterministic IDs for local paths.\"\"\"\n registry = PersistentRepoRegistry()\n\n path = \"/path/to/repo\"\n\n id1 = registry.add(path)\n id2 = registry.add(path)\n id3 = registry.add(path) # No ref\n\n # Same path should be same\n assert id1 == id2\n # Different paths should be different\n assert id1 != id3\n\n def test_local_path_with_ref(self):\n \"\"\"Test deterministic IDs for local paths with refs.\"\"\"\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "7", + "got": "7", + "got_raw": "7\n\n # Empty hunk header\n header = \"@@ -0,0 +0,0 @@\"\n hunk = DiffParser._parse_hunk_header(header)\n\n assert hunk is not None\n assert hunk.old_start == 0\n assert hunk.old_count == 0\n assert hunk.new_start == 0\n assert hunk.new_count == 0\n\n # Invalid hunk header\n header = \"@@ -10,5 @@\"\n hunk = DiffParser._parse_hunk_header(header)\n\n assert hunk is None\n\ndef test_parse_h", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "names", + "got": "assert \"Bar\" in names", + "got_raw": "<|fim_suffix|>\n assert \"Bar\" in names\n assert \"foo\" in names\n assert \"Bar\" in names\n assert \"foo\" in names\n assert \"Bar\" in names\n assert \"foo\" in names\n assert \"Bar\" in names\n assert \"foo\" in names\n assert \"Bar\" in names\n assert \"foo\" in names\n assert \"Bar\" in names\n assert \"foo\" in names\n assert \"Bar\" in names\n assert \"foo\" in names\n assert \"Bar\" in names\n assert \"foo\" in", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.38461538461538464, + "n_retrieved": 10 + }, + { + "repo": "cased/kit", + "expected": "0", + "got": "0", + "got_raw": "0\n assert \"review\" in result.stdout\n\n def test_review_command_help(self, runner):\n \"\"\"Test that review command help exists.\"\"\"\n result = runner.invoke(app, [\"review\", \"--help\"])\n\n assert result.exit_code == 0\n assert \"Review a GitHub PR or local diff using kit's repository intelligence and AI analysis.\" in result.stdout\n\n def test_review_command_init_config(self, runner):\n \"\"\"Test that review command init config exists.\"\"\"\n result = runner.invoke(app, [\"review\", \"--init-config\"])\n\n assert result.exit_code == 0\n assert \"\u2705 Created default config file at", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "2", + "got": "2", + "got_raw": "2\n assert gallery[\"projects\"][0][\"title\"] == \"Project 1\"\n assert gallery[\"projects\"][1][\"title\"] == \"Project 2\"\n\n @pytest.mark.asyncio\n async def test_public_share_with_commands(self, share_manager, sample_statistics, sample_charts, temp_dir):\n \"\"\"Test creating a public share with commands updates gallery correctly.\"\"\"\n # Create share with commands\n result = await share_manager.create_share_link(\n statistics=sample_statistics,\n charts_data=sample_charts,\n make_public=True,\n include_commands=True,\n project_name=\"Project 1\"\n )\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "3", + "got": "3", + "got_raw": "3\n assert stats[\"public\"] == 2\n assert stats[\"private\"] == 1\n assert stats[\"with_commands\"] == 2\n assert stats[\"daily_counts\"] == [{\"date\": \"2024-01-15\", \"count\": 2}, {\"date\": \"2024-01-16\", \"count\": 1}]\n assert stats[\"top_projects\"] == [{\"name\": \"Project A\", \"count\": 2}, {\"name\": \"Project B\", \"count\": 1}]\n \n # Test with log file containing entries with different", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "total_tokens)", + "got": "total_tokens)", + "got_raw": " total_tokens)\n self.assertIn('output', total_tokens)\n self.assertIn('cache_creation', total_tokens)\n self.assertIn('cache_read', total_tokens)\n\n # Test daily tokens\n daily_tokens = self.statistics['daily_stats']\n self.assertIn('input', daily_tokens)\n self.assertIn('output', daily_tokens)\n self.assertIn('cache_creation', daily_tokens)\n self.assertIn('cache_read', daily_tokens)\n\n # Test daily costs\n daily_costs = self.statistics['daily_costs']\n self.assertIn('input', daily_costs)\n self.assertIn('output', daily_costs)\n self.assertIn('cache', daily_costs", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "\"Should have input tokens\")", + "got": "\"Total input tokens should be greater than 0\")", + "got_raw": " \"Total input tokens should be greater than 0\")\n self.assertGreater(total_output, 0, \"Total output tokens should be greater than 0\")\n\n def test_total_tokens_by_hour(self):\n \"\"\"Test token counts by hour\"\"\"\n # Group messages by hour\n hourly_tokens = defaultdict(lambda: {'input': 0, 'output': 0})\n \n for msg in self.messages:\n if msg.get('timestamp'):\n date = msg['timestamp'][:10] # Extract YYYY-MM-DD\n hour = int(msg['timestamp'][11:13]) # Extract hour (", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.4931506849315068, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "\"Error count should be identical\")", + "got": "(baseline_errors, new_errors)", + "got_raw": "(baseline_errors, new_errors)\n\n def test_message_count_consistency(self):\n \"\"\"Test that message count remains consistent\"\"\"\n processor = ClaudeLogProcessor(self.test_data_dir)\n _, stats = processor.process_logs()\n \n baseline_message_count = len(self.baseline_messages)\n new_message_count = len(stats['messages'])\n\n self.assertEqual(baseline_message_count, new_message_count)\n\n def test_message_hash_consistency(self):\n \"\"\"Test that message hashes remain consistent\"\"\"\n processor = ClaudeLogProcessor(self.test_data_dir)\n _, stats = processor.process_logs()\n \n baseline_hashes = self.baseline_stats.get('message_hashes", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.25396825396825395, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "0", + "got": "0", + "got_raw": "0\n assert p1['last_modified'] >= 0\n assert p1['first_seen'] >= 0\n \n # Check project 2\n p2 = next(p for p in result if p['dir_name'] == '-Users-test-project2')\n assert p2['file_count'] == 2\n assert p2['display_name'] == '-Users-test-project2'\n\n assert p2['total_size_mb'] >= 0\n assert p2['last_modified'] >= 0\n assert p2['first_seen'] >= 0\n\n def test_projects_without_jsonl_files", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "0", + "got": "0", + "got_raw": "0\n assert result['first_use_date'] is None\n assert result['last_use_date'] is None\n assert result['total_input_tokens'] == 0\n assert result['total_output_tokens'] == 0\n assert result['total_cache_read_tokens'] == 0\n assert result['total_cache_write_tokens'] == 0\n assert result['total_commands'] == 0\n assert result['total_cost'] == 0.0\n assert result['daily_token_usage'] == []\n assert result['daily_costs'] == []\n\n @pytest.mark.asyncio\n async def test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "\"Should have 109 user messages\")", + "got": "(message_types.get('user', 0), 10,", + "got_raw": "(message_types.get('user', 0), 10,\n \"Should have 10 user messages\")\n\n self.assertEqual(message_types.get('task', 0), 0,\n \"Should have 0 task messages\")\n\n self.assertEqual(message_types.get('summary', 0), 0,\n \"Should have 0 summary messages\")\n\n self.assertEqual(message_types.get('compact_summary', 0), 0,\n \"Should have 0 compact summary messages\")\n\n def test_token_counts(self):\n \"\"\"Test token distribution\"\"\"\n token_counts = self.statistics['overview']['total_tokens']\n \n # From baseline_results", + "exact_match": false, + "code_bleu": 0.10390302174233558, + "edit_similarity": 0.2727272727272727, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "\"Message count should not change with optimizations\")", + "got": "(len(messages), len(self.baseline_messages))", + "got_raw": "(len(messages), len(self.baseline_messages))\n\n def test_message_hashes_unchanged(self):\n \"\"\"Test that message hashes remain the same\"\"\"\n processor = ClaudeLogProcessor(self.test_data_dir)\n messages, _ = processor.process_logs()\n\n self.assertEqual(len(messages), len(self.baseline_messages))\n self.assertEqual(len(messages), len(self.baseline_messages))\n self.assertEqual(len(messages), len(self.baseline_messages))\n\n def test_stats_hash_unchanged(self):\n \"\"\"Test that stats hash remains the same\"\"\"\n processor = ClaudeLogProcessor(self.test_data_dir)\n messages, stats = processor.process_logs()\n\n self.assertEqual", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.30927835051546393, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "interruption)", + "got": "", + "got_raw": "\n\n\n# File: sniffly/core/processor.py\n # Check for stop reason indicating completion\n for msg in self.assistant_messages:\n stop_reason = msg.get(\"message\", {}).get(\"stop_reason\", \"\")\n if stop_reason in [\"end_turn\", \"stop_sequence\", \"tool_use\"]:\n return True\n\n return False\n\n def merge_tools_from(self, other: \"Interaction\"):\n \"\"\"Merge tools from another interaction, avoiding duplicates.\"\"\"\n seen_tool_ids = {tool.get(\"id\") for tool in self.tools_used if tool.get(\"id\")}\n\n for tool in other.tools_used:\n tool_id", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "\"Should have data for 2025-06-10\")", + "got": "\"Should have data for 2025-06-10\")", + "got_raw": " \"Should have data for 2025-06-10\")\n\n # Verify token counts for specific dates\n self.assertEqual(daily_tokens['2025-06-08']['input'], 1000, \"Input tokens for 2025-06-08 should be 1000\")\n self.assertEqual(daily_tokens['2025-06-08']['output'], 2000, \"Output tokens for 2025-06-08 should be 2000\")\n self.assertEqual(d", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "\"Should process same number of projects\")", + "got": "(len(seq_results), len(par_results), \"Results should match\")", + "got_raw": "(len(seq_results), len(par_results), \"Results should match\")\n for seq, par in zip(seq_results, par_results):\n self.assertEqual(seq['messages'], par['messages'], \"Message counts should match\")\n self.assertLessEqual(seq['time'], par['time'], \"Sequential time should be less than parallel time\")\n\n def test_parallel_processing_performance(self):\n \"\"\"Test parallel processing performance\"\"\"\n import concurrent.futures\n \n def process_project(project_dir):\n \"\"\"Process a single project\"\"\"\n start = time.time()\n processor = ClaudeLogProcessor(project_dir)\n messages, stats = processor.process_logs()\n return {\n", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.21782178217821782, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "1", + "got": "1", + "got_raw": "1\n assert p1['total_size_mb'] == 0.0\n assert p1['last_modified'] == 0\n assert p1['first_seen'] == 0\n assert p1['display_name'] == '-Users-test-project1'\n \n # Check project 2\n p2 = next(p for p in result if p['dir_name'] == '-Users-test-project2')\n \n assert p2['file_count'] == 2\n assert p2['total_size_mb'] == 0.0\n assert p2['last_modified'] == 0\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chiphuyen/sniffly", + "expected": "\"Initialization should be under 100ms\")", + "got": "\"Initialization should complete within 0.1 seconds\")", + "got_raw": " \"Initialization should complete within 0.1 seconds\")\n self.assertLess(process_time, 0.5, \"Processing + Stats should complete within 0.5 seconds\")\n self.assertLess(prep_time, 0.1, \"Data Preparation should complete within 0.1 seconds\")\n\n def test_memory_cache_hit(self):\n \"\"\"Test memory cache hit rate\"\"\"\n \n # Start timing\n start_time = time.time()\n \n # Step 1: Initialize processor (simulates project loading)\n init_start = time.time()\n processor = ClaudeLogProcessor(self.test_data_dir)\n init_time = time", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.6593406593406593, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "0", + "got": "0", + "got_raw": "0\n\n def test_model2vec_embedding_generation(self, model_identifier: str) -> None:\n \"\"\"Test that Model2Vec embeddings can actually generate embeddings.\"\"\"\n embeddings = AutoEmbeddings.get_embeddings(model_identifier)\n test_text = \"This is a test sentence.\"\n result = embeddings.embed_batch([test_text])\n assert len(result) == 1\n\n assert len(result[0]) > 0\n\n def test_model2vec_embedding_generation(self, model_identifier: str) -> None:\n \"\"\"Test that Model2Vec embeddings can actually generate embeddings.\"\"\"\n embeddings = AutoEmbeddings.get_embeddings(model_identifier)\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "0", + "got": "0", + "got_raw": "0\n\n for chunk in chunks:\n assert isinstance(chunk, dict)\n assert \"text\" in chunk\n assert \"chunk_id\" in chunk\n assert \"chunk_type\" in chunk\n assert \"chunk_size\" in chunk\n assert \"chunk_start\" in chunk\n assert \"chunk_end\" in chunk\n assert \"chunk_overlap\" in chunk\n assert \"chunk_overlap_start\" in chunk\n assert \"chunk_overlap_end\" in chunk\n assert \"chunk_overlap_text\" in chunk\n assert \"chunk_overlap_text_start\" in chunk\n assert \"chunk_overlap_text_end\" in chunk", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "2", + "got": "13", + "got_raw": "13\n assert result[0].start_index == 0\n assert result[0].end_index == 13\n\ndef test_cloud_recursive_chunker_multiple_sentences(\n mock_requests_get,\n mock_requests_post,\n mock_api_response,\n) -> None:\n \"\"\"Test that the Recursive Chunker works with multiple sentences.\"\"\"\n text = \"Hello, world! How are you?\"\n\n # Mock the post request response\n mock_response = Mock()\n mock_response.status_code = 200\n mock_response.json.return_value = mock_api_response(text)\n mock_requests_post.return_value = mock_response\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "2", + "got": "13", + "got_raw": "13\n assert result[0].start_index == 0\n assert result[0].end_index == 13\n\ndef test_cloud_sentence_chunker_batch(\n mock_requests_get,\n mock_requests_post,\n mock_api_response,\n) -> None:\n \"\"\"Test that the sentence chunker works with batch input.\"\"\"\n texts = [\"Hello, world!\", \"This is a test.\"]\n\n # Mock the post request response\n mock_response = Mock()\n mock_response.status_code = 200\n mock_response.json.return_value = mock_api_response(texts)\n mock_requests_post.return_value =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "2", + "got": "13", + "got_raw": "13\n assert result[0].start_index == 0\n assert result[0].end_index == 13\n\ndef test_cloud_semantic_chunker_multiple_sentences(\n mock_requests_get,\n mock_requests_post,\n mock_api_response,\n) -> None:\n \"\"\"Test that the Semantic Chunker works with multiple sentences.\"\"\"\n text = \"Hello, world! How are you?\"\n\n # Mock the post request response\n mock_response = Mock()\n mock_response.status_code = 200\n mock_response.json.return_value = mock_api_response(text)\n mock_requests_post.return_value = mock_response", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "original", + "got": "tch(\"test-string-model\", MockEmbeddings)", + "got_raw": "<|fim_suffix|>tch(\"test-string-model\", MockEmbeddings)\n\n def test_wrap_existing_embeddings(self) -> None:\n \"\"\"Test wrapping an existing BaseEmbeddings instance.\"\"\"\n original = MockEmbeddings(\"test-model\")\n result = EmbeddingsRegistry.wrap(original)\n\n assert result is original\n\n def test_wrap_non_embeddings(self) -> None:\n \"\"\"Test wrapping a non-BaseEmbeddings instance.\"\"\"\n non_embeddings = \"non-embeddings\"\n with pytest.raises(ValueError, match=\"Unsupported object type for embeddings\"):\n EmbeddingsRegistry.wrap(non_embeddings)\n\n def test_wrap_string(self) -> None:\n \"\"\"Test wrapping", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.20833333333333334, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "\"v1\"", + "got": "1", + "got_raw": "1\n\ndef test_base_refinery_is_abstract():\n \"\"\"BaseRefinery is an abstract class.\"\"\"\n with pytest.raises(TypeError):\n BaseRefinery()\n\ndef test_base_refinery_call_delegates_to_refine():\n \"\"\"__call__ delegates to refine.\"\"\"\n # Mock the refine method\n refine_mock = MagicMock()\n refine_mock.return_value = make_chunks(3)\n with patch(\"chonkie.cloud.refineries.base.BaseRefinery.refine\", refine_mock):\n # Create an instance of BaseRefinery\n base_refinery = BaseRefinery()\n # Call __call__\n result = base_refinery", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "None", + "got": "None", + "got_raw": " None\n\ndef test_sentence_chunker_split_text(tokenizer: Tokenizer) -> None:\n \"\"\"Test that the SentenceChunker can split text into chunks.\"\"\"\n chunker = SentenceChunker(\n tokenizer=tokenizer,\n chunk_size=512,\n chunk_overlap=128,\n min_sentences_per_chunk=1,\n min_characters_per_sentence=12,\n approximate=False,\n delim=[\".\", \"!\", \"?\", \"\\n\"],\n include_delim=\"prev\",\n )\n\n text = sample_text()\n chunks = chunker.split_text(text)\n\n assert len(chunks) > 0\n\ndef", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "[]", + "got": "0", + "got_raw": "0\n\ndef test_embed_batch_single(embedding_model: JinaEmbeddings) -> None:\n \"\"\"Test embed_batch with a single text.\"\"\"\n result = embedding_model.embed(sample_text())\n\n assert isinstance(result, np.ndarray)\n assert result.shape == (1, 2048)\n\ndef test_embed_batch_multiple(embedding_model: JinaEmbeddings) -> None:\n \"\"\"Test embed_batch with multiple texts.\"\"\"\n results = embedding_model.embed_batch(sample_texts())\n\n assert isinstance(results, list)\n assert len(results) == len(sample_texts())\n for result in results:\n assert isinstance(result, np.ndarray)\n ", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "\"my-key\"", + "got": "assert data[\"other_key\"] == \"other_value\"", + "got_raw": "<|fim_suffix|>\n assert data[\"other_key\"] == \"other_value\"\n\ndef test_login_creates_config_file(tmp_path, monkeypatch):\n \"\"\"login() creates a config file if one doesn't exist.\"\"\"\n monkeypatch.setenv(\"HOME\", str(tmp_path))\n login(\"my-key\")\n config_path = get_config_path()\n assert config_path.exists()\n\ndef test_login_updates_existing_config(tmp_path, monkeypatch):\n \"\"\"login() updates an existing config file if one exists.\"\"\"\n monkeypatch.setenv(\"HOME\", str(tmp_path))\n config_path = get_config_path()\n with open(config_path, \"w\") as", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.20408163265306123, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "1", + "got": "1", + "got_raw": "1\n assert chunker.min_sentences_per_chunk == 1\n assert chunker.min_characters_per_sentence == 12\n assert chunker.skip_window == 0\n assert chunker.filter_window == 5\n assert chunker.filter_polyorder == 3\n assert chunker.filter_tolerance == 0.2\n assert chunker.delim == [\". \", \"! \", \"? \", \"\\n\"]\n assert chunker.include_delim == \"prev\"\n assert chunker.sep == \"\u2704\"\n\ndef test_cloud_semantic_chunker_chunking(mock_requests_get, mock_requests_post) -> None:\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "chunk_size + 20", + "got": "30", + "got_raw": "30 # Adjust this value as needed\n assert chunk.start_index + chunk.token_count <= len(python_code)\n\n # Check that the next chunk starts after the current one ends\n next_chunk = result[i + 1]\n assert next_chunk.start_index > chunk.end_index\n\n # The last chunk should be close to or under chunk_size\n last_chunk = result[-1]\n assert last_chunk.token_count <= 30 # Adjust this value as needed\n assert last_chunk.start_index + last_chunk.token_count <= len(python_code)\n\ndef test_cloud_code_chunker_chunk_overlap(\n mock", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "model", + "got": "assert embeddings.dimension == 32", + "got_raw": "<|fim_suffix|>\n assert embeddings.dimension == 32\n\ndef test_initialization_with_model_name_or_path(\n embedding_model: Model2VecEmbeddings,\n) -> None:\n \"\"\"Test that the Model2VecEmbeddings instance is initialized correctly with a model name or path.\"\"\"\n embeddings = Model2VecEmbeddings(\"minishlab/potion-base-32M\")\n assert embeddings.model_name_or_path == \"minishlab/potion-base-32M\"\n\n assert embeddings.model is not None\n assert embeddings.model is not None\n assert embeddings.model is not None\n assert embeddings.model is not None\n", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.05263157894736842, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "0", + "got": "0", + "got_raw": "0\n\n@pytest.mark.skipif(\n \"AZURE_OPENAI_ENDPOINT\" not in os.environ,\n reason=\"Skipping test because AZURE_OPENAI_ENDPOINT is not defined\",\n)\ndef test_embed(azure_embedding_model: AzureOpenAIEmbeddings) -> None:\n \"\"\"Test that AzureOpenAIEmbeddings can embed a single text.\"\"\"\n vector = azure_embedding_model.embed(sample_text())\n\n assert isinstance(vector, np.ndarray)\n\n assert vector.shape == (azure_embedding_model.dimension,)\n\n@pytest.mark.skipif(\n \"AZURE_OPENAI_ENDPOINT\" not in os.environ,\n reason=\"Skipping test because AZURE_OPENAI_ENDPOINT is", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "\"r\")", + "got": "\"\"\"Test that the chef processes the file correctly.\"\"\"", + "got_raw": "<|fim_suffix|>\n \"\"\"Test that the chef processes the file correctly.\"\"\"\n mock_file = mock_open(read_data=sample_text)\n with patch(\"builtins.open\", mock_file):\n result = text_chef.process(\"test_file.txt\")\n\n assert isinstance(result, Document)\n assert result.content == sample_text\n\n def test_file_not_found(\n self: \"TestTextChef\",\n text_chef: TextChef,\n ) -> None:\n \"\"\"Test that the chef raises an error when the file is not found.\"\"\"\n with pytest.raises(FileNotFoundError):\n text_chef.process(\"nonexistent_file.txt\")\n\n def test", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.06896551724137931, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "0", + "got": "0", + "got_raw": "0\n\ndef test_cloud_neural_chunker_single_text(\n mock_requests_get_success: Any,\n monkeypatch: pytest.MonkeyPatch,\n) -> None:\n \"\"\"Test that the Neural Chunker works with a single text.\"\"\"\n monkeypatch.setenv(\"CHONKIE_API_KEY\", \"mock-api-key\")\n\n class MockResponse:\n def __init__(self, status_code: int, json_data: list[dict[str, Any]]):\n self.status_code = status_code\n self._json_data = json_data\n\n def json(self) -> list[dict[str, Any]]:\n return self._json", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "chunk.text", + "got": "chunk.text", + "got_raw": " chunk.text\n assert row[\"start_index\"] == chunk.start_index\n assert row[\"end_index\"] == chunk.end_index\n assert row[\"token_count\"] == chunk.token_count\n assert row[\"context\"] == chunk.text\n assert row[\"embedding\"] == chunk.embedding\n\ndef test_dataset_structure_and_content(sample_chunks): # noqa\n porter = DatasetsPorter()\n ds = porter.export(sample_chunks, save_to_disk=False)\n # Check column names - now includes embedding field\n expected_columns = {\n \"id\",\n \"text\",\n \"start_index\",\n \"end_index\",\n ", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "0", + "got": "0", + "got_raw": "0\n assert all(isinstance(chunk, Chunk) for chunk in chunks)\n\ndef test_recursive_chunker_chunking_with_paragraph_rules(sample_text: str, paragraph_rules: RecursiveRules) -> None:\n \"\"\"Test that the RecursiveChunker can chunk a sample text with paragraph rules.\"\"\"\n chunker = RecursiveChunker(rules=paragraph_rules, chunk_size=512, min_characters_per_chunk=12)\n chunks = chunker.chunk(sample_text)\n\n assert len(chunks) > 0\n assert all(isinstance(chunk, Chunk) for chunk in chunks)\n\ndef test_recursive_chunker_chunking_with_sentence_rules(sample_text:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "\"el\"", + "got": "\"he\"", + "got_raw": " \"he\"\n\n assert chunk[1:3:2] == \"h\"\n\n assert chunk[1:3:3] == \"h\"\n\n assert chunk[1:3:4] == \"\"\n\n assert chunk[1:3:5] == \"h\"\n\n assert chunk[1:3:6] == \"\"\n\n assert chunk[1:3:7] == \"\"\n\n assert chunk[1:3:8] == \"\"\n\n assert chunk[1:3:9] == \"\"\n\n assert chunk[1:3:10] == \"\"\n\n assert chunk[1:3:11", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "chonkie-inc/chonkie", + "expected": "1", + "got": "1", + "got_raw": "1 # end\n # Second call: \"b\" at (2, 3)\n second_call_args = mock_text_instance.stylize.call_args_list[1]\n assert second_call_args[0][1] == 2 # start\n assert second_call_args[0][2] == 3 # end\n\n def test_print_strings_indices_with_no_gaps(self, mock_text_class, mock_text_instance) -> None:\n \"\"\"Test that string chunks get correct indices when full_text has no gaps.\"\"\"\n Visualizer().print([\"a\", \"b\"], full_text=\"ab\")\n #", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "5", + "got": "5", + "got_raw": "5\n for record in records:\n assert record[0]['category'] in CHARTS_CONFIG\n assert record[0]['layout'] == 'freeform'\n assert record[0]['name'] == 'Test chart #{}'.format(record[0]['id'])\n assert record[0]['date'] == str(record[0]['date'])\n assert record[0]['id'] == str(record[0]['id'])\n assert record[0]['modules'] is not None\n assert record[0]['modules'][0]['name'] == 'Test chart #{}'.format(\n record[0]['id']\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "27017", + "got": "27017", + "got_raw": "27017\n\n assert settings.DB_NAME == 'charts'\n\n assert settings.DB_TABLE == 'views'\n\n assert settings.ACTIVE_DB == 'mongo'\n\n assert settings.CHARTS_CONFIG == {\n 'C3': {\n 'charts': [\n ('line', 'Line chart'),\n ('bar', 'Bar chart'),\n ('timeseries', 'Timeseries chart'),\n ('step', 'Step chart'),\n ('pie', 'Pie chart'),\n ('area', 'Area chart'),\n ('donut', 'Donut chart'),\n ('spline', 'Spline chart'),\n ('gauge", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "app.config.get('JSONDASH_GLOBAL_USER')", + "got": "'global'", + "got_raw": " 'global'\n\n data = dict(name='global-check', is_global='on')\n test.post('/charts/create', data=data).data\n assert len(read()) == 2\n assert read()[1]['name'] == 'global-check'\n\n assert read()[1]['created_by'] == 'global'\n\n data = dict(name='global-check', is_global='on')\n test.post('/charts/create', data=data).data\n assert len(read()) == 3\n assert read()[2]['name'] == 'global-check'\n\n assert read()[2]['created_by'] == 'global'\n\n ", + "exact_match": false, + "code_bleu": 0.0625, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "100", + "got": "100", + "got_raw": "100\n assert len(dom('div#dashboard-list li')) == 100\n assert len(dom('div#dashboard-list li a')) == 100\n assert len(dom('div#dashboard-list li a').text()) == 100\n assert len(dom('div#dashboard-list li a').attr('href')) == 100\n assert len(dom('div#dashboard-list li a').attr('href')) == 100\n assert len(dom('div#dashboard-list li a').attr('href')) == 100\n assert len", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "ValueError)", + "got": "InvalidSchemaError):", + "got_raw": "InvalidSchemaError):\n charts_builder.get_dims(data)\n\n\n@pytest.mark.parametrize('field', [\n 'width',\n 'height',\n 'dataSource',\n])\n@pytest.mark.filters\ndef test_getdims_missing_width(ctx, client, field):\n app, test = client\n data = dict(width=100, height=100, dataSource='...', type='sometype')\n del data[field]\n\n with pytest.raises(InvalidSchemaError):\n charts_builder.get_dims(data)\n\n\n@pytest.mark.parametrize('field', [\n 'width',\n 'height',\n 'dataSource',\n])\n@pytest.mark.filters\ndef test_getdims", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5806451612903226, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "2", + "got": "2", + "got_raw": "2\n # Test it has 2 add col buttons - left and right\n\n assert len(container.find('.add-new-col-container')) == 2\n # Test it has 2 remove row buttons - top and bottom\n\n assert len(container.find('.remove-row-container')) == 2\n # Test it has 2 remove col buttons - left and right\n\n assert len(container.find('.remove-col-container')) == 2\n # Test it has 2 add row buttons - top and bottom\n\n assert len(container.find('.add-new-row-container')) == 2\n # Test it has 2 add", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "1", + "got": "1", + "got_raw": "1\n assert res[0] == dict(\n id='module_',\n name='foo',\n date=str(dt.now()),\n )\n\n\ndef test_format_data():\n data = dict(\n name='foo',\n date=str(dt.now()),\n category='bar',\n modules=[dict(id='module_')],\n )\n res = db.format_data(data)\n assert isinstance(res, dict)\n assert res == data\n\n\ndef test_get_db_handler():\n assert isinstance(db.get_db_handler(), mongo_adapter.Db)\n\n\ndef test_get_db_handler_mongo():\n settings.ACTIVE_DB = 'mongo'\n assert isinstance(db.get", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "'Username'", + "got": "'global'", + "got_raw": " 'global'\n assert read()[0]['date'] == '2016-08-11 16:00:00'\n assert read()[0]['layout'] == 'grid'\n assert read()[0]['modules'] == '[]'\n assert read()[0]['id'] == '1'\n assert read()[0]['name'] == 'global-check'\n assert read()[0]['date'] == '2016-08-11 16:00:00'\n assert read()[0]['layout'] == 'grid'\n assert read()[", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "result.output", + "got": "json.loads(result.output)", + "got_raw": " json.loads(result.output)\n assert 'children' in json.loads(result.output)\n assert 'name' in json.loads(result.output)\n assert 'type' in json.loads(result.output)\n assert 'children' in json.loads(result.output)\n assert 'name' in json.loads(result.output)\n assert 'type' in json.loads(result.output)\n assert 'children' in json.loads(result.output)\n assert 'name' in json.loads(result.output)\n assert 'type' in json.loads(result.output)\n assert 'children' in json.loads(result.output)\n assert 'name' in json.loads(result.output)\n assert", + "exact_match": false, + "code_bleu": 0.2984745896009823, + "edit_similarity": 0.6842105263157895, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "1", + "got": "1", + "got_raw": "1\n assert len(container.find('.grid-row').find('.col-md-5')) == 1\n assert len(container.find('.grid-row').find('.col-md-4')) == 1\n assert len(container.find('.grid-row').find('.col-md-3')) == 1\n\n assert len(container.find('.grid-row').find('.col-md-12').find('.col-md-6')) == 1\n assert len(container.find('.grid-row').find('.col-md-12').find('.col-md-4')) == 1\n assert len(container.find('.grid-row').find", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "christabor/flask_jsondash", + "expected": "2", + "got": "2", + "got_raw": "2\n assert read()[0]['name'] == 'mydash'\n assert read()[1]['name'] == 'Clone of mydash'\n\n res = test.post(\n url_for('jsondash.clone', c_id=new_id),\n follow_redirects=True)\n dom = pq(res.data)\n flash_msg = 'Created new dashboard clone \"Clone of Clone of mydash\"'\n assert flash_msg in dom.find('.alert').text()\n\n assert len(read()) == 3\n assert read()[0]['name'] == 'mydash'\n assert read()[1]['name'] == 'Clone of mydash'\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chuyangliu/snake", + "expected": "Pos(-10, 10)", + "got": "0", + "got_raw": "0\n assert p != 1\n assert p != \"a\"\n\n assert p == Pos(-5, 5)\n assert p != Pos(-5, 6)\n assert p != Pos(-4, 5)\n\n assert p == Pos(-5, 5)\n assert p != Pos(-5, 4)\n assert p != Pos(-4, 5)\n\n assert p == Pos(-5, 5)\n assert p != Pos(-5, 6)\n assert p != Pos(-4, 5)\n\n assert p == Pos(-5, 5)\n assert", + "exact_match": false, + "code_bleu": 0.07142857142857142, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "chuyangliu/snake", + "expected": "m_copy.point(Pos(i, j)).type", + "got": "m_copy.point(Pos(i, j)).type", + "got_raw": " m_copy.point(Pos(i, j)).type\n\ndef test_point():\n m = Map(5, 5)\n m.point(Pos(1, 1)).type = PointType.FOOD\n assert m.point(Pos(1, 1)).type == PointType.FOOD\n assert m.point(Pos(1, 1)).type == m_copy.point(Pos(1, 1)).type\n\ndef test_is_inside():\n m = Map(5, 5)\n assert m.is_inside(Pos(1, 1))\n assert m.is_inside(Pos(1, 2))\n assert m.is_inside", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chuyangliu/snake", + "expected": "Direc.UP", + "got": "Direc.LEFT", + "got_raw": " Direc.LEFT\n hit[0] = True\n elif adj == Pos(1, 0):\n assert p.direc_to(adj) == Direc.RIGHT\n hit[1] = True\n elif adj == Pos(0, -1):\n assert p.direc_to(adj) == Direc.UP\n hit[2] = True\n elif adj == Pos(0, 1):\n assert p.direc_to(adj) == Direc.DOWN\n hit[3] = True\n assert hit.count(True) == 4\n\ndef test_direc_to():\n", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "chuyangliu/snake", + "expected": "PointType.WALL", + "got": "1", + "got_raw": "1\n else:\n assert m.point(Pos(i, j)).type == 0\n\ndef test_copy():\n m = Map(12, 12)\n m.create_food(Pos(1, 1))\n m_copy = m.copy()\n assert m_copy.num_rows == m.num_rows\n assert m_copy.num_cols == m.num_cols\n assert m_copy.capacity == m.capacity\n assert m_copy.food == m.food\n assert m_copy.point(Pos(1, 1)).type == PointType.FOOD\n\ndef test_point():\n m = Map(12, 12)\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "chuyangliu/snake", + "expected": "3", + "got": "3", + "got_raw": "3\n assert s.head() == Pos(1, 1)\n assert s.tail() == Pos(1, 3)\n\n assert s.map == m\n assert s.steps == 0\n assert s.direc_next is Direc.NONE\n assert s.bodies == deque([Pos(1, 1), Pos(1, 2), Pos(1, 3)])\n\n assert m.point(Pos(1, 1)).type == PointType.HEAD_R\n assert m.point(Pos(1, 2)).type == PointType.BODY_HOR\n assert m.point(Pos(", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "chuyangliu/snake", + "expected": "Direc.RIGHT", + "got": "Direc.RIGHT", + "got_raw": " Direc.RIGHT\n assert Direc.opposite(Direc.RIGHT) == Direc.LEFT\n\n assert Direc.opposite(Direc.NONE) == Direc.NONE\n\n assert Direc.opposite(Direc.LEFT) == Direc.RIGHT\n assert Direc.opposite(Direc.RIGHT) == Direc.LEFT\n assert Direc.opposite(Direc.UP) == Direc.DOWN\n assert Direc.opposite(Direc.DOWN) == Direc.UP\n\n assert Direc.opposite(Direc.LEFT) == Direc.RIGHT\n assert Direc.opposite(Direc.RIGHT) ==", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "coderamp-labs/gitingest", + "expected": "InvalidGitHubTokenError)", + "got": "InvalidGitHubTokenError):", + "got_raw": "InvalidGitHubTokenError):\n validate_github_token(token)\n\n\ndef test_validate_github_token_valid() -> None:\n \"\"\"Test that ``validate_github_token`` does not raise on valid tokens.\"\"\"\n\n validate_github_token(\"github_pat_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\")\n\n\ndef test_create_git_auth_header() -> None:\n \"\"\"Test that ``create_git_auth_header`` returns the correct header for GitHub.\"\"\"\n\n token = \"github_pat_", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.9795918367346939, + "n_retrieved": 10 + }, + { + "repo": "coderamp-labs/gitingest", + "expected": "content", + "got": "", + "got_raw": " # noqa: PLR2004 (no-assert)\n assert \"src/subfile2.txt\" in # noqa: PLR2004 (no-assert)\n assert \"src/subfile3.txt\" in # noqa: PLR2004 (no-assert)\n assert \"src/subfile4.txt\" in # noqa: PLR2004 (no-assert)\n assert \"src/subfile5.txt\" in # noqa: PLR2004 (no-assert)\n assert \"src/subfile6.txt\" in # noqa:", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "coderamp-labs/gitingest", + "expected": "token)", + "got": "ghp_ + \"f\" * 36, url=url)", + "got_raw": "ghp_ + \"f\" * 36, url=url)\n else:\n header_mock.assert_not_called()\n\n\ndef test_create_git_repo_helper_calls_with_token() -> None:\n \"\"\"Test that ``create_git_auth_header`` is invoked with the token.\"\"\"\n header_mock = mocker.patch(\"gitingest.utils.git_utils.create_git_auth_header\", return_value=\"key=value\")\n mock_repo = mocker.MagicMock()\n mocker.patch(\"git.Repo\", return_value=mock_repo)\n\n create_git_repo(str(tmp_path), \"https://github.com/foo/bar.git\", \"ghp_\" + \"f\" * 3", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.06451612903225806, + "n_retrieved": 10 + }, + { + "repo": "coderamp-labs/gitingest", + "expected": "content_with_ignore", + "got": "", + "got_raw": " # type: ignore\n assert \"This file should be included.\" in content_with_ignore # type: ignore\n\n # Run ingestion with the gitignore functionality disabled.\n _, _, content_without_ignore = await ingest_async(source=str(repo_path), include_gitignored=False)\n # 'exclude.txt' should be included.\n\n assert \"This file should be excluded.\" in content_without_ignore # type: ignore\n assert \"This file should be included.\" in content_without_ignore # type: ignore\n\n@pytest.mark.asyncio\nasync def test_ingest_with_submodules(repo_path: Path) -> None:\n \"\"\"Integration test", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "coderamp-labs/gitingest", + "expected": "expected", + "got": "", + "got_raw": " # noqa: DTZ001\n assert mock_resolve.call_count == GIT_INSTALLED_CALLS\n\n\n@pytest.mark.asyncio\nasync def test_clone_repo(\n *,\n mocker: MockerFixture,\n) -> None:\n \"\"\"Verify that ``clone_repo`` works by using _resolve_ref_to_sha.\"\"\"\n mock_resolve = mocker.patch(\"gitingest.utils.git_utils._resolve_ref_to_sha\")\n mock_resolve.return_value = \"abc123def456\" # Mock SHA\n\n config = CloneConfig(\n url=DEMO_URL,\n local_path=LOCAL_REPO_PATH,\n commit=\"abc", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "coderamp-labs/gitingest", + "expected": "structure", + "got": "e", + "got_raw": "<|fim_suffix|>e\n assert not (not_structure_match := not_structure_regex.search(structure)) is None\n assert not_structure_match.group(1) == pattern_scenario[\"expected_not_structure\"]\n\n\ndef test_include_ignore_patterns_with_exclude(\n temp_directory: Path,\n sample_query: IngestionQuery,\n) -> None:\n \"\"\"Test ``ingest_query`` to ensure included and ignored paths are included and ignored respectively.\n\n Given a directory with ``.txt`` and ``.py`` files, and a set of include patterns or a set of ignore patterns:\n When ``ingest_query`` is invoked,\n Then it", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "coderamp-labs/gitingest", + "expected": "stderr_lines", + "got": "", + "got_raw": " # noqa: WPS221\n assert stderr_lines[-1] == summary, \"Unexpected summary message not found in STDERR\"\n finally:\n output_file.unlink()\n\n\ndef test_cli_with_file_output() -> None:\n \"\"\"Test CLI invocation with output directed to a file.\"\"\"\n output_file = Path(OUTPUT_FILE_NAME)\n # Clean up any existing digest.txt file before test\n if output_file.exists():\n output_file.unlink()\n\n try:\n result = _invoke_isolated_cli_runner([\"./\", \"--output\", output_file])\n\n # \u2500\u2500\u2500 core expectations (stdout) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cohere-ai/cohere-python", + "expected": "dict)", + "got": "", + "got_raw": " # type: ignore\n dict)\n\n self.assertEqual(response[\"model\"], \"cohere.embed-english-v3\")\n\n self.assertEqual(response[\"embedding_types\"], [\"float\"])\n\n self.assertEqual(response[\"output_dimension\"], 256)\n\n self.assertEqual(response[\"embedding\"], [0.0, 0.0])\n\n def test_embed_with_output_dimension_and_embedding_types(self) -> None:\n response = self.client.embed(\n texts=[\"I love Cohere!\"],\n input_type=\"search_document\",\n model_id=\"cohere.embed-english-v3\",\n output_dimension=256,\n embedding_types=[\"float", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cohere-ai/cohere-python", + "expected": "256)", + "got": "256)", + "got_raw": "256)\n self.assertEqual(captured_body[\"embedding_types\"], [\"float\", \"int8\"])\n self.assertEqual(captured_body[\"input_type\"], \"search_document\")\n self.assertEqual(captured_body[\"texts\"], [\"hello world\"])\n\n def test_embed_passes_params_to_bedrock_with_batching(self) -> None:\n mock_boto3, mock_botocore, captured_body = self._make_bedrock_client()\n\n with patch(\"cohere.manually_maintained.cohere_aws.client.lazy_boto3\", return_value=mock_boto3), \\\n patch(\"cohere.manually_maintained", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "cohere-ai/cohere-python", + "expected": "str(request.url))", + "got": "", + "got_raw": " # type: ignore\n captured_aws_request_kwargs[\"headers\"][\"host\"])\n\n\n# File: src/cohere/aws_client.py\n def __init__(\n self,\n *,\n aws_access_key: typing.Optional[str] = None,\n aws_secret_key: typing.Optional[str] = None,\n aws_session_token: typing.Optional[str] = None,\n aws_region: typing.Optional[str] = None,\n timeout: typing.Optional[float] = None,\n service: typing.Union[typing.Literal[\"bedrock\"], typing.Literal[\"sagemaker\"]],\n ):\n Client.__init__(\n self,\n base", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cohere-ai/cohere-python", + "expected": "\"text-generation\" in events)", + "got": "", + "got_raw": "\n\n\n# File: src/cohere/raw_base_client.py\n \"text-generation\",\n \"text-generation-error\",\n \"text-generation-end\",\n \"text-generation-start\",\n \"text-generation-start-error\",\n \"text-generation-start-end\",\n \"text-generation-start-end-error\",\n \"text-generation-start-end-error-end\",\n \"text-generation-start-end-error-end-error\",\n \"text-generation-start-end-error-end-error-end\",\n \"text-generation-start-end-error-end-error-end-error\",\n \"text-generation-start-end-error-end-error-end-error-end\",\n \"text-generation-start-end-error-end-error-end-error-end-error\",\n \"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cohere-ai/cohere-python", + "expected": "response)", + "got": "", + "got_raw": "\n\n\n# File: src/cohere/aws_client.py\n return _response.data\n\n def check_api_key(self, *, request_options: typing.Optional[RequestOptions] = None) -> CheckApiKeyResponse:\n \"\"\"\n Checks that the api key in the Authorization header is valid and active\n\n Parameters\n ----------\n request_options : typing.Optional[RequestOptions]\n Request-specific configuration.\n\n Returns\n -------\n CheckApiKeyResponse\n OK\n\n Examples\n --------\n from cohere import Client\n\n client = Client(\n client_name=\"YOUR_CLIENT_NAME\",\n token=\"YOUR_TOKEN\",\n )\n client.check", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "cohere-ai/cohere-python", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n await self.co.chat_stream(\n model=\"command-r-plus-08-2024\",\n messages=[{\"role\": \"user\", \"content\": \"hello world!\"}],\n stream=True,\n )\n\n async def test_stream_equals_false(self) -> None:\n\n with self.assertRaises(NotImplementedError):\n await self.co.chat_stream(\n model=\"command-r-plus-08-2024\",\n messages=[{\"role\": \"user\", \"content\": \"hello world!\"}],\n stream=False,\n )\n\n async def test_chat_stream(self) -> None:\n response", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "commaai/laika", + "expected": "sat_info_orbit[2])", + "got": "0, rtol=0, atol=1e-10)", + "got_raw": "0, rtol=0, atol=1e-10)\n np.testing.assert_allclose(sat_info_nav[3], 0, rtol=0, atol=1e-10)\n np.testing.assert_allclose(sat_info_nav[4], 0, rtol=0, atol=1e-10)\n np.testing.assert_allclose(sat_info_nav[5], 0, rtol=0, atol=1e-10)\n np.testing.assert_allclose(sat_info_nav[6], 0, rtol=0, atol=1e-", + "exact_match": false, + "code_bleu": 0.10390302174233558, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "commaai/laika", + "expected": "prn)", + "got": "prn)", + "got_raw": " prn)\n\n def test_nmea_id_from_prn_for_main_constellations(self):\n data = MAIN_CONSTELLATIONS\n\n for expected_nmea_id, prn in data:\n nmea_id = get_nmea_id_from_prn(prn)\n\n self.assertEqual(expected_nmea_id, nmea_id)\n\n def test_constellation_from_nmea_id_for_main_constellations(self):\n data = MAIN_CONSTELLATIONS\n\n for expected_constellation, nmea_id in data:\n constellation = get_constellation(nmea_id)\n\n self.assertEqual(expected_constellation,", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "commaai/laika", + "expected": "os.path.exists(file.filepath_attempt))", + "got": "os.path.exists(file.filepath_attempt) )", + "got_raw": " os.path.exists(file.filepath_attempt) )\n with self.assertRaises(DownloadFailed):\n self._download_and_cache_file(self.url_bases, file)\n self.assertTrue( os.path.exists(file.filepath_attempt) )\n\n @parameterized.expand([(f,) for f in files])\n def test_write_attempt_file_on_success(self, file):\n\n self.assertFalse( os.path.exists(file.filepath_attempt) )\n self._download_and_cache_file(self.url_bases, file)\n self.assertTrue( os.path.exists(file.filepath_attempt) )\n\n @parameterized.expand([(f,) for f in files])\n def test_write_attempt_file_on_success", + "exact_match": false, + "code_bleu": 1.0, + "edit_similarity": 0.987012987012987, + "n_retrieved": 10 + }, + { + "repo": "commaai/laika", + "expected": "14)", + "got": "0, atol=1e-10)", + "got_raw": "0, atol=1e-10)\n np.testing.assert_allclose((gps_times[1] - gpst_to_utc(gps_times[1])), 0, atol=1e-10)\n np.testing.assert_allclose((gps_times[2] - gpst_to_utc(gps_times[2])), 0, atol=1e-10)\n np.testing.assert_allclose((gps_times[3] - gpst_to_utc(gps_times[3])), 0, atol=1e-10)\n np.testing.assert_allclose((gps_times[4] - gpst_to", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "commaai/laika", + "expected": "1.7378390525714509)", + "got": "1.0000000000000002)", + "got_raw": "1.0000000000000002)\n\n def test_HDOP(self):\n dop = get_HDOP(self.receiver, self.satellites)\n\n self.assertAlmostEqual(dop, 1.0000000000000002)\n\n def test_PDOP(self):\n dop = get_PDOP(self.receiver, self.satellites)\n\n self.assertAlmostEqual(dop, 1.0000000000000002)\n\n def test_TDOP(self):\n dop = get_TDOP(self.receiver", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2631578947368421, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "expected[checksum_field]", + "got": "0, f\"Checksum mismatch for {msg_name} {expected_msg[0]}\"", + "got_raw": "0, f\"Checksum mismatch for {msg_name} {expected_msg[0]}\"\n\n def test_checksums(self):\n # TODO: add more tests\n self.verify_checksum(\n subtests=self.subtests,\n dbc_file='opendbc/car/secoc/secoccan.dbc',\n msg_name='SECOC_MSG',\n msg_addr=0x18000000,\n test_messages=[\n b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "std", + "got": "0xFF - std", + "got_raw": "0xFF - std\n assert parser.vl['LKAS_HUD_A']['CHECKSUM'] == 0xFF - ext\n\n def test_tesla_checksum(self):\n \"\"\"Test checksums for Tesla CAN ids\"\"\"\n # TODO: refactor to use self.verify_checksum()\n dbc_file = \"tesla_model3_party_2022_can_generated\"\n msgs = [(\"ACC\", 0), (\"ACC_A\", 0)]\n parser = CANParser(dbc_file, msgs, 0)\n packer = CANPacker(dbc_file)\n\n values = {\n 'ACC_STATE': 1,\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.46153846153846156, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "should_match", + "got": "should_match", + "got_raw": " should_match\n\n\n# File: opendbc/car/fingerprints.py\nfrom opendbc.car import uds\nfrom opendbc.car.carlog import carlog\nfrom opendbc.car.can_definitions import CanRecvCallable, CanSendCallable\nfrom opendbc.car.fw_query_definitions import ESSENTIAL_ECUS, AddrType, EcuAddrBusType, FwQueryConfig, LiveFwVersions, OfflineFwVersions\nfrom opendbc.car.interfaces import get_interface_attr\nfrom opendbc.car.isotp_parallel_query import IsoTpParallelQuery\nfrom opendbc.car.values import BRANDS\nfrom", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "aeb_event == 0)", + "got": "0)", + "got_raw": "0)\n\n def test_aeb(self):\n for aeb_event in range(4):\n\n self.assertEqual(self._tx(self._long_control_msg(10, aeb_event=aeb_event)), 0)\n\n def test_aeb_2(self):\n for aeb_event in range(4):\n\n self.assertEqual(self._tx(self._long_control_msg(10, aeb_event=aeb_event)), 0)\n\n def test_aeb_3(self):\n for aeb_event in range(4):\n\n self.assertEqual(self._tx(self._long_control_msg(10, aeb_event=aeb_event", + "exact_match": false, + "code_bleu": 0.28284271247461906, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "self.MIN_GAS)", + "got": "0)", + "got_raw": "0)\n self.assertGreater(self.MAX_GAS, self.MIN_GAS)\n\n self.assertGreater(self.MAX_BRAKE, self.MAX_GAS)\n\n self.assertGreater(self.MAX_POSSIBLE_BRAKE, self.MAX_BRAKE)\n self.assertGreater(self.MAX_POSSIBLE_GAS, self.MAX_GAS)\n\n def test_gas_brake_limits_correct(self):\n self.assertIsNotNone(self.MAX_POSSIBLE_BRAKE)\n self.assertIsNotNone(self.MAX_POSSIBLE_GAS)\n\n assert self.MAX_BRAKE is not None and self.MAX_GAS is not None\n self.assertGreater(self.MAX_B", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "self._tx(self._acc_cancel_msg(False)))", + "got": "", + "got_raw": "\n\n\n# File: opendbc/car/chevrolet/values.py\n0.0001]),\n ([5, 25], [0.00045, 0.00015])\n )\n CURVATURE_ERROR = 0.002 # ~6 degrees at 10 m/s, ~10 degrees at 35 m/s\n\n ACCEL_MAX = 2.0 # m/s^2 max acceleration\n ACCEL_MIN = -3.5 # m/s^2 max deceleration\n MIN_GAS = -", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "len(result)", + "got": "1 if len(result) == 1 else 0", + "got_raw": "1 if len(result) == 1 else 0\n assert 1 == 1 if result[0] in CANFD_EXPECTED_ECUS else 0\n codes.add(result[0])\n\n assert len(codes) == 1\n\n for fw in fws:\n result = get_platform_codes([fw])\n assert result[0] in codes\n\n for fw in fws:\n result = get_platform_codes([fw])\n assert result[0] in codes\n\n for fw in fws:\n result = get_platform_codes([fw])\n assert result[0] in codes\n\n ", + "exact_match": false, + "code_bleu": 0.317023313852343, + "edit_similarity": 0.5641025641025641, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "self._rx(self._speed_msg(0)))", + "got": "0, self.safety.rx_hook(self._speed_msg(100)))", + "got_raw": "0, self.safety.rx_hook(self._speed_msg(100)))\n self.assertTrue(0, self.safety.rx_hook(self._speed_msg(100)))\n self.assertTrue(0, self.safety.rx_hook(self._speed_msg(100)))\n self.assertTrue(0, self.safety.rx_hook(self._speed_msg(100)))\n self.assertTrue(0, self.safety.rx_hook(self._speed_msg(100)))\n self.assertTrue(0, self.safety.rx_hook(self._speed_msg(100)))\n self.assertTrue(0, self.safety.rx_hook(self", + "exact_match": false, + "code_bleu": 0.39846811316275854, + "edit_similarity": 0.7567567567567568, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "self._tx(self._button_msg(resume=True)))", + "got": "", + "got_raw": "\n\n\n# File: opendbc/car/ford/fordcan.py\n# File: opendbc/car/ford/fordcan.py\n# File: opendbc/car/ford/fordcan.py\n# File: opendbc/car/ford/fordcan.py\n# File: opendbc/car/ford/fordcan.py\n# File: opendbc/car/ford/fordcan.py\n# File: opendbc/car/ford/fordcan.py\n# File: opendbc/car/ford/fordcan.py\n# File: opendbc/car/ford/fordcan.py\n#", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "self._tx(tester_present))", + "got": "0x7d0 in self.safety.get_ecus())", + "got_raw": "0x7d0 in self.safety.get_ecus())\n self.assertEqual(should_tx, self.safety.is_allowed(tester_present))\n\n def test_tester_present_disallowed(self, ecu_disable: bool = True):\n \"\"\"\n Ensure tester present diagnostic message is disallowed to keep ECU knocked out\n for longitudinal control.\n \"\"\"\n\n addr, bus = self.DISABLED_ECU_UDS_MSG\n for should_tx, msg in ((True, b\"\\x02\\x3E\\x80\\x00\\x00\\x00\\x00\\x00\"),\n (False,", + "exact_match": false, + "code_bleu": 0.21834177214239062, + "edit_similarity": 0.3508771929824561, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "i % 256", + "got": "i + 1) % (1 << 8)", + "got_raw": "i + 1) % (1 << 8)\n\n # packer should not increment the counter\n for i in range(1000):\n msg = packer.make_can_msg(\"CAN_FD_MESSAGE\", 0, {})\n parser.update([0, [msg]])\n\n assert parser.vl[\"CAN_FD_MESSAGE\"][\"COUNTER\"] == i % (1 << 8)\n\n def test_packer_checksum(self):\n msgs = [(\"CAN_FD_MESSAGE\", 0), ]\n packer = CANPacker(TEST_DBC)\n parser = CANParser(TEST_DBC, msgs, 0)\n\n #", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "{(b\"CV1-CV000\", None)}", + "got": "def test_platform_codes(self):", + "got_raw": "<|fim_suffix|>\n\n def test_platform_codes(self):\n # Asserts basic platform code parsing behavior for a few cases\n results = get_platform_codes([b\"\\xf1\\x00DH LKAS 1.1 -150210\"])\n assert results == {(b\"DH\", b\"150210\")}\n\n # Some cameras and all radars do not have dates\n results = get_platform_codes([b\"\\xf1\\x00AEhe SCC H-CUP 1.01 1.01 96400-G2000", + "exact_match": false, + "code_bleu": 0.18334613341308786, + "edit_similarity": 0.07692307692307693, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "self.safety.get_controls_allowed())", + "got": "0 in self.safety.get_controls_allowed())", + "got_raw": "0 in self.safety.get_controls_allowed())\n self._rx(self._ls_01_msg(cancel=False, bus=0))\n self.assertTrue(0 in self.safety.get_controls_allowed())\n\n def test_resume_button(self):\n # Disable on rising edge of resume button\n self._rx(self._tsk_status_msg(False, main_switch=True))\n self.safety.set_controls_allowed(1)\n self._rx(self._ls_01_msg(resume=True, bus=0))\n\n self.assertFalse(0 in self.safety.get_controls_allowed())\n self._rx(self._ls_01_msg(resume", + "exact_match": false, + "code_bleu": 0.7860753021519787, + "edit_similarity": 0.9333333333333333, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "car_params.centerToFront", + "got": "0.5", + "got_raw": "0.5\n assert car_params.wheelbase * 0.7 > 0.5\n assert car_params.centerToFront > 0.4\n assert car_params.centerToFront < 0.6\n\n assert car_params.minEnableSpeed > 0\n assert car_params.minSteerSpeed > 0\n assert car_params.tireStiffnessFactor > 0\n assert car_params.flags == 0\n\n assert car_params.rotationalInertia > 0\n assert car_params.tireStiffnessFront > 0\n assert car_params.tireStiffnessR", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.07407407407407407, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "len(codes)", + "got": "1, \"Unexpected platform codes\"", + "got_raw": "1, \"Unexpected platform codes\"\n\n @parameterized.expand(FW_VERSIONS.items())\n def test_fw_versions_fuzzy(self, car_model: str, fw_versions: dict[tuple[int, int, int | None], Iterable[bytes]]):\n for (ecu, addr, subaddr), fws in fw_versions.items():\n assert ecu in ECU_PART_NUMBER, \"Unexpected ECU\"\n assert addr == ECU_ADDRESSES[ecu], \"ECU address mismatch\"\n assert subaddr is None, \"Unexpected ECU subaddress\"\n\n for fw in fws:\n assert len(f", + "exact_match": false, + "code_bleu": 0.2849383821193472, + "edit_similarity": 0.3, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "should_fail", + "got": "should_fail, f\"Expected {should_fail} but got {failed} for {fn} with rule {rule}\"", + "got_raw": " should_fail, f\"Expected {should_fail} but got {failed} for {fn} with rule {rule}\"\n\n\n@pytest.mark.parametrize(\"fn, transform\", patterns)\ndef test_misra(fn, transform):\n with tempfile.TemporaryDirectory() as tmp:\n shutil.copytree(ROOT, tmp, dirs_exist_ok=True,\n ignore=shutil.ignore_patterns('.venv', '.git', '*.ctu-info', '.hypothesis'))\n\n # apply patch\n with open(os.path.join(tmp, fn), 'r+') as f:\n content = f.read()\n f.seek(0)\n f.write(transform", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.2391304347826087, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "{platform}", + "got": "1, f\"Expected 1 match, got {len(matches)} for {platform} {CP.carVin}\"", + "got_raw": "1, f\"Expected 1 match, got {len(matches)} for {platform} {CP.carVin}\"\n\n\n# File: opendbc/car/ford/fingerprints.py\nfrom opendbc.car import Bus, CarSpecs, PlatformConfig, Platforms\nfrom opendbc.car.structs import CarParams\nfrom opendbc.car.docs_definitions import CarDocs\nfrom opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries\n\nEcu = CarParams.Ecu\n\n# debug ecu fw version is the git hash of the firmware\n\n\nFINGERPRINTS = {\n CAR.F", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.25316455696202533, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "yr2)", + "got": "yr2, abs=1e-6)", + "got_raw": "yr2, abs=1e-6)\n\n def test_calc_curvature(self):\n \"\"\"Verify that the curvature function matches the results\n from the state space model.\"\"\"\n\n for roll in np.linspace(math.radians(-20), math.radians(20), num=11):\n for u in np.linspace(1, 30, num=10):\n for sa in np.linspace(math.radians(-20), math.radians(20), num=11):\n\n # Compute curvature based on state space model\n curv1 = self.VM.calc_curvature(sa, u, roll)\n\n ", + "exact_match": false, + "code_bleu": 0.17747405280050269, + "edit_similarity": 0.4444444444444444, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "self._rx(msg))", + "got": "0 == self._rx(msg))", + "got_raw": "0 == self._rx(msg))\n self.assertEqual(quality_flag, self.safety.get_controls_allowed())\n\n # Mess with counter to make it fail\n msg[0].data[3] = 0 # Speed checksum & half of yaw signal\n msg[0].data[4] = 0 # Speed counter\n should_rx = msg_type == \"speed_2\" and quality_flag\n\n self.assertEqual(should_rx, 0 == self._rx(msg))\n self.assertEqual(quality_flag, self.safety.get_controls_allowed())\n\n # Mess with quality flag to make it fail\n msg", + "exact_match": false, + "code_bleu": 0.6786502681586726, + "edit_similarity": 0.8484848484848485, + "n_retrieved": 10 + }, + { + "repo": "commaai/opendbc", + "expected": "1", + "got": "1, \"Expected exactly one candidate\"", + "got_raw": "1, \"Expected exactly one candidate\"\n assert candidates[0] in expected, f\"Expected {candidates[0]} to be in {expected}\"\n\n def test_fingerprint(self):\n car_fingerprint, finger, vin, car_fw, source, exact_match = fingerprint(can_recv, can_send, set_obd_multiplexing, num_pandas, cached_params)\n\n if car_fingerprint is None:\n carlog.error({\"event\": \"car doesn't match any fingerprints\", \"fingerprints\": repr(fingerprints)})\n candidate = \"MOCK\"\n else:\n CarInterface = interfaces[car_fingerprint]\n", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.05555555555555555, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "16", + "got": "16", + "got_raw": "16\n\ndef test_env_overrides_file():\n mock_file_config = {\n \"image\": \"custom/image:latest\",\n \"threads\": 8,\n }\n mock_env_config = {\n \"image\": \"env/image:override\",\n }\n\n with patch(\"ramalama.config.load_file_config\", return_value=mock_file_config):\n with patch(\"ramalama.config.load_env_config\", return_value=mock_env_config):\n cfg = default_config()\n assert cfg.image == \"env/image:override\"\n\n assert cfg.threads == 8\n\ndef test_env_overrides_default():\n mock_env_config", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "\"All done\"", + "got": "assert len(events) == 1", + "got_raw": "<|fim_suffix|>\n assert len(events) == 1\n\n assert events[0].text == \"All done\"\n\n def test_streaming_extracts_text_from_done_events_with_multiple_outputs(self):\n chunk = (\n b\"event: response.output_text.done\\n\"\n b'data: {\"type\":\"response.output_text.done\",\"output\":[{\"content\":'\n b'[{\"type\":\"output_text\",\"text\":\"All done\"},{\"type\":\"output_text\",\"text\":\"Another done\"}]}]}\\n\\n'\n )\n\n events = list(self.provider.parse_stream_chunk(chunk))\n\n assert len(events) == 1\n\n assert events[", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.06060606060606061, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "0", + "got": "1", + "got_raw": "1\n assert _text_content(shell.conversation_history[0]) == \"Please analyze:\"\n\n\n @patch('urllib.request.urlopen')\n def test_chat_with_file_input(self, mock_urlopen):\n \"\"\"Test chat functionality when an input file is specified.\"\"\"\n # Mock the models endpoint response\n mock_response = MagicMock()\n mock_response.__iter__.return_value = [b'{\"data\": [{\"id\": \"test-model\"}]}']\n mock_urlopen.return_value = mock_response\n\n mock_args = MagicMock()\n mock_args.rag = None\n mock_args.ARGS = [\"Please analyze:\"]\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "22", + "got": "1", + "got_raw": "1\n assert exc_info.value.output == f\"Transport {test_transport} is not supported.\\n\"\n\n\n@pytest.mark.e2e\ndef test_unsupported_transport_message_with_help():\n test_transport = \"test-transport\"\n with pytest.raises(CalledProcessError) as exc_info:\n check_output([\"ramalama\", \"pull\", \"foobar\"], env={\"RAMALAMA_TRANSPORT\": test_transport}, stderr=STDOUT)\n\n\n assert exc_info.value.returncode == 1\n assert exc_info.value.output == f\"Transport {test_transport} is not supported.\\n\"\n\n\n@pytest.mark.e2e\ndef test_un", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "0", + "got": "0, \"No handlers were installed\"", + "got_raw": "0, \"No handlers were installed\"\n\n # Verify that the HTTP handler is a ProxyHandler\n http_handler = next((h for h in installed_opener.handlers if isinstance(h, urllib.request.ProxyHandler)), None)\n assert http_handler is not None, \"No HTTP handler was installed\"\n\n # Verify that the HTTPS handler is a ProxyHandler\n https_handler = next((h for h in installed_opener.handlers if isinstance(h, urllib.request.ProxyHandler)), None)\n assert https_handler is not None, \"No HTTPS handler was installed\"\n\n def test_proxy_handler_not_installed(self, monkeypatch):\n \"\"\"Test that", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0625, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "sio.read()", + "got": "def test_get_accel(self):", + "got_raw": "<|fim_suffix|>\n def test_get_accel(self):\n assert get_accel(\"intel\") == \"intel\"\n assert get_accel(\"amd\") == \"amd\"\n assert get_accel(\"nvidia\") == \"nvidia\"\n assert get_accel(\"none\") == \"none\"\n assert get_accel(\"none\") == \"none\"\n assert get_accel(\"none\") == \"none\"\n assert get_accel(\"none\") == \"none\"\n assert get_accel(\"none\") == \"none\"\n assert get_accel(\"none\") == \"none\"\n assert get_accel(\"none\") == \"none\"\n assert get_accel(\"none\")", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.17142857142857143, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "content", + "got": "assert result.content == \"test yaml content\"", + "got_raw": "<|fim_suffix|>\n assert result.content == \"test yaml content\"\n\n assert printed_output == [\n f\"Generating Kubernetes YAML file: {name}.yaml\",\n ]\n\n\ndef test_kube_genfile_with_env(monkeypatch):\n \"\"\"Test the genfile function with environment variables.\"\"\"\n from ramalama.kube import genfile\n\n # Capture print output\n printed_output = []\n monkeypatch.setattr(\"builtins.print\", lambda x: printed_output.append(x))\n\n name = \"test-model\"\n content = \"test yaml content\"\n\n result = genfile(name, content)\n\n assert result.filename == \"test-model", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.27450980392156865, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n get_chat_provider(\"unknown://\")\n\ndef test_get_chat_provider_returns_openai_provider():\n\n provider = get_chat_provider(\"openai://\")\n\n assert isinstance(provider, OpenAIResponsesChatProvider)\n\n\n# File: ramalama/cli.py\n parser.add_argument(\n \"--api-key\",\n type=str,\n default=get_config().api_key,\n help=\"\"\"OpenAI-compatible API key.\n Can also be set in ramalama.conf or via the RAMALAMA_API_KEY environment variable.\"\"\",\n )\n chat_run_options(parser)\n parser.add_argument(\n \"--list\",\n \"--ls\",\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "True", + "got": "expected", + "got_raw": " expected\n\n\ndef test_cfg_container_env_override_with_default():\n with patch.dict(os.environ, {\"RAMALAMA_IN_CONTAINER\": \"true\"}):\n cfg = default_config()\n\n assert cfg.is_set(\"container\") is True\n\n\ndef test_cfg_container_env_override_with_default_and_env_value():\n with patch.dict(os.environ, {\"RAMALAMA_IN_CONTAINER\": \"false\"}):\n cfg = default_config()\n\n assert cfg.is_set(\"container\") is False\n\n\ndef test_cfg_container_env_override_with_default_and_env_value_and_env_value():\n with patch.dict(os.environ, {\"RAMALAMA_IN_CONTAINER\": \"true\"}):\n cfg", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "provider", + "got": "t_factory_module, \"get_chat_provider\", fake_get_chat_provider)", + "got_raw": "<|fim_suffix|>t_factory_module, \"get_chat_provider\", fake_get_chat_provider)\n\n transport = TransportFactory(\"huggingface://gpt-4o-mini\", args).create()\n\n assert captured[\"scheme\"] == \"huggingface\"\n assert isinstance(transport, Huggingface)\n\n assert transport.provider is provider\n\ndef test_transport_factory_passes_scheme_to_get_model_scope(monkeypatch):\n args = ARGS()\n provider = ModelScope(\"https://api.modelscope.cn/v2\")\n captured: dict[str, str] = {}\n\n def fake_get_model_scope(scheme: str):\n captured[\"scheme\"] = scheme", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.22857142857142856, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "8", + "got": "6", + "got_raw": "6\n assert all(isinstance(part, ImageURLPart) for part in image_parts)\n\n for part in image_parts:\n assert part.url.startswith(\"data:image/\")\n assert part.detail is None\n\n def test_image_with_detail(self, data_dir):\n \"\"\"Test loading an image with a detail.\"\"\"\n with tempfile.TemporaryDirectory() as tmp_dir:\n image_file = os.path.join(tmp_dir, \"test.jpg\")\n with open(image_file, \"wb\") as f:\n f.write(b\"jpeg data\")\n\n builder = OpanAIChatAPIMessageBuilder()\n messages = builder.load(tmp_dir)\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "value", + "got": "1 if value else 0", + "got_raw": "1 if value else 0\n\n\ndef test_pull_verify_default(monkeypatch):\n from ramalama.cli import init_cli\n\n argv = [\"ramalama\", \"pull\"]\n argv.append(\"model\")\n monkeypatch.setattr(sys, \"argv\", argv)\n parser, args = init_cli()\n assert hasattr(args, \"verify\")\n\n assert args.verify == 1\n\n\ndef test_pull_verify_default_false(monkeypatch):\n from ramalama.cli import init_cli\n\n argv = [\"ramalama\", \"pull\"]\n argv.append(\"--verify\")\n argv.append(\"model\")\n monkeypatch.setattr(sys", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.45454545454545453, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "None", + "got": "t = make_provider()", + "got_raw": "<|fim_suffix|>t = make_provider()\n transport = APITransport(\"gpt-4o-mini\", provider)\n recorded: dict[str, object] = {}\n\n def fake_chat(args, operational_args=None, provider=None):\n recorded[\"args\"] = args\n recorded[\"operational_args\"] = operational_args\n recorded[\"provider\"] = provider\n\n monkeypatch.setattr(api_module, \"chat\", fake_chat)\n\n args = SimpleNamespace(\n container=True, engine=\"podman\", url=\"http://localhost\", model=None, api=\"none\", api_key=None\n )\n transport.run(args, [])\n\n ", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "42", + "got": "42", + "got_raw": "42\n\n def test_layered_mixin_defaults_overridden(self):\n \"\"\"Test that defaults are overridden when overridden.\"\"\"\n layer1 = {\"name\": \"custom_name\", \"value\": 100}\n\n config = self.LayeredTestConfig(layer1)\n\n assert config.name == \"custom_name\"\n\n assert config.value == 100\n\n def test_layered_mixin_defaults_overridden_with_subconfig(self):\n \"\"\"Test that defaults are overridden when overridden with a subconfig.\"\"\"\n layer1 = {\"name\": \"custom_name\", \"value\": 100, \"nested\": {\"count\":", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "content", + "got": "assert result.content == expected_content", + "got_raw": "<|fim_suffix|>\n assert result.content == expected_content\n\n assert printed_output == [\n \"Generating Compose YAML file: docker-compose.yaml\",\n \"Generating Compose YAML file: docker-compose.yaml\",\n ]\n\n\ndef test_compose_genfile_with_output_dir(monkeypatch):\n \"\"\"Test the standalone genfile helper function with an output directory.\"\"\"\n printed_output = []\n monkeypatch.setattr(\"builtins.print\", lambda x: printed_output.append(x))\n\n name = \"test-service\"\n content = \"services:\\n test-service:\\n image: hello-world\"\n output_dir = \"output\"\n\n result = Com", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.2916666666666667, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "2", + "got": "2", + "got_raw": "2\n assert result[0].text == \"test1\"\n assert result[1].text == \"test2\"\n\n def test_image_file_manager_load_image_url(self):\n \"\"\"Test loading an image URL.\"\"\"\n with patch.object(BasicImageFileLoader, 'load', return_value=\"data:image/jpeg;base64,test\"):\n manager = ImageFileManager()\n result = manager.load([\"test.jpg\"])\n\n assert len(result) == 1\n assert result[0].text == \"test\"\n\n def test_image_file_manager_load_image_bytes(self):\n \"\"\"Test loading image bytes.\"\"\"\n with patch.object(Basic", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "info", + "got": "assert \"Model\" in info", + "got_raw": "<|fim_suffix|>\n assert \"Model\" in info\n assert \"ModelType\" in info[\"Model\"]\n assert \"ModelName\" in info[\"Model\"]\n assert \"ModelVersion\" in info[\"Model\"]\n assert \"ModelSize\" in info[\"Model\"]\n assert \"ModelQuantization\" in info[\"Model\"]\n assert \"ModelQuantizationMode\" in info[\"Model\"]\n assert \"ModelQuantizationBits\" in info[\"Model\"]\n assert \"ModelQuantizationType\" in info[\"Model\"]\n assert \"ModelQuantizationFormat\" in info[\"Model\"]\n assert \"ModelQuantizationPadding\" in info", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.3076923076923077, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "\"gpt-4o-mini\"", + "got": "0", + "got_raw": "0\n assert args.api == \"none\"\n assert args.api_key == \"provider-default\"\n\n assert recorded[\"args\"] == args\n assert recorded[\"operational_args\"] is None\n assert recorded[\"provider\"] == provider\n\ndef test_api_transport_run_with_args(monkeypatch):\n provider = make_provider()\n transport = APITransport(\"gpt-4o-mini\", provider)\n recorded: dict[str, object] = {}\n\n def fake_chat(args, operational_args=None, provider=None):\n recorded[\"args\"] = args\n recorded[\"operational_args\"] = operational_args\n recorded[\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n@pytest.mark.e2e\n@pytest.mark.parametrize(\n \"args,expected\",\n [\n ([\"list\", \"--json\"], True),\n ([\"list\", \"--json\", \"--noheading\"], False),\n ([\"list\", \"--json\", \"-n\"], False),\n ([\"list\", \"--json\", \"-q\"], False),\n ([\"list\", \"--json\", \"-q\", \"--noheading\"], False),\n ],\n ids=[\n \"ramalama list --json\",\n \"ramalama list --json --noheading\",\n \"ramalama list --json -n\",\n \"ramal", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "containers/ramalama", + "expected": "\"1024\"", + "got": "1024", + "got_raw": "1024\n\n def test_max_tokens_cli_override(self):\n \"\"\"Test that max_tokens can be set via command line argument.\"\"\"\n with patch(\"ramalama.config.load_file_config\", return_value={}):\n parser = argparse.ArgumentParser()\n parser.add_argument(\"--max-tokens\", type=int, default=0)\n args = parser.parse_args([\"--max-tokens\", \"1024\"])\n cfg = default_config()\n cfg.max_tokens = args.max_tokens\n\n assert cfg.max_tokens == 1024\n\n def test_max_tokens_default(self):\n \"\"\"Test that max_tokens is set to", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"foo\"", + "got": "\"foo\"", + "got_raw": " \"foo\"\n assert (dst / \"forbidden.txt\").read_text(\"utf-8\") == \"bar\"\n\ndef test_relative_render_path_outside_destination_raises_error_with_quiet(\n tmp_path_factory: pytest.TempPathFactory,\n) -> None:\n root = tmp_path_factory.mktemp(\"root\")\n (src := root / \"src\").mkdir()\n (dst := root / \"dst\").mkdir()\n build_file_tree(\n {\n root / \"forbidden.txt\": \"foo\",\n src / \"{{ pathjoin('..', 'forbidden.txt') }}\": \"bar\",\n }\n )\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "defaults", + "got": "", + "got_raw": " # noqa: WPS437\n assert is_trusted_repository(settings, \"https://example.com\") # noqa: WPS437\n\n\ndef test_load_settings_from_utf_file_with_invalid_encoding(\n settings_path: Path, monkeypatch: pytest.MonkeyPatch\n) -> None:\n def _encode(data: str) -> bytes:\n if data.startswith(\"utf-16\"):\n data = f\"\\ufeff{data}\"\n return data.encode(\"utf-16-le\")\n\n defaults = {\n \"foo\": \"\\u3053\\u3093\\u306b", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"P2\"", + "got": "\"P2\"", + "got_raw": " \"P2\"\n expected_parent2_answers = {\n \"_src_path\": str(parent2),\n \"_commit\": \"v1.0+parent2\",\n \"name\": \"P2\",\n }\n assert load_answersfile_data(dst, \".parent2-answers.yml\") == expected_parent2_answers\n # Apply child. It uses the answers file from parent 1.\n copier.run_copy(\n str(child),\n dst,\n defaults=True,\n overwrite=True,\n answers_file=\".copier-answers.yml\",\n )\n git_save(dst)\n\n assert (dst / \"child.txt\").read_text", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"v1\"", + "got": "1", + "got_raw": "1\n # Update to v1\n run_update(dst_path=dst)\n assert load_answersfile_data(dst)[\"_commit\"] == 1\n assert example.read_text() == \"1\"\n\n # Update to HEAD\n run_update(dst_path=dst, vcs_ref=VcsRef(\"HEAD\"))\n assert load_answersfile_data(dst)[\"_commit\"] == sha\n assert example.read_text() == \"2\"\n\n # Update to v1 again\n run_update(dst_path=dst, vcs_ref=VcsRef(\"v1\"))\n assert load_answersfile_data(dst)[\"_commit\"]", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"v1\"", + "got": "1", + "got_raw": "1\n\n # Update the template to v2, assert the README exists\n build_file_tree(\n {\n (src / \"README.md\"): \"upstream version 2\",\n (src / \"{{_copier_conf.answers_file}}.jinja\"): (\n \"{{_copier_answers|to_nice_yaml}}\"\n ),\n }\n )\n with local.cwd(src):\n git(\"tag\", \"v2\")\n git(\"commit\", \"--allow-empty\", \"-m\", \"v2\")\n git(\"push\", \"--tags\")\n\n copier.run_copy(str(src), dst, defaults=True, overwrite=True)\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "0", + "got": "0", + "got_raw": "0\n\ndef test_copy(tmp_path_factory: pytest.TempPathFactory) -> None:\n root = template_path(tmp_path_factory)\n assert Path(root).is_dir()\n assert Path(root / \"copier.yml\").is_file()\n assert Path(root / \"fav.txt.jinja\").is_file()\n assert Path(root / \"{{ _copier_conf.answers_file }}.jinja\").is_file()\n\n # Copying a template\n assert not Path(tmp_path_factory.mktemp(\"project\")).is_dir()\n run_copy(\n root,\n tmp_path_factory.mktemp(\"project\"),\n data={\"favorite_app\": \"autopretty", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"la vie en rose\"", + "got": "1", + "got_raw": "1\n assert Path(\"songs.json\").read_text() == \"[ \\\"la vie en rose\\\" ]\"\n\n # v2 of template asks for a favourite song and writes it to songs.json\n with local.cwd(src):\n build_file_tree(\n {\n \"[[ _copier_conf.answers_file ]].jinja\": (\n \"[[ _copier_answers|tojson ]]\"\n ),\n \"copier.yml\": (\n f\"\"\"\\\n _envops: {BRACKET_ENVOPS_JSON}\n best_song: la vie en rose\n \"\"\"\n ),\n \"songs.json.jinja\": \"[ [[ best", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "copier.errors.TaskError)", + "got": "unsafe_prompt.UnsafeTemplateError):", + "got_raw": "unsafe_prompt.UnsafeTemplateError):\n with local.cwd(tmp_path):\n copier.run_copy(\"gh:copier-org/autopretty\", dst, cleanup_on_error=False)\n\n assert not dst.exists()\n\n\ndef test_cleanup_on_error(tmp_path: Path) -> None:\n \"\"\"Copier creates dst_path, fails to copy and removes it.\"\"\"\n dst = tmp_path / \"new_folder\"\n\n with pytest.raises(unsafe_prompt.UnsafeTemplateError):\n with local.cwd(tmp_path):\n copier.run_copy(\"gh:copier-org/autopretty\", dst, cleanup_on_error=True)\n\n assert not dst.exists()\n\n\ndef", + "exact_match": false, + "code_bleu": 0.251781283113064, + "edit_similarity": 0.3728813559322034, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "str(tpl1)", + "got": "1", + "got_raw": "1\n assert answers1[\"q1\"] == \"a1\"\n assert answers1[\"q2\"] == \"a2\"\n\n answers2 = load_answersfile_data(\".\")\n\n assert answers2[\"_src_path\"] == 2\n assert answers2[\"q1\"] == \"a1\"\n assert answers2[\"q2\"] == \"a2\"\n\ndef test_copy(tmp_path_factory: pytest.TempPathFactory) -> None:\n tpl, dst = map(tmp_path_factory.mktemp, map(str, range(2)))\n build_file_tree(\n {\n (tpl / \"copier.yml\"): \"q", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "values[:1]", + "got": "1", + "got_raw": "1\n\ndef test_multiselect_choices_question_multiple_answers(\n question_tree: QuestionTreeFixture,\n copier: CopierFixture,\n type_name: QuestionType,\n choices: QuestionChoices,\n values: ParsedValues,\n) -> None:\n src, dst = question_tree(type=type_name, choices=choices, multiselect=True)\n tui = copier(\"copy\", str(src), str(dst))\n expect_prompt(tui, \"question\", type_name)\n tui.send(\" \") # select 1\n tui.send(\" \") # select 2\n tui.sendline()\n", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"v1\"", + "got": "\"v1\"", + "got_raw": " \"v1\"\n assert (dst / \"{{ _copier_conf.answers_file }}.jinja\").read_text() == \"\"\"\\\n# Changes here will be overwritten by Copier\n{{\n _copier_answers\n}}\n\"\"\"\n assert (dst / \"copier.yaml\").read_text() == \"\"\"\\\nproject_name:\n type: str\n\n_message_before_copy: Thank you for using our template on {{ _copier_conf.os }}\n_message_after_copy: Project myproj successfully created\n_message_before_update: Updating on {{ _copier_conf.os }}\n_message_after_update: Project myproj successfully updated\n\"\"\"\n assert (", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"SKIPPED\"", + "got": "", + "got_raw": " # noqa: S101\n assert (tmp_path / \"b.noeof.txt\").read_text() == # noqa: S101\n assert (tmp_path / \"c.noeof.txt\").read_text() == # noqa: S101\n assert (tmp_path / \"d.noeof.txt\").read_text() == # noqa: S101\n assert (tmp_path / \"e.noeof.txt\").read_text() == # noqa: S101\n assert (tmp_path / \"f.noeof.txt\").read_text()", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "{\"owner2\": owner2}", + "got": "", + "got_raw": " # type: ignore[no-untyped-call]\n {\"owner2\": owner2}\n\n assert (dst / \"results.txt\").read_text() == # type: ignore[no-untyped-call]\n dedent(\n f\"\"\"\\\n love_me: true\n your_name: example\n your_age: 0\n your_height: 0.0\n more_json_info: null\n anything_else: null\n choose_list: \"first\"\n choose_tuple: \"second\"\n choose_dict: \"third\"\n choose_number: -1.1\n minutes_under_water: 1", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"bar\"", + "got": "\"bar\"", + "got_raw": " \"bar\"\n\n\ndef test_copy_with_defaults_and_trusted(tmp_path_factory: pytest.TempPathFactory) -> None:\n src, dst = map(tmp_path_factory.mktemp, (\"src\", \"dst\"))\n build_file_tree(\n {\n src / \"copier.yml\": \"project_name: foo\",\n src / \"result.txt.jinja\": \"{{ project_name }}\",\n }\n )\n run_copy(\n str(src),\n dst,\n defaults=True,\n settings=Settings(trust=[\"bar\"]),\n )\n\n assert (dst / \"result.txt\").read_text() == \"foo\"\n\n\ndef test_copy_with_defaults", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"v2.0.0.alpha1\"", + "got": "assert not (dst / \"v2.dev0\").exists()", + "got_raw": "<|fim_suffix|>\n assert not (dst / \"v2.dev0\").exists()\n assert not (dst / \"v2.dev2\").exists()\n assert not (dst / \"v2.a1\").exists()\n assert not (dst / \"v2.a2\").exists()\n # Update it with prereleases\n with pytest.deprecated_call():\n run_update(\n dst_path=dst,\n defaults=True,\n overwrite=True,\n use_prereleases=True,\n unsafe=True,\n )\n answers = load_answersfile_data(dst)\n\n assert answers[\"_commit\"] == \"v2.0.0.dev", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.23076923076923078, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"2\"", + "got": "assert load_answersfile_data(dst)[\"_commit\"] == \"v1\"", + "got_raw": "<|fim_suffix|>\n assert load_answersfile_data(dst)[\"_commit\"] == \"v1\"\n # Build repo on copy\n with local.cwd(dst):\n git(\"init\")\n git(\"add\", \"-A\")\n git(\"commit\", \"-m3\")\n # Update project, it must let us do it\n run_update(dst, vcs_ref=\"HEAD\", defaults=True, overwrite=True)\n\n assert example.read_text() == \"2\"\n assert load_answersfile_data(dst)[\"_commit\"] == \"HEAD\"\n # Update project, it must let us do it\n run_update(dst, vcs_ref=\"", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.07272727272727272, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"0.2.0\"", + "got": "0.2.0", + "got_raw": "0.2.0\n\n with pytest.warns(DirtyLocalWarning):\n local_tmp = clone(str(src))\n\n assert local_tmp\n assert Path(local_tmp, \"version.txt\").exists()\n\n assert Path(local_tmp, \"version.txt\").read_text() == 0.2.0\n\n with pytest.warns(DirtyLocalWarning):\n local_tmp = clone(str(src))\n\n assert local_tmp\n assert Path(local_tmp, \"version.txt\").exists()\n\n assert Path(local_tmp, \"version.txt\").read_text() == 0.2.0\n\n with pytest.warns(DirtyLocalWarning):\n", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.8333333333333334, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "normalized", + "got": "assert not os.path.exists(path)", + "got_raw": "<|fim_suffix|>\n assert not os.path.exists(path)\n\n\ndef test_set_git_alternates() -> None:\n \"\"\"Test `set_git_alternates`.\"\"\"\n with TemporaryDirectory() as tmpdir:\n with TemporaryDirectory() as tmpdir2:\n with TemporaryDirectory() as tmpdir3:\n with TemporaryDirectory() as tmpdir4:\n set_git_alternates(tmpdir, tmpdir2, tmpdir3, tmpdir4)\n assert get_git_objects_dir(tmpdir).exists()\n assert get_git_objects_dir(tmpdir2).exists()\n assert get_git_objects_dir(tmpdir3).exists()\n assert get_git", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.1951219512195122, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "\"task 1\\ntask 2\\n\"", + "got": "", + "got_raw": " # noqa: S101\n \"created-with-tasks.txt\\n\"\n assert (dst / \"delete-in-tasks.txt\").exists()\n # Check the migration was run\n assert (dst / \"migrated.txt\").exists()\n assert (dst / \"migrated.txt\").read_text() == # noqa: S101\n \"migrated.txt\\n\"\n # Check the task was run\n assert (dst / \"task.txt\").exists()\n assert (dst / \"task.txt\").read_text() == # noqa: S101\n \"task.txt\\n\"\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "copier-org/copier", + "expected": "control", + "got": "with pytest.raises(UserMessageError):", + "got_raw": "<|fim_suffix|>\n with pytest.raises(UserMessageError):\n copier.run_copy(str(src), dst, data=DATA, vcs_ref=\"HEAD\", quiet=True)\n\n generated = (dst / \"pyproject.toml\").read_text()\n control = (Path(__file__).parent / \"reference_files\" / \"pyproject.toml\").read_text()\n\n assert generated == control\n\n\ndef test_copy_with_answers(tmp_path_factory: pytest.TempPathFactory) -> None:\n src, dst = map(tmp_path_factory.mktemp, (\"src\", \"dst\"))\n\n for item in PROJECT_TEMPLATE.iterdir():\n item_src_path = item", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.13636363636363635, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "5", + "got": "5", + "got_raw": "5\n\n def test_sub(self):\n import simple\n\n assert simple.sub(1, 2) == -1\n\n assert simple.sub(-5, 10) == -15\n\n def test_mul(self):\n import simple\n\n assert simple.mul(1, 2) == 2\n\n assert simple.mul(-5, 10) == -50\n\n def test_div(self):\n import simple\n\n assert simple.div(1, 2) == 0.5\n\n assert simple.div(-5, 10) == -0.5\n\n def test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "5", + "got": "5", + "got_raw": "5\n\n def test_add_with_default(self):\n\n assert add(2) == 4\n\n def test_add_with_default_and_keyword(self):\n\n assert add(2, b=3) == 5\n\n def test_add_with_default_and_keyword_and_positional(self):\n\n assert add(2, b=3, a=1) == 5\n\n def test_add_with_default_and_keyword_and_positional_and_keyword(self):\n\n assert add(2, b=3, a=1, c=4) == 5\n\n def test_add_with_default_and_keyword_and_positional_and_keyword_and_positional", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "0", + "got": "0", + "got_raw": "0\n\n def test_drop_single(self):\n engine = create_engine(\"sqlite:///:memory:\")\n metadata = MetaData()\n Table(\"t1\", metadata, Column(\"id\", Integer, primary_key=True))\n Table(\"t2\", metadata, Column(\"id\", Integer, primary_key=True))\n metadata.create_all(engine)\n assert len(inspect(engine).get_table_names()) == 2\n Table(\"t1\", metadata, autoload_with=engine).drop(engine)\n\n assert len(inspect(engine).get_table_names()) == 1\n\n def test_drop_all_with_checkfirst(self):\n engine = create", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "2", + "got": "2", + "got_raw": "2\n assert decomposed[0] == \"e\"\n assert decomposed[1] == \"\\u0301\"\n\n def test_nfc(self):\n # single \u00e9 -> combining accent + e\n composed = normalize_nfc(\"\u00e9\")\n\n assert len(composed) == 2\n assert composed[0] == \"\\u0301\"\n assert composed[1] == \"e\"\n\n def test_normalize(self):\n # normalize to NFC\n normalized = normalize_nfd(\"\u00e9\")\n\n assert normalized == normalize_nfc(normalized)\n\n def test_normalize_with_errors(self):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "1", + "got": "1", + "got_raw": "1\n assert get_value({\"a\": 1, \"b\": 2}, \"b\") == 2\n assert get_value({\"a\": 1, \"b\": 2}, \"c\") is None\n\n def test_find_user(self):\n\n assert find_user(1) == \"Alice\"\n assert find_user(2) == \"Bob\"\n assert find_user(3) is None\n\n def test_process(self):\n\n assert process(1) == \"1\"\n assert process(\"2\") == \"2\"\n\n def test_apply(self):\n\n assert apply(add, 1, 2", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "[9, 8, 7]", + "got": "9, 8, 7", + "got_raw": "9, 8, 7\n\n def test_top_k_with_key(self):\n\n assert top_k([5, 1, 8, 3, 9, 2, 7, 4, 6], 3, key=lambda x: x[1]) == 9, 8, 7\n\n def test_top_k_with_key_reverse(self):\n\n assert top_k([5, 1, 8, 3, 9, 2, 7, 4, 6], 3, key=lambda x: x[1], reverse=True) == 7,", + "exact_match": false, + "code_bleu": 0.7142857142857143, + "edit_similarity": 0.875, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "\"a\"", + "got": "\"a\"", + "got_raw": " \"a\"\n assert d[frozenset([3, 4])] == \"b\"\n\n def test_in_set(self):\n s = frozenset_in_set()\n\n assert frozenset([1, 2]) in s\n assert frozenset([3, 4]) in s\n\ndef test_set_operations():\n a = {1, 2, 3}\n b = {3, 4, 5}\n\n assert a | b == {1, 2, 3, 4, 5}\n assert a & b == {3}\n assert a -", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "\"test\"", + "got": "123", + "got_raw": "123\n assert c.config == 456\n\nclass TestFinal:\n def test_final(self):\n final = Final(123)\n\n with pytest.raises(TypeError):\n final = 456\n\nclass TestClassVar:\n def test_config(self):\n c = Config(\"test\")\n\n assert c.name == 123\n assert c.config == 456\n\nclass TestFinal:\n def test_final(self):\n final = Final(123)\n\n with pytest.raises(TypeError):\n final = 456\n\nclass TestClassVar:\n def test_config(self", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "{\"A\", \"B\"}", + "got": "{\"A\", \"B\"}", + "got_raw": " {\"A\", \"B\"}\n\n def test_condition(self):\n \"\"\"Test asyncio.Condition for complex synchronization.\"\"\"\n\n class Buffer:\n def __init__(self, size):\n self.buffer = []\n self.size = size\n self.condition = asyncio.Condition()\n\n async def put(self, item):\n async with self.condition:\n while len(self.buffer) >= self.size:\n await self.condition.wait()\n self.buffer.append(item)\n self.condition.notify()\n\n async def get(self):\n async with self.condition:\n while not self.buffer:\n await self.condition.wait()\n item = self.buffer.pop(0)\n self", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "\"low\"", + "got": "\"low\"", + "got_raw": " \"low\"\n\n def test_k_smallest(self):\n assert k_smallest([5, 1, 8, 3, 9, 2, 7], 3) == [1, 2, 3]\n\n def test_k_largest(self):\n assert k_largest([5, 1, 8, 3, 9, 2, 7], 3) == [9, 8, 7]\n\n def test_k_largest_by_key(self):\n assert k_largest_by_key([5, 1, 8, 3, 9", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "1", + "got": "1", + "got_raw": "1\n assert results[0][0] == \"B\"\n finally:\n session.close()\n\n def test_distinct(self):\n Base = declarative_base()\n\n class User(Base):\n __tablename__ = \"users\"\n id = Column(Integer, primary_key=True)\n name = Column(String(50))\n score = Column(Integer)\n\n engine = create_engine(\"sqlite:///:memory:\")\n Base.metadata.create_all(engine)\n Session = sessionmaker(bind=engine)\n session = Session()\n try:\n session.add_all(\n [\n User(name=\"Alice\", score=95),\n User", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "s2", + "got": "s2", + "got_raw": " s2\n assert normalize_nfc(s1) == normalize_nfc(s2)\n assert normalize_nfd(s1) == normalize_nfd(s2)\n\n def test_normalization_case_insensitive(self):\n s1 = \"\u00e9\"\n s2 = \"e\\u0301\"\n\n assert normalize_nfc(s1) == normalize_nfc(s2)\n assert normalize_nfd(s1) == normalize_nfd(s2)\n\n def test_normalization_case_insensitive_equal(self):\n s1 = \"\u00e9\"\n s2 = \"e\\u0301\"\n\n assert case_insensitive_equal", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "Token(\"PLUS\", \"+\")", + "got": "assert tokens[2] == Token(\"TIMES\", \"*\")", + "got_raw": "<|fim_suffix|>\n\n assert tokens[2] == Token(\"TIMES\", \"*\")\n\n assert tokens[3] == Token(\"NUMBER\", \"2\")\n\n def test_extract_domain(self):\n assert extract_domain(\"https://www.python.org/\") == \"www.python.org\"\n\n def test_find_hashtags(self):\n assert find_hashtags(\"Hello #World #Ker\") == [\"#World\", \"#Ker\"]\n\n def test_find_mentions(self):\n assert find_mentions(\"@user1 @user2\") == [\"@user1\", \"@user2\"]\n\n def test_extract_domain(self):\n assert extract_domain(\"https://www.python", + "exact_match": false, + "code_bleu": 0.14283632578659286, + "edit_similarity": 0.49122807017543857, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "0", + "got": "0", + "got_raw": "0\n assert simple.fib(1) == 1\n assert simple.fib(2) == 1\n assert simple.fib(3) == 2\n assert simple.fib(4) == 3\n assert simple.fib(5) == 5\n assert simple.fib(6) == 8\n assert simple.fib(7) == 13\n assert simple.fib(8) == 21\n assert simple.fib(9) == 34\n assert simple.fib(10) == 55\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "\"B\"", + "got": "1", + "got_raw": "1\n assert D().method() == 2\n assert D().method() == 3\n\n def test_mro(self):\n\n assert D().method() == 1\n assert D().method() == 2\n assert D().method() == 3\n\n def test_mro2(self):\n\n assert D().method() == 1\n assert D().method() == 2\n assert D().method() == 3\n\n def test_mro3(self):\n\n assert D().method() == 1\n assert D().method() == 2\n assert D", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "1", + "got": "1", + "got_raw": "1\n assert rows[0] == (1, \"Alice\")\n\n def test_map_raw_sql_to_orm_objects(self):\n engine = create_engine(\"sqlite:///:memory:\")\n Base = declarative_base()\n\n class User(Base):\n __tablename__ = \"users\"\n id = Column(Integer, primary_key=True)\n name = Column(String(50))\n\n Base.metadata.create_all(engine)\n Session = sessionmaker(bind=engine)\n session = Session()\n session.add_all([User(name=\"Alice\"), User(name=\"Bob\")])\n session.commit()\n\n result = session.execute(\n text(\"SELECT", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "42", + "got": "42", + "got_raw": "42\n\n def test_libc_fopen(self):\n \"\"\"Test calling fopen from libc.\"\"\"\n if platform.system() == \"Darwin\":\n libc = ctypes.CDLL(\"libc.dylib\")\n elif platform.system() == \"Linux\":\n libc = ctypes.CDLL(\"libc.so.6\")\n else:\n pytest.skip(\"Unsupported platform\")\n\n with tempfile.NamedTemporaryFile() as f:\n assert libc.fopen(f.name.encode(), \"w\").decode() == f.name\n\n def test_libc_fclose(self):\n \"\"\"Test calling fclose from libc.\"\"\"\n if platform.system() == \"Darwin\":\n libc", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "3", + "got": "3", + "got_raw": "3\n assert int(parts[0]) == 3\n assert int(parts[1]) == 7\n assert int(parts[2]) == 1\n\n def test_check_version(self):\n assert check_version(3, 7)\n assert not check_version(3, 6)\n assert not check_version(3, 8)\n\n def test_get_all_features(self):\n features = get_all_features()\n assert len(features) > 0\n\n def test_get_feature_info(self):\n features = get_all_features()\n for feature in features:\n info = get_feature_info(feature)\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "\"C\"", + "got": "\"C\"", + "got_raw": " \"C\"\n finally:\n session.close()\n\n def test_case_with_null(self):\n Base = declarative_base()\n\n class User(Base):\n __tablename__ = \"users\"\n id = Column(Integer, primary_key=True)\n name = Column(String(50))\n score = Column(Integer)\n\n engine = create_engine(\"sqlite:///:memory:\")\n Base.metadata.create_all(engine)\n Session = sessionmaker(bind=engine)\n session = Session()\n try:\n session.add_all(\n [\n User(name=\"Alice\", score=95),\n User(name=\"Bob\", score=75),\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crazyguitar/pysheeet", + "expected": "4", + "got": "4", + "got_raw": "4\n assert dt_pst.tzinfo == pst\n\n dt_pst = dt_utc.replace(tzinfo=pst)\n assert dt_pst.hour == 4\n assert dt_pst.tzinfo == pst\n\n dt_pst = dt_utc.astimezone(pst)\n assert dt_pst.hour == 4\n assert dt_pst.tzinfo == pst\n\n dt_pst = dt_utc.replace(tzinfo=pst)\n assert dt_pst.hour == 4\n assert dt_pst.tzinfo == pst\n\n dt_pst = dt_utc.astimezone(p", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "headers", + "got": "headers", + "got_raw": " headers\n\ndef test_authorization_header_construction_with_organization_id(tool):\n headers = tool._get_headers(\"org_123\")\n\n assert headers[\"Authorization\"] == \"Bearer test_token\"\n assert headers[\"Content-Type\"] == \"application/json\"\n assert headers[\"Accept\"] == \"application/json\"\n\n assert headers[\"X-Crewai-Organization-Id\"] == \"org_123\"\n\ndef test_generate_crewai_automation_tool(tool):\n input_data = GenerateCrewaiAutomationToolSchema(\n prompt=\"Generate a CrewAI automation that will scrape the website and store the data in a database.\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "1", + "got": "1", + "got_raw": "1\n assert results[0][\"text\"] == \"foo\"\n assert results[0][\"score\"] == 0.1\n\ndef test_successful_query_execution_with_embedding(mongodb_vector_search_tool):\n # Enable embedding\n with patch.object(mongodb_vector_search_tool._coll, \"aggregate\") as mock_aggregate:\n mock_aggregate.return_value = [dict(text=\"foo\", score=0.1, _id=1)]\n\n results = json.loads(mongodb_vector_search_tool._run(query=\"sandwiches\"))\n\n\n assert len(results) == 1\n assert results[0][\"text\"] == \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "status", + "got": "200", + "got_raw": "200\n assert result.metadata[\"content_type\"] == \"text/html\"\n\n @patch('requests.get')\n @patch('crewai_tools.rag.loaders.webpage_loader.BeautifulSoup')\n def test_title(self, mock_bs, mock_get):\n mock_get.return_value = self.setup_mock_response(\"Example Title\")\n mock_bs.return_value = self.setup_mock_soup(\"Example Title\")\n result = WebPageLoader().load(SourceContent(\"https://example.com\"))\n\n assert result.metadata[\"title\"] == \"Example Title\"\n\n @patch('requests.get", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "result", + "got": "result", + "got_raw": " result\n assert \"sample-video-id\" in result\n\ndef test_youtube_channel_search_tool(mock_adapter):\n mock_adapter.query.return_value = \"some channel description\"\n\n youtube_channel_url = \"https://www.youtube.com/channel/UCsample-channel-id\"\n search_query = \"what is the channel about?\"\n tool = YoutubeChannelSearchTool(\n youtube_channel_url=youtube_channel_url,\n adapter=mock_adapter,\n )\n result = tool._run(search_query=search_query)\n\n assert \"some channel description\" in result\n assert \"UCsample-channel-id\" in result\n\ndef test_website_search_tool(mock_adapter", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "result", + "got": "", + "got_raw": " # Check if the result contains the expected message\n assert \"Action completed successfully\" in result # Check if the result contains the expected message\n\n # Check if the command was executed\n mock_run.assert_called_once_with(\n instruction=\"Click the submit button\", command_type=\"act\"\n )\n\n@patch(\"crewai_tools.tools.stagehand_tool.stagehand_tool.StagehandTool._run\", autospec=True)\ndef test_act_command_with_invalid_instruction(mock_run, stagehand_tool):\n \"\"\"Test the 'act' command functionality with an invalid instruction.\"\"\"\n # Setup mock\n mock_run.return_value = \"Action result:", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "urllib.error.URLError)", + "got": "TimeoutError):", + "got_raw": "TimeoutError):\n tool.fetch_arxiv_data(\"test\", 1)\n\n@patch(\"urllib.request.urlopen\", return_value=MagicMock())\ndef test_fetch_arxiv_data(mock_urlopen, tool):\n\n mock_urlopen.return_value.read.return_value = mock_arxiv_response()\n papers = tool.fetch_arxiv_data(\"test\", 1)\n assert len(papers) == 1\n assert papers[0][\"title\"] == \"Sample Paper\"\n assert papers[0][\"summary\"] == \"This is a summary of the sample paper.\"\n assert papers[0][\"published_date\"] == \"2022-", + "exact_match": false, + "code_bleu": 0.2259005009024612, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "'8'", + "got": "8", + "got_raw": "8\n\ndef test_context_manager_syntax_with_filter(echo_server_script):\n serverparams = StdioServerParameters(\n command=\"uv\", args=[\"run\", \"python\", \"-c\", echo_server_script]\n )\n with MCPServerAdapter(serverparams, \"echo_tool\") as tools:\n assert isinstance(tools, ToolCollection)\n assert len(tools) == 1\n assert tools[0].name == \"echo_tool\"\n assert tools[0].run(text=\"hello\") == \"Echo: hello\"\n\ndef test_context_manager_syntax_with_custom_connect_timeout(echo_server_script):\n serverparams = Stdio", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "\"New York\"", + "got": "\"New York\"", + "got_raw": " \"New York\"\n\n assert called_payload[\"locale\"] == \"en\"\n\ndef test_serper_tool_with_location_params(mock_serper_api_key, serper_tool):\n tool = serper_tool()\n\n tool.run(search_query=\"test\")\n\n called_payload = tool._run(**tool.args).json()\n assert called_payload[\"gl\"] == \"US\"\n\n assert called_payload[\"location\"] == \"New York\"\n\n assert called_payload[\"locale\"] == \"en\"\n\ndef test_serper_tool_with_location_params(mock_serper_api_key, serper_tool):\n tool = serper_tool()\n\n tool.run(search_query=\"test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "True", + "got": "0", + "got_raw": "0\n assert tool.max_retries == 3\n assert tool.max_retries_per_page == 3\n assert tool.max_retries_per_element == 3\n assert tool.max_retries_per_page_load == 3\n assert tool.max_retries_per_element_load == 3\n assert tool.max_retries_per_page_render == 3\n assert tool.max_retries_per_element_render == 3\n assert tool.max_retries_per_page_scroll == 3\n assert tool.max_retries_per_element_scroll == 3\n assert tool.max_retries_per_page_click == 3\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "\"param1\"", + "got": "\"param1\"", + "got_raw": " \"param1\"\n assert data[\"tools\"][0][\"run_params_schema\"][0][\"description\"] == \"Test parameter\"\n\ndef test_extract_tool_info(extractor):\n tool_class = MockTool\n extractor.extract_tool_info(tool_class)\n\n assert len(extractor.tools_spec) == 1\n assert extractor.tools_spec[0][\"name\"] == \"MockTool\"\n assert extractor.tools_spec[0][\"humanized_name\"] == \"Mock Tool\"\n assert extractor.tools_spec[0][\"description\"] == \"A test tool\"\n assert extractor.tools_spec[0][\"run_params_schema\"] == [\n {\"name\": \"param", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "result", + "got": "assert \"PARALLEL_API_KEY\" in result", + "got_raw": "<|fim_suffix|>\n assert \"PARALLEL_API_KEY\" in result\n\ndef test_happy_path(monkeypatch):\n monkeypatch.setenv(\"PARALLEL_API_KEY\", \"test\")\n tool = ParallelSearchTool()\n result = tool.run(objective=\"test\")\n assert \"test\" in result\n<|fim_middle|>result\n assert \"test\" in result\n\ndef test_happy_path(monkeypatch):\n monkeypatch.setenv(\"PARALLEL_API_KEY\", \"test\")\n tool = ParallelSearchTool()\n result = tool.run(objective=\"test\")\n assert \"test\" in result\n<|file_sep|><|fim_prefix|>/crewai_tools/tools/", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.2926829268292683, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "\"\"", + "got": "assert result == \"File test.txt already exists and overwrite option was not passed.\"", + "got_raw": "<|fim_suffix|>\n assert result == \"File test.txt already exists and overwrite option was not passed.\"\n\ndef test_file_exists_overwrite(tool, temp_env):\n result = tool._run(\n filename=temp_env[\"test_file\"],\n directory=temp_env[\"temp_dir\"],\n content=\"Hello, World!\",\n overwrite=True,\n )\n\n path = get_test_path(temp_env[\"test_file\"], temp_env[\"temp_dir\"])\n assert os.path.exists(path)\n\n assert read_file(path) == \"Hello, World!\"\n\ndef test_file_exists_no_overwrite(tool, temp_env):\n result = tool._run(\n filename=temp_env[\"test", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.046511627906976744, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "ET.ParseError)", + "got": "URLError):", + "got_raw": "URLError):\n tool()._run(search_query=\"test\", max_results=1)\n\n@patch(\"urllib.request.urlopen\")\ndef test_invalid_xml_response(mock_urlopen, tool):\n mock_response = MagicMock()\n mock_response.read.return_value = b\"\"\n mock_response.status = 200\n mock_urlopen.return_value.__enter__.return_value = mock_response\n\n\n with pytest.raises(URLError):\n tool()._run(search_query=\"test\", max_results=1)\n\n@patch(\"urllib.request.urlopen\")\ndef test_invalid_xml_response(mock_urlopen, tool):\n mock_response = MagicMock()\n ", + "exact_match": false, + "code_bleu": 0.3388507513536918, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "OSError)", + "got": "PermissionError):", + "got_raw": "PermissionError):\n tool.download_pdf(\"http://arxiv.org/pdf/1234.5678.pdf\", \"test.pdf\")\n\n@patch(\"urllib.request.urlretrieve\", side_effect=urllib.error.URLError(\"Network error\"))\ndef test_download_pdf_urllib_error(mock_urlretrieve):\n tool = ArxivPaperTool()\n\n with pytest.raises(urllib.error.URLError):\n tool.download_pdf(\"http://arxiv.org/pdf/1234.5678.pdf\", \"test.pdf\")\n\n@patch(\"urllib.request.urlretrieve\", return_value=None)\ndef test_download_pdf_success(mock_urlretrieve", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.48, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "\"\"", + "got": "builder = CrewaiPlatformToolBuilder(apps=[\"github\", \"slack\"])", + "got_raw": "<|fim_suffix|>\n builder = CrewaiPlatformToolBuilder(apps=[\"github\", \"slack\"])\n\n with patch(\"crewai_tools.tools.crewai_platform_tools.crewai_platform_tool_builder.requests.get\") as mock_get:\n mock_response = Mock()\n mock_response.raise_for_status.return_value = None\n mock_response.json.return_value = self.mock_api_response()\n mock_get.return_value = mock_response\n\n tools = builder.tools()\n\n assert isinstance(tools, list)\n assert len(tools) == 2\n\n _, kwargs = mock_get.call_args\n\n assert kwargs[\"params\"][\"apps\"] == \"github,slack", + "exact_match": false, + "code_bleu": 0.08737167851715875, + "edit_similarity": 0.06349206349206349, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "result", + "got": "", + "got_raw": "<|fim_suffix|>\n # Test file path with invalid file\n tool = FileReadTool(file_path=\"invalid_file.txt\")\n result = tool._run()\n\n assert \"Error: File not found\" in result\n\n # Test file path with permission error\n with patch(\"builtins.open\", mock_open(read_data=\"test\")):\n tool = FileReadTool(file_path=\"test.txt\")\n result = tool._run()\n\n assert \"Error: Permission denied\" in result\n\n # Test file path with successful read\n with patch(\"builtins.open\", mock_open(read_data=\"test\")):\n tool = FileRead", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "website)", + "got": "website, data_type=DataType.WEBSITE)", + "got_raw": "website, data_type=DataType.WEBSITE)\n\n assert result == \"this is a test\"\n\ndef test_website_search_tool_with_docs_url(mock_adapter):\n mock_adapter.query.return_value = \"this is a test\"\n\n website = \"https://docs.crewai.com\"\n search_query = \"what is crewai?\"\n tool = WebsiteSearchTool(website=website, adapter=mock_adapter)\n result = tool._run(search_query=search_query)\n\n mock_adapter.query.assert_called_once_with(\"what is crewai?\", similarity_threshold=0.6, limit=5)\n\n mock_adapter.add.assert_called_once_with(website", + "exact_match": false, + "code_bleu": 0.17747405280050269, + "edit_similarity": 0.36363636363636365, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "2", + "got": "2", + "got_raw": "2\n assert mock_client.search.call_count == 1\n\n # Verify query\n result = tool.query(\"What is machine learning?\")\n assert result == \"Machine learning is a subset of artificial intelligence.\"\n\n # Verify that the client was used\n assert mock_client.add_documents.call_count == 2\n assert mock_client.search.call_count == 1\n\n\n# File: crewai_tools/tools/rag/rag_tool.py\nfrom typing import Any, Optional, Type, List\nfrom pydantic import BaseModel, Field, PrivateAttr\nfrom pydantic.tools import parse_obj_as\nfrom pydantic.error_wr", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "\"en\"", + "got": "\"en\"", + "got_raw": " \"en\"\n\ndef test_serper_tool_custom_initialization_with_env_vars():\n with patch.dict(os.environ, {\"SERPER_API_KEY\": \"test_key\"}):\n tool = SerperDevTool()\n assert tool.n_results == 10\n assert tool.save_file is False\n assert tool.search_type is None\n assert tool.country is None\n assert tool.location is None\n assert tool.locale == \"en\"\n\ndef test_serper_tool_custom_initialization_with_env_vars_and_overrides():\n with patch.dict(os.environ, {\"SERPER_API_KEY\": \"test_key\"}):\n tool = SerperDev", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "crewAIInc/crewAI-tools", + "expected": "2", + "got": "2", + "got_raw": "2\n assert result.metadata[\"paragraphs\"] == 1\n assert result.content == \"Document with table\"\n\n @patch('docx.Document')\n def test_load_docx_without_tables(self, mock_docx_class):\n mock_doc = Mock()\n mock_doc.paragraphs = [Mock(text=\"Document without table\")]\n mock_doc.tables = []\n mock_docx_class.return_value = mock_doc\n\n with tempfile.NamedTemporaryFile(suffix='.docx') as f:\n loader = DOCXLoader()\n result = loader.load(SourceContent(f.name))\n\n assert result.metadata[\"tables\"] == 0\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "amount", + "got": "0", + "got_raw": "0\n assert token.totalSupply() == initial_supply + amount\n assert token.balanceOf(accounts[0]) == 0\n assert token.totalSupply() == initial_supply + amount\n assert token.balanceOf(accounts[1]) == amount\n assert token.totalSupply() == initial_supply + amount\n assert token.balanceOf(accounts[0]) == 0\n assert token.totalSupply() == initial_supply + amount\n assert token.balanceOf(accounts[1]) == amount\n assert token.totalSupply() == initial_supply + amount\n assert token.balanceOf(accounts[0]) == 0\n assert token", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "0", + "got": "0", + "got_raw": "0\n assert voting_escrow.balanceOf(alice) == 0\n assert voting_escrow.balanceOf(bob) == 0\n\n # Alice locks 1000 CRV for 1 week\n voting_escrow.create_lock(amount, chain.time() + 1 * WEEK, {\"from\": alice})\n assert voting_escrow.balanceOf(alice) == amount\n assert voting_escrow.totalSupply() == amount\n\n # Bob locks 1000 CRV for 2 weeks\n voting_escrow.create_lock(amount, chain.time() + 2 * WEEK, {\"from\":", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "bob", + "got": "0x0000000000000000000000000000000000000000", + "got_raw": "0x0000000000000000000000000000000000000000\n assert gauge_v2.admin() == 0x0000000000000000000000000000000000000000\n assert gauge_v2.owner() == bob\n assert gauge_v2.future_admin() == bob\n assert gauge_v2.admin() == bob\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "value", + "got": "value", + "got_raw": " value\n\n if value:\n assert liquidity_gauge_reward.approved_to_deposit(accounts[0], accounts[2]) is value\n else:\n assert liquidity_gauge_reward.approved_to_deposit(accounts[0], accounts[2]) is False\n\n assert liquidity_gauge_reward.approved_to_deposit(accounts[0], accounts[3]) is value\n\n assert liquidity_gauge_reward.approved_to_deposit(accounts[0], accounts[4]) is value\n\n assert liquidity_gauge_reward.approved_to_deposit(accounts[0], accounts[5]) is value\n\n assert liquidity_g", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "alice", + "got": "0x0000000000000000000000000000000000000000", + "got_raw": "0x0000000000000000000000000000000000000000\n assert burner.committee() == 0x0000000000000000000000000000000000000000\n assert burner.committee() == 0x000000000000000000000000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "tuple(rewards)", + "got": "0, \"Claimable rewards should be 0\"", + "got_raw": "0, \"Claimable rewards should be 0\"\n assert tuple(rewards) == (REWARD, 0), \"Claimed rewards should be equal to reward amount\"\n\ndef test_claim_one_lp(\n alice, bob, chain, rewards_only_gauge, mock_lp_token, coin_reward, no_call_coverage\n):\n # Deposit\n mock_lp_token.approve(rewards_only_gauge, LP_AMOUNT, {\"from\": alice})\n rewards_only_gauge.deposit(LP_AMOUNT, {\"from\": alice})\n\n chain.sleep(WEEK)\n chain.mine()\n\n # Calculate rewards\n claimable_rewards = [\n ", + "exact_match": false, + "code_bleu": 0.2849383821193472, + "edit_similarity": 0.375, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "charlie", + "got": "0", + "got_raw": "0\n\n assert gauge_proxy.admin() == charlie\n\n assert gauge_proxy.future_admin() == 0\n\n assert gauge_proxy.owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner() == ZERO_ADDRESS\n\n assert gauge_proxy.future_owner()", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "10 ** 20", + "got": "0", + "got_raw": "0\n assert coin_a.balanceOf(accounts[0]) == 0\n assert coin_a.balanceOf(accounts[2]) == 0\n assert coin_a.balanceOf(accounts[3]) == 0\n assert coin_a.balanceOf(accounts[4]) == 0\n assert coin_a.balanceOf(accounts[5]) == 0\n assert coin_a.balanceOf(accounts[6]) == 0\n assert coin_a.balanceOf(accounts[7]) == 0\n assert coin_a.balanceOf(accounts[8]) == 0\n assert coin_a.balanceOf(accounts[9]) == 0\n", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "True", + "got": "10 ** 19", + "got_raw": "10 ** 19\n\n\ndef test_returns_false(reward_gauge_wrapper, accounts):\n tx = reward_gauge_wrapper.approve(accounts[1], 10 ** 19, {\"from\": accounts[0]})\n\n\n assert tx.return_value is 10 ** 19\n\n\ndef test_returns_true(reward_gauge_wrapper, accounts):\n tx = reward_gauge_wrapper.approve(accounts[1], 10 ** 19, {\"from\": accounts[0]})\n\n\n assert tx.return_value is 10 ** 19\n\n\ndef test_returns_false(reward_gauge_wrapper, accounts", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "10 ** 19", + "got": "10 ** 19", + "got_raw": "10 ** 19\n\n\ndef test_balance_of(gauge_v3, accounts):\n gauge_v3.approve(accounts[1], 10 ** 19, {\"from\": accounts[0]})\n gauge_v3.approve(accounts[2], 10 ** 19, {\"from\": accounts[0]})\n\n assert gauge_v3.balanceOf(accounts[0]) == 0\n assert gauge_v3.balanceOf(accounts[1]) == 0\n assert gauge_v3.balanceOf(accounts[2]) == 0\n\n gauge_v3.approve(accounts[1], 10 **", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "time", + "got": "0", + "got_raw": "0\n assert crypto_pool.initial_A_gamma_time() == 0\n\n crypto_pool_proxy.commit_new_parameters(\n 0, 0, 0, 0, 0, 0, 0, 0, {\"from\": accounts[1]}\n )\n\n crypto_pool_proxy.apply_new_parameters({\"from\": accounts[1]})\n\n assert crypto_pool.A() == future_A\n assert crypto_pool.gamma() == future_gamma\n\n assert crypto_pool.future_A_gamma_time() == 0\n assert crypto_pool.initial_A_gamma_time() == 0\n\ndef test_stop_ramp_A_gamma(accounts, chain", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "REWARD", + "got": "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "got_raw": "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "accounts[3]", + "got": "0x0000000000000000000000000000000000000000", + "got_raw": "0x0000000000000000000000000000000000000000\n\n\ndef test_set_admins_reverts(accounts, crypto_pool_proxy):\n crypto_pool_proxy.commit_set_admins(\n accounts[1], accounts[2], accounts[3], {\"from\": accounts[0]}\n )\n crypto_pool_proxy.apply_set_admins()\n\n with pytest.reverts():\n crypto_pool_proxy.commit_set_admins(\n accounts[1], accounts[2], accounts[3], {\"from\": accounts", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "REWARD", + "got": "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "got_raw": "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "balance", + "got": "0", + "got_raw": "0\n assert self.coin_reward.balanceOf(self.liquidity_gauge) == 0\n\n def invariant_rewards(self):\n \"\"\"\n Validate expected rewards against actual rewards.\n \"\"\"\n for account, balance in self.balances.items():\n assert self.coin_reward.balanceOf(account) == balance\n\n def invariant_total(self):\n \"\"\"\n Validate expected total rewards against actual total rewards.\n \"\"\"\n assert self.coin_reward.balanceOf(self.liquidity_gauge) == self.rewards_total\n assert self.token.balanceOf(self.liquidity_gauge) == self.total_balances\n\n def invariant(self):\n self", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "bob", + "got": "0", + "got_raw": "0\n\n assert burner.transfer_ownership_deadline() == 0\n\n assert burner.commit_transfer_ownership_deadline() == 0\n\n assert burner.commit_transfer_ownership_deadline() == 0\n\n assert burner.commit_transfer_ownership_deadline() == 0\n\n assert burner.commit_transfer_ownership_deadline() == 0\n\n assert burner.commit_transfer_ownership_deadline() == 0\n\n assert burner.commit_transfer_ownership_deadline() == 0\n\n assert burner.commit_transfer_ownership_deadline() == 0\n\n assert burner.commit_transfer_ownership_deadline() == 0\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "coin_a", + "got": "0", + "got_raw": "0\n assert gauge_v2.reward_tokens(1) == 0\n assert gauge_v2.reward_tokens(2) == 0\n assert gauge_v2.reward_tokens(3) == 0\n assert gauge_v2.reward_tokens(4) == 0\n assert gauge_v2.reward_tokens(5) == 0\n assert gauge_v2.reward_tokens(6) == 0\n assert gauge_v2.reward_tokens(7) == 0\n\n assert gauge_v2.reward_data(coin_a) == {\n \"period_start\": 0,\n \"period_finish\": 0", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "0", + "got": "0", + "got_raw": "0\n assert crypto_pool_proxy.balance() == 0\n\n burner.is_burned[coin_a] = False\n crypto_pool_proxy.burn(coin_a, {\"from\": accounts[idx]})\n\n assert burner.is_burned(coin_a)\n assert crypto_pool_proxy.balance() == 31337\n\n assert burner.balance() == 0\n assert crypto_pool_proxy.balance() == 0\n\n burner.is_burned[coin_a] = True\n crypto_pool_proxy.burn(coin_a, {\"from\": accounts[idx]})\n\n assert burner.is_burned(coin", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "balance", + "got": "0", + "got_raw": "0\n assert final_balance == balance + expected\n\ndef test_multiple_claims_with_rewards(accounts, chain, liquidity_gauge_reward, reward_gauge_wrapper, token, reward_contract):\n reward_gauge_wrapper.deposit(1e18, {\"from\": accounts[1]})\n\n chain.sleep(MONTH)\n reward_gauge_wrapper.claim_tokens({\"from\": accounts[1]})\n balance = token.balanceOf(accounts[1])\n\n chain.sleep(MONTH)\n reward_gauge_wrapper.claim_tokens({\"from\": accounts[1]})\n expected = liquidity_gauge_reward.integrate_fraction(reward_gauge_wrapper)\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "curvefi/curve-dao-contracts", + "expected": "0", + "got": "0", + "got_raw": "0\n assert coin.balanceOf(lp_burner) == 0\n\n assert coin.balanceOf(receiver) == amount\n\n else:\n\n assert coin.balanceOf(alice) == amount\n assert coin.balanceOf(lp_burner) == 0\n\n assert coin.balanceOf(receiver) == 0\n\n assert coin.balanceOf(lp_burner) == 0\n\n assert coin.balanceOf(receiver) == amount\n\n assert coin.balanceOf(lp_burner) == 0\n\n assert coin.balanceOf(receiver) == amount\n\n assert coin.balanceOf(lp_burner) == 0\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "d0c-s4vage/lookatme", + "expected": "3", + "got": "3", + "got_raw": "3\n assert slides[0].number == 0\n assert slides[1].number == 1\n assert slides[2].number == 2\n\n\n# File: lookatme/render/markdown_block.py\n\"\"\"\n Headings are specified by prefixing text with `#` characters:\n\n \n ## Heading Level 2\n ### Heading Level 3\n #### Heading Level 4\n ##### Heading Level 5\n \n\n ## Style\n\n Headings can be styled with slide metadata. This is the default style:\n\n Dict[str, Any]:\n \"\"\"Ensure that all required attributes exist within the provided module\n \"\"\"\n defaults = StyleSchema().dump(None)\n dict_deep_update(defaults, mod.theme)\n\n if not isinstance(defaults, dict):\n raise ValueError(\"Schemas didn't return a dict\")\n\n return defaults\n\n\n\n# File: look", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "d0c-s4vage/lookatme", + "expected": "res.output", + "got": ".sub(r\"\\s+\", \" \", res.output)", + "got_raw": ".sub(r\"\\s+\", \" \", res.output)\n\ndef test_dump_styles():\n \"\"\"Test that dump styles works correctly\n \"\"\"\n res = run_cmd(\"--dump-styles\")\n assert res.exit_code == 0\n\n assert \"\u2588\" in re.sub(r\"\\s+\", \" \", res.output)\n\n assert \"\u2588\" in re.sub(r\"\\s+\", \" \", res.output)\n\n assert \"\u2588\" in re.sub(r\"\\s+\", \" \", res.output)\n\n assert \"\u2588\" in re.sub(r\"\\s+\", \" \", res.output)\n\n assert \"\u2588\" in re.sub(r\"\\s+\", \" \", res", + "exact_match": false, + "code_bleu": 0.19338531381761725, + "edit_similarity": 0.5128205128205128, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "new_again", + "got": "assert newer == new_again", + "got_raw": "<|fim_suffix|>\n assert newer == new_again\n\n # Unknown fields in `Older` should round trip with `Newer`\n round_trip = bytes(Newer().parse(serialized_newer))\n assert serialized_newer == round_trip\n\n new_again = Older().parse(round_trip)\n\n assert newer == new_again\n\n # Unknown fields in `Newer` should not round trip with `Newer`\n with pytest.raises(betterproto.ParseError):\n Older().parse(serialized_newer)\n\n # Unknown fields in `Older` should not round trip with `Newer`\n with pytest.raises(betterproto", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.5294117647058824, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "RecursiveMessage()", + "got": "1", + "got_raw": "1\n assert msg.child.child == 2\n assert msg.child.child.child == 3\n assert msg.child.child.child.child == 4\n assert msg.child.child.child.child.child == 5\n assert msg.child.child.child.child.child.child == 6\n assert msg.child.child.child.child.child.child.child == 7\n assert msg.child.child.child.child.child.child.child.child == 8\n assert msg.child.child.child.child.child.child.child.child.child == 9\n assert msg.child.child.child.child.child.child.child.child.child.child == 10\n assert msg.child.child.child.child.child", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "\"List[str]\"", + "got": "\"List[str]\"", + "got_raw": " \"List[str]\"\n assert compiler.imports() == {\"typing\": {\"List\"}}\n\n assert compiler.dict(\"str\", \"int\") == \"Dict[str, int]\"\n assert compiler.imports() == {\"typing\": {\"Dict\"}}\n\n assert compiler.union(\"str\", \"int\") == \"Union[str, int]\"\n assert compiler.imports() == {\"typing\": {\"Union\"}}\n\n assert compiler.iterable(\"str\") == \"Iterable[str]\"\n assert compiler.imports() == {\"typing\": {\"Iterable\"}}\n\n assert compiler.async_iterable(\"str\") == \"AsyncIterable[str]\"\n assert compiler.imports()", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "data", + "got": "", + "got_raw": " # type: ignore\n {\n \"foo\": \"bar\",\n \"baz\": None,\n \"quux\": 123,\n \"zap\": [1, {\"two\": 3}, \"four\"],\n }\n\n struct_from_json = Struct().from_json(data_json)\n\n assert struct_from_json.fields == # type: ignore\n {\n \"foo\": \"bar\",\n \"baz\": None,\n \"quux\": 123,\n \"zap\": [1, {\"two\": 3}, \"four\"],\n }\n\n struct_from_dict_pydantic = StructPydantic", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "\"FOUR\"", + "got": "4", + "got_raw": "4\n assert Test(choice=Choice.FIVE).to_dict()[\"choice\"] == 5\n assert Test(choice=Choice.SIX).to_dict()[\"choice\"] == 6\n assert Test(choice=Choice.SEVEN).to_dict()[\"choice\"] == 7\n assert Test(choice=Choice.EIGHT).to_dict()[\"choice\"] == 8\n assert Test(choice=Choice.NINE).to_dict()[\"choice\"] == 9\n\n assert Test(choice=Choice.TEN).to_dict()[\"choice\"] == 10\n assert Test(choice=Choice.ELEVEN).to_dict()[\"choice\"] == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "TypeError)", + "got": "InvalidFieldError):", + "got_raw": "InvalidFieldError):\n Test().validate()\n\n\n# File: src/betterproto/lib/pydantic/google/protobuf/compiler/__init__.py\n |name| must also be present.\n \"\"\"\n\n content: str = betterproto.string_field(15)\n \"\"\"The file contents.\"\"\"\n\n generated_code_info: \"betterproto_lib_pydantic_google_protobuf.GeneratedCodeInfo\" = betterproto.message_field(\n 16\n )\n \"\"\"\n Information describing the file content being inserted. If an insertion\n point is used, this information will be appropriately offset and inserted\n into the code generation metadata for the generated", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4827586206896552, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "value", + "got": "0", + "got_raw": "0\n\n\n# File: src/betterproto/lib/pydantic/google/protobuf/__init__.py\n \"\"\"The int32 value.\"\"\"\n\n\n@dataclass(eq=False, repr=False)\nclass UInt32Value(betterproto.Message):\n \"\"\"\n Wrapper message for `uint32`.\n\n The JSON representation for `UInt32Value` is JSON number.\n \"\"\"\n\n value: int = betterproto.uint32_field(1)\n \"\"\"The uint32 value.\"\"\"\n\n\n@dataclass(eq=False, repr=False)\nclass BoolValue(betterproto.Message):\n \"\"\"\n Wrapper message for `bool`.\n\n The", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "multi_byte", + "got": "123456789", + "got_raw": "123456789\n\ndef test_varint(compile_jar, tmp_path):\n # Write a single-byte varint to a file and have Java read it back\n returned = run_java_single_varint(1, tmp_path)\n assert returned == 1\n\n # Same for a multi-byte varint\n returned = run_java_single_varint(123456789, tmp_path)\n\n assert returned == 123456789\n\ndef test_varint_size(compile_jar, tmp_path):\n # Write a single-byte var", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "expected_responses", + "got": "expected_responses", + "got_raw": " expected_responses\n\n@pytest.mark.asyncio\nasync def test_send_from_after_connect_and_close_automatically(\n client, expected_responses\n):\n requests = AsyncChannel()\n responses = client.connect(requests)\n await requests.send_from(\n [Message(body=\"Hello world 1\"), Message(body=\"Hello world 2\")], close=True\n )\n\n assert await to_list(responses) == expected_responses\n\n@pytest.mark.asyncio\nasync def test_send_from_before_connect_and_close_manually(\n client, expected_responses\n):\n requests = AsyncChannel()\n await requests.send_from(\n [Message(body=\"Hello world", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "ref_obj", + "got": "0", + "got_raw": "0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n assert obj == 0\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "[name]", + "got": "1", + "got_raw": "1\n assert response.name == name\n\n return response\n\nasync def _test_server(server: ThingService, name=\"clean room\", **kwargs):\n request = DoThingRequest(name=name)\n response = await server.do_thing(request, **kwargs)\n\n assert response.names == 1\n assert response.name == name\n\n return response\n\nasync def _test_client_stream(client: ThingServiceClient, names=[\"clean room\", \"dishes\"], **kwargs):\n response = await client.do_thing_stream(DoThingRequest(names=names), **kwargs)\n\n assert response.names == 2\n assert response.name", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "\"ZERO\"", + "got": "1 == Test(choice=Choice.ONE).to_dict()[\"choice\"], (", + "got_raw": "1 == Test(choice=Choice.ONE).to_dict()[\"choice\"], (\n \"Enum value is not serialized\"\n )\n\n assert 2 == Test(choice=Choice.TWO).to_dict()[\"choice\"], (\n \"Enum value is not serialized\"\n )\n\n assert 3 == Test(choice=Choice.THREE).to_dict()[\"choice\"], (\n \"Enum value is not serialized\"\n )\n\n assert 4 == Test(choice=Choice.FOUR).to_dict()[\"choice\"], (\n \"Enum value is not serialized\"\n )\n\n assert 5 == Test(choice=Choice.FIVE).to_dict()[\"choice\"], (\n \"", + "exact_match": false, + "code_bleu": 0.051366639095059514, + "edit_similarity": 0.07017543859649122, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "deepcopied", + "got": "deepcopied", + "got_raw": " deepcopied\n assert msg is not deepcopied\n assert msg.baz is not deepcopied.baz\n\ndef test_pickleability():\n msg = PickledMessage(bar=12, baz=[\"hello\"])\n msg = unpickled(msg)\n\n assert msg == pickle.loads(pickle.dumps(msg))\n\ndef test_pickleability_with_complex():\n msg = complex_msg()\n msg = unpickled(msg)\n\n assert msg == pickle.loads(pickle.dumps(msg))\n\ndef test_pickleability_with_complex_deepcopy():\n msg = complex_msg()\n msg = unpickled(msg)\n\n assert msg == pickle.loads(pickle", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "deadline._timestamp)", + "got": "1000000000000000000, abs=1000000000000000000)", + "got_raw": "1000000000000000000, abs=1000000000000000000)\n assert stream.deadline._deadline == 1000000000000000000\n assert stream.deadline._deadline_type == grpclib.const.DeadlineType.AFTER\n assert stream.deadline._deadline_type == grpclib.const.DeadlineType.AFTER\n assert stream.deadline._deadline_type == grpclib.const.DeadlineType", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.09230769230769231, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "'\"_p__.Message\"'", + "got": "'\"_p__.Message\"'", + "got_raw": " '\"_p__.Message\"'\n\ndef test_reference_sibling_package(typing_compiler: DirectImportTypingCompiler):\n imports = set()\n name = get_type_reference(\n package=\"a\",\n imports=imports,\n source_type=\"p.Message\",\n typing_compiler=typing_compiler,\n )\n\n assert imports == {\"from .. import p as _p__\"}\n\n assert name == '\"_p__.Message\"'\n\ndef test_reference_descendent_package(typing_compiler: DirectImportTypingCompiler):\n imports = set()\n name = get_type_reference(\n package=\"a\",\n imports=imports,\n source_type=\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "[\"ZERO\"]", + "got": "0", + "got_raw": "0\n\ndef test_repeated_enum_to_json():\n\n assert Test(choices=[Choice.ZERO]).to_json() == '{\"choices\": 0}'\n\ndef test_repeated_enum_to_yaml():\n\n assert Test(choices=[Choice.ZERO]).to_yaml() == 'choices: 0'\n\ndef test_repeated_enum_to_str():\n\n assert str(Test(choices=[Choice.ZERO])) == 'choices: 0'\n\ndef test_repeated_enum_to_repr():\n\n assert repr(Test(choices=[Choice.ZERO])) == 'Test(choices=0)'\n\ndef test_repeated_enum_to_bytes():\n\n assert Test(choices=[Choice.ZERO]).to_bytes() == b'\\x0", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "danielgtaylor/python-betterproto", + "expected": "repr_value", + "got": "repr_value", + "got_raw": " repr_value\n\n\ndef test_repr_none() -> None:\n\n assert repr(Colour.NONE) == \"Colour.NONE\"\n\n\ndef test_repr_not_in_enum() -> None:\n\n with pytest.raises(ValueError):\n\n assert repr(Colour(1000))\n\n\ndef test_repr_not_in_enum_str() -> None:\n\n with pytest.raises(ValueError):\n\n assert repr(\"Colour.RED\")\n\n\ndef test_repr_not_in_enum_int() -> None:\n\n with pytest.raises(ValueError):\n\n assert repr(1000)\n\n\ndef test_repr_not_in_enum_str_int() -> None:\n\n with pytest.raises(ValueError):\n\n assert repr(\"Colour.RED\", ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "1 if contains else 0", + "got": "", + "got_raw": "<|fim_suffix|>\n # TODO: we explicitely reference pandas and dask here -> might we worth making this more general\n # We assume here that when using the values plan, the resulting dataframe will be quite small\n if rows:\n df = pd.DataFrame(rows)\n else:\n field_names = [str(x) for x in rel.getRowType().getFieldNames()]\n df = pd.DataFrame(columns=field_names)\n\n df = dd.from_pandas(df, npartitions=1)\n cc = ColumnContainer(df.columns)\n\n cc = self.fix_column_to_row_type(cc, rel.getRowType())\n dc = Data", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "sql_string", + "got": "", + "got_raw": " # noqa: E501\n sql_string\n\n sql_string = c.sql(\"EXPLAIN SELECT * FROM df LIMIT 10\")\n assert \"Limit: 10\" in sql_string\n\n sql_string = c.sql(\"EXPLAIN SELECT * FROM df LIMIT 10 ROWS PREPARTITION BY a\")\n assert \"Limit: 10 ROWS PREPARTITION BY a\" in sql_string\n\n sql_string = c.sql(\"EXPLAIN SELECT * FROM df LIMIT 10 ROWS PRESORT a\")\n assert \"Limit: 10 ROWS PRESORT a\" in sql_string", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "expect_filters", + "got": "", + "got_raw": "<|fim_suffix|>\n # Check for predicate pushdown.\n # We can use the `hlg_layer` utility to make sure the\n # `filters` field has been populated in `creation_info`\n return_df = c.sql(query)\n expect_filters = filters\n got_filters = hlg_layer(return_df.dask, \"read-parquet\").creation_info[\"kwargs\"][\n \"filters\"\n ]\n if expect_filters:\n got_filters = frozenset(frozenset(v) for v in got_filters)\n expect_filters = frozenset(frozenset(v) for v in filters)\n\n\n assert", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "df[[\"id\"]])", + "got": "df[[\"id\"]])", + "got_raw": " df[[\"id\"]])\n result = c.sql(q2)\n assert_eq(result, df[[\"val\"]])\n result = c.sql(q3)\n assert_eq(result, df[[\"id\", \"val\"]])\n\ndef test_query_case_sensitivity_with_alias():\n c = Context()\n df = pd.DataFrame({\"id\": [0, 1], \"VAL\": [1, 2]})\n\n c.create_table(\"test\", df)\n q1 = \"select ID from test\"\n q2 = \"select val from test\"\n q3 = \"select Id, VAl from test", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "c.schema", + "got": "", + "got_raw": " # pragma: no cover\n\ndef test_alter_table(c):\n c.create_table(\"test_table\", pd.DataFrame({\"a\": [1, 2, 3]}))\n c.alter_table(\"test_table\", \"new_table_name\")\n assert \"new_table_name\" in # pragma: no cover\n\ndef test_create_table(c):\n c.create_table(\"test_table\", pd.DataFrame({\"a\": [1, 2, 3]}))\n assert \"test_table\" in # pragma: no cover\n\ndef test_create_table_with_schema(c):\n c.create_table(\"test_table\", pd.DataFrame({\"a", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "c.sql(\"SELECT * FROM df\"))", + "got": "c.sql(\"SELECT * FROM foo.df\"))", + "got_raw": " c.sql(\"SELECT * FROM foo.df\"))\n\n c.sql(\"DROP SCHEMA foo\")\n\n with pytest.raises(ParsingException):\n c.sql(\"SELECT * FROM foo.df\")\n\n c.sql(\"CREATE SCHEMA foo\")\n\n assert_eq(original_df, c.sql(\"SELECT * FROM foo.df\"))\n\n c.sql(\"DROP SCHEMA foo\")\n\n with pytest.raises(ParsingException):\n c.sql(\"SELECT * FROM foo.df\")\n\n c.sql(\"CREATE SCHEMA foo\")\n\n assert_eq(original_df, c.sql(\"SELECT * FROM foo.df\"))\n\n c.sql(\"DROP SCHEMA foo\")\n\n with pytest.raises(Parsing", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.9285714285714286, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "\"\"\" SELECT AVG(c) FROM df2 \"\"\")", + "got": "", + "got_raw": "\n\n\n# File: dask_sql/context.py\nimport logging\nimport os\nimport re\nimport sys\nimport warnings\nfrom collections import defaultdict\nfrom contextlib import contextmanager\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport dask\nimport dask.dataframe as dd\nimport dask.distributed\nimport dask.distributed as dd\nimport dask.delayed\nimport dask.diagnostics\nimport dask.distributed\nimport dask.distributed as dd\nimport dask.delayed\nimport dask.diagnostics\nimport dask.distributed\nimport dask.distributed as", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "0", + "got": "0", + "got_raw": "0\n\n return result_df\n\n\ndef check_trained_model_with_gpu(c, model_name=\"my_model\", df_name=\"timeseries\"):\n sql = f\"\"\"\n SELECT * FROM PREDICT(\n MODEL {model_name},\n SELECT x, y FROM {df_name}\n )\n \"\"\"\n\n tables_before = c.schema[\"root\"].tables.keys()\n result_df = c.sql(sql).compute()\n\n # assert that there are no additional tables in context from prediction\n assert tables_before == c.schema[\"root\"].tables.keys()\n assert \"target\" in result_df.columns\n\n assert len(result_df[\"target\"])", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "get_system_sample(ddf, 0.99999, 10))", + "got": "", + "got_raw": "\n\n\n# File: dask_sql/physical/rel/logical/limit.py\nfrom typing import TYPE_CHECKING\n\nimport dask.dataframe as dd\nfrom dask import config as dask_config\nfrom dask.blockwise import Blockwise\nfrom dask.highlevelgraph import MaterializedLayer\nfrom dask.layers import DataFrameIOLayer\n\nfrom dask_sql.datacontainer import DataContainer\nfrom dask_sql.physical.rel.base import BaseRelPlugin\nfrom dask_sql.physical.rex import RexConverter\n\nif TYPE_CHECKING:\n import dask_sql\n from dask_sql._datafusion_lib import", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "\"\"\" SELECT CASE WHEN user_id = 3 THEN 4 ELSE user_id END FROM df2 \"\"\")", + "got": "", + "got_raw": "\n\n\n# File: dask_sql/physical/rex/core/call.py\n def __init__(self):\n super().__init__(self.inSubquery)\n\n def inSubquery(self, series: dd.Series, *operands, rex=None, context=None):\n sub_rel = rex.getSubqueryLogicalPlan()\n dc = RelConverter.convert(sub_rel, context=context)\n\n # Extract the specified column/Series from the Dataframe\n fq_column_name = self._get_fq_column_name(series, dc)\n\n # Extract the specified column/Series from the Dataframe\n fq_column_name = self._get_f", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "AttributeError)", + "got": "DFParsingException):", + "got_raw": "DFParsingException):\n c.create_table(\"my_table\", \"wrong\")\n\n with pytest.raises(DFParsingException):\n c.create_table(\"my_table\", \"wrong\", format=\"wrong\")\n\n with pytest.raises(DFParsingException):\n c.create_table(\"my_table\", \"wrong\", format=\"parquet\", gpu=True)\n\n with pytest.raises(DFParsingException):\n c.create_table(\"my_table\", \"wrong\", format=\"parquet\", gpu=False)\n\n with pytest.raises(DFParsingException):\n c.create_table(\"my_table\", \"wrong\", format=\"parquet\", gpu=\"wrong\")\n\n with pytest.raises", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "\"string\"", + "got": "0", + "got_raw": "0\n assert ops_mapping[\"substring\"](a, 10, 10) == 0\n assert ops_mapping[\"substring\"](a, 10, 100) == 0\n assert ops_mapping[\"substring\"](a, 10, 1000) == 0\n assert ops_mapping[\"substring\"](a, 10, 10000) == 0\n assert ops_mapping[\"substring\"](a, 10, 100000) == 0\n assert ops_mapping[\"substring\"](a, 1", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "200", + "got": "200", + "got_raw": "200\n assert response.json() == {\n \"columns\": [\"SCHEMA_NAME\", \"TABLE_NAME\", \"TABLE_TYPE\"],\n \"data\": [\n [\"a_schema\", \"tables\", \"TABLE\"],\n [\"a_schema\", \"columns\", \"TABLE\"],\n [\"a_schema\", \"functions\", \"FUNCTION\"],\n [\"a_schema\", \"views\", \"VIEW\"],\n [\"a_schema\", \"schemas\", \"SCHEMA\"],\n [\"a_schema\", \"experiments\", \"EXPERIMENT\"],\n [\"a_schema\", \"models\", \"MODEL\"],\n ],\n }\n\n@pytest.mark.xfail(reason=\"WIP DataF", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "c.DEFAULT_SCHEMA_NAME", + "got": "c.DEFAULT_SCHEMA_NAME", + "got_raw": " c.DEFAULT_SCHEMA_NAME\n\n c.sql(\"CREATE SCHEMA example\")\n c.sql(\"USE SCHEMA example\")\n c.sql(\"DROP SCHEMA example\")\n\n assert c.schema_name == c.DEFAULT_SCHEMA_NAME\n\n c.sql(\"CREATE SCHEMA example\")\n c.sql(\"USE SCHEMA example\")\n c.sql(\"DROP SCHEMA example\")\n\n assert c.schema_name == c.DEFAULT_SCHEMA_NAME\n\n c.sql(\"CREATE SCHEMA example\")\n c.sql(\"USE SCHEMA example\")\n c.sql(\"DROP SCHEMA example\")\n\n assert c.schema_name == c.DEFAULT_SCHEMA_NAME\n\n c.sql(\"CREATE SC", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "\"\"\" SELECT * FROM df1 \"\"\")", + "got": "", + "got_raw": "\n\n\n# File: dask_sql/integrations/ipython.py\nimport time\nfrom typing import TYPE_CHECKING\n\nfrom dask_sql.mappings import _SQL_TO_PYTHON_FRAMES\nfrom dask_sql.physical.rex.core import RexCallPlugin\n\nif TYPE_CHECKING:\n import dask_sql\n\n# That is definitely not pretty, but there seems to be no better way...\nKEYWORDS = [\n \"and\",\n \"as\",\n \"asc\",\n \"between\",\n \"by\",\n \"columns\",\n \"count\",\n \"create\",\n \"delete\",\n \"desc\",\n \"describe", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "RuntimeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n c.sql('SHOW COLUMNS FROM \"information_schema\".\"columns\"')\n with pytest.raises(NotImplementedError):\n c.sql('SHOW COLUMNS FROM \"information_schema\".\"columns\".\"column\"')\n with pytest.raises(NotImplementedError):\n c.sql('SHOW COLUMNS FROM \"information_schema\"')\n with pytest.raises(NotImplementedError):\n c.sql('SHOW COLUMNS FROM \"information_schema\".\"columns\"')\n with pytest.raises(NotImplementedError):\n c.sql('SHOW COLUMNS FROM \"information_schema\".\"columns\".\"column\"')\n with pytest.raises(NotImplementedError):\n c", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5294117647058824, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "False", + "got": "42", + "got_raw": "42\n assert \"answer\" in captured.out\n\ndef test_meta_commands(c, client, capsys):\n _meta_commands(\"\\\\l\", context=c, client=client)\n captured = capsys.readouterr()\n assert \"Schemas\" in captured.out\n\n _meta_commands(\"\\\\dt\", context=c, client=client)\n captured = capsys.readouterr()\n assert \"Tables\" in captured.out\n\n _meta_commands(\"\\\\df\", context=c, client=client)\n captured = capsys.readouterr()\n assert \"Functions\" in captured.out\n\n _meta_commands(\"\\\\de\", context", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "second_mock", + "got": "second_mock", + "got_raw": " second_mock\n\n with pytest.raises(RuntimeError):\n c.sql(\n \"\"\"\n CREATE MODEL my_model WITH (\n model_class = 'mock.MagicMock',\n target_column = 'target'\n ) AS (\n SELECT x, y, x*y > 0 AS target\n FROM timeseries\n LIMIT 100\n )\n \"\"\"\n )\n\n c.sql(\n \"\"\"\n CREATE OR REPLACE MODEL my_model WITH (\n model_class = 'mock.MagicMock',\n target_column = 'target'\n ) AS (\n SELECT x, y, x*y > 0 AS target\n FROM timeseries", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "\"\"\" SELECT df2.user_id, df2.d FROM df2 \"\"\")", + "got": "", + "got_raw": "\n\n\n# File: dask_sql/physical/rex/core/call.py\n def __init__(self):\n super().__init__(self.search)\n\n def search(self, series: dd.Series, sarg: SargPythonImplementation):\n conditions = [r.filter_on(series) for r in sarg.ranges]\n\n assert len(conditions) > 0\n\n if len(conditions) > 1:\n or_operation = ReduceOperation(operation=operator.or_)\n return or_operation(*conditions)\n else:\n return conditions[0]\n\n\nclass ExtractOperation(Operation):\n \"\"\"\n Function for performing PostgreSQL like functions in", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dask-contrib/dask-sql", + "expected": "result)", + "got": "", + "got_raw": "\n\n\n# File: dask_sql/physical/rel/custom/predict_model.py\nimport logging\nimport uuid\nfrom typing import TYPE_CHECKING\n\nimport dask.dataframe as dd\nimport pandas as pd\n\nfrom dask_sql.datacontainer import ColumnContainer, DataContainer\nfrom dask_sql.physical.rel.base import BaseRelPlugin\n\nif TYPE_CHECKING:\n import dask_sql\n from dask_sql._datafusion_lib import LogicalPlan\n\nlogger = logging.getLogger(__name__)\n\n\nclass PredictModelPlugin(BaseRelPlugin):\n \"\"\"\n Predict the target using the given model and dataframe from the SELECT query.\n\n The SQL", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"test-key\"", + "got": "t(embeddings) == 1024\"test-key\"", + "got_raw": "<|fim_suffix|>t(embeddings) == 1024<|fim_middle|>\"test-key\"\n\ndef test_google_embedder_embed():\n embedder = GoogleEmbedder(api_key=\"test-key\")\n embeddings = embedder.embed(\"Hello world\", model_name=\"models/text-embedding-004\")\n\n assert len(embeddings) == 1024\n\ndef test_google_embedder_embed_with_model_name():\n embedder = GoogleEmbedder(api_key=\"test-key\")\n embeddings = embedder.embed(\"Hello world\", model_name=\"models/text-embedding-004\")\n\n assert len(embeddings) == 1024", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.4878048780487805, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "{\"start\": \"A\", \"C\": \"C\"}", + "got": "", + "got_raw": "\n\n\n\n\n\n# File: datapizza-ai-core/datapizza/agents/agent.py\n def _decorator_tools(self):\n tools = []\n for attr_name in dir(self):\n attr = getattr(self, attr_name)\n # Check for tool methods\n if isinstance(attr, Tool):\n tools.append(attr)\n\n return tools\n\n @_lock_if_not_stateless\n def stream_invoke(\n self,\n task_input: str,\n tool_choice: Literal[\"auto\", \"required\", \"none\", \"required_first\"]\n | list[str] = \"auto\",\n **gen_kwargs,\n ) -> Generator", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"test\"", + "got": "\"test\"", + "got_raw": " \"test\"\n assert agent.system_prompt == \"You are a test agent\"\n assert agent.planning_prompt == \"test planning prompt\"\n\n def test_run_agent(self):\n agent = Agent(\n name=\"test\",\n client=MockClient(),\n system_prompt=\"You are a test agent\",\n planning_prompt=\"test planning prompt\",\n )\n\n response = agent.run(\"test input\")\n\n assert isinstance(response, ClientResponse)\n assert response.content == [\"test output\"]\n\n def test_run_agent_with_tools(self):\n agent = Agent(\n name=\"test\",\n client=MockClient(),\n system_prompt=\"You are", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"COSINE\"", + "got": "1", + "got_raw": "1\n\ndef test_metric_from_config_dense_cosine(store, vector_cfg):\n\n assert store._metric_from_config(vector_cfg[0]) == 2\n\ndef test_metric_from_config_dense_euclidean(store, vector_cfg):\n\n assert store._metric_from_config(vector_cfg[0]) == 3\n\ndef test_metric_from_config_dense_minkowski(store, vector_cfg):\n\n assert store._metric_from_config(vector_cfg[0]) == 4\n\ndef test_metric_from_config_dense_hamming(store, vector_cfg):\n\n assert store._metric_from_config(vector_cfg[0]) == 5\n\ndef test_metric_from_config_dense_j", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"alpha\"", + "got": "tore.add(c, collection_name=collection)", + "got_raw": "<|fim_suffix|>tore.add(c, collection_name=collection)\n # flush collection\n client = store.get_client()\n client.flush(collection_name=collection)\n out = store.retrieve(collection, ids=[\"id-1\"])\n assert len(out) == 1\n got = out[0]\n assert got.id == \"id-1\"\n\n assert got.text == \"alpha\"\n assert got.embeddings[0].values == [0.5, 0.2, 0.1]\n assert got.embeddings[0].indices == [1, 5, 9]\n assert got.embeddings[", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.13043478260869565, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "1", + "got": "1", + "got_raw": "1\n assert issubclass(w[-1].category, DeprecationWarning)\n assert \"pdf_path\" in str(w[-1].message)\n\ndef test_parse_with_pdf_path(mock_docling_parser, tmp_path):\n \"\"\"Test parse() with 'pdf_path'.\"\"\"\n dummy_file = tmp_path / \"test.pdf\"\n dummy_file.write_text(\"fake-pdf\")\n\n node = mock_docling_parser.parse(pdf_path=str(dummy_file))\n\n assert isinstance(node, Node)\n assert node.type == NodeType.PDF\n\ndef test_parse_with_text(mock_docling_parser):\n \"\"\"Test parse() with 'text'.\"\"\"\n text", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"Hello, world!\"", + "got": "\"This is a test.\"", + "got_raw": " \"This is a test.\"\n assert document.children[1].content == \"this is a sentence.\"\n\n assert document.children[1].children[0].node_type == NodeType.SENTENCE\n assert document.children[1].children[0].content == \"this is a sentence.\"\n\ndef test_md_parser():\n parser = MDParser()\n assert parser is not None\n\n text = \"\"\"# My Title\nThis is the first paragraph. It has two sentences.\nThis is the second paragraph.\n\n# Another Title\nThis is the third paragraph.\n\"\"\"\n\n document = parser.parse(text)\n assert document is not None\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.1875, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "Memory()", + "got": "", + "got_raw": " # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert memory_copy == # type: ignore\n assert", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "18", + "got": "9", + "got_raw": "9\n\n def test_stateless_lock_thread(self):\n agent = Agent(\n name=\"test\",\n client=MockClient(),\n system_prompt=\"You are a test agent\",\n stateless=True,\n )\n\n def test_func(x):\n agent.run(str(x))\n\n with ThreadPoolExecutor(max_workers=3) as executor:\n futures = [executor.submit(test_func, x) for x in range(9)]\n [future.result() for future in futures]\n\n\n assert len(agent._memory) == 0\n\n def test_stateless_lock_thread(self):\n agent = Agent(\n name=\"test\",\n client", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "expected", + "got": "", + "got_raw": "<|fim_suffix|>\n # 1. Match any .log file in /var/log directory\n (\"/var/log/syslog.log\", [r\"^/var/log/.*\\.log$\"], True),\n # 2. Match .txt files in /var/log with specific naming\n (\"/var/log/syslog.log\", [r\"^/var/log/[^/]+\\.txt$\"], False),\n # 3. Match date-formatted PDF reports (YYYYMMDD)\n (\"/data/reports/20230801.pdf\", [r\"^/data/reports/\\d{8}\\.pdf$", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"model\"", + "got": "0", + "got_raw": "0\n assert messages[0][\"content\"] == system_prompt\n\n assert messages[1][\"role\"] == 1\n assert messages[1][\"content\"] == \"Hello!\"\n\ndef test_google_memory_to_messages_with_no_system_prompt():\n memory = Memory()\n memory.new_turn(role=ROLE.USER)\n memory.add_to_last_turn(TextBlock(content=\"Hello!\"))\n messages = GoogleMemoryAdapter().memory_to_messages(memory)\n\n assert messages[0][\"role\"] == 1\n assert messages[0][\"content\"] == \"Hello!\"\n\ndef test_google_memory_to_messages_with_function_call():\n memory = Memory()\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"test_value\"", + "got": "e = mock_docling_parser.parse(file_path=str(dummy_file), metadata=user_metadata)", + "got_raw": "<|fim_suffix|>e = mock_docling_parser.parse(file_path=str(dummy_file), metadata=user_metadata)\n\n assert node.metadata[\"source\"] == \"user_upload\"\n\n assert node.metadata[\"custom_field\"] == \"test_value\"\n\n assert node.metadata[\"ocr_options\"] == OCROptions(ocr_engine=OCREngine.DOCLONG, ocr_language=\"en\")\n\n assert node.metadata[\"ocr_options\"][\"ocr_engine\"] == OCREngine.DOCLONG\n\n assert node.metadata[\"ocr_options\"][\"ocr_language\"] == \"en\"\n\n assert node.metadata[\"ocr_options\"][\"ocr_language\"] == \"en\"\n\n assert node.metadata[\"", + "exact_match": false, + "code_bleu": 0.06074588070876682, + "edit_similarity": 0.10869565217391304, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "1", + "got": "1", + "got_raw": "1\n section = root.children[0]\n assert section.node_type == NodeType.SECTION\n assert section.metadata[\"title\"] == \"Title\"\n assert section.metadata[\"level\"] == 1\n\n assert len(section.children) == 2\n paragraph = section.children[0]\n assert paragraph.node_type == NodeType.PARAGRAPH\n assert len(paragraph.children) == 1\n sentence = paragraph.children[0]\n assert sentence.node_type == NodeType.SENTENCE\n assert sentence.content == \"This is a paragraph.\"\n\n section = section.children[1]\n assert section.node_type == NodeType", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"test-key\"", + "got": "\"test-key\"", + "got_raw": " \"test-key\"\n assert embedder.model_name == \"text-embedding-ada-002\"\n\ndef test_openai_embedder_embed():\n embedder = OpenAIEmbedder(api_key=\"test-key\")\n\n embeddings = embedder.embed(\"Hello world\", model_name=\"text-embedding-ada-002\")\n\n assert len(embeddings) == 1536\n assert isinstance(embeddings[0], float)\n\ndef test_openai_embedder_embed_with_model_name():\n embedder = OpenAIEmbedder(api_key=\"test-key\")\n\n embeddings = embedder.embed(\"Hello world\", model_name=\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"Hello, world!\"", + "got": "t = memory_copy[0].blocks[0].content", + "got_raw": "<|fim_suffix|>t = memory_copy[0].blocks[0].content\n\n assert memory_copy[0].blocks[0].content == \"Hello, world! 2\"\n\n assert memory_copy[0].blocks[0].content != \"Hello, world!\"\n\n\ndef test_memory_iter():\n memory = Memory()\n memory.add_turn(blocks=[TextBlock(content=\"Hello, world!\")], role=ROLE.USER)\n memory.add_turn(blocks=[TextBlock(content=\"Hello, world!\")], role=ROLE.ASSISTANT)\n\n for block in memory:\n assert isinstance(block, Block)\n\n for block in memory.iter_blocks():\n", + "exact_match": false, + "code_bleu": 0.08032276872815308, + "edit_similarity": 0.1568627450980392, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"user\"", + "got": "assert messages[1][\"role\"] == \"user\"", + "got_raw": "<|fim_suffix|>\n assert messages[1][\"role\"] == \"user\"\n assert \"Hello!\" in str(messages[1][\"parts\"])\n\n assert messages[2][\"role\"] == \"assistant\"\n assert \"Hi there!\" in str(messages[2][\"parts\"])\n\n assert messages[3][\"role\"] == \"user\"\n assert \"What's your name?\" in str(messages[3][\"parts\"])\n\n assert messages[4][\"role\"] == \"assistant\"\n assert \"My name is ChatGPT.\" in str(messages[4][\"parts\"])\n\n assert messages[5][\"role\"] == \"user\"\n assert \"What's", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"test_tool\"", + "got": "\"test_tool\"", + "got_raw": " \"test_tool\"\n assert tools[0].description == \"A test tool\"\n assert tools[0].properties == {\"arg1\": {\"type\": \"string\"}}\n assert tools[0].required == [\"arg1\"]\n\n @pytest.mark.asyncio\n async def test_a_list_tools_uses_persistent_session(self):\n \"\"\"a_list_tools should use _persistent_session if available.\"\"\"\n client = MCPClient(url=\"https://example.com/mcp\")\n\n # Create mock tool\n mock_tool = MagicMock()\n mock_tool.name = \"test_tool\"\n mock_tool.description = \"A test tool\"\n mock", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "[TextBlock(content=\"Mock response\")]", + "got": "1", + "got_raw": "1\n\n assert response.content[0].role == ROLE.USER.value\n assert response.content[0].content == \"Mock response\"\n\n assert response.content[1].role == ROLE.ASSISTANT.value\n assert response.content[1].content == \"Mock response\"\n\n assert response.content[2].role == ROLE.USER.value\n assert response.content[2].content == \"Mock response\"\n\n assert response.content[3].role == ROLE.ASSISTANT.value\n assert response.content[3].content == \"Mock response\"\n\n assert response.content[4].role == ROLE.USER.value\n assert response", + "exact_match": false, + "code_bleu": 0.0625, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "\"test_elements\"", + "got": "\"test_collection\"", + "got_raw": " \"test_collection\"\n\ndef test_pipeline_from_yaml_with_clients():\n \"\"\"Test that clients section in YAML config correctly instantiates and injects clients.\"\"\"\n pipeline = IngestionPipeline().from_yaml(\n str(TEST_DIR / \"config_with_clients.yaml\")\n )\n\n # Verify the pipeline has the expected components\n assert len(pipeline.pipeline.components) == 3\n\n # The second component should be SplitterWrapper with a TextSplitter element\n splitter_wrapper = pipeline.pipeline.components[1]\n # Use class name check because importlib loads from a different module context\n assert splitter_wrapper.__class__.__name__ ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.625, + "n_retrieved": 10 + }, + { + "repo": "datapizza-labs/datapizza-ai", + "expected": "None", + "got": "assert embedder.model_name == \"test-model\"", + "got_raw": "<|fim_suffix|>\n assert embedder.model_name == \"test-model\"\n\n assert embedder.system_prompt == \"test-system-prompt\"\n\n assert embedder.temperature == 0.5\n\n assert embedder.cache is None\n\n assert embedder.project_id is None\n\n assert embedder.location is None\n\n assert embedder.credentials_path is None\n\n assert embedder.use_vertexai is False\n\n assert embedder.memory_adapter is None\n\n assert embedder.memory is None\n\n assert embedder.tools is None\n\n assert embedder.function_call is None\n\n assert embedder.function_call_block is None\n\n assert embed", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.043478260869565216, + "n_retrieved": 10 + }, + { + "repo": "datarobot/syftr", + "expected": "api.SyftrStudyStatus.STOPPED", + "got": "api.SyftrStudyStatus.STOPPED", + "got_raw": " api.SyftrStudyStatus.STOPPED\n\ndef test_delete():\n study = api.Study.from_file(EXAMPLE_STUDY_CONFIG_PATH)\n study.run()\n time.sleep(45)\n assert study.status[\"job_status\"] == api.SyftrStudyStatus.RUNNING\n study.delete()\n time.sleep(45)\n\n assert study.status[\"job_status\"] == api.SyftrStudyStatus.INITIALIZED\n\ndef test_delete_non_existent_study():\n study = api.Study.from_file(NON_EXISTANT_STUDY_CONFIG_PATH)\n with pytest.raises(api.Syftr", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datarobot/syftr", + "expected": "0", + "got": "0, call_data", + "got_raw": "0, call_data\n assert sum(call.llm_call_latency for call in call_data) > 0, call_data\n assert sum(call.llm_call_latency for call in call_data) > 0, call_data\n assert sum(call.llm_call_latency for call in call_data) > 0, call_data\n assert sum(call.llm_call_latency for call in call_data) > 0, call_data\n assert sum(call.llm_call_latency for call in call_data) > 0, call_data\n assert sum(call.llm_call_latency for call in call_data) > 0,", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "datarobot/syftr", + "expected": "df.columns", + "got": "tudy_config.optimization.objective_1_name: obj_1,", + "got_raw": "<|fim_suffix|>tudy_config.optimization.objective_1_name: obj_1,\n study_config.optimization.objective_2_name: obj_2,\n }\n except optuna.TrialPruned:\n return None\n\ndef test_get_study_returns_study():\n with patch(\"syftr.api.optuna.load_study\", return_value=MOCK_STUDY):\n study = api.Study.from_file(EXAMPLE_STUDY_CONFIG_PATH)\n assert isinstance(study, api.Study)\n assert study.study_config.name == MOCK_STUDY.study_name\n\ndef test_get_study_returns_study_from_db():\n with patch(\"", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.13559322033898305, + "n_retrieved": 10 + }, + { + "repo": "datarobot/syftr", + "expected": "3", + "got": "3", + "got_raw": "3\n\n # test through syftr\n dataset = FinanceBenchHF()\n assert dataset.name == \"financebench\"\n assert dataset.subset == \"dev\"\n assert dataset.description == (\n \"This dataset is a vast collection of all kind of information that you can find on Wikipedia. \"\n \"It can be used, for instance, to retrieve straightforward facts from one or more documents, \"\n \"compare two entities based on shared attributes, \"\n \"identify relationships, roles, or attributes of entities, \"\n \"reason about dates, timelines, or chronological order, \"\n \"determine geographical relationships or", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datarobot/syftr", + "expected": "None", + "got": "assert llama_debug.get_event_pairs(CBEventType.AGENT_STEP)", + "got_raw": "<|fim_suffix|>\n assert llama_debug.get_event_pairs(CBEventType.AGENT_STEP)\n assert llama_debug.get_event_pairs(CBEventType.SYNTHESIZE)\n assert llama_debug.get_event_pairs(CBEventType.LLM)\n assert llama_debug.get_event_pairs(CBEventType.QUERY)\n assert llama_debug.get_event_pairs(CBEventType.AGENT_STEP)\n assert llama_debug.get_event_pairs(CBEventType.SYNTHESIZE)\n assert llama_debug.get_event_pairs(CBEventType.LLM)\n assert llama_debug.get_event_pairs(CBEventType.QUERY)\n assert llama_debug.get_event_pairs(CBEventType.AG", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.03225806451612903, + "n_retrieved": 10 + }, + { + "repo": "datarobot/syftr", + "expected": "None", + "got": "assert vdb is not None, \"VectorStoreIndex is None\"", + "got_raw": "<|fim_suffix|>\n assert vdb is not None, \"VectorStoreIndex is None\"\n\n # Check if vdb is not empty\n assert len(vdb) > 0, \"VectorStoreIndex is empty\"\n\n # Check if vdb is not None\n assert vdb is not None, \"VectorStoreIndex is None\"\n\n # Check if vdb is not empty\n assert len(vdb) > 0, \"VectorStoreIndex is empty\"\n\n # Check if vdb is not None\n assert vdb is not None, \"VectorStoreIndex is None\"\n\n # Check if vdb is", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.14814814814814814, + "n_retrieved": 10 + }, + { + "repo": "datarobot/syftr", + "expected": "pareto_df.columns", + "got": "assert isinstance(pareto_df, pd.DataFrame)", + "got_raw": "<|fim_suffix|>\n assert isinstance(pareto_df, pd.DataFrame)\n assert not pareto_df.empty\n\n assert \"user_attrs_flow\" in pareto_df.columns\n assert \"values_0\" in pareto_df.columns\n assert \"values_1\" in pareto_df.columns\n assert \"values_2\" in pareto_df.columns\n assert \"values_3\" in pareto_df.columns\n assert \"values_4\" in pareto_df.columns\n assert \"values_5\" in pareto_df.columns\n assert \"values_6\" in pareto_df.columns\n assert \"", + "exact_match": false, + "code_bleu": 0.15619699684601276, + "edit_similarity": 0.3728813559322034, + "n_retrieved": 10 + }, + { + "repo": "datarobot/syftr", + "expected": "2", + "got": "1", + "got_raw": "1\n assert df_trials[\"user_attrs_flow\"].iloc[0] == {\n \"query\": \"What is the capital of France?\",\n \"context\": \"Paris is the capital of France.\",\n \"response\": \"Paris is the capital of France.\",\n }\n assert df_trials[\"user_attrs_metric_failed\"].iloc[0] == True\n assert df_trials[\"user_attrs_metric\"].iloc[0] == 0.0\n assert df_trials[\"user_attrs_metric_1\"].iloc[0] == 0.0\n assert df_trials[\"user_attrs_metric_2\"].iloc[0] ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "ref_id_2", + "got": "0", + "got_raw": "0\n assert result\n assert os.path.isfile(test_filepath) and \\\n \"test1\" in open(test_filepath, \"r\").read()\n assert os.path.isfile(random_filepath) and \\\n \"test\" in open(random_filepath, \"r\").read()\n # Checkout to second ref, .datmo should be unaffected\n result = self.git_code_manager.checkout_ref(ref_id_2)\n\n # Check code was properly checked out\n\n assert ref_id_2 != 0\n assert result\n assert os.path.isfile(test_filepath) and \\\n \"test2\" in open(test_filepath, \"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "\"\"", + "got": "0", + "got_raw": "0\n # teardown container\n self.docker_environment_driver.stop(container_id, force=True)\n\n @pytest_docker_environment_failed_instantiation(test_datmo_dir)\n def test_stop_container(self):\n # TODO: test with all variables provided\n self.docker_environment_driver.build_image(self.image_name,\n self.dockerfile_path)\n # With default parameters\n return_code, container_id = \\\n self.docker_environment_driver.run_container(self.image_name)\n assert return_code == 0 and \\\n container_id\n # teardown container\n self.docker_environment_driver.stop(container_id, force=True)\n # teardown container\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "v", + "got": "v", + "got_raw": " v\n\n def test_init_with_id(self):\n snapshot_entity = Snapshot(self.input_dict)\n\n for k, v in self.input_dict.items():\n\n assert getattr(snapshot_entity, k) == v\n\n def test_str(self):\n snapshot_entity = Snapshot(self.input_dict)\n\n assert str(snapshot_entity) == \"snapshot my_model (my message)\"\n\n def test_eq(self):\n snapshot_entity = Snapshot(self.input_dict)\n\n assert snapshot_entity == Snapshot(self.input_dict)\n\n def test_get_files(self):\n snapshot_entity = Snapshot(self.input_dict)\n\n assert snapshot_entity.files == None\n\n def test_get_files_with_files", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "result", + "got": "result", + "got_raw": " result\n\n # Test when optional parameters are given\n self.snapshot_command.parse(\n [\"snapshot\", \"ls\", \"--format\", \"csv\", \"--session-id\", \"123456\"])\n\n result = self.snapshot_command.execute()\n\n assert result\n\n assert created_snapshot_obj in result\n\n def test_snapshot_create(self):\n self.__set_variables()\n\n # Test when optional parameters are not given\n self.snapshot_command.parse(\n [\"snapshot\", \"create\", \"-m\", \"my test snapshot\"])\n\n created_snapshot_obj = self.snapshot_command.execute()\n\n assert created_snapshot_obj\n\n assert created_snapshot_obj", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "tags", + "got": "tags", + "got_raw": " tags\n\n @pytest_docker_environment_failed_instantiation(test_datmo_dir)\n def test_list_images(self):\n failed = False\n try:\n self.docker_environment_driver.list_images()\n except EnvironmentImageNotFound:\n failed = True\n assert failed\n\n self.docker_environment_driver.build_image(self.image_name,\n self.dockerfile_path)\n\n result = self.docker_environment_driver.list_images()\n tags = result.__dict__['attrs']['RepoTags']\n\n assert self.image_name + \":latest\" in tags\n\n @pytest_docker_environment_failed_instantiation(test_datmo_dir)\n def test_search_images", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "self.base_controller.home", + "got": "\\", + "got_raw": " \\\n self.base_controller.home\n\n assert self.base_controller.code_driver.datmo_directory_name == \\\n Config().datmo_directory_name\n\n def test_default_file_driver_not_initialized(self):\n assert self.base_controller.file_driver != None\n assert self.base_controller.file_driver.type == \"local\"\n\n assert self.base_controller.file_driver.root == \\\n self.base_controller.home\n\n assert self.base_controller.file_driver.datmo_directory_name == \\\n Config().datmo_directory_name\n\n def test_default_environment_driver_not_initialized(self):\n assert self.base_controller.environment_driver != None\n assert self.base_controller.environment_driver.type == \"", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "set(ids)", + "got": "set(ids)", + "got_raw": " set(ids)\n\n def test_query_environments_single(self):\n environment_1 = self.dal.environment.create(\n Environment(self.environment_input_dict))\n environment_2 = self.dal.environment.create(\n Environment(self.environment_input_dict))\n environment_3 = self.dal.environment.create(\n Environment(self.environment_input_dict))\n\n results = self.dal.environment.query(\n {\"id\": environment_1.id}, sort_key=\"created_at\", sort_order=\"ascending\")\n assert len(results) == 1\n assert results[0].created_at == environment_1.created_at\n\n results = self.dal.environment.query(\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "model2.id", + "got": "model2.id", + "got_raw": " model2.id\n assert model.name == model2.name\n assert model.description == model2.description\n\n def test_sanity_check_for_code_driver(self):\n self.project_controller.init(name=\"test\", description=\"test\")\n model = self.base_controller.model\n code_driver = self.base_controller.code_driver\n code_driver.init()\n code_driver2 = self.base_controller.code_driver\n assert code_driver and code_driver2\n assert code_driver2 == code_driver\n\n def test_sanity_check_for_file_driver(self):\n self.project_controller.init(name=\"test\", description=\"test\")\n model = self.base_controller", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "self.user_input_dict['name']", + "got": "self.user_input_dict['name']", + "got_raw": " self.user_input_dict['name']\n assert user.email == self.user_input_dict['email']\n\n def test_create_user_by_object(self):\n user = User(self.user_input_dict)\n user = self.dal.user.create(user)\n assert user.id\n\n assert user.name == self.user_input_dict['name']\n assert user.email == self.user_input_dict['email']\n\n def test_create_user_by_object_with_id(self):\n user = User(self.user_input_dict)\n user.id = \"1234567890\"\n user = self.dal.user.create(user)\n assert user.id\n\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "None", + "got": "0", + "got_raw": "0\n\n def test_create(self):\n filepath = self.local_file_driver.create(\"test.txt\", directory=False)\n assert os.path.isfile(filepath)\n\n def test_exists(self):\n filepath = self.local_file_driver.create(\"test.txt\", directory=False)\n assert self.local_file_driver.exists(\"test.txt\", directory=False)\n\n def test_get(self):\n filepath = self.local_file_driver.create(\"test.txt\", directory=False)\n with open(filepath, \"w\") as f:\n f.write(\"test\")\n with open(filepath, \"r\") as f:\n assert f.read() == \"test\"\n\n def test_delete(self", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "f2", + "got": "f2", + "got_raw": " f2\n\n # Test 2: Check if the logger is properly initialized\n assert logger.name == \"root\"\n assert logger.level == logging.INFO\n assert logger.handlers[0].level == logging.INFO\n assert logger.handlers[0].formatter._fmt == \"%(asctime)s - [%(name)s@%(module)s.%(funcName)s] [%(levelname)s] - %(message)s\"\n\n # Test 3: Check if the logger is properly initialized\n assert logger.name == \"root\"\n assert logger.level == logging.INFO\n assert logger.handlers[0].level == logging.INFO\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "default_name", + "got": "default_name", + "got_raw": " default_name\n assert result.description == \"\"\n\n def test_init_create_success_default_name_no_description_with_environment(\n self):\n self.project_command.parse([\"init\"])\n\n # Test when environment is created\n @self.project_command.cli_helper.input(\"\\n\\ny\\n\\n\\n\\n\")\n def dummy(self):\n return self.project_command.execute()\n\n result = dummy(self)\n\n # Ensure that the name and description are current\n _, default_name = os.path.split(\n self.project_command.project_controller.home)\n assert result\n\n assert result.name == default_name\n assert result.description == \"\"\n\n def test_init_create", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "result.duration", + "got": "0.004", + "got_raw": "0.004\n assert task.status == result.status\n\n def test_get_by_id_model(self):\n task = self.dal.task.create(Task(self.task_input_dict))\n result = self.dal.model.get_by_id(task.model_id)\n assert task.model_id == result.id\n assert task.command == result.command\n assert task.start_time == result.start_time\n assert task.end_time == result.end_time\n\n assert task.duration == 0.004\n assert task.status == result.status\n\n def test_get_by_id_environment(self):\n task = self.dal.task.create(Task(self.task", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.1, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "code_obj", + "got": "code_obj", + "got_raw": " code_obj\n\n # Test should return same code_obj if same commit_id\n code_obj_3 = self.code_controller.create(commit_id=code_obj.commit_id)\n\n assert code_obj_3 == code_obj\n\n # Test should return same code_obj if same commit_id\n code_obj_4 = self.code_controller.create(commit_id=code_obj_2.commit_id)\n\n assert code_obj_4 == code_obj\n\n # Test should return same code_obj if same commit_id\n code_obj_5 = self.code_controller.create(commit_id=code_obj_3.commit_id)\n\n assert code_obj_5", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "set(ids)", + "got": "set(ids)", + "got_raw": " set(ids)\n\n def test_get(self):\n self.__setup()\n # Create tasks in the project\n task_obj_1 = self.task_controller.create()\n task_obj_2 = self.task_controller.create()\n\n # Get task by id\n result = self.task_controller.get(task_obj_1.id)\n assert result.id == task_obj_1.id\n\n # Get task by id\n result = self.task_controller.get(task_obj_2.id)\n assert result.id == task_obj_2.id\n\n # Get task by id\n result = self.task_controller.get(task_obj_1.id)\n assert", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "v", + "got": "v", + "got_raw": " v\n\n def test_init_with_id(self):\n file_collection_entity = FileCollection(self.input_dict)\n\n for k, v in self.input_dict.items():\n\n assert getattr(file_collection_entity, k) == v\n\n def test_to_dictionary(self):\n file_collection_entity = FileCollection(self.input_dict)\n\n assert file_collection_entity.to_dictionary() == self.input_dict\n\n def test_to_dictionary_with_id(self):\n file_collection_entity = FileCollection(self.input_dict)\n\n assert file_collection_entity.to_dictionary() == self.input_dict\n\n def test_to_dictionary_with_id(self):\n file_collection_entity = FileCollection(self.input_dict", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "test_ports", + "got": "test_ports", + "got_raw": " test_ports\n assert self.run_command.args.environment_paths == [test_dockerfile]\n assert self.run_command.args.mem_limit == test_mem_limit\n\n # test for single set of ports\n self.run_command.parse([\n \"run\", \"--ports\", test_ports[0], \"--environment-paths\",\n test_dockerfile, \"--mem-limit\", test_mem_limit, test_command\n ])\n # test for desired side effects\n assert self.run_command.args.cmd == test_command\n assert self.run_command.args.ports == [test_ports[0]]\n assert self.run_command.args.environment_paths == [test_d", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "\"a\"", + "got": "\"a\"", + "got_raw": " \"a\"\n assert \"script.py\" in result[0].name\n\n def test_task_entity_create(self):\n # Test failure because entity has not been created by controller\n failed = False\n try:\n create(message=\"test\")\n except DoesNotExist:\n failed = True\n assert failed\n\n # Test success\n snapshot_entity = self.__setup()\n assert isinstance(snapshot_entity, Snapshot)\n\n def test_task_entity_create_from_task(self):\n # Test failure because entity has not been created by controller\n failed = False\n try:\n create(message=\"test\", run_id=\"test\")\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "set(ids)", + "got": "set(ids)", + "got_raw": " set(ids)\n\n def test_get_by_id(self):\n snapshot_1 = self.dal.snapshot.create(\n Snapshot(self.snapshot_input_dict))\n snapshot_2 = self.dal.snapshot.create(\n Snapshot(self.snapshot_input_dict))\n\n # Get snapshot by id\n snapshot = self.dal.snapshot.get_by_id(snapshot_1.id)\n assert snapshot.id == snapshot_1.id\n\n # Get snapshot by id that does not exist\n failed = False\n try:\n _ = self.dal.snapshot.get_by_id(\"non_existent_id\")\n except EntityNotFound:\n failed = True\n assert failed\n\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "datmo/datmo", + "expected": "3", + "got": "0", + "got_raw": "0\n\n def test_db_query_with_sort_key(self):\n test_obj = {\"foo\": \"bar\"}\n self.database.set(self.collection, test_obj)\n results = self.database.query(self.collection, test_obj, \"foo\")\n\n assert len(results) == 1\n assert results[0]['foo'] == 'bar'\n\n def test_db_query_with_sort_order(self):\n test_obj = {\"foo\": \"bar\"}\n self.database.set(self.collection, test_obj)\n results = self.database.query(self.collection, test_obj, \"foo\", \"desc\")\n\n assert len(results) == 1\n assert results", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n FlowResponse( # closing flow make screen `SUCCESS`\n version=Version.FLOW_MSG.value,\n data={\"test\": \"test\"},\n close_flow=True,\n flow_token=\"test\",\n ).to_dict()[\"screen\"]\n\ndef test_flow_response_with_close_flow_and_screen():\n assert (\n FlowResponse( # closing flow make screen `SUCCESS`\n version=Version.FLOW_MSG.value,\n data={\"test\": \"test\"},\n close_flow=True,\n flow_token=\"test\",\n screen=\"test\",\n ).to_dict()[\"screen\"]\n == \"test\"\n )\n\n\n with pytest", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "\"value\"", + "got": "123", + "got_raw": "123\n\n @wa.on_message\n def shared_data_handler(_: WhatsApp, m: types.Message):\n m.shared_data[\"key\"] = None\n m.continue_handling()\n\n @wa.on_message\n def shared_data_check(_: WhatsApp, m: types.Message):\n m.shared_data[\"key\"] = \"value\"\n\n wa._invoke_callbacks(\n handler_type=handlers.MessageHandler,\n update=msg,\n )\n\n\n assert msg.shared_data[\"key\"] == 123\n\n @wa.on_message\n def shared_data_handler(_: WhatsApp, m: types.Message):\n m.shared_data[\"key", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "ValueError, match=\"Expected 2 cards in Carousel parameters, but got 1.\")", + "got": "pytest.raises(", + "got_raw": " pytest.raises(\n ValueError,\n match=\"Missing parameters for CarouselCard component.\",\n ):\n t = Template(\n name=\"test_template_with_carousel_card\",\n language=TemplateLanguage.ENGLISH_US,\n category=TemplateCategory.MARKETING,\n components=[\n Carousel(\n cards=[\n CarouselCard(\n components=[\n BodyText(\n \"Hello {{name}}\",\n name=\"User\",\n )\n ]\n )\n ]\n )\n ],\n )\n t.validate_params(params=None)\n\n with pytest.raises(\n ValueError,\n match=\"Missing parameters for CarouselCard component.\",\n ):\n t = Template", + "exact_match": false, + "code_bleu": 0.2014250264904512, + "edit_similarity": 0.16279069767441862, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "{\"type\": \"string\"}", + "got": "1", + "got_raw": "1\n assert encoder._get_json_type(1) == 2\n assert encoder._get_json_type(True) == 3\n assert encoder._get_json_type(None) == 4\n assert encoder._get_json_type(FlowStr(\"Example\")) == 5\n assert encoder._get_json_type(FlowStr(\"Example\", \"test\")) == 6\n assert encoder._get_json_type(FlowStr(\"Example\", \"test\", \"test\")) == 7\n assert encoder._get_json_type(FlowStr(\"Example\", \"test\", \"test\", \"test\")) == 8\n", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "class_with_parentheses_args", + "got": "1 == len(wa._handlers)", + "got_raw": "1 == len(wa._handlers)\n assert isinstance(wa._handlers[0], handlers.MessageHandler)\n\n @WhatsApp.on_message(filters.text) # @WhatsApp.on_x(filters) with kw\n def class_with_parentheses_args(_, __, **kwargs): ...\n\n module.__dict__[\"on_message\"] = class_with_parentheses_args\n wa = WhatsApp(server=None, verify_token=\"1234567890\", handlers_modules=[module])\n\n assert 1 == len(wa._handlers)\n assert isinstance(wa._handlers[0], handlers.MessageHandler)\n\n @WhatsApp.on_message", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.24489795918367346, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "data.get(\"href\")", + "got": "", + "got_raw": " # type: ignore\n assert exc.title == data[\"title\"]\n except AssertionError as e:\n print(f\"Failed for {exc_typ.__name__}: {e}\")\n raise\n\n\n# File: pywa/api.py\n def get_business_account_id(self, phone_id: str) -> dict[str, str]:\n \"\"\"\n Get the business account ID for a phone number.\n\n - Read more at `developers.facebook.com `_.\n\n Return example::\n\n {\n \"business_account_id\": \"123456789", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "h", + "got": "", + "got_raw": " # type: ignore\n assert wa._handlers[handlers.MessageHandler][1] is # type: ignore\n assert wa._handlers[handlers.MessageHandler][2] is # type: ignore\n\n assert wa._handlers[handlers.CallbackButtonHandler][0] is # type: ignore\n assert wa._handlers[handlers.CallbackButtonHandler][1] is # type: ignore\n assert wa._handlers[handlers.CallbackButtonHandler][2] is # type: ignore\n\n assert wa._handlers[handlers.CallbackSelectionHandler][0] is # type: ignore\n assert wa._handlers", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "\"abc\"", + "got": "assert client.phone_id == PHONE_ID", + "got_raw": "<|fim_suffix|>\n assert client.phone_id == PHONE_ID\n client.phone_id = \"abc\"\n\n assert client.phone_id == \"abc\"\n\ndef test_api(client):\n api = client.api\n assert api == client._api\n\n client.api = \"abc\"\n\n assert api == \"abc\"\n\ndef test_server(client):\n assert client.server is None\n client.server = \"abc\"\n\n assert client.server == \"abc\"\n\ndef test_callback_url(client):\n assert client.callback_url is None\n client.callback_url = \"abc\"\n\n assert client.callback_url == \"abc\"\n\ndef test_verify_token(client):\n assert client", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.10256410256410256, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "\"manual\"", + "got": "wa_async.listen(", + "got_raw": "<|fim_suffix|>\n wa_async.listen(\n to=identifier, filters=filters.true, cancelers=filters.false, timeout=0.3\n )\n\n assert exc_info.value.reason == \"manual\"\n\ndef test_listener_canceled_async(wa_async: WhatsAppAsync):\n identifier = DummyUpdate().listener_identifier\n\n def stop_listener():\n time.sleep(0.1)\n wa_async.stop_listening(to=identifier, reason=\"manual\")\n\n threading.Thread(target=stop_listener).start()\n with pytest.raises(ListenerCanceled) as exc_info:\n wa_async.listen(\n to=identifier, filters=filters.true, cancel", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "david-lev/pywa", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n CallbackData()\n\n\ndef test_callback_class_not_empty():\n \"\"\"Test if the callback data is empty.\"\"\"\n\n with pytest.raises(NotImplementedError):\n CallbackData()\n\n\ndef test_callback_class_not_empty():\n \"\"\"Test if the callback data is empty.\"\"\"\n\n with pytest.raises(NotImplementedError):\n CallbackData()\n\n\ndef test_callback_class_not_empty():\n \"\"\"Test if the callback data is empty.\"\"\"\n\n with pytest.raises(NotImplementedError):\n CallbackData()\n\n\ndef test_callback_class_not_empty():\n \"\"\"Test if the callback data is empty.\"\"\"\n\n with pytest.raises(NotImplementedError):\n CallbackData()\n\n\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "\"dbos-toolbox\"", + "got": "0", + "got_raw": "0\n\n # dbos init my-app -t dbos-app-starter\n project_name, template = _resolve_project_name_and_template(\n project_name=\"my-app\",\n template=\"dbos-app-starter\",\n config=False,\n git_templates=git_templates,\n templates_dir=templates_dir,\n )\n assert project_name == \"my-app\"\n\n assert template == 1\n\n # dbos init my-app -t dbos-cron-starter\n project_name, template = _resolve_project_name_and_template(\n project_name=\"my-app\",\n template=\"dbos-cron-starter\",\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "wfid", + "got": "wfid", + "got_raw": " wfid\n assert list_results[0].status == \"PENDING\"\n\n handle = client.get_workflow(wfid)\n assert handle.get_status() == \"PENDING\"\n\n handle = client.get_workflow(wfid)\n assert handle.get_status() == \"SUCCESS\"\n\n list_results = client.list_workflows()\n assert len(list_results) == 1\n\n assert list_results[0].workflow_id == wfid\n assert list_results[0].status == \"SUCCESS\"\n\n handle = client.get_workflow(wfid)\n assert handle.get_status() == \"SUCCESS\"\n\n handle = client.get_workflow(wfid)\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "\"1\"", + "got": "1", + "got_raw": "1\n\n return \"test_workflow\"\n\n\ndef test_workflow() -> None:\n dbos = DBOS()\n dbos.start()\n dbos.workflow(test_workflow)\n dbos.stop()\n\n\ndef test_workflow_with_args() -> None:\n dbos = DBOS()\n dbos.start()\n dbos.workflow(test_workflow_with_args)\n dbos.stop()\n\n\ndef test_workflow_with_args_and_kwargs() -> None:\n dbos = DBOS()\n dbos.start()\n dbos.workflow(test_workflow_with_args_and_kwargs)\n dbos.stop()\n\n\ndef test_workflow_with_args_and_kwargs_and_serializer() -> None:\n db", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "\"None!\"", + "got": "1", + "got_raw": "1\n\n async def testExceptionAction() -> None:\n raise Exception(\"Trouble?\")\n\n async def testExceptionAction2() -> None:\n raise Exception(\"Trouble?\")\n\n async def testExceptionAction3() -> None:\n raise Exception(\"Trouble?\")\n\n async def testExceptionAction4() -> None:\n raise Exception(\"Trouble?\")\n\n async def testExceptionAction5() -> None:\n raise Exception(\"Trouble?\")\n\n async def testExceptionAction6() -> None:\n raise Exception(\"Trouble?\")\n\n async def testExceptionAction7() -> None:\n raise", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "\"value\"", + "got": "\"value\"", + "got_raw": " \"value\"\n\ndef test_role_tracing_with_dbos() -> None:\n # Set up a simple in-memory span exporter for testing\n exporter = InMemorySpanExporter()\n span_processor = SimpleSpanProcessor(exporter)\n provider = tracesdk.TracerProvider()\n provider.add_span_processor(span_processor)\n\n def function_to_trace() -> None:\n with provider.get_tracer(__name__).start_as_current_span( # pyright: ignore\n \"test-span\"\n ) as span:\n span.set_attribute(\"testattribute\", \"value\")\n\n # Clear any existing spans\n exporter.clear()\n\n #", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "27", + "got": "27", + "got_raw": "27\n assert translated_config[\"database\"][\"db_engine_kwargs\"] == config[\"db_engine_kwargs\"]\n\n assert translated_config[\"runtimeConfig\"][\"admin_port\"] == 8001\n assert translated_config[\"runtimeConfig\"][\"run_admin_server\"] == False\n\n assert translated_config[\"telemetry\"][\"OTLPExporter\"][\"tracesEndpoint\"] == [\n \"http://otel:7777\",\n ]\n assert translated_config[\"telemetry\"][\"OTLPExporter\"][\"logsEndpoint\"] == []\n\n assert translated_config[\"telemetry\"][\"OTLPExporter\"][\"tracesEndpoint\"] == [\n \"http://otel:77", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "0", + "got": "0", + "got_raw": "0\n\n # Test for roles set into span\n # Get the spans that were recorded\n spans = exporter.get_finished_spans()\n\n # Assert that we have two spans\n # One is the handler span\n # The other is the WF span\n assert len(spans) == 2\n assert spans[0].context is not None\n assert spans[1].context is not None\n\n span = spans[1]\n assert span.name == \"/user/b\"\n assert span.attributes is not None\n\n span = spans[0]\n assert span.name == test_user_endpoint", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "1", + "got": "1", + "got_raw": "1\n wf = wfs[0]\n assert wf[\"workflow_uuid\"] == phase1_wfid\n assert wf[\"name\"] == \"ser_restart_workflow\"\n assert wf[\"status\"] == \"PENDING\"\n assert wf[\"inputs\"] == {\"val\": \"phase1\"}\n assert wf[\"outputs\"] == {\"result\": \"result_phase1\"}\n assert wf[\"error\"] is None\n assert wf[\"serialization\"] == DBOSDefaultSerializer.name()\n\n # ======= PHASE 2: Custom JSON serializer =======\n DBOS.destroy(destroy_registry=True)\n dbos_inst = DBOS(\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "2)", + "got": "3)", + "got_raw": "3)\n self.assertEqual(n1.day, 1)\n self.assertEqual(n1.hour, 12)\n self.assertEqual(n1.minute, 0)\n self.assertEqual(n1.second, 0)\n\n def testMonth(self):\n base = datetime(2010, 2, 24, 12, 9)\n itr = croniter(\"0 0 1 * *\", base)\n n1 = itr.get_next(datetime)\n self.assertEqual(n1.month, 3)\n self.assertEqual(n1.day, 1)\n self.assertEqual(n1.hour, 12", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "4", + "got": "2", + "got_raw": "2\n assert metrics[0].metric_type == \"workflow_count\"\n assert metrics[0].metric_name == \"test_workflow_a\"\n assert metrics[0].value == 2\n assert metrics[1].metric_type == \"workflow_count\"\n assert metrics[1].metric_name == \"test_workflow_b\"\n assert metrics[1].value == 1\n assert metrics[0].metric_type == \"step_count\"\n assert metrics[0].metric_name == \"test_step_x\"\n assert metrics[0].value == 2\n assert metrics[1].metric_type == \"step_count", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "\"Yay!\"", + "got": "\"Yay!\"", + "got_raw": " \"Yay!\"\n dbos._sys_db.update_workflow_outcome(\"testWorkflow\", \"PENDING\")\n dbos._sys_db.update_workflow_outcome(\"testWorkflow\", \"PENDING\")\n dbos._sys_db.update_workflow_outcome(\"testWorkflow\", \"PENDING\")\n dbos._sys_db.update_workflow_outcome(\"testWorkflow\", \"PENDING\")\n dbos._sys_db.update_workflow_outcome(\"testWorkflow\", \"PENDING\")\n dbos._sys_db.update_workflow_outcome(\"testWorkflow\", \"PENDING\")\n dbos._sys_db.update_workflow_outcome(\"testWorkflow\", \"P", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "5", + "got": "5", + "got_raw": "5\n time.sleep(5)\n assert wf_counter == val + 3\n # Deactivate--scheduled workflow should stop\n response = requests.get(\"http://localhost:3001/deactivate\", timeout=5)\n assert response.status_code == 200\n for event in dbos.poller_stop_events:\n assert event.is_set()\n # Verify the scheduled workflow does not run anymore\n time.sleep(5)\n assert wf_counter == val + 3\n # Deactivate--scheduled workflow should stop\n response = requests.get(\"http://localhost:3001", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "2", + "got": "2", + "got_raw": "2\n assert stepi[0].step_id == 1\n assert stepi[0].step_name == \"test_workflow\"\n assert stepi[0].step_type == \"workflow\"\n assert stepi[0].step_status == StepStatus.PENDING.value\n assert stepi[0].step_parent_id is None\n assert stepi[0].step_parent_name is None\n assert stepi[0].step_parent_type is None\n assert stepi[0].step_parent_status is None\n assert stepi[0].step_parent_step_id is None\n assert stepi", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "\"plain_password\")", + "got": "", + "got_raw": "\n\n\n# File: dbos/_dbos_config.py\nimport os\nimport re\nfrom importlib import resources\nfrom typing import Any, Dict, List, Optional, TypedDict, cast\n\nimport sqlalchemy as sa\nimport yaml\nfrom sqlalchemy import make_url\n\nfrom dbos._serialization import Serializer\n\nfrom ._error import DBOSInitializationError\nfrom ._logger import dbos_logger\nfrom ._schemas.system_database import SystemSchema\n\nDBOS_CONFIG_PATH = \"dbos-config.yaml\"\n\n\nclass DBOSConfig(TypedDict, total=False):\n \"\"\"\n Data structure containing the DBOS library configuration.\n\n Attributes:\n name (", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "1", + "got": "1", + "got_raw": "1\n assert wfl[0].workflow_id == \"test_workflow\"\n assert wfl[0].workflow_fid == 0\n assert wfl[0].workflow_status == WorkflowStatus.ACTIVE\n\n # Test for roles set into span\n # Get the spans that were recorded\n spans = exporter.get_finished_spans()\n\n # Assert that we have two spans\n # One is the handler span\n # The other is the WF span\n assert len(spans) == 2\n assert spans[0].context is not None\n assert spans[1].context is", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "\"a\"", + "got": "\"a\"", + "got_raw": " \"a\"\n assert response.json.get(\"res2\") == \"b\"\n assert response.json.get(\"id1\") == wfuuid\n assert response.json.get(\"id2\") == wfuuid\n\n response = client.get(\"/a/b\", headers={\"dbos-idempotency-key\": wfuuid})\n assert response.status_code == 200\n assert response.json is not None\n\n assert response.json.get(\"res1\") == \"a\"\n assert response.json.get(\"res2\") == \"b\"\n assert response.json.get(\"id1\") == wfuuid\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "\"This is a secret_password test\")", + "got": "\"This is a secret_password test\")", + "got_raw": " \"This is a secret_password test\")\n\n def test_substitute_env_vars_with_missing_docker_secret(self) -> None:\n # Mock the /run/secrets/ path\n with patch(\"os.path.exists\") as mock_exists:\n mock_exists.return_value = False\n content = \"This is a ${DOCKER_SECRET:db_password} test\"\n result = _substitute_env_vars(content, silent=True)\n\n self.assertEqual(result, \"This is a ${DOCKER_SECRET:db_password} test\")\n\n def test_substitute_env_vars_with_invalid_docker_secret(self) -> None:\n # Create a mock Docker secret", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "input_val", + "got": "5", + "got_raw": "5\n assert steps_completed == 2\n\n # Resume the workflow async again\n async_handle = await DBOS.resume_workflow_async(wfid)\n\n assert (await async_handle.get_result()) == 5\n assert steps_completed == 2\n\n # Resume the workflow async again\n async_handle = await DBOS.resume_workflow_async(wfid)\n\n assert (await async_handle.get_result()) == 5\n assert steps_completed == 2\n\n # Resume the workflow async again\n async_handle = await DBOS.resume_workflow_async(wfid)\n\n assert (await async_handle.get_result()) == 5\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "5", + "got": "5 * queued_steps", + "got_raw": "5 * queued_steps\n assert step_enqueues == 5 * queued_steps\n\n # Stop the workflow. Verify that the steps are still running.\n with SetWorkflowID(wfid):\n original_handle = DBOS.start_workflow(inst.test_workflow)\n original_handle.get_result()\n\n assert step_counter == 5 * queued_steps\n assert step_enqueues == 5 * queued_steps\n\n # Start the workflow again. Verify that the steps are still running.\n with SetWorkflowID(wfid):\n original_handle = DBOS.start_workflow(inst.test_workflow)\n original_handle.get_result()\n\n assert step_counter == 5", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "dbos-inc/dbos-transact-py", + "expected": "None", + "got": "", + "got_raw": " # type: ignore\n assert stati.class_name and \"DBOSTestWrapperMethods\" in stati.class_name\n\n # Test wrapper class methods\n wrapper_inst = DBOSTestWrapperMethods(\"dynamicconfig\")\n res = wrapper_inst.test_workflow(\"x\", \"y\")\n assert res == \"y1x\"\n\n wh = DBOS.start_workflow(wrapper_inst.test_workflow, \"x\", \"y\")\n assert wh.get_result() == \"y1x\"\n stati = DBOS.get_workflow_status(wh.get_workflow_id())\n assert stati\n\n assert stati.config_name is # type: ignore\n assert stati", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "2", + "got": "2", + "got_raw": "2\n assert decoder_locs.shape[1] == 2\n assert decoder_locs[0, 0] == 0\n assert decoder_locs[0, 1] == 1\n assert decoder_locs[1, 0] == 1\n assert decoder_locs[1, 1] == 2\n\n # Check encoder-to-decoder mapping\n encoder_to_decoder_map = components[\"encoder_to_decoder_map\"]\n assert encoder_to_decoder_map.shape[0] == act_matrix._nnz()\n assert encoder_to_decoder_map.shape[1] == 2\n assert encoder_to_decoder", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "3", + "got": "3", + "got_raw": "3\n assert graph_tensor.logit_targets[0].token_str == \"\"\n assert graph_tensor.logit_targets[0].vocab_idx == 262\n assert graph_tensor.logit_targets[1].token_str == \"\"\n assert graph_tensor.logit_targets[1].vocab_idx == 290\n assert graph_tensor.logit_targets[2].token_str == \"\"\n assert graph_tensor.logit_targets[2].vocab_idx == 314\n\n # Test with LogitTarget list using non-empty token strings\n graph_tensor = Graph(\n input_string=\"test\",\n input_tokens=torch", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "n_active", + "got": "512", + "got_raw": "512\n assert components[\"decoder_vecs\"].shape[0] == n_active\n\n # Check encoder_to_decoder_map\n assert components[\"encoder_to_decoder_map\"].shape == (n_active,)\n assert components[\"encoder_to_decoder_map\"].dtype == torch.int64\n\n # Check decoder_locations\n assert components[\"decoder_locations\"].shape == (2, n_active)\n assert components[\"decoder_locations\"].dtype == torch.int64\n\n # Check token vectors\n assert components[\"token_vectors\"].shape == (n_pos, d_model)\n assert components[\"token_vectors\"].dtype == torch.float3", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "components", + "got": "components", + "got_raw": " components\n assert \"reconstruction\" in components\n assert \"encoder_vecs\" in components\n assert \"decoder_vecs\" in components\n assert \"encoder_to_decoder_map\" in components\n assert \"decoder_locations\" in components\n\n # Verify that the decoder locations are correct\n decoder_locations = components[\"decoder_locations\"]\n assert decoder_locations.shape == (n_layers, 2)\n assert decoder_locations[0, 0] == 0\n assert decoder_locations[0, 1] == 0\n assert decoder_locations[1, 0] == 0\n assert decoder", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "expected_token_strs[1]", + "got": "assert torch.equal(loaded_graph.activation_values, torch.tensor([1.5]))", + "got_raw": "<|fim_suffix|>\n assert torch.equal(loaded_graph.activation_values, torch.tensor([1.5]))\n assert loaded_graph.scan == \"test_scan\"\n assert loaded_graph.n_pos == 3\n finally:\n os.remove(tmp_path)\n\n\ndef test_compute_node_influence():\n \"\"\"Test that compute_node_influence works as expected.\"\"\"\n # Create a simple graph with 3 nodes\n adjacency_matrix = torch.tensor([[0, 1, 0], [0, 0, 1], [1, 0, 0]])\n logit_weights = torch.tensor([0.5, 0.3,", + "exact_match": false, + "code_bleu": 0.07535838128770536, + "edit_similarity": 0.34408602150537637, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "(batch_size * seq_len, 512)", + "got": "e, lazy_encoder=lazy_enc, lazy_decoder=lazy_dec, device=torch.device(\"cpu\")", + "got_raw": "<|fim_suffix|>e, lazy_encoder=lazy_enc, lazy_decoder=lazy_dec, device=torch.device(\"cpu\")\n )\n\n # Test encode\n encoded = transcoder.encode(test_input)\n\n assert encoded.shape == (batch_size, seq_len, d_model)\n\n # Test decode\n decoded = transcoder.decode(encoded)\n\n assert decoded.shape == (batch_size, seq_len, d_model)\n\n # Test decode with skip connection\n if transcoder.W_skip is not None:\n decoded_skip = transcoder.decode(encoded, skip_connection=True)\n\n assert decoded_skip.shape == (batch_size, seq_len, d_model)\n\n ", + "exact_match": false, + "code_bleu": 0.08097785064266204, + "edit_similarity": 0.0784313725490196, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "(len(feat_ids), lazy_clt.n_layers, lazy_clt.d_model)", + "got": "", + "got_raw": "<|fim_suffix|>\n # Test decoder access for layer 0 (writes to all layers)\n layer_id = 0\n\n # Full access\n lazy_full = lazy_clt._get_decoder_vectors(layer_id)\n eager_full = eager_clt._get_decoder_vectors(layer_id)\n assert torch.allclose(lazy_full, eager_full)\n assert lazy_full.shape == (\n lazy_clt.d_transcoder,\n lazy_clt.n_layers,\n lazy_clt.d_model,\n )\n\n # Slice access\n feat_ids = torch.tensor([10, 50, 100, 200", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "str_without_acts", + "got": "\"Fait: Michael Jordan joue au\"", + "got_raw": " \"Fait: Michael Jordan joue au\"\n assert str_without_acts == \"Fait: Michael Jordan joue au\"\n\n assert logits_with_activations.shape == logits_without_activations.shape\n assert logits_with_activations.shape == (1, 10000, 30000)\n assert logits_without_activations.shape == (1, 10000, 30000)\n\n assert activations.shape == (1, 10000, 30000)\n assert no_activations.shape == (1, 100", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2608695652173913, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "2", + "got": "2", + "got_raw": "2\n assert decoder_locs.shape[1] == 2\n assert decoder_locs[0, 0] == 0\n assert decoder_locs[0, 1] == 1\n assert decoder_locs[1, 0] == 1\n assert decoder_locs[1, 1] == 2\n\n # Check encoder-to-decoder mapping\n encoder_to_decoder_map = components[\"encoder_to_decoder_map\"]\n assert encoder_to_decoder_map.shape[0] == act_matrix._nnz()\n assert encoder_to_decoder_map.shape[1] == 2\n assert encoder_to_decoder", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "expected_state[\"W_dec\"].shape", + "got": "assert isinstance(transcoder.W_enc, torch.nn.Parameter)", + "got_raw": "<|fim_suffix|>\n assert isinstance(transcoder.W_enc, torch.nn.Parameter)\n assert \"W_dec\" in transcoder._parameters\n\n # Accessing W_dec should trigger lazy loading\n W_dec = transcoder.W_dec\n\n assert W_dec.shape == expected_state[\"W_dec\"].shape\n assert W_dec.dtype == expected_state[\"W_dec\"].dtype\n assert W_dec.device == expected_state[\"W_dec\"].device\n\n # Accessing W_enc should trigger lazy loading\n W_enc = transcoder.W_enc\n\n assert W_enc.shape == expected_state[\"W_enc\"].shape\n assert W_enc.dtype ==", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.23809523809523808, + "n_retrieved": 10 + }, + { + "repo": "decoderesearch/circuit-tracer", + "expected": "(3,)", + "got": "3", + "got_raw": "3\n assert targets.logit_vectors.shape == 3, targets.logit_vectors.shape\n\n assert targets.logit_targets[0].token_str == \"hello\"\n assert targets.logit_targets[1].token_str == \"world\"\n assert targets.logit_targets[2].token_str == \"test\"\n\ndef test_attribution_targets_str_tuple(mock_data):\n \"\"\"Test AttributionTargets with Sequence[tuple[str, float, torch.Tensor]] input (tuple).\"\"\"\n logits, unembed_proj, tokenizer = mock_data\n targets = AttributionTargets(\n attribution_targets=[(\"hello\", 0.5, torch.randn(", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"a.b=c\"", + "got": "", + "got_raw": " # pyright: ignore[reportUnknownArgumentType]\n \"a%5Bb%5D=c\"\n\n\n@pytest.mark.parametrize(\"method\", [\"class\", \"function\"])\ndef test_nested_brackets(method: str) -> None:\n if method == \"class\":\n serialise = Querystring(nested_format=\"brackets\").stringify\n else:\n serialise = partial(stringify, nested_format=\"brackets\")\n\n\n assert unquote(serialise({\"a\": {\"b\": \"c\"}})) == # pyright: ignore[reportUnknownArgumentType]\n \"a[b]=c\"\n\n\n@pytest.mark.parametrize(\"method", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "obj2[\"foo\"][\"bar\"][0])", + "got": "obj2[\"foo\"][\"bar\"][0])", + "got_raw": " obj2[\"foo\"][\"bar\"][0])\n assert_different_identities(obj1[\"foo\"][\"bar\"][0][\"hello\"], obj2[\"foo\"][\"bar\"][0][\"hello\"])\n\ndef test_complex_nested_list() -> None:\n obj1 = [{\"foo\": {\"bar\": [{\"hello\": \"world\"}]}}]\n obj2 = deepcopy_minimal(obj1)\n assert_different_identities(obj1, obj2)\n assert_different_identities(obj1[0], obj2[0])\n assert_different_identities(obj1[0][\"foo\"], obj2[0][\"foo\"])\n assert_different_identities(obj1[0", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"org/project\"", + "got": "\"org/project\"", + "got_raw": " \"org/project\"\n assert spec.version == \"v1\"\n\n def test_slug_with_underscore_rejected_by_pattern(self) -> None:\n \"\"\"Slug pattern doesn't allow _ - use from_slug() for version parsing.\"\"\"\n with pytest.raises(ValidationError) as exc_info:\n MCPServerWireSpec(slug=\"org/project_v1\", version=\"v2\")\n assert \"string_pattern_mismatch\" in str(exc_info.value).lower()\n\n # Correct way: use from_slug() which parses the version\n spec = MCPServerWireSpec.from_slug(\"org/project_v1\")\n\n assert spec.slug == \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"github\"", + "got": "\"github\"", + "got_raw": " \"github\"\n assert result[\"url\"] == \"https://api.github.com\"\n assert result[\"timeout\"] == 60000\n\n def test_with_dict(self) -> None:\n \"\"\"Serialize dict with to_dict().\"\"\"\n conn = MockConnection(\"github\", \"https://api.github.com\", 60000)\n\n result = serialize_connection(conn.to_dict())\n\n assert result[\"name\"] == \"github\"\n assert result[\"url\"] == \"https://api.github.com\"\n assert result[\"timeout\"] == 60000\n\n def test_with_string(self) ->", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "15000", + "got": "15000", + "got_raw": "15000\n\n def test_to_dict(self) -> None:\n \"\"\"Extract fields from object with to_dict().\"\"\"\n\n class Connection:\n name = \"connection\"\n base_url = \"https://connection.api.com\"\n timeout_ms = 15000\n to_dict = lambda self: {\"name\": self.name, \"base_url\": self.base_url, \"timeout_ms\": self.timeout_ms}\n\n result = serialize_connection(Connection())\n\n assert result[\"name\"] == \"connection\"\n assert result[\"base_url\"] == \"https://connection.api.com\"\n\n assert result[\"timeout_ms\"] ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "expected", + "got": "assert result is expected", + "got_raw": "<|fim_suffix|>\n assert result is expected\n\n\n@pytest.mark.parametrize(\n \"content, expected\",\n [\n (\"123\", 123),\n (\"123.456\", 123.456),\n (\"123.456e-123\", 123.456e-123),\n (\"123.456e+123\", 123.456e+123),\n (\"123.456e123\", 123.4", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.48484848484848486, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "True", + "got": "", + "got_raw": " # type: ignore\n assert response.is_sse_stream is False\n assert response.is_stream is False\n assert response.is_async is False\n assert response.is_async_stream is False\n assert response.is_streaming is False\n assert response.is_async_streaming is False\n assert response.is_sse is False\n assert response.is_async_sse is False\n assert response.is_sse_streaming is False\n assert response.is_async_sse_streaming is False\n assert response.is_sse_streaming is False\n assert response.is_async_sse_streaming is False\n assert response.is", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "{\"foo\": \"bar\"}", + "got": "{\"foo\": \"bar\"}", + "got_raw": " {\"foo\": \"bar\"}\n\n # pathlib.Path objects are left as-is\n\n assert await transform({\"foo\": SAMPLE_FILE_PATH}, TypedDictBase64Input, use_async) == {\"foo\": SAMPLE_FILE_PATH}\n\n # bytes are left as-is\n\n assert await transform({\"foo\": b\"bar\"}, TypedDictBase64Input, use_async) == {\"foo\": b\"bar\"}\n\n # io.BytesIO objects are left as-is\n\n assert await transform({\"foo\": io.BytesIO(b\"bar\")}, TypedDictBase64Input, use_async) == {\"foo\": io.BytesIO", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "1", + "got": "1", + "got_raw": "1\n assert pairs[0][0] == \"api\"\n assert pairs[0][1] == {\"key\": \"xxx\"}\n\n def test_with_list_inputs(self) -> None:\n \"\"\"Works with list inputs too.\"\"\"\n connections = [{\"name\": \"api\"}]\n secrets = [{\"connection_name\": \"api\", \"values\": {\"key\": \"xxx\"}}]\n\n pairs = match_credentials_to_connections(connections, secrets)\n\n\n assert len(pairs) == 1\n assert pairs[0][0] == \"api\"\n assert pairs[0][1] == {\"key\": \"xxx\"}\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"a\"", + "got": "\"a\"", + "got_raw": " \"a\"\n assert foo() is None\n with pytest.raises(TypeError):\n foo(1)\n\ndef test_keyword_param() -> None:\n @required_args([\"b\"])\n def foo(a: str | None = None, b: str | None = None) -> str | None:\n return b\n\n\n assert foo(\"a\") is None\n assert foo(a=\"a\") == \"a\"\n assert foo(b=\"a\") == \"a\"\n assert foo(a=\"a\", b=\"a\") == \"a\"\n with pytest.raises(TypeError):\n foo(\"a\", \"a\")\n\ndef", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "None", + "got": "assert isinstance(completion.choices[0].message, ParsedChatCompletionMessage)", + "got_raw": "<|fim_suffix|>\n assert isinstance(completion.choices[0].message, ParsedChatCompletionMessage)\n assert completion.choices[0].message.role == \"assistant\"\n assert completion.choices[0].message.content == \"San Francisco\"\n assert completion.choices[0].message.units == \"f\"\n assert completion.choices[0].message.temperature == 65\n\n @pytest.mark.respx(base_url=base_url)\n def test_parse_pydantic_model_with_refusal(self, client: Dedalus, respx_mock: MockRouter) -> None:\n \"\"\"Test parsing a response into a Pydantic model.\"\"\"\n respx", + "exact_match": false, + "code_bleu": 0.07432998184513635, + "edit_similarity": 0.07407407407407407, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"a=true\"", + "got": "\"a=true\"", + "got_raw": " \"a=true\"\n assert stringify({\"a\": False}) == \"a=false\"\n\n assert stringify({\"a\": 1.0}) == \"a=1.0\"\n assert stringify({\"a\": 1.1}) == \"a=1.1\"\n\n assert stringify({\"a\": None}) == \"a=\"\n assert stringify({\"a\": \"\"}) == \"a=\"\n\n assert stringify({\"a\": [1, 2, 3]}) == \"a=1&a=2&a=3\"\n assert stringify({\"a\": [1, 2, 3], \"b\": [4", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"hello!\"", + "got": "2", + "got_raw": "2\n assert obj.bar == \"hello!\"\n\ndef test_response_parse_custom_model_async(client: AsyncDedalus) -> None:\n response = AsyncAPIResponse(\n raw=httpx.Response(200, content=json.dumps({\"foo\": \"hello!\", \"bar\": 2})),\n client=client,\n stream=False,\n stream_cls=None,\n cast_to=str,\n options=FinalRequestOptions.construct(method=\"get\", url=\"/foo\"),\n )\n\n obj = await response.parse(to=CustomModel)\n\n assert obj.foo == 2\n assert obj.bar == \"hello!\"\n\ndef test_response_parse_custom", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"v1.2.0\"", + "got": "1.2", + "got_raw": "1.2\n assert spec.slug == \"dedalus-labs/example-server\"\n\n def test_from_slug_without_version(self) -> None:\n \"\"\"Slug without explicit version parameter.\"\"\"\n spec = MCPServerWireSpec.from_slug(\"dedalus-labs/example-server\")\n\n assert spec.version == 1.0\n assert spec.slug == \"dedalus-labs/example-server\"\n\n def test_from_slug_with_invalid_version(self) -> None:\n \"\"\"Slug with invalid version parameter.\"\"\"\n with pytest.raises(ValueError):\n MCPServerWireSpec.from_slug(\"dedalus-labs/example-server\", version=\"v1.2.", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5454545454545454, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"in=foo,bar\"", + "got": "\"in=foo&in=bar\"", + "got_raw": " \"in=foo&in=bar\"\n assert unquote(serialise({\"in\": [\"foo\", \"bar\", \"baz\"]})) == \"in=foo&in=bar&in=baz\"\n assert unquote(serialise({\"in\": [\"foo\", \"bar\", \"baz\", \"qux\"]})) == \"in=foo&in=bar&in=baz&in=qux\"\n assert unquote(serialise({\"in\": [\"foo\", \"bar\", \"baz\", \"qux\", \"quux\"]})) == \"in=foo&in=bar&in=baz&", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8148148148148148, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "_ENVELOPE_VERSION", + "got": "0x01", + "got_raw": "0x01\n\n nonce = envelope[1:1+NONCE_LEN]\n ciphertext = envelope[1+NONCE_LEN:]\n\n assert len(ciphertext) == key_size - _TAG_LEN\n\n tag = envelope[-_TAG_LEN:]\n\n assert len(tag) == _TAG_LEN\n\n assert len(nonce) == NONCE_LEN\n\n assert len(ciphertext) == key_size - _TAG_LEN\n\n assert len(tag) == _TAG_LEN\n\n assert len(nonce) == NONCE_LEN\n\n assert len(ciphertext) == key_size - _TAG_LEN\n\n assert len(tag) ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "\"ping\"", + "got": "\"ping\"", + "got_raw": " \"ping\"\n assert sse.data == \"\"\n assert sse.id is None\n assert sse.retry is None\n\n\n@pytest.mark.asyncio\n@pytest.mark.parametrize(\"sync\", [True, False], ids=[\"sync\", \"async\"])\nasync def test_event_with_data(sync: bool, client: Dedalus, async_client: AsyncDedalus) -> None:\n def body() -> Iterator[bytes]:\n yield b\"event: ping\\n\"\n yield b\"data: Hello, world!\\n\"\n yield b\"\\n\"\n\n iterator = make_event_iterator(content=body(), sync=sync, client=client,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedalus-labs/dedalus-sdk-python", + "expected": "6", + "got": "6", + "got_raw": "6\n assert copied.max_retries == 7\n\n def test_copy_non_default_options(self, client: Dedalus) -> None:\n # options that don't have a default are not overridden\n copied = client.copy(max_retries=7)\n assert copied.max_retries == 7\n assert client.max_retries == 0\n\n copied2 = copied.copy(max_retries=6)\n\n assert copied2.max_retries == 6\n assert copied.max_retries == 7\n\n def test_copy_non_default_options(self, client: Dedalus) -> None:\n # options that don", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "[0, 2]", + "got": "0", + "got_raw": "0\n assert data_model._interaction_indices == [[0, 1]]\n\n data_model = DataModel(\n [\n dedupe.variables.String(field=\"a\", name=\"a\"),\n dedupe.variables.String(field=\"b\", name=\"b\", has_missing=True),\n dedupe.variables.Interaction(\"a\", \"b\"),\n ]\n )\n\n assert data_model._missing_field_indices == 1\n assert data_model._interaction_indices == [[0, 1]]\n\n data_model = DataModel(\n [\n dedupe.variables.String(field=\"a\", name=\"a\"),\n dedupe.variables.String(field=\"b\",", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "{\"0\"}", + "got": "{\"0\"}", + "got_raw": " {\"0\"}\n assert fn.commonIntegerPredicate(\"g00fy 1992\") == {\"1992\"}\n\n assert fn.commonIntegerPredicate(\"g00fy 1992 1993\") == {\"1992\", \"1993\"}\n\n assert fn.commonIntegerPredicate(\"g00fy 1992 1993 1994\") == {\"1992\", \"1993\", \"1994\"}\n\n assert fn.commonIntegerPredicate(\"g00fy 1", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "1", + "got": "1", + "got_raw": "1\n\n def test_comparator(self):\n var = ExistsType(\"foo\")\n\n assert var.comparator(None, None) == 0\n assert var.comparator(None, 1) == 1\n assert var.comparator(1, None) == 1\n assert var.comparator(1, 1) == 1\n assert var.comparator(1, 0) == 0\n assert var.comparator(0, 1) == 0\n assert var.comparator(0, 0) == 0\n\n def test_comparator_missing(self):\n var", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "{\"go\"}", + "got": "{\"go-of\"}", + "got_raw": " {\"go-of\"}\n assert fn.firstTokenPredicate(\"go-of y \") == {\"go-of\"}\n assert fn.firstTokenPredicate(\"go-of y \") == {\"go-of\"}\n\n def test_first_two_tokens_predicate(self):\n assert fn.firstTwoTokensPredicate(\"donald\") == {\"donald\"}\n assert fn.firstTwoTokensPredicate(\"don ald\") == {\"donald\"}\n assert fn.firstTwoTokensPredicate(\"do\\nal d\") == {\"do\"}\n\n assert fn.firstTwoTokensPredicate(\"go-of y \") == {\"go-of\"}\n assert fn.firstTwoTokensPredicate(\"go-of y", + "exact_match": false, + "code_bleu": 0.49999999999999994, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "[\"deduplicat\", \"eduplicate\"]", + "got": "\"d\",", + "got_raw": "<|fim_suffix|> \"d\",\n \"e\",\n \"d\",\n \"u\",\n \"p\",\n \"l\",\n \"i\",\n \"c\",\n \"a\",\n \"t\",\n \"e\",\n ]\n assert unique_ngrams(\"deduplicate\", 2) == [\n \"de\",\n \"ed\",\n \"du\",\n \"up\",\n \"pl\",\n \"li\",\n \"ic\",\n \"ca\",\n \"at\",\n \"te\",\n ]\n assert unique_ngrams(\"deduplicate\", 3) == [\n \"ded\",\n \"edu\",\n \"dup", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "IndexError)", + "got": "StopIteration):", + "got_raw": "StopIteration):\n active_learner.pop()\n\n def test_AL_with_labels(self):\n random.seed(1111111111110)\n # Even with random seed, the order of the following seem to be random,\n # so we shouldn't test for exact order.\n EXPECTED_CANDIDATES = [\n ({\"name\": \"Willy\", \"age\": \"35\"}, {\"name\": \"William\", \"age\": \"35\"}),\n ({\"name\": \"Jimmy\", \"age\": \"20\"}, {\"name\": \"Jimbo\", \"age\": \"2", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.23076923076923078, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "self.desired_scored_pairs[\"pairs\"])", + "got": "self.desired_scored_pairs[\"pairs\"])", + "got_raw": " self.desired_scored_pairs[\"pairs\"])\n numpy.testing.assert_almost_equal(scores[\"score\"], self.desired_scored_pairs[\"score\"], decimal=2)\n\n def test_score_duplicates_with_threshold(self):\n scores = dedupe.core.scoreDuplicates(\n self.records, self.data_model.distances, self.classifier, 2, threshold=0.8\n )\n\n numpy.testing.assert_equal(scores[\"pairs\"], self.desired_scored_pairs[\"pairs\"])\n numpy.testing.assert_almost_equal(scores[\"score\"], self.desired_scored_pairs[\"score\"], decimal=2)\n\n def test_score_duplicates_with_threshold_and_weight(self):\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "{\"cc\"}", + "got": "{\"11c\"}", + "got_raw": " {\"11c\"}\n assert fn.sortedAcronym(\"c1p c10p\") == {\"11c\"}\n assert fn.sortedAcronym(\"c1p c10p\") == {\"11c\"}\n assert fn.sortedAcronym(\"c1p c10p\") == {\"11c\"}\n assert fn.sortedAcronym(\"c1p c10p\") == {\"11c\"}\n assert fn.sortedAcronym(\"c1p c10p\") == {\"11c\"}\n assert fn.sortedAcronym(\"c1p c10p\") == {\"1", + "exact_match": false, + "code_bleu": 0.49999999999999994, + "edit_similarity": 0.7692307692307693, + "n_retrieved": 10 + }, + { + "repo": "dedupeio/dedupe", + "expected": "{frozenset([120, 125]), frozenset([130, 135])}", + "got": "{", + "got_raw": " {\n frozenset({100, 105}),\n frozenset({110, 115, 120, 125}),\n frozenset({130, 135}),\n frozenset({140, 145}),\n }\n\n def test_constrained_inverted_index(self):\n blocker = dedupe.blocking.Fingerprinter(\n [\n dedupe.predicates.TfidfTextSearchPredicate(0.0, \"name\"),\n dedupe.predicates.TfidfTextSearchPredicate(0.0, \"age\"),\n", + "exact_match": false, + "code_bleu": 0.031294924079018974, + "edit_similarity": 0.0425531914893617, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "[{\"a\": 1, \"b\": 4}, {\"a\": 2, \"b\": 5}]", + "got": "2", + "got_raw": "2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(2) == 2\n assert df.take(", + "exact_match": false, + "code_bleu": 0.028314455119112403, + "edit_similarity": 0.05405405405405406, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "exec_plan.successful)", + "got": "", + "got_raw": "\n\n\n# File: smallpond/execution/driver.py\nimport argparse\nimport os\nimport socket\nimport sys\nfrom multiprocessing import Process\nfrom typing import List, Optional\n\nfrom loguru import logger\n\nimport smallpond\nfrom smallpond.common import DEFAULT_MAX_FAIL_COUNT, DEFAULT_MAX_RETRY_COUNT\nfrom smallpond.dataframe import DataFrame\nfrom smallpond.execution.task import ExecutionPlan\nfrom smallpond.io.filesystem import load\nfrom smallpond.logical.node import LogicalPlan\n\n\nclass Driver(object):\n \"\"\"\n A helper class that includes boilerplate code to execute a logical plan.\n \"\"\"\n\n def __init__(self) -> None", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "len(exec_plan.final_output.load_partitioned_datasets(npartitions, data_partition_column)))", + "got": ".assertEqual(len(exec_plan), npartitions)", + "got_raw": ".assertEqual(len(exec_plan), npartitions)\n for partition in exec_plan:\n self.assertEqual(partition.schema, input_dataset.schema)\n self.assertEqual(partition.num_rows, input_dataset.num_rows)\n self.assertEqual(partition.num_columns, input_dataset.num_columns)\n self.assertEqual(partition.num_partitions, npartitions)\n self.assertEqual(partition.num_files, input_dataset.num_files)\n self.assertEqual(partition.num_files, input_dataset.num_files)\n self.assertEqual(partition.num_files, input_dataset.num_files)\n self.assertEqual(partition.num_files, input_dataset.num_files)\n self.assertEqual(partition.num_files, input_dataset.num", + "exact_match": false, + "code_bleu": 0.21073102594260032, + "edit_similarity": 0.3816793893129771, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "len(partitioned_datasets))", + "got": "0 if orig_dataset.empty else len(partitioned_datasets))", + "got_raw": "0 if orig_dataset.empty else len(partitioned_datasets))\n\n # check the number of files\n for i, partition_dataset in enumerate(partitioned_datasets):\n self.assertEqual(orig_dataset.num_files, partition_dataset.num_files)\n\n # check the number of rows\n for i, partition_dataset in enumerate(partitioned_datasets):\n self.assertEqual(orig_dataset.num_rows, partition_dataset.num_rows)\n\n # check the number of partitions\n for i, partition_dataset in enumerate(partitioned_datasets):\n self.assertEqual(orig_dataset.num_partitions, partition_dataset.num_partitions)\n\n # check the number of rows in each partition\n for i", + "exact_match": false, + "code_bleu": 0.41722614486115056, + "edit_similarity": 0.6419753086419753, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "arrow_batch_output.num_rows)", + "got": "10 * small_dataset.num_rows)", + "got_raw": "10 * small_dataset.num_rows)\n self.assertEqual(small_partitions.npartitions, 7)\n self.assertEqual(large_partitions.npartitions, 7)\n self.assertEqual(arrow_batch_output.num_rows, 10 * small_dataset.num_rows)\n self.assertEqual(pandas_batch_output.num_rows, 10 * small_dataset.num_rows)\n\n def test_variable_length_input_datasets_with_streaming(self):\n ctx = Context()\n small_dataset = ParquetDataSet([\"tests/data/mock_urls/*.parquet\"])\n large_dataset = ParquetDataSet([\"tests/data/mock_urls/*.parquet\"] * 10)\n small", + "exact_match": false, + "code_bleu": 0.4111336169005197, + "edit_similarity": 0.5357142857142857, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "pa.table({\"c\": [5, 7, 9]})", + "got": "df = sp.from_arrow(pa.table({\"a\": [1, 2, 3], \"b\": [4, 5, 6]}))", + "got_raw": "<|fim_suffix|>\n df = sp.from_arrow(pa.table({\"a\": [1, 2, 3], \"b\": [4, 5, 6]}))\n df1 = df.map(\"a + b as c\")\n\n assert df1.to_arrow() == pa.table({\"c\": [5, 7, 9]})\n\n\ndef test_map_batches(sp: Session):\n df = sp.from_arrow(pa.table({\"a\": [1, 2, 3], \"b\": [4, 5, 6]}))\n df1 = df.map_batches(lambda df: df.to_pandas().apply", + "exact_match": false, + "code_bleu": 0.20299685933250958, + "edit_similarity": 0.4772727272727273, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "sum(dataset.num_rows for dataset in partitioned_datasets))", + "got": ".assertEqual(orig_dataset.num_files, sum([x.num_files for x in partitioned_datasets]))", + "got_raw": ".assertEqual(orig_dataset.num_files, sum([x.num_files for x in partitioned_datasets]))\n self.assertEqual(orig_dataset.num_rows, sum([x.num_rows for x in partitioned_datasets]))\n\n # check the partitioned datasets\n for i, partitioned_dataset in enumerate(partitioned_datasets):\n self.assertEqual(orig_dataset.num_files, partitioned_dataset.num_files)\n self.assertEqual(orig_dataset.num_rows, partitioned_dataset.num_rows)\n self.assertEqual(orig_dataset.columns, partitioned_dataset.columns)\n self.assertEqual(orig_dataset.generated_columns, partitioned_dataset.generated_columns)\n self.assertEqual(orig_dataset.union_by_name, partitioned_dataset.union_by", + "exact_match": false, + "code_bleu": 0.1258220555845937, + "edit_similarity": 0.6527777777777778, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "get_nth_partition(items, 0, 2))", + "got": "get_nth_partition(items, 0, 2))", + "got_raw": " get_nth_partition(items, 0, 2))\n self.assertListEqual([2, 3], get_nth_partition(items, 1, 2))\n # split into 3 partitions\n self.assertListEqual([1], get_nth_partition(items, 0, 3))\n self.assertListEqual([1, 2], get_nth_partition(items, 0, 3))\n self.assertListEqual([2, 3], get_nth_partition(items, 1, 3))\n self.assertListEqual([3], get_nth_partition(items, 2, 3))\n\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "sorted(final_table.column_names))", + "got": ".assertEqual(final_table.num_rows, 1000)", + "got_raw": ".assertEqual(final_table.num_rows, 1000)\n self.assertEqual(final_table.column_names, [\"host\", \"url\", \"filename\", \"file_row_number\"])\n self.assertEqual(final_table.column_types, [arrow.string(), arrow.string(), arrow.string(), arrow.int64()])\n\n def test_hash_partition_task(self):\n ctx = Context()\n # select columns when defining dataset\n dataset = ParquetDataSet([\"tests/data/mock_urls/*.parquet\"], columns=[\"url\"])\n data_files = DataSourceNode(ctx, dataset)\n data_partitions = DataSetPartitionNode(ctx, (data_files,), npartitions=3, partition", + "exact_match": false, + "code_bleu": 0.2777619034011791, + "edit_similarity": 0.5753424657534246, + "n_retrieved": 10 + }, + { + "repo": "deepseek-ai/smallpond", + "expected": "file.schema_arrow.metadata)", + "got": "file.schema_arrow.metadata)", + "got_raw": " file.schema_arrow.metadata)\n\n def test_arrow_schema_metadata_with_large_string(self):\n table = self._load_parquet_files(glob.glob(\"tests/data/arrow/*.parquet\"))\n metadata = {b\"a\": b\"1\", b\"b\": b\"2\"}\n table_with_meta = table.replace_schema_metadata(metadata)\n print(f\"table_with_meta.schema.metadata {table_with_meta.schema.metadata}\")\n\n with tempfile.TemporaryDirectory(dir=self.output_root_abspath) as output_dir:\n self.assertTrue(dump_to_parquet_files(table_with_meta, output_dir, \"arrow_schema_metadata\", max_workers=2))\n par", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "out", + "got": "out", + "got_raw": " out\n\ndef test_manual_override_is_applied_even_if_pronunciation_overrides_stale():\n job = DummyJob()\n job.manual_overrides = [\n {\n \"token\": \"Unfu*k\",\n \"pronunciation\": \"Unfuck\",\n }\n ]\n\n out = _apply(\"He said Unfu*k loudly.\", job)\n\n assert \"Unfuck\" in out\n\ndef test_manual_override_is_applied_even_if_pronunciation_overrides_stale():\n job = DummyJob()\n job.manual_overrides = [\n {\n \"token\": \"Unfu*k\",\n \"pronunciation\": \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "\"Fiction\"", + "got": "\"Fiction\"", + "got_raw": " \"Fiction\"\n assert merged[\"year\"] == None\n\ndef test_merge_metadata_prefers_overrides_and_drops_none_values() -> None:\n extracted = {\"title\": \"Original\", \"artist\": \"Someone\"}\n overrides = {\"artist\": \"Another\", \"genre\": \"Fiction\", \"year\": None}\n\n merged = _merge_metadata(extracted, overrides)\n\n assert merged[\"title\"] == \"Original\"\n assert merged[\"artist\"] == \"Another\"\n\n assert merged[\"genre\"] == \"Fiction\"\n assert merged[\"year\"] == None\n\ndef test_merge_metadata_prefers_overrides", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "\"Summary text\"", + "got": "\"Summary text\"", + "got_raw": " \"Summary text\"\n\ndef test_opds_metadata_overrides_maps_series_and_series_index() -> None:\n overrides = _opds_metadata_overrides(\n {\n \"authors\": [\"Alexandre Dumas\"],\n \"subtitle\": \"Unabridged\",\n \"series\": \"Example\",\n \"series_index\": 2,\n \"tags\": [\"Fiction\", \"Classic\"],\n \"summary\": \"Summary text\",\n }\n )\n\n assert overrides[\"series\"] == \"Example\"\n assert overrides[\"series_index\"] == \"2\"\n\n # Existing behavior still present\n assert overrides[\"authors\"] == \"Alexandre D", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "\"Alexandre Dumas\"", + "got": "[\"Alexandre Dumas\"]", + "got_raw": " [\"Alexandre Dumas\"]\n assert overrides[\"subtitle\"] == \"Unabridged\"\n assert overrides[\"series\"] == \"Example\"\n assert overrides[\"series_index\"] == 2\n assert overrides[\"tags\"] == [\"Fiction\", \"Classic\"]\n assert overrides[\"summary\"] == \"Summary text\"\n\n\ndef test_opds_metadata_overrides_maps_author_and_subtitle_with_series() -> None:\n overrides = _opds_metadata_overrides(\n {\n \"authors\": [\"Alexandre Dumas\"],\n \"subtitle\": \"Unabridged\",\n \"series\": \"Example\",\n \"series_index\": 2,\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.9444444444444444, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "\"All Caps Title\"", + "got": "\"all caps title\"", + "got_raw": " \"all caps title\"\n assert changed\n\ndef test_normalize_chapter_opening_caps_basic_title_with_italics() -> None:\n normalized, changed = _normalize_chapter_opening_caps(\"ALL CAPS TITLE\")\n\n assert normalized == \"all caps title\"\n assert changed\n\ndef test_normalize_chapter_opening_caps_basic_title_with_italics_and_underscores() -> None:\n normalized, changed = _normalize_chapter_opening_caps(\"ALL CAPS TITLE\")\n\n assert normalized == \"all caps title\"\n assert changed\n\ndef test_normalize", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8125, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "parser.content_texts[id_1])", + "got": "parser.content_texts[id_1])", + "got_raw": " parser.content_texts[id_1])\n self.assertIn(\"This is the second chapter\", parser.content_texts[id_1])\n\n # Verify lengths\n self.assertEqual(parser.content_lengths[id_1], len(\"This is the first chapter\"))\n self.assertEqual(parser.content_lengths[id_1], len(\"This is the second chapter\"))\n\n def test_ncx_only_parsing_with_nav(self):\n \"\"\"\n Verify that an EPUB with only an NCX file (no HTML nav) is parsed correctly.\n Logic tested: _process_epub_content_nav (NCX branch), _parse_ncx_navpoint\n \"\"\"\n # 1", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "speakers", + "got": "speakers", + "got_raw": " speakers\n assert \"blue\" in speakers\n\n assert speakers[\"volescu\"].label == \"Volescu\"\n assert speakers[\"blue\"].label == \"Blue Leader\"\n\ndef test_analyze_speakers_ignores_trailing_stopwords():\n chunks = [\n _chunk('Then Blue Leader shouted, \"Hold the perimeter.\"', 0),\n _chunk('But Volescu said, \"We march at dawn.\"', 1),\n ]\n\n analysis = analyze_speakers(_chapters(), chunks, threshold=1, max_speakers=0)\n\n speakers = analysis.speakers\n\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "normalize(\"2009\", cfg)", + "got": "assert \"two thousand\" in normalize(\"2000\", cfg)", + "got_raw": "<|fim_suffix|> assert \"two thousand\" in normalize(\"2000\", cfg)\n\n def test_2000s_american(self, cfg):\n # 2000-2009 are usually \"two thousand X\"\n assert \"two thousand one\" in normalize(\"2001\", cfg)\n\n assert \"two thousand nine\" in normalize(\"2009\", cfg)\n\n assert \"two thousand\" in normalize(\"2000\", cfg)\n\n def test_2000s_american_2(self, cfg):\n # 2000-20", + "exact_match": false, + "code_bleu": 0.31239399369202553, + "edit_similarity": 0.6086956521739131, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "[\"1\"]", + "got": "assert [entry.id for entry in filtered.entries] == [\"1\", \"3\"]", + "got_raw": "<|fim_suffix|>\n assert [entry.id for entry in filtered.entries] == [\"1\", \"3\"]\n\n\ndef test_calibre_opds_search_filters_by_series() -> None:\n client = CalibreOPDSClient(\"http://example.com/catalog\")\n feed = OPDSFeed(\n id=\"catalog\",\n title=\"Catalog\",\n entries=[\n OPDSEntry(id=\"1\", title=\"The Long Journey\", series=\"Journey Tales\"),\n OPDSEntry(id=\"2\", title=\"Hidden Worlds\", series=\"Journey Tales\"),\n OPDSEntry(id=\"3\", title=\"Side Stories\",", + "exact_match": false, + "code_bleu": 0.09107438368292149, + "edit_similarity": 0.15151515151515152, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "expected_root", + "got": "expected_root", + "got_raw": " expected_root\n assert os.path.exists(expected_hf)\n assert os.path.exists(os.path.join(expected_hf, \"cache\"))\n assert os.path.exists(os.path.join(expected_hf, \"datasets\"))\n assert os.path.exists(os.path.join(expected_hf, \"models\"))\n assert os.path.exists(os.path.join(expected_hf, \"tokenizers\"))\n\n\ndef test_abogen_temp_dir_configures_hf_cache_with_env(monkeypatch, tmp_path):\n import abogen.utils as utils\n\n cache_root = tmp_path / \"cache-root\"\n home_dir = tmp_path / \"home\"\n\n monkeypatch.setenv", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "\"speaker_voice\"", + "got": "\"speaker_voice\"", + "got_raw": " \"speaker_voice\"\n\n\ndef test_chunk_voice_spec_falls_back_to_default() -> None:\n job = SimpleNamespace(voice=\"base_voice\")\n chunk = {\"speaker_id\": \"narrator\"}\n\n\n assert _chunk_voice_spec(job, chunk, \"fallback\") == \"base_voice\"\n\n\ndef test_chunk_voice_spec_falls_back_to_none() -> None:\n job = SimpleNamespace(voice=\"base_voice\")\n chunk = {\"speaker_id\": \"narrator\"}\n\n\n assert _chunk_voice_spec(job, chunk, \"fallback\") is None\n\n\ndef test_chunk_voice_spec_falls_back_to_none_if_no_s", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "formula", + "got": "0.7 * \"af_nova\" + 0.3 * \"am_liam\"", + "got_raw": "0.7 * \"af_nova\" + 0.3 * \"am_liam\"\n\n\ndef test_chunk_voice_spec_uses_resolved_formula():\n formula = \"af_nova*0.7+am_liam*0.3\"\n job = _sample_job(formula)\n\n\n assert _chunk_voice_spec(job, None) == 0.7 * \"af_nova\" + 0.3 * \"am_liam\"\n\n\ndef test_collect_required_voice_ids():\n job = _sample_job(\"af_nova*0.7+am_liam*0.3\")\n assert _collect_required_voice", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.05, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n self.assertEqual(chapters[0][1], \"Chapter 1\")\n self.assertEqual(chapters[1][1], \"Chapter 2\")\n\n def test_single_file_multiple_chapters_with_nav(self):\n \"\"\"\n Test splitting one XHTML file into two chapters using an anchor.\n \"\"\"\n book = epub.EpubBook()\n book.set_identifier(\"slice123\")\n book.set_title(\"Slicing Test Book\")\n\n # Create a single content file with two sections\n content_html = \"\"\"\n \n \n

Chapter 1\n self.assertEqual(metadata.get(\"language\"), \"en\")\n\n def test_pdf_metadata_extraction(self):\n \"\"\"Test metadata extraction in PdfParser.\"\"\"\n parser = get_book_parser(self.sample_pdf_path)\n # Processing content triggers metadata extraction in current implementation\n parser.process_content()\n\n metadata = parser.get_metadata()\n self.assertEqual(metadata.get(\"title\"), \"Sample Book\")\n\n self.assertEqual(metadata.get(\"author\"), \"Test Author\")\n\n self.assertEqual(metadata.get(\"language\"), \"en\")\n\n def test_markdown_metadata_extraction(self):\n \"\"\"Test metadata extraction in MarkdownParser.\"\"\"\n parser = get_book_parser(self.sample_md_path)\n", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.12903225806451613, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "text1)", + "got": "text1)", + "got_raw": " text1)\n self.assertIn(\"[12]\", text1)\n self.assertIn(\"1\", text1)\n\n text2 = parser.content_texts[\"page_2\"]\n self.assertIn(\"Page 2 content\", text2)\n self.assertNotIn(\"[12]\", text2)\n self.assertNotIn(\"1\", text2)\n finally:\n parser.close()\n\n def test_epub_parser_content(self):\n \"\"\"Test EpubParser content extraction.\"\"\"\n parser = get_book_parser(self.sample_epub_path)\n try:\n parser.process_content()\n\n self.assertIn(\"intro\", parser.content_texts)\n self.assertIn(\"chap1", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "\"Volescu\"", + "got": "\"Volescu\"", + "got_raw": " \"Volescu\"\n assert speakers[\"volescu\"].confidence == \"high\"\n assert speakers[\"volescu\"].sample_quotes == [\n {\"excerpt\": \"But Volescu said, \"We march at dawn.\"\", \"gender_hint\": \"Context mentions both male and female pronouns.\"},\n {\"excerpt\": \"Then Blue Leader shouted, \"Hold the perimeter.\"\", \"gender_hint\": \"Context mentions both male and female pronouns.\"},\n ]\n\ndef test_analyze_speakers_ignores_trailing_stopwords():\n chunks = [\n _chunk('Then Blue Leader shouted, \"Hold the perimeter.\"', ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "PdfParser)", + "got": "PdfParser)", + "got_raw": " PdfParser)\n\n parser_epub = get_book_parser(self.sample_epub_path)\n\n self.assertIsInstance(parser_epub, EpubParser)\n\n parser_md = get_book_parser(self.sample_md_path)\n\n self.assertIsInstance(parser_md, MarkdownParser)\n\n def test_pdf_parser(self):\n \"\"\"Test that the PDF parser correctly extracts text and chapters.\"\"\"\n parser = get_book_parser(self.sample_pdf_path)\n\n self.assertEqual(parser.file_type, \"pdf\")\n\n # Process content\n content_texts, content_lengths = parser.process_content()\n\n # Check content texts\n self.assertIn(\"Page 1 content\", content_texts)\n self.assertIn(\"", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "denizsafak/abogen", + "expected": "\"male\"", + "got": "\"male\"", + "got_raw": " \"male\"\n assert mary.gender == \"female\"\n assert alex.gender == \"male\"\n\n assert john.detected_gender == \"male\"\n assert mary.detected_gender == \"female\"\n assert alex.detected_gender == \"male\"\n\n assert john.male_votes == 1\n assert mary.female_votes == 1\n assert alex.male_votes == 1\n\n assert john.female_votes == 0\n assert mary.male_votes == 0\n assert alex.female_votes == 0\n\n assert john.sample_quotes == [\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "descriptinc/audiotools", + "expected": "spk_batch", + "got": "0.0", + "got_raw": "0.0\n\n spk_batch = AudioSignal.batch([spk.deepcopy() for _ in range(batch_size)])\n ir_batch = AudioSignal.batch(\n [ir.deepcopy().zero_pad(np.random.randint(1000), 0) for _ in range(batch_size)],\n pad_signals=True,\n )\n\n convolved = spk_batch.deepcopy().convolve(ir_batch)\n\n assert convolved == 0.0\n\n spk_batch = AudioSignal.batch([spk.deepcopy() for _ in range(batch_size)])\n ir_batch = AudioSignal.batch(\n [ir.deepcopy().zero_pad(np.random.randint(", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "descriptinc/audiotools", + "expected": "sample_rate", + "got": "44100", + "got_raw": "44100\n assert signal.shape == (4, 2, 44100)\n\n # Check that the signal is resampled correctly\n assert np.allclose(signal.audio_data, array, atol=1e-5)\n\n # Check that the signal is resampled correctly\n assert np.allclose(signal.audio_data, array, atol=1e-5)\n\n # Check that the signal is resampled correctly\n assert np.allclose(signal.audio_data, array, atol=1e-5)\n\n # Check that the signal is resampled correctly\n assert np.allclose(signal", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "descriptinc/audiotools", + "expected": "1e-4", + "got": "1e-10", + "got_raw": "1e-10\n\n\ndef test_high_pass():\n sample_rate = 44100\n f = 440\n t = torch.arange(0, 1, 1 / sample_rate)\n sine_wave = torch.sin(2 * np.pi * f * t)\n window = AudioSignal.get_window(\"hann\", sine_wave.shape[-1], sine_wave.device)\n sine_wave = sine_wave * window\n signal = AudioSignal(sine_wave.unsqueeze(0), sample_rate=sample_rate)\n out = signal.deepcopy().high_pass(220)\n\n assert out.audio", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "descriptinc/audiotools", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n spk.apply_codec(\"mp3\")\n\n with pytest.raises(NotImplementedError):\n spk.apply_codec(\"ogg\")\n\n with pytest.raises(NotImplementedError):\n spk.apply_codec(\"amr-nb\")\n\n with pytest.raises(NotImplementedError):\n spk.apply_codec(\"amr-wb\")\n\n with pytest.raises(NotImplementedError):\n spk.apply_codec(\"amr-wb-2\")\n\n with pytest.raises(NotImplementedError):\n spk.apply_codec(\"amr-wb-3\")\n\n with pytest.raises(NotImplementedError):\n spk.apply_codec", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "descriptinc/audiotools", + "expected": "44100", + "got": "44100", + "got_raw": "44100\n assert x.num_channels == 1\n assert x.batch_size == 1\n\n assert x.shape == (1, 1, 22050)\n\n assert x.signal_duration == 0.5\n assert x.duration == 0.5\n\n assert x.sample_rate == 44100\n assert x.num_channels == 1\n assert x.batch_size == 1\n\n assert x.shape == (1, 1, 22050)\n\n assert x.signal_duration == 0.5\n assert x.duration ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "descriptinc/audiotools", + "expected": "signal_from_ffmpeg.signal_length", + "got": "10", + "got_raw": "10\n assert signal_from_ffmpeg.signal_length == 10\n\n assert og_signal.sample_rate == 44100\n assert signal_from_ffmpeg.sample_rate == 44100\n\n assert og_signal.stft_params == signal_from_ffmpeg.stft_params\n\n assert og_signal.stft_data is not None\n assert signal_from_ffmpeg.stft_data is not None\n\n assert og_signal.audio_data is not None\n assert signal_from_ffmpeg.audio_data is not None\n\n assert og_signal._loudness is not None\n assert signal_from_ffmpeg._loudness", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "descriptinc/audiotools", + "expected": "sig3", + "got": "sig3", + "got_raw": " sig3\n\n array = np.random.randn(2, 16000)\n sig4 = AudioSignal(array, sample_rate=16000)\n\n assert sig1 != sig4\n\n array = np.random.randn(2, 16000)\n sig5 = AudioSignal(array, sample_rate=16000)\n\n assert sig1 != sig5\n\n array = np.random.randn(2, 16000)\n sig6 = AudioSignal(array, sample_rate=16000)\n\n assert sig1 != sig6\n\n array", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dgasmith/opt_einsum", + "expected": "(2, 2)", + "got": "2", + "got_raw": "2\n assert np.allclose(result, np.einsum(expr, *ops))\n\n path = contract_path(expr, *ops, optimize=optimize)\n assert len(path) == 2\n\n result = contract(expr, *ops, optimize=optimize)\n\n assert result.shape == 2\n assert np.allclose(result, np.einsum(expr, *ops))\n\n path = contract_path(expr, *ops, optimize=optimize)\n assert len(path) == 2\n\n result = contract(expr, *ops, optimize=optimize)\n\n assert result.shape == 2\n assert np.allclose(result", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "dgasmith/opt_einsum", + "expected": "\"GEMM\"", + "got": "1", + "got_raw": "1\n assert expr.contraction_list[2][2] == \"acd,bd->acd\"\n assert expr.contraction_list[2][-1] is False\n\n assert expr.contraction_list[3][2] == \"acd,bd->acd\"\n assert expr.contraction_list[3][-1] is False\n\n assert expr.contraction_list[4][2] == \"acd,bd->acd\"\n assert expr.contraction_list[4][-1] is False\n\n assert expr.contraction_list[5][2] == \"acd,bd->acd\"\n assert expr.contraction_list[5", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dgasmith/opt_einsum", + "expected": "res_got3)", + "got": "res_got3)", + "got_raw": " res_got3)\n\n # check numpy call returns numpy still\n res_got4 = expr(var, backend=\"numpy\")\n assert isinstance(res_got4, np.ndarray)\n\n np.testing.assert_allclose(res_exp, res_got4)\n\n # check numpy call returns numpy still\n res_got5 = expr(backends.to_numpy(var))\n assert isinstance(res_got5, np.ndarray)\n\n np.testing.assert_allclose(res_exp, res_got5)\n\n # check numpy call returns numpy still\n res_got6 = expr(backends.to_numpy(var), backend=\"numpy\")\n assert isinstance", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dgasmith/opt_einsum", + "expected": "expr.__str__()", + "got": "", + "got_raw": "<|fim_suffix|>\n #> 1. 'dbe,cd->bce' [GEMM]\n #> 2. 'bce,abc->ea' [GEMM]\n #> 3. 'ea,ac->ae' [DOT]\n #> 4. 'ae,ab->a' [DOT]\n #> 5. 'a,ab->a' [DOT]\n #> 6. 'a,ab->a' [DOT]\n #> 7. ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dgasmith/opt_einsum", + "expected": "object", + "got": "0", + "got_raw": "0\n assert ein.shape == views[0].shape\n assert ein.dtype == views[0].dtype\n assert ein.shape == views[0].shape\n assert ein.dtype == views[0].dtype\n\n ein = contract(string, *views, optimize=False, use_blas=True)\n\n assert ein.dtype != 0\n assert ein.shape == views[0].shape\n assert ein.dtype == views[0].dtype\n assert ein.shape == views[0].shape\n assert ein.dtype == views[0].dtype\n\n ein = contract(string, *views, optimize=True, use", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dgasmith/opt_einsum", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n expr(np.random.rand(2, 3), np.random.rand(3, 4), out=np.random.rand(2, 4), backend=\"numpy\")\n\n # should only be able to specify backend\n\n with pytest.raises(NotImplementedError):\n expr(np.random.rand(2, 3), np.random.rand(3, 4), backend=\"numpy\")\n\n # should only be able to specify constants\n\n with pytest.raises(NotImplementedError):\n expr(np.random.rand(2, 3), np.random.rand(3, 4), constants=[0], backend=\"numpy\")\n\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "dgasmith/opt_einsum", + "expected": "0.0", + "got": "0", + "got_raw": "0\n assert pytest.approx(sparse_opt) == 0\n\n # test conversion mode\n np_views = [np.asarray(x) for x in views]\n np_opt = expr(*np_views)\n\n # If the expression returns a float, stop here\n if not ein.shape:\n\n assert pytest.approx(ein) == 0\n assert pytest.approx(sparse_opt) == 0\n\n # test conversion mode\n np_views = [np.asarray(x) for x in views]\n np_opt = expr(*np_views)\n\n # If the expression returns a float, stop here\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "dgilland/pydash", + "expected": "_.initial(value)", + "got": "1", + "got_raw": "1\n assert _.initial(value) == 1\n assert _.initial(value) == 1\n\n assert _.initial(value) == 1\n assert _.initial(value) == 1\n assert _.initial(value) == 1\n\n assert _.initial(value) == 1\n assert _.initial(value) == 1\n assert _.initial(value) == 1\n\n assert _.initial(value) == 1\n assert _.initial(value) == 1\n assert _.initial(value) == 1\n\n assert _.initial(value) == 1\n assert _.initial(value)", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dgilland/pydash", + "expected": "3", + "got": "3", + "got_raw": "3\n\ndef test_juxtapose():\n\n assert _.juxtapose(lambda x, y, z: x + y + z, lambda x, y, z: x * y * z)(1, 2, 3) == [4, 6]\n\ndef test_juxtapose_with_kwargs():\n\n assert _.juxtapose(lambda x, y, z: x + y + z, lambda x, y, z: x * y * z)(1, 2, z=3) == [4, 6]\n\ndef test_juxtapose_with_kwargs_and_args():\n\n assert _.juxtapose(lambda", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dgilland/pydash", + "expected": "_._", + "got": "", + "got_raw": " # noqa: E711\n\n\ndef test_dash_alias():\n\n assert _.py_ is # noqa: E711\n\n\ndef test_dash_alias():\n\n assert _.py_ is # noqa: E711\n\n\ndef test_dash_alias():\n\n assert _.py_ is # noqa: E711\n\n\ndef test_dash_alias():\n\n assert _.py_ is # noqa: E711\n\n\ndef test_dash_alias():\n\n assert _.py_ is # noqa: E711\n\n\ndef test_dash_alias():\n\n assert _.py_ is # noqa: E711\n\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dgilland/pydash", + "expected": "expected", + "got": "3", + "got_raw": "3\n\n\n@parametrize(\n \"case,expected\",\n [\n ((lambda: 3, 2), 3),\n ((lambda: 3, -1), 3),\n ],\n)\ndef test_after_with_args(case, expected):\n done = _.after(*case)\n\n for _x in range(case[1] - 1):\n ret = done(1, 2, 3)\n assert ret is None\n\n ret = done(1, 2, 3)\n\n assert ret == 3\n\n\n@parametrize(\n \"case,expected\",\n [\n ((lambda: ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dgilland/pydash", + "expected": "expected", + "got": "assert _.chunk(*case) == expected", + "got_raw": "<|fim_suffix|>\n assert _.chunk(*case) == expected\n\n\n@parametrize(\n \"case,expected\",\n [\n (([1, 2, 3, 4, 5],), [[1, 2, 3, 4, 5]]),\n (([1, 2, 3, 4, 5], 2), [[1, 2], [3, 4], [5]]),\n (([1, 2, 3, 4, 5], 3), [[1, 2, 3], [4, 5]]", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.3902439024390244, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "[{\"data\": \"test\"}]", + "got": "100, f\"Expected 'args' to be 100, got: {calls[0]['args']}\"", + "got_raw": "100, f\"Expected 'args' to be 100, got: {calls[0]['args']}\"\n assert calls[0][\"kwargs\"] == {\"width\": 500, \"height\": 500}, f\"Expected 'kwargs' to be {'width': 500, 'height': 500}, got: {calls[0]['kwargs']}\"\n```\n\n```{note}\nIf you override a hook method in your component class and do **not** call\n``super()``, the corresponding signal will **not** fire because\n``super()`` is", + "exact_match": false, + "code_bleu": 0.17265002270610103, + "edit_similarity": 0.18421052631578946, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "actual", + "got": "actual", + "got_raw": " actual\n\n\ndef test_convert_to_dash_case():\n expected = \"hello-world\"\n actual = convert_to_dash_case(\"hello-world\")\n\n\n assert expected == actual\n\n\ndef test_convert_to_pascal_case():\n expected = \"HelloWorld\"\n actual = convert_to_pascal_case(\"hello-world\")\n\n\n assert expected == actual\n```\n\n\n```python\n# hello_world.py\nfrom django_unicorn.components import UnicornView\n\nclass HelloWorldView(UnicornView):\n name = \"World\"\n```\n\n```html\n\n
\n Delete by uuid\n:::\n\n:::{", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.48, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "True", + "got": "True", + "got_raw": " True\n\n\ndef test_is_html_well_formed_with_empty_element():\n html = \"\"\"\n
\n \n
\n Name: {{ name }}\n
\n \"\"\"\n actual = is_html_well_formed(html)\n\n\n assert actual is True\n\n\ndef test_is_html_well_formed_with_invalid_element():\n html = \"\"\"\n
\n \n
\n Name: {{ name }}\n
\n \"\"\"\n actual = is_html_well_form", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "{\"NAME\": \"morphdom\"}", + "got": "{", + "got_raw": " {\n \"NAME\": \"morphdom\",\n \"RELOAD_SCRIPT_ELEMENTS\": False,\n }\n\n settings.UNICORN = {\n \"MORPHER\": {\n \"NAME\": \"alpine\",\n \"RELOAD_SCRIPT_ELEMENTS\": True,\n },\n }\n\n assert get_morpher_settings() == {\n \"NAME\": \"alpine\",\n \"RELOAD_SCRIPT_ELEMENTS\": True,\n }\n\n settings.UNICORN = {\n \"MORPHER\": {\n \"NAME\": \"alpine\",\n \"RELOAD_SCRIPT_ELEMENTS\": False,\n },\n }\n\n assert get_morpher", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.09523809523809523, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "component.integer", + "got": "99", + "got_raw": "99\n\n set_property_value(component, \"value\", 99)\n\n assert 99 == component.value\n\ndef test_set_property_value_str():\n component = FakeComponent(component_name=\"test\", component_id=\"test_set_property_value_str\")\n\n assert \"hello\" == \"hello\"\n\n set_property_value(component, \"value\", \"hello\")\n\n assert \"hello\" == component.value\n\ndef test_set_property_value_bool():\n component = FakeComponent(component_name=\"test\", component_id=\"test_set_property_value_bool\")\n\n assert True == True\n\n set_property_value(component, \"value\", True)\n\n assert True ==", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "grandparent", + "got": "assert child.parent is parent", + "got_raw": "<|fim_suffix|>\n assert child.parent is parent\n\n assert parent.parent is grandparent\n\n assert child.parent.parent is grandparent\n\n assert child.parent.parent.parent is None\n\n # Restore the child\n cache_full_tree(child)\n\n # Verify the child is restored\n assert child.parent is parent\n\n assert parent.parent is grandparent\n\n assert child.parent.parent is grandparent\n\n assert child.parent.parent.parent is None\n\n\ndef test_cacheable_component_restores_nested_state_on_pickle_failure_with_parent():\n \"\"\"Test that deeply nested parent/children are all restored when pickle fails.\"\"\"\n\n grandparent = FakeComponent(\n component", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "flavor.pk", + "got": "1", + "got_raw": "1\n assert actual.name == \"first-flavor\"\n assert actual.parent.pk == 2\n assert actual.parent.name == \"parent-flavor\"\n```\n\n## Model Field\n\nA Django `Model` field can be used as a field on a component just like basic Python primitive types. Use `unicorn:model` to bind to a field of a Django `Model` like you would in a normal Django template.\n\n:::{warning}\nUsing this functionality will serialize your entire model by default and expose all of the values in the HTML source code. Do not use this particular functionality if there are properties that need to be kept private.\n\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "parent", + "got": "parent", + "got_raw": " parent\n assert child.parent_id == parent.id\n assert child.parent.name == parent.name\n\ndef test_set_property_fk_with_model_instance_with_typehint():\n # Arrange\n parent = Flavor.objects.create(name=\"Parent\")\n child = Flavor.objects.create(name=\"Child\")\n\n # Act\n set_property_from_data(child, \"parent\", parent)\n\n # Assert\n\n assert child.parent == parent\n assert child.parent_id == parent.id\n assert child.parent.name == parent.name\n\ndef test_set_property_fk_with_model_instance_with_typehint_and_old_typehint():\n # Arrange\n parent = Flavor.objects.create", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "0", + "got": "0", + "got_raw": "0\n\ndef test_component_mounted_signal(client):\n \"\"\"component_mounted fires after a component is first created.\"\"\"\n received, handler = _collect(component_mounted)\n try:\n post_and_get_response(\n client,\n url=FAKE_URL,\n data={\"method_count\": 0},\n action_queue=[{\"payload\": {\"name\": \"test_method\"}, \"type\": \"callMethod\"}],\n )\n finally:\n component_mounted.disconnect(handler)\n\n assert len(received) >= 1\n last = received[-1]\n assert \"component\" in last\n assert isinstance(last[\"component\"],", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-commons/django-unicorn", + "expected": "html", + "got": "html", + "got_raw": " html\n assert 'unicorn:component_id=\"tests.templatetags.test_unicorn_render.FakeComponentKwargs\"' in html\n assert 'unicorn:component_name=\"tests.templatetags.test_unicorn_render.FakeComponentKwargs\"' in html\n assert 'unicorn:component_key=\"tests.templatetags.test_unicorn_render.FakeComponentKwargs\"' in html\n assert 'unicorn:parent=\"tests.templatetags.test_unicorn_render.FakeComponentKwargs\"' in html\n assert 'unicorn:request=\"tests.templatetags.test_unicorn", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-crispy-forms/django-crispy-forms", + "expected": "0", + "got": "0", + "got_raw": "0\n\ndef test_form_show_errors():\n form = SampleForm()\n form.helper.layout = Layout(\n \"password1\",\n FieldWithButtons(\"password2\", StrictButton(\"Confirm\")),\n PrependedText(\"first_name\", \"Mr.\"),\n AppendedText(\"last_name\", \"@\"),\n PrependedAppendedText(\"datetime_field\", \"on\", \"secs\"),\n )\n form.helper.form_show_errors = False\n\n html = render_crispy_form(form)\n\n assert html.count(\"\") == 2\n assert html.count(\"
\") == 2\n assert html.count(\"
\") == 2\n assert html.count(\"
\") == 2\n assert html.count(\"
\") == 2\n assert html.count(\"
\")", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "django-crispy-forms/django-crispy-forms", + "expected": "\"legend\"", + "got": "\"legend\"", + "got_raw": " \"legend\"\n assert layout[0].css_class == \"test-class\"\n\n helper[0:2].wrap_together(MultiField, css_class=\"test-class\")\n assert isinstance(layout[0], MultiField)\n assert isinstance(layout[1], MultiField)\n\n helper[0:2].wrap_together(MultiField, css_class=\"test-class\")\n assert isinstance(layout[0], MultiField)\n assert isinstance(layout[1], MultiField)\n\n helper[0:2].wrap_together(MultiField, css_class=\"test-class\")\n assert isinstance(layout[0], MultiField)\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "CommandError, \"Unknown database non-existing_database\")", + "got": "self.assertRaises(CommandError) as cm:", + "got_raw": " self.assertRaises(CommandError) as cm:\n call_command(\"reset_schema\", database=\"non_existing_database\")\n\n self.assertEqual(\n str(cm.exception),\n \"Unknown database 'non_existing_database'\",\n )\n\n def test_should_raise_CommandError_when_database_is_not_postgresql(self):\n\n with self.assertRaises(CommandError) as cm:\n call_command(\"reset_schema\", database=\"sqlite3\")\n\n self.assertEqual(\n str(cm.exception),\n \"This command can be used only with PostgreSQL databases.\",\n )\n\n def test_should_raise_CommandError_when_database_is_not_postgresql(self):\n\n with self.assertRaises(CommandError) as cm:\n call", + "exact_match": false, + "code_bleu": 0.15619699684601276, + "edit_similarity": 0.34408602150537637, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "active)", + "got": "active)", + "got_raw": " active)\n\n def test_active_excludes_inactive(self):\n post = Post.objects.create(status=ActivatorModel.INACTIVE_STATUS)\n active = Post.objects.active()\n\n self.assertNotIn(post, active)\n\n def test_inactive_includes_inactive(self):\n post = Post.objects.create(status=ActivatorModel.INACTIVE_STATUS)\n inactive = Post.objects.inactive()\n\n self.assertIn(post, inactive)\n\n def test_inactive_excludes_active(self):\n post = Post.objects.create(status=ActivatorModel.ACTIVE_STATUS)\n inactive = Post.objects.inactive()\n\n self.assertNotIn(post, inactive)\n\n def test_active_in", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "fake_user2[\"username\"]", + "got": "\"username\": \"allan_poe\",", + "got_raw": "<|fim_suffix|>\n \"username\": \"allan_poe\",\n \"email\": \"allan_poe@example.com\",\n \"is_active\": True,\n \"is_staff\": True,\n \"is_superuser\": True,\n \"groups\": [\"admin\"],\n }\n user = User(**fake_user)\n user.save()\n\n fake_user2 = {\n \"username\": \"niccolas\",\n \"email\": \"niccolas@example.com\",\n \"is_active\": True,\n \"is_staff\": True,\n \"is_superuser\": False,\n \"groups\": [\"staff\"],\n }\n user2 = User(**", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.43478260869565216, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "CommandError, match=\"Only available in debug mode\")", + "got": "ImportError):", + "got_raw": "ImportError):\n call_command(\"dumpscript\", \"user\", stdout=out)\n\n assert \"DEBUG only\" in out.getvalue()\n\ndef test_without_user_model(settings):\n settings.AUTH_USER_MODEL = \"auth.User\"\n\n out = StringIO()\n\n with pytest.raises(ImportError):\n call_command(\"dumpscript\", \"user\", stdout=out)\n\n assert \"DEBUG only\" in out.getvalue()\n\ndef test_without_user_model(settings):\n settings.AUTH_USER_MODEL = \"auth.User\"\n\n out = StringIO()\n\n with pytest.raises(ImportError):\n call_command(\"dumpscript\", \"user\", stdout=out)\n\n assert \"DEBUG only\"", + "exact_match": false, + "code_bleu": 0.2259005009024612, + "edit_similarity": 0.21875, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "CommandError, \"Unknown database unknown\")", + "got": "from django.core.management import call_command", + "got_raw": "\n\n\nfrom django.core.management import call_command\nfrom django.test import TestCase\nfrom django.test.utils import override_settings\n\nfrom unittest.mock import patch\n\nMYSQL_DATABASE_SETTINGS = {\n \"ENGINE\": \"django.db.backends.mysql\",\n \"NAME\": \"dbatabase\",\n \"USER\": \"foo\",\n \"PASSWORD\": \"bar\",\n \"HOST\": \"127.0.0.1\",\n \"PORT\": \"3306\",\n}\n\nSQLITE3_DATABASE_SETTINGS = {\n \"ENGINE\": \"django.db.backends.sqlite3\",\n \"NAME\": \"db.sqlite3\",\n}\n\nPOSTGRESQL_DATABASE_SETTINGS = {\n ", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.13636363636363635, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n\n def test_prints_error_on_nonexistent_script_with_traceback(self):\n cmd = self.get_command()\n with self.assertRaises(CommandError):\n call_command(cmd, \"non_existent_script\", verbosity=2, traceback=True)\n self.assertIn(\n \"No (valid) module for script 'non_existent_script' found\",\n sys.stdout.getvalue(),\n )\n\n self.assertEqual(cmd.last_exit_code, 1)\n\n def test_prints_error_on_nonexistent_script_with_silent(self):\n cmd = self.get_command()\n with self.assertRaises(CommandError):\n call_command(cmd, \"non_existent_script\",", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "m_stdout.getvalue())", + "got": ".assertTrue(os.path.exists(os.path.join(JOBS_DIR, time_period)))", + "got_raw": ".assertTrue(os.path.exists(os.path.join(JOBS_DIR, time_period)))\n for job in os.listdir(os.path.join(JOBS_DIR, time_period)):\n self.assertTrue(\n os.path.exists(os.path.join(JOBS_DIR, time_period, job))\n )\n\n self.assertEqual(\n m_stdout.getvalue(),\n \"SUCCESS: Created jobs directory structure for testapp_with_no_models_file\\n\",\n )\n\n @patch(\"sys.stdout\", new_callable=StringIO)\n def test_should_create_jobs_directory_structure_and_print_ERROR_message(\n self, m_stdout\n ):\n call_command(\"create_jobs\", \"testapp_with", + "exact_match": false, + "code_bleu": 0.08687475782716618, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "\"-2\")", + "got": "1)", + "got_raw": "1)\n\n def test_empty_slug_source_callable(self):\n # regression test\n\n m = SluggedTestModel(title=\"\")\n m.save()\n\n self.assertEqual(m.slug, 1)\n\n def test_empty_slug_source_callable_with_args(self):\n # regression test\n\n m = SluggedTestModel(title=\"\")\n m.save()\n\n self.assertEqual(m.slug, 1)\n\n def test_empty_slug_source_callable_with_kwargs(self):\n # regression test\n\n m = SluggedTestModel(title=\"\")\n m.save()\n\n self.assertEqual(m.slug, 1)\n\n def test_empty_slug_source_callable_with_args_and_kwargs(self):\n ", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "[])", + "got": "[])", + "got_raw": " [])\n\n def test_empty_dict(self):\n j = JSONFieldTestModel.objects.create(a=6, j_field={})\n self.assertIsInstance(j.j_field, dict)\n\n self.assertEqual(j.j_field, {})\n\n def test_jsonfield(self):\n j = JSONFieldTestModel.objects.create(a=6, j_field={\"a\": 1, \"b\": 2})\n self.assertIsInstance(j.j_field, JSONDict)\n\n self.assertEqual(j.j_field, {\"a\": 1, \"b\": 2})\n\n def test_jsonfield2(self):\n j = JSONFieldTestModel.objects.create(a=6", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "str(\"Test Value\"))", + "got": "\"Test Value\")", + "got_raw": " \"Test Value\")\n\n self.assertEqual(widont_html(\"Test Value\"), \"Test Value\")\n\n self.assertEqual(widont_html(str(\"Test Value\")), \"Test Value\")\n\n def test_widont_html(self):\n self.assertEqual(widont_html(\"Test Value\"), \"Test Value\")\n\n self.assertEqual(widont_html(str(\"Test Value\")), \"Test Value\")\n\n self.assertEqual(widont_html(\"Test Value

test me out

trailing text\"), \"Test Value

test me out

", + "exact_match": false, + "code_bleu": 0.28284271247461906, + "edit_similarity": 0.8780487804878049, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "CommandError, \"1 errors found\")", + "got": "", + "got_raw": "\n\n\n# File: django_extensions/management/commands/create_migrations.py\nimport os\nimport sys\nfrom typing import List\n\nfrom django.core.management.base import AppCommand\nfrom django.core.management.color import color_style\n\nfrom django_extensions.management.utils import _make_writeable, signalcommand\n\n\nclass Command(AppCommand):\n help = \"Creates a Django migration directory structure for the given app name \"\n \"in the app's directory.\"\n\n requires_system_checks: List[str] = []\n # Can't import settings during this command, because they haven't\n # necessarily been created.\n can_import_settings = True\n\n @signal", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "first or set())", + "got": "first)", + "got_raw": " first)\n self.assert_imported_under_names(SecondDerivedClass, second)\n self.assert_imported_under_names(ThirdDerivedClass, third)\n self.assert_imported_under_names(FourthDerivedClass, fourth)\n\n def assert_imported_under_names(self, class_to_check, expected_names):\n # type: (type, Set[str]) -> ()\n \"\"\"\n Auxiliary assertion which checks are classes imported under names.\n :param class_to_check: class to check\n :param expected_names: set of expected names under which class_to_check should be available\n \"\"\"\n # type: (type, Set[str])", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "\"TeslaCar\")", + "got": "\"testapp_with_no_models_file.models.Person\")", + "got_raw": " \"testapp_with_no_models_file.models.Person\")\n\n def test_no_models_dot_py_with_app_style(self):\n data = generate_graph_data([\"testapp_with_no_models_file\"], app_style_filename=\"testapp_with_no_models_file.app-style.json\")\n self.assertEqual(len(data[\"graphs\"]), 1)\n\n model_name = data[\"graphs\"][0][\"models\"][0][\"name\"]\n\n self.assertEqual(model_name, \"testapp_with_no_models_file.models.Person\")\n\n def test_no_models_dot_py_with_app_style_and_app_name(self):\n data = generate_graph_data([\"testapp_with_no_models_file\"], app_style_filename=\"test", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2545454545454545, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "CommandError, \"Default site with pk=321 does not exist\")", + "got": "self.assertRaises(CommandError):", + "got_raw": " self.assertRaises(CommandError):\n call_command(\"set_default_site\")\n\n @patch(\"django_extensions.management.commands.set_default_site.Site\")\n def test_should_update_site_object(self, mock_site):\n mock_site.objects.get.return_value = Site(id=321, name=\"test\", domain=\"test.com\")\n call_command(\"set_default_site\", \"--name\", \"test\", \"--domain\", \"test.com\")\n mock_site.objects.get.assert_called_with(pk=321)\n mock_site.objects.filter.assert_called_with(pk=321)\n mock_site.objects.filter.return_value.update.assert_called_with(name=\"test\", domain=\"", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.29545454545454547, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "m_stderr.getvalue())", + "got": ".assertTrue(os.path.exists(filepath))", + "got_raw": ".assertTrue(os.path.exists(filepath))\n self.assertTrue(os.path.isfile(filepath))\n\n self.assertIn(\n \"Notice: Couldn't set permission bits on {}. You're probably using an uncommon filesystem setup. No problem.\\n\".format(\n filepath\n ),\n m_stderr.getvalue(),\n )\n\n @patch(\"sys.stderr\", new_callable=StringIO)\n @patch(\"django_extensions.management.commands.create_command._make_writeable\") # noqa\n def test_should_print_error_on_permission_error(self, m__make_writeable, m_stderr): # noqa\n m__make_writeable.side_effect = PermissionError\n self._", + "exact_match": false, + "code_bleu": 0.15537125692760353, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "pdb.set_trace.called)", + "got": "issubclass(pdb.set_trace.mock_calls[0].args[0].__class__, MagicMock))", + "got_raw": "issubclass(pdb.set_trace.mock_calls[0].args[0].__class__, MagicMock))\n\n def test_ipdb_filter(self):\n \"\"\"Test for ipdb filter.\"\"\"\n import ipdb\n\n ipdb.set_trace = MagicMock(return_value=None)\n template = self.engine.from_string(\n \"\"\"\n {% load debugger_tags %}\n\n {{ test_object|ipdb }}\n \"\"\"\n )\n template.render({\"test_object\": \"test_value\"})\n\n self.assertTrue(issubclass(ipdb.set_trace.mock_calls[0].args[0].__class__, MagicMock))\n\n def test_wdb_filter(self):\n ", + "exact_match": false, + "code_bleu": 0.16923267918690046, + "edit_similarity": 0.4222222222222222, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "set())", + "got": "set())", + "got_raw": " set())\n\n def test_import_subclasses(self):\n self.assert_imports(\n first={FirstDerivedClass.__name__},\n second={SecondDerivedClass.__name__},\n third={ThirdDerivedClass.__name__},\n fourth={FourthDerivedClass.__name__},\n )\n\n def test_import_subclasses_with_included_classes(self):\n self.assert_imports(\n first={FirstDerivedClass.__name__},\n second={SecondDerivedClass.__name__},\n third={ThirdDerivedClass.__name__},\n fourth={FourthDerivedClass.__name__},\n )\n\n def test_import_subclasses_with_included_classes", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "output)", + "got": "output)", + "got_raw": " output)\n\n def test_should_print_errors_if_template_in_VALIDATE_TEMPLATES_IGNORES(\n self,\n ):\n out = StringIO()\n\n with override_settings(\n INSTALLED_APPS=settings.INSTALLED_APPS\n + [\"tests.testapp_with_template_errors\"],\n VALIDATE_TEMPLATES_IGNORES=[\"template_with_error.html\"],\n ):\n call_command(\"validate_templates\", verbosity=3, stdout=out, stderr=out)\n\n output = out.getvalue()\n\n\n self.assertIn(\"1 errors found\\n\", output)\n\n def test_should_print_errors_if_template_in_TEMPLATE_DIRS(self):\n out = StringIO()\n\n with override_settings(\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "m_stdout.getvalue())", + "got": "m_stdout.getvalue())", + "got_raw": " m_stdout.getvalue())\n\n\n\nfrom io import StringIO\n\nfrom django.core.management import call_command\nfrom django.test import TestCase\n\nfrom unittest.mock import patch\n\nclass GeneratePasswordTests(TestCase):\n\n @patch(\n \"django_extensions.management.commands.generate_password.get_random_secret_key\"\n )\n @patch(\"sys.stdout\", new_callable=StringIO)\n def test_should_return_random_password(self, m_stdout, m_get_random_secret):\n m_get_random_secret.return_value = \"random_password\"\n\n call_command(\"generate_password\")\n\n\n self.assertIn(\"random_password\", m_stdout.getvalue())\n\n\n\nfrom io import StringIO\n\nfrom django.core.management import call", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "django-extensions/django-extensions", + "expected": "tuple)", + "got": "tuple)", + "got_raw": " tuple)\n self.assertEqual(len(field), 2)\n self.assertIsInstance(field[0], models.Field)\n self.assertIsInstance(field[1], models.Model)\n\n def test__get_fields_returns_list_of_tulpes_for_inherited_model(self):\n uniq_mixin_fields = UniqueFieldMixin._get_fields(\n InheritedFromPostWithUniqField\n )\n self.assertIsInstance(uniq_mixin_fields, list)\n for field in uniq_mixin_fields:\n\n self.assertIsInstance(field, tuple)\n self.assertEqual(len(field), 2)\n self.assertIsInstance(field[0], models.Field)\n self.assertIsInstance(field", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "3", + "got": "3", + "got_raw": "3\n assert any(\n exception.exception_type == \"ValueError\" for exception in exceptions\n )\n assert any(\n exception.exception_type == \"TypeError\" for exception in exceptions\n )\n assert any(\n exception.exception_type == \"KeyError\" for exception in exceptions\n )\n\n def test_background_task_tracking(self):\n \"\"\"Test background task tracking.\"\"\"\n app = FastAPI()\n storage_engine = create_engine(\n \"sqlite:///:memory:\",\n connect_args={\"check_same_thread\": False},\n poolclass=StaticPool,\n )\n\n radar = Radar(app, storage_engine=storage_engine)\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "3", + "got": "3", + "got_raw": "3\n assert trace.status == \"ok\"\n\n def test_create_span(self, test_session):\n \"\"\"Test creating a span.\"\"\"\n trace = Trace(\n trace_id=\"abc123\",\n service_name=\"test-service\",\n operation_name=\"GET /users\",\n start_time=datetime.now(timezone.utc),\n span_count=3,\n status=\"ok\",\n )\n test_session.add(trace)\n test_session.commit()\n\n span = Span(\n trace_id=trace.trace_id,\n parent_span_id=\"def456\",\n operation_name=\"GET /users/1\",\n service_name=\"test-service", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "\"2\"", + "got": "2", + "got_raw": "2\n\n def test_middleware_captures_headers(self, client, storage_session):\n \"\"\"Test that middleware captures headers.\"\"\"\n app = client.app\n\n @app.get(\"/headers\")\n async def headers():\n return {\"headers\": {\"X-Test\": \"test\", \"X-Test-2\": \"test2\"}}\n\n # Make request with headers\n response = client.get(\"/headers\", headers={\"X-Test\": \"test\", \"X-Test-2\": \"test2\"})\n assert response.status_code == 200\n\n # Verify headers were captured\n requests = storage_session.query", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "\"abc123\"", + "got": "1", + "got_raw": "1\n assert trace.service_name == \"test-service\"\n assert trace.operation_name == \"GET /users\"\n assert trace.start_time == datetime.now(timezone.utc)\n assert trace.span_count == 3\n assert trace.status == \"ok\"\n\n def test_create_span(self, test_session):\n \"\"\"Test creating a span.\"\"\"\n trace = Trace(\n trace_id=\"abc123\",\n service_name=\"test-service\",\n operation_name=\"GET /users\",\n start_time=datetime.now(timezone.utc),\n span_count=3,\n status=\"ok\",\n )\n test_session.add(trace)\n test", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "4", + "got": "4", + "got_raw": "4\n\n # Should have 4 queries\n queries = session.query(CapturedQuery).all()\n\n assert len(queries) >= 4\n\n # Should have 4 exceptions\n exceptions = session.query(CapturedException).all()\n\n assert len(exceptions) >= 4\n\n # Should have 4 background tasks\n tasks = session.query(BackgroundTask).all()\n\n assert len(tasks) >= 4\n\n def test_background_task_monitoring(self):\n \"\"\"Test background task monitoring.\"\"\"\n # Setup application with database\n app = FastAPI()\n\n # Create test database\n test_db_engine", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "True", + "got": "", + "got_raw": " # noqa: E711\n assert not middleware.enable_tracing\n\n def test_middleware_dispatch(self, mock_get_session):\n \"\"\"Test middleware dispatch.\"\"\"\n app = Mock()\n middleware = RadarMiddleware(\n app=app,\n get_session=mock_get_session,\n exclude_paths=[\"/health\", \"/metrics\"],\n max_body_size=5000,\n capture_response_body=True,\n enable_tracing=False,\n )\n\n request = Mock()\n request.headers = {\"X-Trace-ID\": \"12345\"}\n request.method = \"GET\"\n request.url = \"http://", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "True", + "got": "assert capture.slow_query_threshold == 100", + "got_raw": "<|fim_suffix|>\n assert capture.slow_query_threshold == 100\n\n def test_register(self, mock_engine):\n \"\"\"Test QueryCapture register method.\"\"\"\n capture = QueryCapture(\n get_session=Mock(),\n capture_bindings=True,\n slow_query_threshold=100,\n )\n capture.register(mock_engine)\n assert capture._registered_engines == {id(mock_engine): mock_engine}\n\n def test_unregister(self, mock_engine):\n \"\"\"Test QueryCapture unregister method.\"\"\"\n capture = QueryCapture(\n get_session=Mock(),\n capture_bindings=True,\n slow_query_threshold=100,\n )\n ", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.13043478260869565, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "\"failed\"", + "got": "\"failed\"", + "got_raw": " \"failed\"\n assert task.error == \"Task failed due to network error\"\n\n def test_background_task_completed(self, test_session):\n \"\"\"Test completed background task.\"\"\"\n task = BackgroundTask(\n task_id=\"task-123\",\n name=\"completed_task\",\n status=\"completed\",\n start_time=datetime.now(timezone.utc),\n end_time=datetime.now(timezone.utc),\n duration_ms=1000,\n )\n test_session.add(task)\n test_session.commit()\n\n assert task.status == \"completed\"\n assert task.duration_ms == 1000\n\n def test_background_task_running(self", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "doganarif/fastapi-radar", + "expected": "3", + "got": "3", + "got_raw": "3\n assert tasks[0].status == \"running\"\n assert tasks[1].status == \"running\"\n assert tasks[2].status == \"completed\"\n\n def test_task_status(self, mock_get_session, storage_session):\n \"\"\"Test task status.\"\"\"\n\n @track_background_task(mock_get_session)\n def task_a():\n return \"a\"\n\n task_a()\n\n task = storage_session.query(BackgroundTask).first()\n\n assert task.status == \"completed\"\n\n def test_task_error(self, mock_get_session, storage_session):\n \"\"\"Test task error.\"\"\"\n\n @track_background_task(mock_get_session)\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dooit-org/dooit", + "expected": "2", + "got": "2", + "got_raw": "2\n\n await pilot.press(\"escape\")\n\n assert not app.bar_switcher.search_bar\n\n assert len(tree._options) == 4\n\n await pilot.press(\"escape\")\n\n assert not app.bar_switcher.search_bar\n\n assert len(tree._options) == 4\n\n await pilot.press(\"escape\")\n\n assert not app.bar_switcher.search_bar\n\n assert len(tree._options) == 4\n\n await pilot.press(\"escape\")\n\n assert not app.bar_switcher.search_bar\n\n assert len(tree._options) == 4\n\n await pilot.press(\"escape\")\n\n assert not app.bar_switcher", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dooit-org/dooit", + "expected": "\"(icon) this is a [italic", + "got": "\"italic\" in formatted", + "got_raw": " \"italic\" in formatted\n assert \"icon\" in formatted\n\n store.remove(\"italic\")\n formatted = store.format_value(w1.description, w1)\n\n assert \"italic\" not in formatted\n assert \"icon\" in formatted\n\n store.remove(\"icon\")\n formatted = store.format_value(w1.description, w1)\n\n assert \"italic\" not in formatted\n assert \"icon\" not in formatted\n\n store.add(set_italic, id=\"italic\")\n store.add(add_icon, id=\"icon\")\n store.add(add_icon_skip_multiple, id=\"icon_skip_multiple\")\n formatted = store.format_value", + "exact_match": false, + "code_bleu": 0.12663928094193208, + "edit_similarity": 0.30434782608695654, + "n_retrieved": 10 + }, + { + "repo": "dooit-org/dooit", + "expected": "new_options[::-1]", + "got": "new_options", + "got_raw": " new_options\n\n sort_bar.selected = 0\n await pilot.press(\"enter\")\n await pilot.pause()\n current_bar = app.bar_switcher.visible_content\n assert isinstance(current_bar, StatusBar)\n\n new_options = [node.id for node in tree._options]\n\n assert current_options != new_options\n\n sort_bar.selected = 1\n await pilot.press(\"enter\")\n await pilot.pause()\n current_bar = app.bar_switcher.visible_content\n assert isinstance(current_bar, StatusBar)\n\n new_options = [node.id for node in tree._options]\n\n assert current_options == new_options\n\n sort_bar", + "exact_match": false, + "code_bleu": 0.08494336535733721, + "edit_similarity": 0.7857142857142857, + "n_retrieved": 10 + }, + { + "repo": "dooit-org/dooit", + "expected": "0", + "got": "0", + "got_raw": "0\n\n w2 = w.add_workspace()\n assert w2.nest_level == 1\n\n w3 = w2.add_workspace()\n assert w3.nest_level == 2\n\n w4 = w3.add_workspace()\n assert w4.nest_level == 3\n\n w5 = w4.add_workspace()\n assert w5.nest_level == 4\n\n w6 = w5.add_workspace()\n assert w6.nest_level == 5\n\n w7 = w6.add_workspace()\n assert w7.nest_level == 6\n\n w8 = w7.add", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dooit-org/dooit", + "expected": "4", + "got": "4", + "got_raw": "4\n assert tree.current_model is None\n\n await pilot.press(\"s\")\n assert len(tree._options) == 4\n assert tree.current_model is None\n\n await pilot.press(\"a\")\n assert len(tree._options) == 3\n assert tree.current_model is None\n\n await pilot.press(\"p\")\n assert len(tree._options) == 2\n assert tree.current_model is None\n\n await pilot.press(\"a\")\n assert len(tree._options) == 1\n assert tree.current_model is None\n\n await pilot.press(\"p\")\n assert len(tree._options)", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dooit-org/dooit", + "expected": "4", + "got": "4", + "got_raw": "4\n\n t.decrease_urgency()\n t.decrease_urgency()\n t.decrease_urgency()\n t.decrease_urgency()\n t.decrease_urgency()\n\n assert t.urgency == 1\n\ndef test_sort(create_workspace, create_todo):\n w = create_workspace()\n t = w.add_todo()\n t2 = w.add_todo()\n t3 = w.add_todo()\n t4 = w.add_todo()\n t5 = w.add_todo()\n t6 = w.add_todo()\n t7 = w.add_todo()\n t8 = w.add", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dooit-org/dooit", + "expected": "1", + "got": "1", + "got_raw": "1\n assert tree.current_model is None\n\n assert tree.current_model is None\n assert tree.current_model is None\n\n assert tree.current_model is None\n assert tree.current_model is None\n\n assert tree.current_model is None\n assert tree.current_model is None\n\n assert tree.current_model is None\n assert tree.current_model is None\n\n assert tree.current_model is None\n assert tree.current_model is None\n\n assert tree.current_model is None\n assert tree.current_model is None\n\n assert tree.current_model is None\n assert tree.current_model is None\n\n assert tree.current_model is", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dooit-org/dooit", + "expected": "0", + "got": "0", + "got_raw": "0\n\n\ndef test_adding_and_removing_children(create_workspace):\n w = create_workspace()\n w2 = w.add_workspace()\n w3 = w.add_workspace()\n\n assert len(w.workspaces) == 2\n assert len(w2.workspaces) == 0\n assert len(w3.workspaces) == 0\n\n w2.drop()\n w3.drop()\n\n assert len(w.workspaces) == 0\n\n\ndef test_adding_and_removing_todos(create_workspace):\n w = create_workspace()\n w2 = w.add_workspace()\n w3 = w.add_workspace()\n\n t =", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "{\"os\": 1}", + "got": "{\"os\": 1}", + "got_raw": " {\"os\": 1}\n\n def test_single_part_above_level(self) -> None:\n path_dict = {\"os\": \"/usr/lib/os.py\"}\n result = count_package_prefixes(path_dict, level=1)\n\n assert result == {\"os\": 1}\n\n def test_multiple_parts_below_level(self) -> None:\n path_dict = {\"os.path\": \"/usr/lib/os.py\"}\n result = count_package_prefixes(path_dict, level=2)\n\n assert result == {\"os.path\": 1}\n\n def test_multiple_parts_above_level(self) -> None:\n path_dict = {\"os.path\":", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "2", + "got": "2", + "got_raw": "2\n assert parsed_args[0].name == \"model\"\n assert parsed_args[0].value == \"gpt2\"\n assert parsed_args[0].volume\n assert parsed_args[1].name == \"data\"\n assert parsed_args[1].value == \"/path/to/data\"\n assert parsed_args[1].volume\n\ndef test_parse_args_with_default() -> None:\n settings = LoaderSettings(\n description=\"test loader\",\n args=[\n LoaderArgument(name=\"model\", description=\"Model to use\", default=\"gpt2\"),\n LoaderArgument(name=\"data\", description=\"Data path\",", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "result[\"object_type\"]", + "got": "t(\"object_type\", \"list\")", + "got_raw": "<|fim_suffix|>t(\"object_type\", \"list\")\n assert \"length\" in result\n assert result[\"length\"] == 2\n\n def test_tuple(self) -> None:\n result = inspect_object((1, 2, 3))\n\n assert \"tuple\" in result[\"object_type\"]\n assert \"length\" in result\n assert result[\"length\"] == 3\n\n def test_set(self) -> None:\n result = inspect_object({1, 2, 3})\n\n assert \"set\" in result[\"object_type\"]\n assert \"length\" in result\n assert result[\"length\"] ==", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.6222222222222222, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "\"test-loader\"", + "got": "assert run.errors[\"timeout\"] == \"timeout reached\"", + "got_raw": "<|fim_suffix|>\n assert run.errors[\"timeout\"] == \"timeout reached\"\n assert run.warnings is None\n assert run.stdout is None\n assert run.stderr is None\n assert run.exit_code is None\n assert run.stages is None\n assert run.extra is None\n\n def test_extra(self) -> None:\n loader = Loader.__new__(Loader)\n loader.name = \"test-loader\"\n loader.platform = None\n loader.build_args = None\n loader.args = None\n loader.extra = {\"test\": \"value\"}\n\n run = loader._create_errored_run(\"timeout\", \"", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.12903225806451613, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "False", + "got": "assert arg.default == \"default\"", + "got_raw": "<|fim_suffix|>\n assert arg.default == \"default\"\n\n assert arg.volume is False\n\n assert arg.artifact is False\n\n arg = LoaderArgument(name=\"test\", description=\"Test arg\", default=\"default\", volume=True, artifact=True)\n assert arg.default == \"default\"\n\n assert arg.volume is True\n\n assert arg.artifact is True\n\n arg = LoaderArgument(name=\"test\", description=\"Test arg\", default=\"default\", volume=True, artifact=True)\n assert arg.default == \"default\"\n\n assert arg.volume is True\n\n assert arg.artifact is True\n\n arg = LoaderArgument(name=\"test\",", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "\"1.0TiB\"", + "got": "1024**4", + "got_raw": "1024**4\n\n def test_gibibytes(self) -> None:\n\n assert sizeof_fmt(1024**3) == 1024**3\n\n def test_megabytes(self) -> None:\n\n assert sizeof_fmt(1024**2) == 1024**2\n\n def test_kilobytes(self) -> None:\n\n assert sizeof_fmt(1024) == 1024\n\n def test_bytes(self) -> None:\n\n assert sizeof_fmt(1) == 1\n\n def test_negative_bytes(self", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.26666666666666666, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "{\"timeout\": \"timeout reached\"}", + "got": "{\"timeout\": \"timeout reached\"}", + "got_raw": " {\"timeout\": \"timeout reached\"}\n\n def test_defaults(self) -> None:\n loader = Loader.__new__(Loader)\n loader.name = \"test-loader\"\n loader.platform = None\n loader.build_args = None\n loader.args = None\n\n run = loader._create_errored_run(\"timeout\", \"timeout reached\")\n assert run.errors == {\"timeout\": \"timeout reached\"}\n\n def test_extra(self) -> None:\n loader = Loader.__new__(Loader)\n loader.name = \"test-loader\"\n loader.platform = None\n loader.build_args = None\n loader.args = None\n\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "\"my_model\"", + "got": "\"my_model\"", + "got_raw": " \"my_model\"\n\n def test_dashes_preserved(self) -> None:\n\n assert sanitized_agent_name(\"my-model\") == \"my-model\"\n\n def test_spaces_preserved(self) -> None:\n\n assert sanitized_agent_name(\"my model\") == \"my model\"\n\n def test_dots_preserved(self) -> None:\n\n assert sanitized_agent_name(\"my.model\") == \"my.model\"\n\n def test_colons_preserved(self) -> None:\n\n assert sanitized_agent_name(\"my:model\") == \"my:model\"\n\n def test_slashes_preserved(self) -> None:\n\n assert sanitized_agent_name", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "\"/cache\"", + "got": "\"/cache\"", + "got_raw": " \"/cache\"\n\n assert vol.host == \"~/.cache\"\n\n assert vol.guest == \"/cache\"\n\n assert vol.host == \"~/.cache\"\n\n assert vol.guest == \"/cache\"\n\n assert vol.host == \"~/.cache\"\n\n assert vol.guest == \"/cache\"\n\n assert vol.host == \"~/.cache\"\n\n assert vol.guest == \"/cache\"\n\n assert vol.host == \"~/.cache\"\n\n assert vol.guest == \"/cache\"\n\n assert vol.host == \"~/.cache\"\n\n assert vol.guest == \"/cache\"\n\n assert vol.host == \"~/.cache\"\n\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dreadnode/dyana", + "expected": "\"rw\"", + "got": "\"rw\"", + "got_raw": " \"rw\"\n\n def test_artifacts_volume_read_only(self, mock_docker_client: MagicMock) -> None:\n mock_docker_client.containers.run.return_value = MagicMock()\n run_detached(\"img\", [\"cmd\"], {\"/host/path\": \"/artifacts\", \"/other/path\": \"/other\"})\n call_kwargs = mock_docker_client.containers.run.call_args.kwargs\n\n assert call_kwargs[\"volumes\"][\"/host/path\"][\"mode\"] == \"ro\"\n assert call_kwargs[\"volumes\"][\"/other/path\"][\"mode\"] == \"ro\"\n\n def test_artifacts_volume_read_only(self, mock_docker", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "_UnevaluatedForwardRefError)", + "got": "_UnevaluatedForwardRefError):", + "got_raw": " _UnevaluatedForwardRefError):\n get_recursive_args(typing.Union[int, SomeForwardRef])\n\n assert get_recursive_args(typing.Union[int, typing.List[SomeForwardRef]]) == [int, SomeForwardRef]\n\n assert get_recursive_args(typing.Union[int, typing.List[typing.List[SomeForwardRef]]]) == [int, SomeForwardRef]\n\n assert get_recursive_args(typing.Union[int, typing.List[typing.List[typing.List[SomeForwardRef]]]]) == [int, SomeForwardRef]\n\n assert get_recursive_args(typing.Union[int, typing.List[typing.List[", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.9824561403508771, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "\"GlobalOtherClassBefore\"", + "got": "", + "got_raw": " # type: ignore [attr-defined]\n \"GlobalOtherClassBefore\"\n assert fields[\"global_ref\"].raw_type == GlobalOtherClassBefore # type: ignore [attr-defined]\n\n assert fields[\"nested_global_ref\"].raw_type == Optional[GlobalOtherClassBefore] # type: ignore [attr-defined]\n\n\ndef test_forward_refs_fn_scope_unresolvable():\n \"\"\"Function scope struct with forward references that we cannot automatically resolve.\"\"\"\n\n # Unresolvable by resolve_types_on_dataclass in get_fields_from_msgspec_struct\n class FnScopeUnresolvable(msgspec.Struct):\n imported_ref: \"msgspec_examples.P", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "\"str\"", + "got": "'\"str\"'", + "got_raw": " '\"str\"'\n assert _maybe_quote_value(\"str with space\") == '\"str with space\"'\n assert _maybe_quote_value(\"123\") == '123'\n assert _maybe_quote_value(\"123 with space\") == '123 with space'\n\n assert _maybe_quote_value(\"123\") == '123'\n assert _maybe_quote_value(\"123 with space\") == '123 with space'\n assert _maybe_quote_value(\"str\") == '\"str\"'\n assert _maybe_quote_value(\"str with space\") == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8333333333333334, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "\"members\"", + "got": "\"members\"", + "got_raw": " \"members\"\n assert fields[2].type_name == \"list[Person]\"\n # members\n assert fields[3].model_full_name == FullyQualifiedName.from_object(dataclasses_examples.Party)\n assert fields[3].name == \"members\"\n assert fields[3].type_name == \"list[Person]\"\n\ndef test_is_dataclass_class():\n assert is_dataclass_class(dataclasses_examples.Party)\n assert not is_dataclass_class(int)\n\ndef test_resolve_types_on_dataclass():\n Party = dataclasses_examples.Party\n resolve_types_on_dataclass(Party)\n fields = get_fields_from_data", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "None", + "got": "assert get_field_extractor_fn(NotAModel) is None", + "got_raw": "<|fim_suffix|>\n assert get_field_extractor_fn(NotAModel) is None\n\n assert get_predicate_fn(key) == predicate_fn\n\n\ndef test_register_plugin_overwrite():\n \"\"\"Overwriting a plugin key will overwrite the existing plugin.\"\"\"\n\n key, base_model, predicate_fn, get_fields_fn = custom_plugin\n\n assert key in list_plugins()\n\n class MyModel(base_model): ...\n\n assert identify_field_extractor_fn(MyModel) == get_fields_fn\n assert identify_field_extractor_fn(erdantic.examples.pydantic.Party) not in (\n get_fields_fn,\n None,\n )\n\n class NotAModel: ...\n\n", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "GlobalOtherModelAfter", + "got": "", + "got_raw": " # type: ignore\n GlobalOtherModelAfter\n assert fields[\"nested_global_ref_after\"].type_name == \"Optional[GlobalOtherModelAfter]\"\n assert fields[\"nested_global_ref_after\"].raw_type == # type: ignore\n Optional[GlobalOtherModelAfter]\n\ndef test_forward_refs_local_scope():\n \"\"\"Local scope model with forward references that we can handle automatically.\"\"\"\n # Model is defined in the local scope of a function\n fields = {fi.name: fi for fi in get_fields_from_pydantic_v1_model(LocalWithFwdRefs)}\n pprint({name: (fi.type_name, fi", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "\"str\"", + "got": "\"str\"", + "got_raw": " \"str\"\n\n # age\n assert fields[1].model_full_name == FullyQualifiedName.from_object(dataclasses_examples.Party)\n assert fields[1].name == \"age\"\n\n assert fields[1].type_name == \"int\"\n\n # address\n assert fields[2].model_full_name == FullyQualifiedName.from_object(dataclasses_examples.Party)\n assert fields[2].name == \"address\"\n\n assert fields[2].type_name == \"Address\"\n\n # phone_numbers\n assert fields[3].model_full_name == FullyQualifiedName.from_object(dataclasses_examples.Party)\n assert fields[", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "predicate_fn", + "got": "assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)", + "got_raw": "<|fim_suffix|>\n assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)\n assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)\n assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)\n assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)\n assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)\n assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)\n assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)\n assert get_field_extractor_fn(tp) == get_field_extractor_fn(tp)\n assert get_field_extractor_fn", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "\"Party\"", + "got": "", + "got_raw": " # type: ignore [attr-defined]\n \"erdantic.examples.msgspec.ImportedRef\"\n assert fields[\"imported_ref\"].raw_type == # type: ignore [attr-defined]\n msgspec_examples.ImportedRef\n assert fields[\"imported_ref\"].raw_type is not None\n assert fields[\"imported_ref\"].raw_type is not msgspec_examples.ImportedRef\n assert fields[\"imported_ref\"].raw_type is msgspec_examples.ImportedRef\n assert fields[\"imported_ref\"].raw_type is not msgspec_examples.ImportedRef\n assert fields[\"imported_ref\"].raw_type is", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "\"GlobalWithFwdRefs\"", + "got": "", + "got_raw": " # type: ignore [union-attr]\n assert fields[\"self_ref\"].raw_type == pydantic_examples.GlobalWithFwdRefs\n\n assert fields[\"self_ref\"].type_name == # type: ignore [union-attr]\n assert fields[\"self_ref\"].raw_type == pydantic_examples.GlobalWithFwdRefs\n\n assert fields[\"self_ref\"].type_name == # type: ignore [union-attr]\n assert fields[\"self_ref\"].raw_type == pydantic_examples.GlobalWithFwdRefs\n\n assert fields[\"self_ref\"].type_name == # type: ignore [union-attr", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "\"cf-many\"", + "got": "\"cf-many\"", + "got_raw": " \"cf-many\"\n assert _get_crowsfoot_d2(Cardinality.MANY, Modality.ZERO) == \"cf-many\"\n assert _get_crowsfoot_d2(Cardinality.MANY, Modality.ONE) == \"cf-many-required\"\n\n # UNSPECIFIED modality behaves like UNDEFINED; required only if Cardinality.MANY\n assert _get_crowsfoot_d2(Cardinality.UNSPECIFIED, Modality.UNSPECIFIED) == \"cf-one\"\n assert _get_crowsfoot_d2(Cardinality.UNSPECIFIED, Modality.ZERO) == \"cf-one\"\n assert _get_crowsfoot", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "msgspec_examples.Party", + "got": "", + "got_raw": " # type: ignore [union-attr]\n FullyQualifiedName.from_object(msgspec_examples.Party)\n assert fields[\"imported_ref\"].raw_type == # type: ignore [union-attr]\n FullyQualifiedName.from_object(msgspec_examples.Party)\n assert fields[\"imported_ref\"].raw_type == # type: ignore [union-attr]\n FullyQualifiedName.from_object(msgspec_examples.Party)\n assert fields[\"imported_ref\"].raw_type == # type: ignore [union-attr]\n FullyQualifiedName.from_object(msgspec_examples.Party)\n assert fields[\"imported_ref\"].raw_type == ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "expected_dataclasses_models", + "got": "expected_dataclasses_models", + "got_raw": " expected_dataclasses_models\n assert (\n set(find_models(dataclasses_examples, limit_search_models_to=[\"dataclasses\"]))\n == expected_dataclasses_models\n )\n assert set(find_models(dataclasses_examples, limit_search_models_to=[\"pydantic\"])) == set()\n\n with pytest.raises(PluginNotFoundError):\n set(find_models(pydantic_examples, limit_search_models_to=[\"nonexistent\"]))\n\n with pytest.raises(PluginNotFoundError):\n set(find_models(pydantic_examples, limit_search_models_to=[\"nonexistent\", \"pydantic\"]))\n\n with pytest.raises(PluginNotFoundError):\n set(find_models(pydantic_examples,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "pydantic_examples.Party", + "got": "", + "got_raw": " # type: ignore\n assert fields[\"nested_imported_ref\"].type_name == \"Optional[Quest]\"\n assert fields[\"nested_imported_ref\"].raw_type == # type: ignore\n assert fields[\"global_ref\"].type_name == \"GlobalWithFwdRefs\"\n assert fields[\"global_ref\"].raw_type == # type: ignore\n assert fields[\"nested_global_ref\"].type_name == \"Optional[GlobalWithFwdRefs]\"\n assert fields[\"nested_global_ref\"].raw_type == # type: ignore\n assert fields[\"self_ref\"].type_name == \"FnScopeAutomaticallyResolvable\"\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "drivendataorg/erdantic", + "expected": "attrs_examples.Party", + "got": "", + "got_raw": " # type: ignore [attr-defined]\n attrs_examples.GlobalWithFwdRefs.imported_ref\n assert fields[\"imported_ref\"].raw_type == # type: ignore [attr-defined]\n attrs_examples.GlobalWithFwdRefs.imported_ref\n assert fields[\"imported_ref\"].raw_type == # type: ignore [attr-defined]\n attrs_examples.GlobalWithFwdRefs.imported_ref\n assert fields[\"imported_ref\"].raw_type == # type: ignore [attr-defined]\n attrs_examples.GlobalWithFwdRefs.imported_ref\n assert fields[\"imported_ref\"].raw_type == ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "(128, 2187)", + "got": "2 ** (1 + 2 * 3), \"Wrong number of rows\"", + "got_raw": "2 ** (1 + 2 * 3), \"Wrong number of rows\"\n assert new_dimension == 3 ** (1 + 2 * 3), \"Wrong number of columns\"\n\n\ndef test_get_repeated_game_with_2_by_3_stage_game_with_2_repetitions():\n \"\"\"\n Checks the dimension of a repeated game.\n\n The expected number of rows is:\n\n 2 ^ (1 + 2 * 3) (there are 7 possible histories, for each there are two\n possible actions)\n\n The expected number of columns is:\n\n 3 ^ (1 + 2", + "exact_match": false, + "code_bleu": 0.1235622127262679, + "edit_similarity": 0.19607843137254902, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "(1, number_of_rows + 1)", + "got": "(1, number_of_rows + 1)", + "got_raw": " (1, number_of_rows + 1)\n assert A_eq[0, -1] == 0\n assert A_eq[0, :-1].sum() == number_of_rows\n\ndef test_get_A_ub():\n for number_of_rows in range(2, 10):\n A_ub = get_A_ub(row_player_payoff_matrix=np.ones(shape=(number_of_rows, number_of_rows)))\n\n assert A_ub.shape == (number_of_rows, number_of_rows + 1)\n assert A_ub[:, -1].sum() == number_of_rows\n assert A_ub[:, :-1].sum(axis", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "GeneratorType)", + "got": "GeneratorType)", + "got_raw": " GeneratorType)\n\n for vertex in vertices_generator:\n self.assertEqual(len(vertex[0]), number_of_strategies)\n self.assertEqual(len(vertex[1]), number_of_strategies)\n self.assertEqual(len(vertex[0]), dimension)\n self.assertEqual(len(vertex[1]), dimension)\n self.assertTrue(np.all(vertex[0] >= 0))\n self.assertTrue(np.all(vertex[1] >= 0))\n self.assertTrue(np.all(vertex[0] <= 1))\n self.assertTrue(np.all(vertex[1] <= 1))\n self.assertTrue(np.all(vertex[0] + vertex[1] <= 1))\n self", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "[(), (0,), (1,), (0, 1)])", + "got": "[[], [0], [1], [0, 1]])", + "got_raw": " [[], [0], [1], [0, 1]])\n\n def test_indifference_strategies(self):\n A = np.array([[1, 0], [0, 1]])\n B = np.array([[1, 0], [0, 1]])\n non_degenerate = False\n tol = 10**-16\n\n for pair in indifference_strategies(A, B, non_degenerate=non_degenerate, tol=tol):\n s1, s2, sup1, sup2 = pair\n self.assertTrue(obey_support(s1, sup1, tol=tol", + "exact_match": false, + "code_bleu": 0.15336485865771982, + "edit_similarity": 0.625, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "len(population)", + "got": "6", + "got_raw": "6\n\n\ndef test_properties_of_scores_for_complete_graph():\n \"\"\"\n Confirm that output works and falls within expected bounds for a complete\n graph.\n\n Note this uses a strategy that generates a boolean array. However this will\n be considered like a binary array.\n \"\"\"\n population = np.array((0, 0, 1, 1, 2, 2))\n M = np.array(((0, 1, 1), (1, 0, 1), (1, 1, 0)))\n scores = score_all_individuals(\n A=M,\n population=population,\n", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "(number_of_strategies + dimension, dimension + 1))", + "got": "2 * number_of_strategies + dimension, halfspace.shape[0])", + "got_raw": "2 * number_of_strategies + dimension, halfspace.shape[0])\n self.assertEqual(dimension, halfspace.shape[1])\n\n @given(A=arrays(np.int8, (4, 5)))\n def test_creation_of_halfspaces_with_zero_sum(self, A):\n \"\"\"\n Test that can create halfspaces for a zero sum game\n\n Parameters\n ----------\n A : array\n 2 dimensional list/array representing the payoff matrix for a\n the row player in a game.\n \"\"\"\n A = A + abs(np.min(A))\n halfspace = build_halfspaces(A)\n number_of_str", + "exact_match": false, + "code_bleu": 0.27824623288353134, + "edit_similarity": 0.6728971962616822, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "DeprecationWarning)", + "got": "DeprecationWarning)", + "got_raw": " DeprecationWarning)\n self.assertEqual(w[0].message.args[0], \"Standard lemke_howson function now supports lex sort, this class will be removed soon\")\n\n def test_lemke_howson_lex(self):\n A = np.array([[-1, -1, -1], [0, 0, 0], [-1, -1, -10000]])\n B = np.array([[-1, -1, -1], [0, 0, 0], [-1, -1, -10000]])\n eqs = lem", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "{len(initial_population)}", + "got": "{len(last_generation)}", + "got_raw": " {len(last_generation)}\n assert set(map(len, generations)) == {len(initial_population)}\n assert set(last_generation) == set(initial_population)\n else:\n pytest.skip(\"Only non negative valued matrices are currently supported\")\n\n@given(M=arrays(np.int8, (3, 3), unique=True))\ndef test_moran_process_in_3_by_3_game_with_mutation_probability(M):\n \"\"\"\n This tests that the final population only has a single population in it and\n that all generations have a population of the correct length and the correct\n possible entries.\n\n Note that only non negative sampled matrices", + "exact_match": false, + "code_bleu": 0.488923022434901, + "edit_similarity": 0.5957446808510638, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "True", + "got": "True", + "got_raw": " True\n assert is_best_response(A=A, sigma_c=sigma_c, sigma_r=sigma_r) is False\n\ndef test_is_best_response_example_2():\n \"\"\"\n This tests an example from the discussion documentation.\n\n The second assert checks that the column player strategy is as expected.\n \"\"\"\n A = np.array(((0, -1, 1), (1, 0, -1), (-1, 1, 0)))\n sigma_c = np.array((0, 1 / 2, 1 / 2))\n sigma_r = np.array((1, 0, ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "np.array_equal(halfspace[number_of_strategies:, :-1], -np.eye(dimension)))", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n halfspace[-1, -1], -np.ones(number_of_strategies + dimension)\n )\n\n @given(A=arrays(np.int8, (4, 5)))\n def test_creation_of_halfspaces_with_zero_sum(self, A):\n \"\"\"\n Test that can create halfspaces for a zero sum game\n\n Parameters\n ----------\n A : array\n 2 dimensional list/array representing the payoff matrix for a\n the row player in a game.\n \"\"\"\n A = A + abs(np.min(A))\n halfspace = build_halfspaces(A)\n number_of_strategies, dimension =", + "exact_match": false, + "code_bleu": 0.06521739130434781, + "edit_similarity": 0.1839080459770115, + "n_retrieved": 10 + }, + { + "repo": "drvinceknight/Nashpy", + "expected": "1", + "got": "1", + "got_raw": "1\n assert eqs[0] == (np.array([0.25, 0.25, 0.25, 0.25]), np.array([0.25, 0.25, 0.25, 0.25]))\n\n def test_support_enumeration_for_particular_game_2(self):\n \"\"\"\n This particular game was raised in\n https://github.com/drvinceknight/Nashpy/issues/67. Two users reported\n that it\n did not return any equilibria under support enumeration. I was", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dylanljones/pyrekordbox", + "expected": "len(blues)", + "got": "1000", + "got_raw": "1000\n assert len(colors) == 1000\n assert len(blues) == 1000\n\n assert heights.dtype == np.int64\n assert colors.dtype == np.int64\n assert blues.dtype == np.int64\n\n assert heights.shape == (1000, 2)\n assert colors.shape == (1000, 2, 3)\n assert blues.shape == (1000, 2, 3)\n\n assert heights[0, 0] == 0\n assert heights[0, ", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dylanljones/pyrekordbox", + "expected": "times)", + "got": "0.5 * np.arange(tag.count))", + "got_raw": "0.5 * np.arange(tag.count))\n\ndef test_pqtz_tag_get_times():\n paths = ANLZ_FILES[0]\n file = anlz.AnlzFile.parse_file(paths[\"DAT\"])\n tag = file.get_tag(\"PQTZ\")\n\n times = 0.5 * np.arange(tag.count)\n tag.set_times(times)\n\n assert_equal(tag.get_times(), 0.5 * np.arange(tag.count))\n\ndef test_pqtz_tag_get_times_with_offset():\n paths = ANLZ_FILES[0]\n file = anlz.AnlzFile.parse_file(paths[\"DAT\"])\n tag = file", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.12121212121212122, + "n_retrieved": 10 + }, + { + "repo": "dylanljones/pyrekordbox", + "expected": "0", + "got": "0, f\"Command failed with exit code {result.exit_code}\"", + "got_raw": "0, f\"Command failed with exit code {result.exit_code}\"\n assert \"Usage:\" in result.stdout, f\"Command output does not contain 'Usage:'\"\n assert \"Options:\" in result.stdout, f\"Command output does not contain 'Options:'\"\n\ndef test_cli_version():\n \"\"\"Check if the CLI version is correct.\"\"\"\n result = shell(\"python -m pyrekordbox --version\")\n # Check if the command was successful\n\n assert result.exit_code == 0, f\"Command failed with exit code {result.exit_code}\"\n assert \"pyrekordbox\" in result.stdout, f\"", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.03636363636363636, + "n_retrieved": 10 + }, + { + "repo": "dylanljones/pyrekordbox", + "expected": "p", + "got": "p", + "got_raw": " p\n\n@pytest.mark.parametrize(\"paths\", ANLZ_FILES)\ndef test_ppth_tag_setters(paths):\n tmp = \"\"\n for path in paths.values():\n file = anlz.AnlzFile.parse_file(path)\n tag = file.get_tag(\"PPTH\")\n p = tag.get()\n if not tmp:\n tmp = p\n else:\n\n assert tmp == p\n\n@pytest.mark.parametrize(\"paths\", ANLZ_FILES)\ndef test_ppth_tag_update_len(paths):\n tmp = \"\"\n for path in paths.values():\n file = anlz.AnlzFile.parse_file(path)\n tag = file", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "RuntimeError)", + "got": "ValidationError):", + "got_raw": "ValidationError):\n settings = LazySettings(\n redis_enabled=True,\n redis_host=\"redis_host\",\n redis_port=6379,\n redis_db=0,\n redis_decode_responses=True,\n )\n\n with pytest.raises(ValidationError):\n settings = LazySettings(\n redis_enabled=True,\n redis_host=\"redis_host\",\n redis_port=6379,\n redis_db=0,\n redis_decode_responses=True,\n )\n\n with pytest.raises(ValidationError):\n settings = LazySettings(\n redis_enabled=True,\n redis_host=\"redis_host\",\n redis_port=6379,\n redis_db", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5333333333333333, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "\"7.2\"", + "got": "7.2", + "got_raw": "7.2\n assert settings.server.deploy_arguments.snap_version == 22\n assert settings.server.deploy_arguments.rhel_version == \"7\"\n\ndef test_690_example2(tmp_path):\n environ = {\"MYAPP_SERVER__VERSION__RELEASE\": \"7.2\"}\n filename = create_file(\n filename=tmp_path / \"s.yaml\",\n data=\"\"\"\\\n SERVER:\n VERSION:\n RELEASE: \"6.10\"\n SNAP: 22\n DEPLOY_WORKFLOW: \"deploy-sat-jenkins\"\n DEPLOY_ARGUMENTS:\n sat_version: \"@format {this.server.version", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "\"testing\"", + "got": "assert settings.PORT == 4040", + "got_raw": "<|fim_suffix|>\n assert settings.PORT == 4040\n\n assert settings.CUSTOM.NESTED_1.NESTED_2.NESTED_3.NESTED_4.TOML == 5\n\n assert settings.CUSTOM.NESTED_1.NESTED_2.NESTED_3.NESTED_4.YAML == 5\n\n assert settings.CUSTOM.NESTED_1.NESTED_2.NESTED_3.NESTED_4.JSON == 5\n\n assert settings.CUSTOM.NESTED_1.NESTED_2.NESTED_3.NEST", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.2702702702702703, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "value", + "got": "value", + "got_raw": " value\n assert flask_app.config.get(key) == value\n assert flask_app.config.get(key, \"default\") == value\n assert flask_app.config.get(key, \"default\") == value\n assert flask_app.config.get(key, \"default\") == value\n assert flask_app.config.get(key, \"default\") == value\n assert flask_app.config.get(key, \"default\") == value\n assert flask_app.config.get(key, \"default\") == value\n assert flask_app.config.get(key, \"default\") == value\n assert flask_app.config.get(key, \"default\") == value\n assert flask", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "val", + "got": "val", + "got_raw": " val\n\n\ndef test_extracted_validators_from_annotated_with_default(monkeypatch):\n def cast_url(v):\n return v.lower()\n\n def auth_condition(v):\n return \"token\" in v\n\n class Auth(DictValue):\n token: Annotated[str, Validator(len_min=10)]\n\n not_banana = Validator(ne=\"banana\")\n\n class Settings(Dynaconf):\n dynaconf_options = Options(\n _trigger_validation=False,\n )\n name: Annotated[str, Validator(ne=\"Valdemort\")]\n age: int\n team: str = \"Default\"\n colors:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "{\"name\": \"Bruno\", \"age\": 17})", + "got": "123)", + "got_raw": "123)\n\n self.assertEqual(settings.get(\"PERSON\"), 123)\n self.assertEqual(settings.get(\"PERSON\", 2), 2)\n self.assertEqual(settings.get(\"PERSON\", 2, default=3), 3)\n self.assertEqual(settings.get(\"PERSON\", 2, default=3, merge_unique=True), 123)\n\n self.assertEqual(settings.get(\"PERSON\", 2, default=3, merge_unique=False), 2)\n\n self.assertEqual(settings.get(\"PERSON\", 2, default=3, merge_unique=True), 123)\n\n self.assertEqual(settings.get(\"PERSON\", ", + "exact_match": false, + "code_bleu": 0.1074569931823542, + "edit_similarity": 0.12121212121212122, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "0", + "got": "0", + "got_raw": "0\n assert value * 2 == 2\n assert value / 2 == 0.5\n assert value // 2 == 0\n assert value % 2 == 1\n assert divmod(value, 2) == (0, 1)\n assert pow(value, 2) == 1\n assert pow(value, 2, 3) == 1\n\n assert value + HookValue(1) == 2\n assert value - HookValue(1) == 0\n assert value * HookValue(2) == 2\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "1", + "got": "1", + "got_raw": "1\n\n assert settings.CONTENT_APP_TTL == 30\n\n # after\n with override_settings(CONTENT_APP_TTL=2):\n\n assert settings.CONTENT_APP_TTL == 2\n\n assert settings.CONTENT_APP_TTL == 30\n\n # after\n with override_settings(CONTENT_APP_TTL=3):\n\n assert settings.CONTENT_APP_TTL == 3\n\n assert settings.CONTENT_APP_TTL == 30\n\n # after\n with override_settings(CONTENT_APP_TTL=4):\n\n assert settings.CONTENT_APP_TTL == 4\n\n assert settings.CONTENT_APP_TTL == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "True", + "got": "assert settings.exists(\"BAR\") is False", + "got_raw": "<|fim_suffix|>\n assert settings.exists(\"BAR\") is False\n\n load(settings, filename=_JSON, env=\"FOO\", key=\"zaz\")\n assert settings.ZAZ == \"naz\"\n\n assert settings.exists(\"ZAZ\") is True\n\n load(settings, filename=_JSON, env=\"FOO\", key=\"zaz\", default=\"default\")\n assert settings.ZAZ == \"naz\"\n\n assert settings.exists(\"ZAZ\") is True\n\n load(settings, filename=_JSON, env=\"FOO\", key=\"zaz\", default=\"default\", cast=\"@int\")\n assert settings.ZAZ == 123", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.047619047619047616, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "2", + "got": "2", + "got_raw": "2\n\n # assert values set by the second hook\n assert settings.INSTALLED_APPS == [\"admin\", \"plugin\", \"extra\"]\n assert settings.COLORS == [\"red\", \"green\", \"blue\", \"yellow\"]\n assert settings.DATABASES.default.NAME == \"db\"\n assert settings.DATABASES.default.PORT == 5152\n assert settings.DATABASES.default.VERSION == 43\n assert settings.DATABASES.default.FORCED_INT == 13\n assert settings.BANDS == [\"Rush\", \"Yes\", \"Anathema\", \"Opeth\"]\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "\"testing\"", + "got": "\"testing\"", + "got_raw": " \"testing\"\n```\n\n## Using `settings` as a `dict`\n\nDynaconf is a `dict` like object, so you can use it as a `dict` and access\nsettings variables using dot notation.\n\n```py\nfrom dynaconf import settings\n\nsettings.username == \"admin\" # dot notation\nsettings.PORT == settings.port == 9900 # case insensitive\nisinstance(settings.port, int) # automatic type casting\nsettings.databases.name == \"mydb\" # Nested keys traversing\nsettings['password'] == \"secret123\" # dict like item access", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "0", + "got": "0", + "got_raw": "0\n assert (\n settings.NESTED_A.NESTED_B[0][2].NESTED_C.NESTED_D[0]\n == \"extra_conf\"\n )\n\n # Dotted set with index\n settings.set(\n \"nested_a.nested_b[2][1].nested_c.nested_d[3]\", \"old_conf\"\n )\n settings.set(\n \"nested_a.nested_b[2][1].nested_c.nested_d[3]\", \"new_conf1\"\n ) # overwrite\n settings.set(\n \"nested_a.nested_b[2][1].", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "42", + "got": "42", + "got_raw": "42\n assert settings.other_person.name == \"Erik\"\n assert settings.other_person.age == 5\n assert settings.even_other_person.name == \"John\"\n assert settings.even_other_person.age == 21\n assert settings.yet_another_person.name == \"John\"\n assert settings.yet_another_person.age == 19\n\n # also works with dict overriding Person class defaults\n assert settings.other_person == {\"name\": \"Erik\", \"age\": 5}\n assert settings.even_other_person == {\"age\": 21}\n assert settings.yet_another", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "RuntimeError)", + "got": "ValidationError) as e:", + "got_raw": "ValidationError) as e:\n write(\"settings\", {\"SECRET\": \"redis_works\"})\n assert \"REDIS_ENABLED_FOR_DYNACONF\" in str(e.value)\n\n@pytest.mark.integration\ndef test_write_vault_not_configured_with_env_var():\n os.environ[\"REDIS_ENABLED_FOR_DYNACONF\"] = \"false\"\n with pytest.raises(ValidationError) as e:\n write(\"settings\", {\"SECRET\": \"redis_works\"})\n assert \"REDIS_ENABLED_FOR_DYNACONF\" in str(e.value)\n del os.environ[\"REDIS_ENABLED_FOR_DYNACONF\"]\n\n@pytest.mark.integration\ndef test", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.45714285714285713, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "2", + "got": "2", + "got_raw": "2\n assert value != \"2\"\n assert value != \"2.0\"\n assert value != \"2.1\"\n assert value != \"2.2\"\n assert value != \"2.3\"\n assert value != \"2.4\"\n assert value != \"2.5\"\n assert value != \"2.6\"\n assert value != \"2.7\"\n assert value != \"2.8\"\n assert value != \"2.9\"\n assert value != \"2.10\"\n assert value != \"2.11\"\n assert value != \"2.12", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "\"Task2-2\"", + "got": "\"Task2-2\"", + "got_raw": " \"Task2-2\"\n\n # Check that the settings are not shared between tasks\n settings = Dynaconf()\n settings.set(\"VALUE\", \"@format Task3-{this.ID}\")\n settings.set(\"ID\", \"3\")\n # Simulate async work\n await asyncio.sleep(0.01)\n result = settings.VALUE\n assert result == \"Task3-3\", f\"Expected 'Task3-3', got '{result}'\"\n return result\n\n # Simulate async work\n await asyncio.sleep(0.01)\n result = settings.VALUE\n assert result == \"Task", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "settings.PORT", + "got": "9900", + "got_raw": "9900\n\nif __name__ == \"__main__\":\n app()\n```\n\n## Programmatically loading a settings file\n\nYou can load files from within a python script.\n\nWhen using relative paths, it will use `root_path` as its basepath.\nLearn more about how `root_path` fallback works [here](configuration.md#root_path).\n\n```python\nfrom dynaconf import Dynaconf\n\nsettings = Dynaconf()\n\n# single file\nsettings.load_file(path=\"/path/to/file.toml\")\n\n# list\nsettings.load_file(path=[\"/path/to/file.toml\", \"/path/to/another-file.toml", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "\"blaz\"", + "got": "123456", + "got_raw": "123456\n\n\ndef test_load_single_key_with_prefix():\n \"\"\"Test loading a single key with prefix\"\"\"\n _JSON = \"\"\"\n {\n \"foo\": {\n \"bar\": \"blaz\",\n \"zaz\": \"naz\"\n }\n }\n \"\"\"\n load(settings, filename=_JSON, env=\"FOO\", key=\"bar\", prefix=\"foo\")\n\n assert settings.FOO_BAR == 123456\n\n\ndef test_load_single_key_with_prefix_and_env():\n \"\"\"Test loading a single key with prefix and env\"\"\"\n _JSON = \"\"\"\n {\n \"foo\":", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "6", + "got": "3", + "got_raw": "3\n assert history[0].env == \"default\"\n assert history[0].source == \"envvar\"\n assert history[0].source_metadata == {\"dynaconf_merge\": True}\n assert history[0].source_metadata[\"dynaconf_merge\"] == True\n assert history[0].source_metadata[\"dynaconf_merge\"].get(\"dynaconf_merge\") == True\n assert history[0].source_metadata[\"dynaconf_merge\"].get(\"dynaconf_merge\") == True\n assert history[0].source_metadata[\"dynaconf_merge\"].get(\"dynaconf_merge\")", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "dynaconf/dynaconf", + "expected": "\"b\")", + "got": "\"b\")", + "got_raw": " \"b\")\n\n def test_modified_settings_with_override(self):\n with override_settings(TEST_VALUE=\"b\"):\n\n self.assertEqual(settings.TEST_VALUE, \"b\")\n\n def test_modified_settings_with_override_and_override_settings(self):\n with override_settings(TEST_VALUE=\"b\"), override_settings(TEST_VALUE=\"c\"):\n\n self.assertEqual(settings.TEST_VALUE, \"c\")\n\n def test_modified_settings_with_override_and_override_settings_and_override_settings(self):\n with override_settings(TEST_VALUE=\"b\"), override_settings(TEST_VALUE=\"c\"), override_settings(TEST_VALUE=\"d\"):\n\n self.assertEqual(settings.TEST_VALUE, \"d\")\n\n def test_modified_settings", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "TypeError)", + "got": "InvalidChecksumError, WifEncoder.EncodeKey, TEST_ED25519_PRIV_KEY, net_ver=b\"\\x80\")", + "got_raw": "InvalidChecksumError, WifEncoder.EncodeKey, TEST_ED25519_PRIV_KEY, net_ver=b\"\\x80\")\n self.assertRaises(InvalidChecksumError, WifEncoder.EncodeKey, TEST_ED25519_PRIV_KEY, net_ver=b\"\\x81\")\n self.assertRaises(InvalidChecksumError, WifEncoder.EncodeKey, TEST_ED25519_PRIV_KEY, net_ver=b\"\\x82\")\n self.assertRaises(InvalidChecksumError, WifEncoder.EncodeKey, TEST_ED25519_PRIV_KEY, net_ver=b\"\\x83\")\n self.assertRaises(", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.15053763440860216, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "XlmAddr is XlmAddrEncoder)", + "got": "issubclass(XlmAddr, XlmAddrDecoder))", + "got_raw": "issubclass(XlmAddr, XlmAddrDecoder))\n self.assertTrue(issubclass(XlmAddr, XlmAddrEncoder))\n\n def test_addr_dec(self):\n\n for test in TEST_VECT:\n self.assertEqual(XlmAddrDecoder.Decode(test[\"address_dec\"]), test[\"address\"])\n\n def test_addr_dec_invalid(self):\n\n for test in TEST_VECT_DEC_INVALID:\n with self.assertRaises(ValueError):\n XlmAddrDecoder.Decode(test)\n\n def test_addr_enc(self):\n\n for test in TEST_VECT:\n self.assertEqual(XlmAddrEncoder.Encode(test[\"pub_key\"], **test[\"address_params\"]), test[\"", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.6774193548387096, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "TypeError)", + "got": "InvalidAlphabetError, Base58Decoder, \"1234567890\", Base58Alphabets.BASE58_CHECK)", + "got_raw": "InvalidAlphabetError, Base58Decoder, \"1234567890\", Base58Alphabets.BASE58_CHECK)\n\n def test_invalid_checksum(self):\n\n self.assertRaises(InvalidChecksumError, Base58Decoder, \"1234567890123456789012345678901234567890123456789012345678901234567890123", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.17777777777777778, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "TypeError)", + "got": "InvalidKeyError, MoneroPrivateKey, key)", + "got_raw": "InvalidKeyError, MoneroPrivateKey, key)\n self.assertRaises(InvalidKeyError, MoneroPrivateKey, key, True)\n\n # Public key\n for key in (TEST_ED25519_PUB_KEY, TEST_ED25519_BLAKE2B_PUB_KEY, TEST_NIST256P1_PUB_KEY,\n TEST_SECP256K1_PUB_KEY, TEST_SR25519_PUB_KEY):\n\n self.assertRaises(InvalidKeyError, MoneroPublicKey, key)\n self.assertRaises(InvalidKeyError, MoneroPublicKey, key, True", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "TypeError)", + "got": "NotImplementedError, Bip32Slip10Ed25519, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,", + "got_raw": "NotImplementedError, Bip32Slip10Ed25519, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,", + "exact_match": false, + "code_bleu": 0.008811000188610465, + "edit_similarity": 0.03684210526315789, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "monero_obj.PrimaryAddress())", + "got": "monero_obj.PrimaryAddress().ToString())", + "got_raw": " monero_obj.PrimaryAddress().ToString())\n\n # Test integrated address\n if not is_watch_only:\n self.assertEqual(test[\"integrated_address\"][\"address\"], monero_obj.IntegratedAddress().ToString())\n self.assertEqual(test[\"integrated_address\"][\"payment_id\"], monero_obj.IntegratedAddress().PaymentId().ToHex())\n\n # Test subaddresses\n for idx, subaddr in enumerate(test[\"subaddresses\"]):\n self.assertEqual(subaddr[\"address\"], monero_obj.Subaddress(idx).ToString())\n self.assertEqual(subaddr[\"major_idx\"], monero_obj.Subaddress(idx).MajorIndex())\n self.assertEqual(subaddr[\"", + "exact_match": false, + "code_bleu": 0.5310725349788701, + "edit_similarity": 0.835820895522388, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "str(mnemonic))", + "got": "MoneroMnemonicGenerator(lang).FromEntropy(binascii.unhexlify(test[\"entropy\"])).ToStr())", + "got_raw": " MoneroMnemonicGenerator(lang).FromEntropy(binascii.unhexlify(test[\"entropy\"])).ToStr())\n\n mnemonic = MoneroMnemonicGenerator(lang).FromEntropy(binascii.unhexlify(test[\"entropy\"]))\n self.assertEqual(test[\"mnemonic\"], mnemonic.ToStr())\n\n mnemonic = MoneroMnemonicGenerator(lang).FromEntropy(binascii.unhexlify(test[\"entropy\"]))\n self.assertEqual(test[\"mnemonic\"], mnemonic.ToStr())\n\n mnemonic = MoneroMnemonicGenerator(lang).FromEntropy(binascii.unhexlify(test[\"entropy\"]))\n self.assertEqual(test[\"mnemonic\"], mnemonic.ToStr())\n\n mnemonic = MoneroMnemonicGenerator", + "exact_match": false, + "code_bleu": 0.07832899330004497, + "edit_similarity": 0.19801980198019803, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "path_elem.IsHard())", + "got": "path_elem.IsHardened())", + "got_raw": " path_elem.IsHardened())\n self.assertEqual(test[\"is_hard\"], path_elem.IsHard())\n\n def test_path(self):\n for test in TEST_VECT_PATH:\n path = SubstratePath(test[\"path\"])\n\n self.assertEqual(test[\"path\"], path.ToStr())\n self.assertEqual(test[\"path\"], str(path))\n\n self.assertEqual(test[\"parsed\"], path.ToList())\n\n def test_add_elem(self):\n for test in TEST_VECT_ADD_ELEM:\n path = SubstratePath(test[\"path\"])\n\n path = path.AddElem(test[\"elem\"])\n\n self.assertEqual(test[\"path\"], path.ToStr())\n\n def test_path", + "exact_match": false, + "code_bleu": 0.488923022434901, + "edit_similarity": 0.9047619047619048, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "Bip32Depth(1) < Bip32Depth(2))", + "got": "0 == Bip32KeyDataConst.ZERO)", + "got_raw": "0 == Bip32KeyDataConst.ZERO)\n self.assertTrue(1 == Bip32KeyDataConst.ONE)\n self.assertTrue(2 == Bip32KeyDataConst.TWO)\n self.assertTrue(3 == Bip32KeyDataConst.THREE)\n self.assertTrue(4 == Bip32KeyDataConst.FOUR)\n self.assertTrue(5 == Bip32KeyDataConst.FIVE)\n self.assertTrue(6 == Bip32KeyDataConst.SIX)\n self.assertTrue(7 == Bip32KeyDataConst.SEVEN)\n self.assertTrue(8 == Bip32KeyDataConst.EIGHT", + "exact_match": false, + "code_bleu": 0.1300254059939352, + "edit_similarity": 0.3448275862068966, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "bip32_obj.Index())", + "got": "bip32_obj.Index())", + "got_raw": " bip32_obj.Index())\n self.assertEqual(test[\"parent_fprint\"], bip32_obj.ParentFingerPrint().ToBytes())\n self.assertEqual(test[\"chain_code\"], bip32_obj.ChainCode().ToBytes())\n self.assertEqual(test[\"pub_key\"], bip32_obj.PublicKey().RawCompressed().ToHex())\n self.assertEqual(test[\"ex_pub\"], bip32_obj.PublicKey().ToExtended())\n\n def test_from_seed_with_child_key(self):\n self._test_from_seed_with_child_key(Bip32Base, Bip32KeyDataConst.TEST_VECTORS)\n\n def test_from_seed_with_der", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "TypeError)", + "got": "", + "got_raw": "\n\n\n# File: bip_utils/__init__.py\n Bip32Ed25519Slip,\n Bip32Ed25519Kholaw,\n Bip32Ed25519Slip,\n Bip32FingerPrint,\n Bip32KeyData,\n Bip32KeyDeserializer,\n Bip32KeyError,\n Bip32KeyIndex,\n Bip32KeyNetVersions,\n Bip32KholawEd25519,\n Bip32Nist256p1,\n Bip32Path,\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "int(elem))", + "got": "0)", + "got_raw": "0)\n self.assertEqual(test_elem, elem.ToInt())\n\n def test_path(self):\n for test in TEST_VECT_PATH:\n self.__test_path(test, Bip32PathParser.Parse(test[\"path\"]))\n\n def test_path_add_elem(self):\n for test in TEST_VECT_ADD_ELEM:\n path = Bip32PathParser.Parse(test[\"path\"])\n path = path.AddElem(test[\"elem\"])\n self.__test_path(test, path)\n\n def test_path_invalid(self):\n for test in TEST_VECT_PATH_INVALID:\n with self.assertRaises(Bip32PathError):\n Bip32PathParser", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "binascii.hexlify(seed))", + "got": "for test in TEST_VECT_MNEMONIC_INVALID:", + "got_raw": "<|fim_suffix|>\n for test in TEST_VECT_MNEMONIC_INVALID:\n lang = test[\"lang\"]\n\n # Test mnemonic validator (language specified)\n mnemonic_validator = AlgorandMnemonicValidator(lang)\n self.assertFalse(mnemonic_validator.IsValid(test[\"mnemonic\"]))\n with self.assertRaises(test[\"exception\"]):\n mnemonic_validator.Validate(test[\"mnemonic\"])\n # Test mnemonic validator (automatic language detection)\n mnemonic_validator = AlgorandMnemonicValidator()\n self.assertFalse(mnemonic_validator.IsValid(test[\"mnemonic\"]))\n with self.assertRaises(test[\"exception\"]):\n mnemonic_validator.Validate(test[\"mnemonic\"])\n\n # Test decoder", + "exact_match": false, + "code_bleu": 0.16398206047581665, + "edit_similarity": 0.06451612903225806, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "ValueError)", + "got": "AddrDecUtils.InvalidAddrEncodingError,", + "got_raw": "AddrDecUtils.InvalidAddrEncodingError,\n addr_dec_class.DecodeAddr,\n addr,\n **addr_params)\n\n def _test_invalid_enc(self, addr_enc_class, pub_key, test_vector):\n for test in test_vector:\n self.assertRaises(AddrEncUtils.InvalidPubKeyError,\n addr_enc_class.EncodeKey,\n pub_key,\n **test[\"address_params\"])\n\n def test_encode_key(self):\n self._test_encode_key(Ed25519AddrEncoder, Ed25519PublicKey, Ed25519AddrTestVector)\n\n def test_decode_addr(self):\n self", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "str(mnemonic))", + "got": "self.assertEqual(test[\"mnemonic\"], mnemonic.ToStr())", + "got_raw": "<|fim_suffix|>\n self.assertEqual(test[\"mnemonic\"], mnemonic.ToStr())\n\n self.assertEqual(test[\"mnemonic\"], mnemonic.ToStr(lang))\n\n # Test mnemonic decoder\n entropy = ElectrumV2MnemonicDecoder(test[\"mnemonic_type\"], lang).Decode(mnemonic)\n\n self.assertEqual(test[\"entropy\"], entropy)\n\n self.assertEqual(test[\"entropy\"], entropy.hex())\n\n self.assertEqual(test[\"entropy\"], BytesUtils.ToBytes(test[\"entropy_final\"]))\n\n # Test seed generator\n seed = ElectrumV2SeedGenerator(mnemonic).Generate()\n\n self.assertEqual(test[\"seed\"], seed)\n\n self.assertEqual(test[\"seed\"], seed", + "exact_match": false, + "code_bleu": 0.12300686288463772, + "edit_similarity": 0.36363636363636365, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "conv_addr)", + "got": "def test_vector(self):", + "got_raw": "<|fim_suffix|>\n def test_vector(self):\n for test in TEST_VECT:\n conv_addr = BchAddrConverter.Convert(test[\"address\"], test[\"new_hrp\"], test[\"new_net_ver\"])\n\n self.assertEqual(test[\"conv_address\"], conv_addr)\n\n def test_vector_invalid(self):\n for test in TEST_VECT:\n with self.assertRaises(ValueError):\n BchAddrConverter.Convert(test[\"address\"], test[\"new_hrp\"], test[\"new_net_ver\"])\n\n\nif __name__ == \"__main__\":\n unittest.main()\n\n\n# File: bip_utils/addr/__init__.py\n# Version\nfrom bip_utils._version", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.1875, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "curve_type)", + "got": "curve_type)", + "got_raw": " curve_type)\n\n self.assertEqual(bip32_class.Curve().Name(), curve_type)\n\n self.assertEqual(bip32_class.Curve().Order(), curve_type)\n\n self.assertEqual(bip32_class.Curve().Generator(), curve_type)\n\n self.assertEqual(bip32_class.Curve().PointClass(), curve_type)\n\n self.assertEqual(bip32_class.Curve().PrivateKeyClass(), curve_type)\n\n self.assertEqual(bip32_class.Curve().PublicKeyClass(), curve_type)\n\n def _test_key_data(self, bip32_class, test_vector):\n for test in test", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "P2SHAddr is P2SHAddrEncoder)", + "got": "issubclass(P2SHAddr, P2SHAddrDecoder))", + "got_raw": "issubclass(P2SHAddr, P2SHAddrDecoder))\n self.assertTrue(issubclass(P2SHAddr, P2SHAddrEncoder))\n\n def test_addr_cls(self):\n\n self.assertTrue(issubclass(P2SHAddr, P2SHAddrDecoder))\n self.assertTrue(issubclass(P2SHAddr, P2SHAddrEncoder))\n\n def test_addr_dec(self):\n\n for test in TEST_VECT:\n self.assertEqual(P2SHAddrDecoder.Decode(test[\"address_dec\"]), test[\"pub_key\"])\n\n def test_addr_dec_invalid(self):\n\n for test in TEST_VECT_DEC_INVALID:\n ", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.696969696969697, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "str(path_elem))", + "got": "path_elem.ToStr())", + "got_raw": " path_elem.ToStr())\n\n self.assertEqual(test[\"is_hard\"], path_elem.IsHardened())\n\n self.assertEqual(test[\"chain_code\"], path_elem.ToChainCode())\n\n def test_path(self):\n for test in TEST_VECT_PATH:\n path = SubstratePath(test[\"path\"])\n\n self.assertEqual(test[\"path\"], path.ToStr())\n\n self.assertEqual(test[\"parsed\"], path.ToList())\n\n def test_add_elem(self):\n for test in TEST_VECT_ADD_ELEM:\n path = SubstratePath(test[\"path\"])\n\n path = path.AddElem(test[\"elem\"])\n\n self.assertEqual(test[\"path\"], path.ToStr())\n\n", + "exact_match": false, + "code_bleu": 0.3303164318013807, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "ebellocchia/bip_utils", + "expected": "test_bit_len // 8)", + "got": "32)", + "got_raw": "32)\n\n def test_entropy_invalid_bitlen(self):\n for test_bit_len in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.09523809523809523, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "key in keys)", + "got": "0 <= len(keys) <= 1)", + "got_raw": "0 <= len(keys) <= 1)\n self.assertTrue(key in keys)\n\n def test_query_with_buffer(self):\n lsh = MinHashLSHEnsemble(threshold=0.9, buffer_size=100000)\n data = list(self._data(64))\n lsh.index(data)\n for key, minhash, size in data:\n keys = lsh.query(minhash, size)\n\n self.assertTrue(0 <= len(keys) <= 1)\n self.assertTrue(key in keys)\n\n def test_query_with_buffer_and_preload(self):\n lsh = MinHashLS", + "exact_match": false, + "code_bleu": 0.14991106946711685, + "edit_similarity": 0.4375, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "d[lm2])", + "got": "11 in lm1)", + "got_raw": "11 in lm1)\n self.assertTrue(123 in lm1)\n self.assertTrue(92 in lm1)\n self.assertTrue(98 in lm1)\n self.assertTrue(123218 in lm1)\n self.assertTrue(32 in lm1)\n self.assertTrue(444 in lm1)\n self.assertFalse(111 in lm1)\n self.assertFalse(123219 in lm1)\n self.assertFalse(123218 in lm1)\n self.assertFalse(123217 in lm1)\n self.assertFalse", + "exact_match": false, + "code_bleu": 0.28744328957046744, + "edit_similarity": 0.35294117647058826, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "b1 < b2)", + "got": "0 < b1 <= b2)", + "got_raw": "0 < b1 <= b2)\n self.assertTrue(0 < r1 <= r2)\n self.assertTrue(b1 * r1 == b2 * r2)\n self.assertTrue(b1 * r1 == lsh.h)\n\n def test_insert(self):\n lsh = MinHashLSH(threshold=0.8)\n m = MinHash(num_perm=128)\n m.update(b\"abc\")\n lsh.insert(1, m)\n self.assertEqual(lsh.keys.get(1), b\"abc\")\n self.assertEqual(lsh.hashtables[0].get(b\"abc\"), [", + "exact_match": false, + "code_bleu": 0.3073940764756322, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "m2)", + "got": "1)", + "got_raw": "1)\n self.assertNotEqual(m1, m2)\n self.assertNotEqual(m1, m3)\n self.assertNotEqual(m1, m4)\n self.assertNotEqual(m1, m5)\n self.assertEqual(m1, m1)\n self.assertEqual(m2, m2)\n self.assertEqual(m3, m3)\n self.assertEqual(m4, m4)\n self.assertEqual(m5, m5)\n\n def test_update_batch(self):\n m = minhash.MinHash(4, 1, hashfunc=fake_hash_func)\n m.update_batch([11, 12, 1", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "lm1.jaccard(lm2) < 1.0)", + "got": "0.0 < lm1.jaccard(lm2) < 1.0)", + "got_raw": "0.0 < lm1.jaccard(lm2) < 1.0)\n\n def test_digest(self):\n m1 = MinHash(4, 1, hashfunc=fake_hash_func)\n m2 = MinHash(4, 1, hashfunc=fake_hash_func)\n lm1 = LeanMinHash(m1)\n lm2 = LeanMinHash(m2)\n self.assertTrue(lm1.digest() == lm2.digest())\n\n def test_pickle(self):\n m1 = MinHash(4, 1, hashfunc=fake_hash_func)\n m2 = MinHash(", + "exact_match": false, + "code_bleu": 0.8070557274927982, + "edit_similarity": 0.8846153846153846, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "b1 < b2)", + "got": "0.2 * b1 + 0.8 * r1 == b2)", + "got_raw": "0.2 * b1 + 0.8 * r1 == b2)\n self.assertTrue(0.2 * b1 + 0.8 * r1 == r2)\n\n def test_insert(self):\n lsh = MinHashLSHBloom(threshold=0.8, n=10, fp=0.01)\n m1 = MinHash(num_perm=128)\n m2 = MinHash(num_perm=128)\n m3 = MinHash(num_perm=128)\n for d in set1:\n m1.update(d.encode(\"utf", + "exact_match": false, + "code_bleu": 0.16108992769687397, + "edit_similarity": 0.4117647058823529, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "lm2)", + "got": "1)", + "got_raw": "1)\n self.assertNotEqual(lm1, m1)\n self.assertNotEqual(lm1, m2)\n self.assertNotEqual(lm1, m3)\n self.assertNotEqual(lm1, m4)\n self.assertNotEqual(lm1, m5)\n self.assertNotEqual(lm1, lm2)\n self.assertNotEqual(lm1, lm3)\n self.assertNotEqual(lm1, lm4)\n self.assertNotEqual(lm1, lm5)\n self.assertNotEqual(lm1, 11)\n self.assertNotEqual(lm1, 12)\n self.assertNot", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n\n def test_insertion_session(self):\n lsh = MinHashLSH(threshold=0.5, num_perm=16)\n m1 = MinHash(16)\n m1.update(b\"a\")\n m2 = MinHash(16)\n m2.update(b\"b\")\n with lsh.insertion_session() as session:\n session.insert(\"a\", m1)\n session.insert(\"b\", m2)\n\n self.assertTrue(\"a\" in lsh.keys)\n self.assertTrue(\"b\" in lsh.keys)\n for table in lsh.hashtables:\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "h2.hashfunc)", + "got": "0b00011111)", + "got_raw": "0b00011111)\n self.assertEqual(h2.hashfunc, 0b00011111)\n\n def test_alpha(self):\n h1 = self._class(4, hashfunc=fake_hash_func)\n h1.update(0b00011111)\n self.assertEqual(h1.alpha, 0.000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "ValueError)", + "got": "NotImplementedError, lsh.insert, m3)", + "got_raw": "NotImplementedError, lsh.insert, m3)\n\n def test_query(self):\n lsh = MinHashLSHBloom(threshold=0.5, num_perm=16, n=10, fp=0.01)\n m1 = MinHash(16)\n m1.update(b\"a\")\n m2 = MinHash(16)\n m2.update(b\"b\")\n lsh.insert(m1)\n lsh.insert(m2)\n\n m3 = MinHash(18)\n\n self.assertRaises(NotImplementedError, lsh.query, m3)\n\n def test", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.3404255319148936, + "n_retrieved": 10 + }, + { + "repo": "ekzhu/datasketch", + "expected": "4)", + "got": "4)", + "got_raw": "4)\n self.assertEqual(h.m, 16)\n self.assertEqual(h.reg, reg)\n\n def test_init_from_p(self):\n h = self._class(p=4, hashfunc=fake_hash_func)\n\n self.assertEqual(h.p, 4)\n self.assertEqual(h.m, 16)\n self.assertEqual(h.reg, np.zeros((16,), dtype=np.int8))\n\n def test_init_from_p_and_reg(self):\n reg = np.array([1 for _ in range(1 << 4)], dtype=np.int8)\n h = self._class(p=4, reg=reg, hash", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "eliangcs/pystock-crawler", + "expected": "{ 'symbol': 'ALL', 'amend': False, 'doc_type': '10-Q', 'period_focus': 'Q1', 'fiscal_year': 2013, 'end_date': '2013-03-31', 'revenues': 8463000000, 'op_income': None, 'net_income': 709000000, 'eps_basic': 1.49, 'eps_diluted': 1.47, 'dividend': 0.25, 'assets': 126612000000, 'cur_assets': None, 'cur_liab': None, 'equity': 20619000000, 'cash': 820000000, 'cash_flow_op': 740000000, 'cash_flow_inv': 136000000, 'cash_flow_fin': -862000000 })", + "got": "2013, 3, 31, '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '", + "got_raw": "2013, 3, 31, '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '10-Q', '", + "exact_match": false, + "code_bleu": 0.03467551930320175, + "edit_similarity": 0.04081632653061224, + "n_retrieved": 10 + }, + { + "repo": "eliangcs/pystock-crawler", + "expected": "{ 'symbol': 'VNO', 'amend': False, 'doc_type': '10-K', 'period_focus': 'FY', 'fiscal_year': 2011, 'end_date': '2011-12-31', 'revenues': 2915665000, 'op_income': 856153000, 'net_income': 601771000, 'eps_basic': 3.26, 'eps_diluted': 3.23, 'dividend': 0.0, 'assets': 20446487000, 'cur_assets': None, 'cur_liab': None, 'equity': 7508447000, 'cash': 606553000, 'cash_flow_op': 702499000, 'cash_flow_inv': -164761000, 'cash_flow_fin': -621974000 })", + "got": "20111231, '10-Q', 'FY', '10-Q', '10-Q', 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "got_raw": "20111231, '10-Q', 'FY', '10-Q', '10-Q', 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.024262821204064342, + "edit_similarity": 0.05154639175257732, + "n_retrieved": 10 + }, + { + "repo": "eliangcs/pystock-crawler", + "expected": "{ 'symbol': 'UTMD', 'amend': False, 'doc_type': '10-K', 'period_focus': 'FY', 'fiscal_year': 2011, 'end_date': '2011-12-31', 'revenues': 37860000, 'op_income': 11842000, 'net_income': 7414000, 'eps_basic': 2.04, 'eps_diluted': 2.03, 'dividend': 0.0, 'assets': 76389000, 'cur_assets': 17016000, 'cur_liab': 9631000, 'equity': 40757000, 'cash': 6534000, 'cash_flow_op': 11365000, 'cash_flow_inv': -26685000, 'cash_flow_fin': 18078000 })", + "got": "1, '10-Q', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '", + "got_raw": "1, '10-Q', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '2011-12-31', '", + "exact_match": false, + "code_bleu": 0.02830989871215469, + "edit_similarity": 0.07508532423208192, + "n_retrieved": 10 + }, + { + "repo": "eliangcs/pystock-crawler", + "expected": "{ 'symbol': 'BK', 'amend': False, 'doc_type': '10-Q', 'period_focus': 'Q1', 'fiscal_year': 2010, 'end_date': '2010-03-31', 'revenues': 883000000, 'op_income': None, 'net_income': 559000000, 'eps_basic': 0.46, 'eps_diluted': 0.46, 'dividend': 0.09, 'assets': 220551000000, 'cur_assets': None, 'cur_liab': None, 'equity': 30455000000, 'cash': 3307000000, 'cash_flow_op': 1191000000, 'cash_flow_inv': 512000000, 'cash_flow_fin': -2126000000 })", + "got": "1390777, 'BK', '2010-03-31', 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10", + "got_raw": "1390777, 'BK', '2010-03-31', 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10", + "exact_match": false, + "code_bleu": 0.034777816516234086, + "edit_similarity": 0.06631762652705062, + "n_retrieved": 10 + }, + { + "repo": "eliangcs/pystock-crawler", + "expected": "content)", + "got": "content)", + "got_raw": " content)\n self.assertIn('AAPL', content)\n self.assertIn('GOOG', content)\n self.assertIn('FB', content)\n\n def assert_nasdaq_output(self):\n # Check if some common NASDAQ symbols are in output\n content = self.get_output_content()\n\n self.assertIn('MSFT', content)\n self.assertIn('IBM', content)\n self.assertIn('AMZN', content)\n self.assertIn('GOOG', content)\n\n def assert_amex_output(self):\n # Check if some common AMEX symbols are in output\n content = self.get_output_content()\n\n self.assertIn('", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "eliangcs/pystock-crawler", + "expected": "{ 'symbol': 'PAY', 'amend': False, 'doc_type': '10-Q', 'period_focus': 'Q2', 'fiscal_year': 2011, 'end_date': '2011-04-30', 'revenues': 292446000, 'op_income': 37338000, 'net_income': 25200000, 'eps_basic': 0.29, 'eps_diluted': 0.27, 'dividend': 0.0, 'assets': 1252289000, 'cur_assets': 935395000, 'cur_liab': 303590000, 'equity': 332172000, 'cash': 531542000, 'cash_flow_op': 68831000, 'cash_flow_inv': -20049000, 'cash_flow_fin': 34676000 })", + "got": "1, '10-Q', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '", + "got_raw": "1, '10-Q', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '2011-04-30', '", + "exact_match": false, + "code_bleu": 0.031875127905899, + "edit_similarity": 0.08403361344537816, + "n_retrieved": 10 + }, + { + "repo": "eliangcs/pystock-crawler", + "expected": "expected.get('cash'))", + "got": "0.0)", + "got_raw": "0.0)\n self.assert_none_or_almost_equal(item.get('cur_assets'), 0.0)\n self.assert_none_or_almost_equal(item.get('cur_liab'), 0.0)\n self.assert_none_or_almost_equal(item.get('cash_flow_op'), 0.0)\n self.assert_none_or_almost_equal(item.get('cash_flow_inv'), 0.0)\n self.assert_none_or_almost_equal(item.get('cash_flow_fin'), 0.0)\n\n def assert_price(self, price, expected):\n self.assertEqual(price.get('symbol'), expected.get('symbol'))\n self.assertEqual(price.get('date", + "exact_match": false, + "code_bleu": 0.153509990260506, + "edit_similarity": 0.16, + "n_retrieved": 10 + }, + { + "repo": "evansd/whitenoise", + "expected": "response.headers", + "got": "response", + "got_raw": " response\n assert response.status_code == 200\n\ndef test_no_content_type_when_not_modified_with_cache_control(server, static_files, _collect_static):\n last_mod = \"Fri, 11 Apr 2100 11:47:06 GMT\"\n url = settings.STATIC_URL + static_files.js_path\n response = server.get(url, headers={\"If-Modified-Since\": last_mod, \"Cache-Control\": \"no-cache\"})\n\n assert \"Content-Type\" not in response\n assert response.status_code == 200\n\ndef test_no_content_type_when", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "evansd/whitenoise", + "expected": "\"application/pkc7-mime\"", + "got": "\"application/pkc7-mime\"", + "got_raw": " \"application/pkc7-mime\"\n\ndef test_matched_filename_with_dot():\n result = MediaTypes().get_type(\".apple-app-site-association\")\n\n assert result == \"application/pkc7-mime\"\n\ndef test_matched_filename_with_dot_and_slash():\n result = MediaTypes().get_type(\"/.apple-app-site-association\")\n\n assert result == \"application/pkc7-mime\"\n\ndef test_matched_filename_with_dot_and_slash_and_extension():\n result = MediaTypes().get_type(\"/.apple-app-site-association.json\")\n\n assert result == \"application/pkc7-mime\"\n\ndef test_matched_filename", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "evansd/whitenoise", + "expected": "404", + "got": "404", + "got_raw": "404\n\ndef test_non_ascii_requests_safely_ignored_with_index(finder_server):\n response = finder_server.get(settings.STATIC_URL + \"with-index/index.html\")\n\n assert response.status_code == 404\n\ndef test_non_ascii_requests_safely_ignored_with_index_and_autorefresh(finder_server):\n response = finder_server.get(settings.STATIC_URL + \"with-index/index.html\")\n\n assert response.status_code == 404\n\ndef test_non_ascii_requests_safely_ignored_with_index_and_autorefresh_and_index_file(finder_server):\n response = finder_server.get(settings.STATIC", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "evansd/whitenoise", + "expected": "True", + "got": "taticfiles\": {\"BACKEND\": backend},", + "got_raw": "<|fim_suffix|>taticfiles\": {\"BACKEND\": backend},\n }\n }\n\n with override_settings(**storages):\n yield\n\ndef test_compressed_storage(setup):\n with _compressed_storage(setup):\n files = Files(\"static\")\n assert files.exists(\"app.js\")\n assert files.exists(\"app.db8f2edc0c8a.js\")\n assert files.exists(\"app.css\")\n assert files.exists(\"app.db8f2edc0c8a.css\")\n assert files.exists(\"app.db8f2edc0c8a.css.gz\")\n assert files.exists(\"app.db8", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.05263157894736842, + "n_retrieved": 10 + }, + { + "repo": "evansd/whitenoise", + "expected": "(\"woops\",)", + "got": "(\"woops\",)", + "got_raw": " (\"woops\",)\n\n\ndef test_main_error_no_files(files_dir):\n with pytest.raises(ValueError) as excinfo:\n compress_main([files_dir, \"--quiet\"])\n\n assert excinfo.value.args == (\"No files found in\", files_dir)\n\n\ndef test_main_error_no_files_no_extensions(files_dir):\n with pytest.raises(ValueError) as excinfo:\n compress_main([files_dir, \"--quiet\", \"--no-gzip\", \"--no-brotli\"])\n\n assert excinfo.value.args == (\"No files found in\", files_dir)\n\n\ndef test_main_error_no_files_no_extensions_no_gzip(files_dir):\n with pytest.raises(ValueError)", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "executablebooks/markdown-it-py", + "expected": "heading_node.map", + "got": "(0, 1)", + "got_raw": " (0, 1)\n assert tuple(heading_node.map or ()) == (0, 1)\n\n assert heading_open.children == heading_node.children\n assert heading_open.children == []\n\n assert heading_open.children == []\n assert heading_node.children == []\n\n assert heading_open.children == []\n assert heading_node.children == []\n\n assert heading_open.children == []\n assert heading_node.children == []\n\n assert heading_open.children == []\n assert heading_node.children == []\n\n assert heading_open.children == []\n assert heading_node.children == []\n\n assert heading_open.children == []\n assert heading_node.children == []\n\n assert heading_open.children", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "executablebooks/markdown-it-py", + "expected": "99", + "got": "99", + "got_raw": "99\n assert md.render(\"some *text*\") == \"

some text

\\n\"\n assert md.renderInline(\"some *text*\") == \"some *text*\"\n\n md = MarkdownIt(\"zero\", {\"maxNesting\": 99, \"linkify\": True})\n assert md.render(\"github.com\") == 'github.com'\n\n md = MarkdownIt(\"zero\", {\"maxNesting\": 99, \"linkify\": True, \"typographer\": True})\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "executablebooks/markdown-it-py", + "expected": "\"text\"", + "got": "\"text\"", + "got_raw": " \"text\"\n assert text_node.content == \"Some paragraph text and \"\n assert text_node.next_sibling.type == \"text\"\n assert text_node.next_sibling.content == \"emphasis here\"\n assert text_node.next_sibling.next_sibling.type == \"text\"\n assert text_node.next_sibling.next_sibling.content == \" and more text here.\"\n assert text_node.next_sibling.next_sibling.next_sibling is None\n assert text_node.next_sibling.next_sibling.next_sibling is None\n assert text_node.next_sibling.next_sibling.next_sibling is None\n assert text_node.next_sibling.next_sibling.next_sibling is None\n assert text_node.next_sibling.next_sibling.next", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "executablebooks/markdown-it-py", + "expected": "heading_node.meta", + "got": "heading_node.meta", + "got_raw": " heading_node.meta\n assert heading_open.block == heading_node.block\n assert heading_open.hidden == heading_node.hidden\n\n assert heading_open.children == heading_node.children\n assert heading_open.nesting == heading_node.nesting\n assert heading_open.nester_tokens == heading_node.nester_tokens\n\n assert heading_open.children[0].tag == heading_node.children[0].tag\n assert tuple(heading_open.children[0].map or ()) == heading_node.children[0].map\n assert heading_open.children[0].level == heading_node.children[0].level\n assert heading_open.children[0].content ==", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "executablebooks/markdown-it-py", + "expected": "1", + "got": "1", + "got_raw": "1\n\n assert link_close.level == 0\n```\n\n```{jupyter-execute}\nfrom markdown_it import MarkdownIt\n\nmdit = MarkdownIt(options_update={\"linkify\": True}).enable(\"linkify\")\ntokens = mdit.parse(\"www.python.org\")\ninline = tokens[1]\nassert inline.type == \"inline\"\nassert inline.children\nlink_open = inline.children[0]\nassert link_open.type == \"link_open\"\nlink_text = inline.children[1]\nassert link_text.type == \"text\"\nlink_close = inline.children[2]\nassert link_close.type == \"link_close\"\n\n# Assert that linkify tokens", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "executablebooks/markdown-it-py", + "expected": "env", + "got": "", + "got_raw": " # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"references\" in # type: ignore\n assert \"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "executablebooks/markdown-it-py", + "expected": "SystemExit)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n parse([\"nonexistent_file.md\"])\n\ndef test_parse_stdin():\n\n with tempfile.NamedTemporaryFile(mode=\"w\", delete=False) as f:\n f.write(\"Hello, world!\\n\")\n f.close()\n\n with patch(\"sys.stdin\", open(f.name, \"r\")):\n parse([\"-\"])\n\n pathlib.Path(f.name).unlink()\n\ndef test_parse_file():\n\n with tempfile.NamedTemporaryFile(mode=\"w\", delete=False) as f:\n f.write(\"Hello, world!\\n\")\n f.close()\n\n parse([f.name])\n\n pathlib.Path(f.name).unlink()\n\n\n# File:", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.3125, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "[[4]])", + "got": "4)", + "got_raw": "4)\n self.assertEqual(combinations(4, 2, []), 6)\n self.assertEqual(combinations(4, 3, []), 4)\n self.assertEqual(combinations(4, 4, []), 1)\n\n self.assertEqual(combinations(4, 1, [1]), 3)\n self.assertEqual(combinations(4, 2, [1]), 4)\n self.assertEqual(combinations(4, 3, [1]), 2)\n self.assertEqual(combinations(4, 4, [1]), 0)\n\n self.assertEqual(combinations(4, 1", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "Rational(1, 3))", + "got": "1/3)", + "got_raw": "1/3)\n\n def test_multiply_two_negative_rational_numbers(self):\n\n self.assertEqual(Rational(-1, 2) * Rational(-2, 3), 1/3)\n\n def test_multiply_two_positive_and_negative_rational_numbers(self):\n\n self.assertEqual(Rational(1, 2) * Rational(-2, 3), -1/3)\n\n def test_multiply_two_negative_and_negative_rational_numbers(self):\n\n self.assertEqual(Rational(-1, 2) * Rational(2, 3), -1/3)\n\n def test_multiply_two_rational_numbers_with_different_denominators(self):\n\n", + "exact_match": false, + "code_bleu": 0.29036157037406557, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "[8])", + "got": "8)", + "got_raw": "8)\n\n def test_division_can_divide_two_numbers(self):\n\n self.assertEqual(evaluate([\"10 5 /\"]), 2)\n\n def test_division_by_zero_raises_exception(self):\n\n with self.assertRaises(StackUnderflowError):\n evaluate([\"5 0 /\"])\n\n def test_division_by_zero_raises_exception(self):\n\n with self.assertRaises(StackUnderflowError):\n evaluate([\"5 0 /\"])\n\n def test_division_by_zero_raises_exception(self):\n\n with self.assertRaises(StackUnderflowError):\n evaluate([\"5 0 /\"])\n\n def test_division_by_zero_raises_exception(self):\n\n with self.assertRaises", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "[-1])", + "got": "1)", + "got_raw": "1)\n\n def test_subtraction_can_subtract_two_numbers_with_negative_numbers(self):\n\n self.assertEqual(evaluate([\"-3 -4 -\"]), 7)\n\n def test_subtraction_can_subtract_two_numbers_with_negative_numbers_and_positive_numbers(self):\n\n self.assertEqual(evaluate([\"-3 4 -\"]), 1)\n\n def test_subtraction_can_subtract_two_numbers_with_negative_numbers_and_positive_numbers_and_negative_numbers(self):\n\n self.assertEqual(evaluate([\"-3 -4 -\"]), 7)\n\n def test_subtraction_can_subtract_two_numbers_with_negative_numbers_and_positive_numbers_and_negative_numbers_and_negative_numbers(self):\n\n self.assertEqual", + "exact_match": false, + "code_bleu": 0.23784142300054423, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "[1])", + "got": "1)", + "got_raw": "1)\n\n def test_singleton_linked_list_to_list_list_with_singular_element(self):\n sut = LinkedList([1])\n\n self.assertEqual(list(sut), [1])\n\n def test_singleton_linked_list_to_list_list_with_singular_element(self):\n sut = LinkedList([1])\n\n self.assertEqual(list(sut), [1])\n\n def test_singleton_linked_list_to_list_list_with_singular_element(self):\n sut = LinkedList([1])\n\n self.assertEqual(list(sut), [1])\n\n def test_singleton_linked_list_to_list_list_with_singular_element(self):\n sut = LinkedList([1])\n\n self.assertEqual(list(sut), [1])\n\n def", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "\"V\")", + "got": "5)", + "got_raw": "5)\n\n def test_10_is_x(self):\n\n self.assertEqual(roman(10), 10)\n\n def test_100_is_c(self):\n\n self.assertEqual(roman(100), 100)\n\n def test_1000_is_m(self):\n\n self.assertEqual(roman(1000), 1000)\n\n def test_10000_is_m(self):\n\n self.assertEqual(roman(10000), 10000)\n\n def test_100000_is_m(self):\n\n self", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "6)", + "got": "6)", + "got_raw": "6)\n\n def test_finds_a_value_at_the_start_of_an_array(self):\n\n\n self.assertEqual(find([1, 3, 4, 6, 8, 9, 11], 1), 0)\n\n def test_finds_a_value_in_the_middle_of_an_array(self):\n\n\n self.assertEqual(find([1, 3, 4, 6, 8, 9, 11], 6), 3)\n\n def test_finds_a_value_in_the_middle_of_an_array_with_even_number_of_elements(self):\n\n\n self.assertEqual(find([1, 3", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n\n def test_single_letter_same_strands(self):\n\n self.assertEqual(distance(\"A\", \"A\"), 0)\n\n def test_longer_strands(self):\n\n self.assertEqual(distance(\"GGACTGAAATCTG\", \"GGACTGAAATCTG\"), 0)\n\n def test_longer_strands_different(self):\n\n self.assertEqual(distance(\"GGACGGATTCTG\", \"AGGACGGATTCT\"), 9)\n\n def test_longer_strands_different_2(self):\n\n self.assertEqual(distance(\"A\", \"G\"), 1)\n\n def test_longer_strands_different_3(self", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "\"II\")", + "got": "\"II\")", + "got_raw": " \"II\")\n\n def test_3_is_iii(self):\n\n self.assertEqual(roman(3), \"III\")\n\n def test_4_is_iv(self):\n\n self.assertEqual(roman(4), \"IV\")\n\n def test_5_is_v(self):\n\n self.assertEqual(roman(5), \"V\")\n\n def test_9_is_ix(self):\n\n self.assertEqual(roman(9), \"IX\")\n\n def test_10_is_x(self):\n\n self.assertEqual(roman(10), \"X\")\n\n def test_11_is_xi(self):\n\n self.assertEqual(roman(", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n\n def test_ability_modifier_for_score_11_is_1(self):\n\n self.assertEqual(modifier(11), 1)\n\n def test_ability_modifier_for_score_12_is_2(self):\n\n self.assertEqual(modifier(12), 2)\n\n def test_ability_modifier_for_score_13_is_3(self):\n\n self.assertEqual(modifier(13), 3)\n\n def test_ability_modifier_for_score_14_is_4(self):\n\n self.assertEqual(modifier(14), 4)\n\n def test_ability_modifier_for_score_15_is_5(self):\n\n self.assertEqual", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "[1])", + "got": "1)", + "got_raw": "1)\n\n def test_extract_row_from_two_number_matrix(self):\n matrix = Matrix(\"1 2\")\n\n self.assertEqual(matrix.row(1), 1)\n self.assertEqual(matrix.row(2), 2)\n\n def test_extract_row_from_three_number_matrix(self):\n matrix = Matrix(\"1 2 3\")\n\n self.assertEqual(matrix.row(1), 1)\n self.assertEqual(matrix.row(2), 2)\n self.assertEqual(matrix.row(3), 3)\n\n def test_extract_row_from_four_number_matrix(self):\n matrix = Matrix(\"1 2 3 4\")\n\n self.assertEqual(matrix.row", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "True)", + "got": "True)", + "got_raw": " True)\n self.assertIs(Allergies(1).allergic_to(\"peanuts\"), False)\n self.assertIs(Allergies(1).allergic_to(\"shellfish\"), False)\n self.assertIs(Allergies(1).allergic_to(\"strawberries\"), False)\n self.assertIs(Allergies(1).allergic_to(\"tomatoes\"), False)\n self.assertIs(Allergies(1).allergic_to(\"chocolate\"), False)\n self.assertIs(Allergies(1).allergic_to(\"pollen\"), False)\n self.assertIs(Allergies(1).all", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "\"4\")", + "got": "4)", + "got_raw": "4)\n buf.write(\"6\")\n buf.write(\"7\")\n buf.write(\"8\")\n self.assertEqual(buf.read(), \"5\")\n self.assertEqual(buf.read(), \"6\")\n self.assertEqual(buf.read(), \"7\")\n self.assertEqual(buf.read(), \"8\")\n self.assertEqual(buf.read(), None)\n\n def test_overwrite_replaces_the_oldest_item_remaining_in_buffer_following_a_write(\n self,\n ):\n buf = CircularBuffer(3)\n buf.write(\"1\")\n buf.write(\"2\")\n buf.write(\"3\")\n self.assertEqual(buf.read(), \"1\")\n buf.write(\"", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "[[5]])", + "got": "5)", + "got_raw": "5)\n self.assertEqual(combinations(5, 2, []), 10)\n self.assertEqual(combinations(5, 3, []), 10)\n self.assertEqual(combinations(5, 4, []), 5)\n self.assertEqual(combinations(5, 5, []), 1)\n\n self.assertEqual(combinations(5, 1, [1]), 4)\n self.assertEqual(combinations(5, 2, [1]), 6)\n self.assertEqual(combinations(5, 3, [1]), 4)\n self.assertEqual(combinations(5, ", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "3)", + "got": "3)", + "got_raw": "3)\n\n def test_finds_the_first_value_in_a_sorted_array(self):\n\n\n self.assertEqual(find([1, 3, 4, 6, 8, 9, 11], 1), 0)\n\n def test_finds_the_last_value_in_a_sorted_array(self):\n\n\n self.assertEqual(find([1, 3, 4, 6, 8, 9, 11], 11), 6)\n\n def test_finds_a_value_in_the_middle_of_a_longer_array(self):\n\n\n self.assertEqual(find([1, 3, 4,", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "[1])", + "got": "1)", + "got_raw": "1)\n\n def test_change_for_2_cents(self):\n\n self.assertEqual(find_fewest_coins([1, 5, 10, 25], 2), 2)\n\n def test_change_for_3_cents(self):\n\n self.assertEqual(find_fewest_coins([1, 5, 10, 25], 3), 3)\n\n def test_change_for_4_cents(self):\n\n self.assertEqual(find_fewest_coins([1, 5, 10, 25], 4), 4)\n\n def test_change_for_", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "robot.name)", + "got": "robot.name)", + "got_raw": " robot.name)\n\n def test_name_is_unique(self):\n robot1 = Robot()\n robot2 = Robot()\n\n self.assertNotEqual(robot1.name, robot2.name)\n\n def test_name_is_always_3_letters(self):\n robot = Robot()\n\n self.assertEqual(len(robot.name), 3)\n\n def test_name_is_always_uppercase(self):\n robot = Robot()\n\n self.assertEqual(robot.name, robot.name.upper())\n\n def test_name_is_always_three_digits(self):\n robot = Robot()\n\n self.assertEqual(len(robot.name), 3)\n\n def test_name_is_always_three_digits(self):\n robot =", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "date(2013, 3, 4))", + "got": "11)", + "got_raw": "11)\n\n def test_when_first_monday_is_the_first_day_of_the_week(self):\n\n self.assertEqual(meetup(2013, 4, \"first\", \"Monday\"), 6)\n\n def test_when_first_monday_is_the_second_day_of_the_week(self):\n\n self.assertEqual(meetup(2013, 4, \"first\", \"Tuesday\"), 7)\n\n def test_when_first_monday_is_the_third_day_of_the_week(self):\n\n self.assertEqual(meetup(2013, 4, \"first\", \"Wednesday\"), 8)\n\n def test_when_first", + "exact_match": false, + "code_bleu": 0.11939665909150465, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n\n def test_one_book(self):\n basket = [\n {\n \"title\": \"The Great Gatsby\",\n \"price\": 10.99,\n },\n ]\n\n self.assertEqual(total(basket), 10.99)\n\n def test_two_books(self):\n basket = [\n {\n \"title\": \"The Great Gatsby\",\n \"price\": 10.99,\n },\n {\n \"title\": \"To Kill a Mockingbird\",\n \"price\": 12.99,\n },\n ]\n\n self.assertEqual(total(basket), 2", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "exercism/python", + "expected": "queue)", + "got": "expected_result, error_message)", + "got_raw": " expected_result, error_message)\n self.assertEqual(actual_result, expected_result, error_message)\n self.assertEqual(queue, original_queue, error_message)\n\n @pytest.mark.task(taskno=8)\n def test_sorted_names_validate_queue(self):\n test_data = (\n (['Steve', 'Ultron', 'Natasha', 'Rocket'], ['Natasha', 'Rocket', 'Steve', 'Ultron']),\n (['Agatha', 'Pepper', 'Valkyrie', 'Drax', 'Nebula'], ['Agatha', 'Drax', 'Nebula', 'Pepper', 'Valk", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.21621621621621623, + "n_retrieved": 10 + }, + { + "repo": "explosion/sense2vec", + "expected": "s2v", + "got": "s2v", + "got_raw": " s2v\n assert \"beekeepers|NOUN\" in s2v.most_similar(\"beekeepers|NOUN\", n=10)\n assert \"beekeepers|NOUN\" in s2v.most_similar(\"beekeepers|NOUN\", n=100)\n assert \"beekeepers|NOUN\" in s2v.most_similar(\"beekeepers|NOUN\", n=1000)\n assert \"beekeepers|NOUN\" in s2v.most_similar(\"beekeepers|NOUN\", n=10000)\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/sense2vec", + "expected": "3", + "got": "3", + "got_raw": "3\n assert result3[0][0] == \"a\"\n assert result3[0][1] == 1.0\n assert result3[0][1] == pytest.approx(1.0)\n assert result3[1][0] == \"b\"\n assert result3[1][1] == 1.0\n assert result3[1][1] == pytest.approx(1.0)\n assert result3[2][0] == \"c\"\n assert result3[2][1] == 0.8\n assert result3[2", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/sense2vec", + "expected": "\"wrld\"", + "got": "\"wrld\"", + "got_raw": " \"wrld\"\n assert doc[1]._.s2v_key == \"wrld|NOUN\"\n\ndef test_component_lemmatize_2(doc):\n def lemmatize(doc, lookups):\n for token in doc:\n token.lemma_ = lookups.get(token.text, token.text)\n return doc\n\n s2v = Sense2VecComponent(doc.vocab, shape=(4, 4), lemmatize=True)\n s2v.first_run = False\n vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32)\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/sense2vec", + "expected": "s2v", + "got": "", + "got_raw": " # noqa: E712\n assert \"test\" not in # noqa: E712\n assert \"test\" in # noqa: E712\n assert \"test\" not in # noqa: E712\n assert \"test\" in # noqa: E712\n assert \"test\" not in # noqa: E712\n assert \"test\" in # noqa: E712\n assert \"test\" not in # noqa: E712\n assert \"test\" in # noqa: E", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/sense2vec", + "expected": "1.0", + "got": "1.0", + "got_raw": "1.0\n\ndef test_component_most_similar(doc):\n s2v = Sense2VecComponent(doc.vocab, shape=(4, 4))\n s2v.first_run = False\n vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32)\n s2v.s2v.add(\"hello|INTJ\", vector)\n s2v.s2v.add(\"world|NOUN\", vector)\n doc = s2v(doc)\n\n assert doc[0]._.s2v_most_similar(1) == [(\"world|NOUN\", ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "len(examples)", + "got": "0", + "got_raw": "0\n\n assert llm._shard_mapper is not None\n assert llm._shard_reducer is not None\n\n assert llm._shard_mapper._shard_size == 1\n assert llm._shard_reducer._shard_size == 1\n\n assert llm._shard_mapper._shard_size == 1\n assert llm._shard_reducer._shard_size == 1\n\n assert llm._shard_mapper._shard_size == 1\n assert llm._shard_reducer._shard_size == 1\n\n assert", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "ValueError, match=\"unexpected value; permitted\")", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n nlp = spacy.load(orig_config, config=config)\n\n with pytest.raises(NotImplementedError):\n nlp = spacy.load(orig_config, config=config, disable=[\"llm\"])\n\n with pytest.raises(NotImplementedError):\n nlp = spacy.load(orig_config, config=config, disable=[\"llm\", \"ner\"])\n\n with pytest.raises(NotImplementedError):\n nlp = spacy.load(orig_config, config=config, disable=[\"ner\"])\n\n with pytest.raises(NotImplementedError):\n nlp = spacy.load(orig_config, config=config, disable=[\"ner\", \"text", + "exact_match": false, + "code_bleu": 0.2259005009024612, + "edit_similarity": 0.2318840579710145, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "[\"llm\"]", + "got": "[\"llm\", \"entity_linker\"]", + "got_raw": " [\"llm\", \"entity_linker\"]\n assert nlp.get_pipe(\"entity_linker\")._kb is not None\n assert nlp.get_pipe(\"entity_linker\")._kb._kb is not None\n assert nlp.get_pipe(\"entity_linker\")._kb._kb._kb is not None\n assert nlp.get_pipe(\"entity_linker\")._kb._kb._kb._kb is not None\n assert nlp.get_pipe(\"entity_linker\")._kb._kb._kb._kb._kb is not None\n assert nlp.get_pipe(\"entity_linker\")._kb._", + "exact_match": false, + "code_bleu": 0.3860973950960897, + "edit_similarity": 0.45161290322580644, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "2", + "got": "1", + "got_raw": "1\n assert prompt_examples[0].label == \"PERSON\"\n\n assert nlp.get_pipe(\"llm\")._task._labels == [\"PERSON\", \"LOCATION\"]\n\n\n@pytest.mark.filterwarnings(\"ignore:Task supports sharding\")\ndef test_label_inconsistency_v2():\n \"\"\"Test whether inconsistency between specified labels and labels in examples is detected.\"\"\"\n cfg = f\"\"\"\n [nlp]\n lang = \"en\"\n pipeline = [\"llm\"]\n\n [components]\n\n [components.llm]\n factory = \"llm\"\n\n [components.llm.task]\n @llm_tasks = \"spacy", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "( [\"-PRON-\", \"have\", \"water\", \"the\", \"plant\", \".\"], [\"I\", \"have\", \"water\", \"the\", \"plant\", \".\"], )", + "got": "", + "got_raw": " # noqa: E712\n [\n [\"water\", \"water\", \"water\"],\n [\"water\", \"water\", \"water\"],\n ]\n else:\n\n assert lemmas == [\"water\", \"water\", \"water\"]\n\n\n@pytest.mark.external\n@pytest.mark.parametrize(\n \"cfg_string\",\n [\n \"zeroshot_cfg_string\",\n \"fewshot_cfg_string\",\n ],\n)\ndef test_lemma_io_with_examples(cfg_string, request):\n cfg = request.getfixturevalue(cfg_string)\n orig_config = Config().from_str(cfg)\n nlp = spacy.util.load_model_from_config(orig_config,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "dict()", + "got": "", + "got_raw": " # type: ignore\n assert task1._label_dict == # type: ignore\n assert task1._label_dict == # type: ignore\n assert task1._label_dict == # type: ignore\n assert task1._label_dict == # type: ignore\n assert task1._label_dict == # type: ignore\n assert task1._label_dict == # type: ignore\n assert task1._label_dict == # type: ignore\n assert task1._label_dict == # type: ignore\n assert task1._label_dict == # type", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "gold_cats", + "got": "", + "got_raw": " # can be 0 if binary and negative\n assert doc.cats[cat] == 1.0 # can be 0 if binary and negative\n\n assert list(doc.cats.keys()) == gold_cats\n\n@pytest.mark.external\n@pytest.mark.skipif(has_openai_key is False, reason=\"OpenAI API key not available\")\ndef test_textcat_predict_v3():\n \"\"\"Use OpenAI to get Textcat results.\n Note that this test may fail randomly, as the LLM's output is unguaranteed\n to be consistent/predictable.\n \"\"\"\n text, labels, gold_cats,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "f\"\"\" You are an expert summarization system. Your task is to accept Text as input and summarize the Text in a concise way. The summary must not, under any circumstances, contain more than 10 words. Here is the Text that needs to be summarized: ''' {example_text} ''' Summary:\"\"\".strip()", + "got": "0 == prompt.count(\"\\n\")", + "got_raw": "0 == prompt.count(\"\\n\")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\"\\t\")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert 0 == prompt.count(\" \")\n assert", + "exact_match": false, + "code_bleu": 0.16784459625186196, + "edit_similarity": 0.025889967637540454, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "[\"llm\"]", + "got": "[\"llm\"]", + "got_raw": " [\"llm\"]\n assert nlp.get_pipe(\"llm\").task == LemmaTask\n assert nlp.get_pipe(\"llm\").model == \"spacy.GPT-3-5.v2\"\n assert nlp.get_pipe(\"llm\").cache == \"spacy.BatchCache.v1\"\n assert nlp.get_pipe(\"llm\").save_io == False\n assert nlp.get_pipe(\"llm\").validate_types == True\n\n assert nlp.pipe_names == [\"llm\"]\n assert nlp.get_pipe(\"llm\").task == LemmaTask\n assert nlp.get_pipe(\"ll", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "n_prompt_examples", + "got": "2", + "got_raw": "2\n\n assert task._prompt_examples[0].text == \"Alice travelled to London.\"\n assert task._prompt_examples[0].reference.text == \"Bob lives in Manchester.\"\n\n assert task._prompt_examples[1].text == \"Bob lives in Manchester.\"\n assert task._prompt_examples[1].reference.text == \"Alice travelled to London.\"\n\n else:\n assert not task._prompt_examples\n\n assert task._shard_mapper is not None\n assert task._shard_reducer is not None\n\n assert task._shard_mapper._n_docs == 2\n assert task._shard_reducer", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "gold_ents", + "got": "gold_ents", + "got_raw": " gold_ents\n\n\n@pytest.mark.parametrize(\n \"text,response,gold_ents\",\n [\n # simple\n (\n \"Jean Jacques and Jaime went to the library.\",\n \"PER: Jean Jacques, Jaime\\nLOC: library\",\n [(\"Jean Jacques\", \"PER\"), (\"Jaime\", \"PER\"), (\"library\", \"LOC\")],\n ),\n # overlapping: should only return the longest span\n (\n \"The Manila Observatory was founded in 1865.\",\n \"LOC: The Manila Observatory, Manila, Manila Observatory\",\n [(\"The Manila Observatory\", \"LOC\")],\n ),\n # flipped", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "n_prompt_examples", + "got": "2", + "got_raw": "2\n assert task._prompt_examples[0] == \"How much wood would a woodchuck chuck if a woodchuck could chuck wood?\"\n assert task._prompt_examples[1] == \"Who sells seashells by the seashore?\"\n else:\n assert not task._prompt_examples\n\n assert llm._task._prompt_examples == task._prompt_examples\n\n assert llm._task._prompt_examples == task._prompt_examples\n\n assert llm._task._prompt_examples == task._prompt_examples\n\n assert llm._task._prompt_examples == task._prompt_examples\n\n assert llm", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "labels", + "got": "labels", + "got_raw": " labels\n assert task2._label_dict == labels\n\n assert task1._label_definitions == task2._label_definitions\n\n assert task1._label_definitions == task2._label_definitions\n\n assert task1._label_definitions == task2._label_definitions\n\n assert task1._label_definitions == task2._label_definitions\n\n assert task1._label_definitions == task2._label_definitions\n\n assert task1._label_definitions == task2._label_definitions\n\n assert task1._label_definitions == task2._label_definitions\n\n assert task1._label_definitions == task2._label_definitions\n\n assert task", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "\"Q60\"", + "got": "0 == len(llm._task._shards)", + "got_raw": "0 == len(llm._task._shards)\n\n # Test that the candidate selector is initialized.\n assert candidate_selector is llm._task._candidate_selector\n\n # Test that the candidate selector is initialized.\n assert candidate_selector is llm._task._candidate_selector\n\n # Test that the candidate selector is initialized.\n assert candidate_selector is llm._task._candidate_selector\n\n # Test that the candidate selector is initialized.\n assert candidate_selector is llm._task._candidate_selector\n\n # Test that the candidate selector is initialized.\n assert candidate_selector is llm._task._candidate_selector\n\n #", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.0625, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "labels", + "got": "labels", + "got_raw": " labels\n assert task1._label_dict == task2._label_dict\n assert task1._label_dict == task3._label_dict\n\n assert task1._label_dict == task2._label_dict\n assert task1._label_dict == task3._label_dict\n\n assert task1._label_dict == task2._label_dict\n assert task1._label_dict == task3._label_dict\n\n assert task1._label_dict == task2._label_dict\n assert task1._label_dict == task3._label_dict\n\n assert task1._label_dict == task2._label_dict\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "ValueError, match=re.escape( \"Request to OpenAI API failed: This model's maximum context length is 4097 tokens. However, your messages \" \"resulted in 5018 tokens. Please reduce the length of the messages.\" ))", + "got": "pytest.raises(ValueError) as excinfo:", + "got_raw": " pytest.raises(ValueError) as excinfo:\n nlp(\"a\" * 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.13310553960037697, + "edit_similarity": 0.024489795918367346, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "gold_spans", + "got": "", + "got_raw": "<|fim_suffix|>\n # Prepare doc\n nlp = spacy.blank(\"en\")\n doc_in = nlp.make_doc(text)\n # Pass to the parser\n # Note: parser() returns a list so we get what's inside\n doc_out = list(llm_spancat.parse_responses([[doc_in]], [[response]]))[0]\n pred_spans = [(span.text, span.label_) for span in doc_out.spans[\"sc\"]]\n\n assert pred_spans == gold_spans\n\n\n@pytest.mark.parametrize(\n \"text,response,gold_spans\",\n [\n # simple\n (\n \"Jean", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/spacy-llm", + "expected": "ValueError, match=\"Request to Cohere API failed:\")", + "got": "", + "got_raw": "\n\n\n# File: spacy_llm/models/rest/palm/registry.py\n strict=PaLM.DEFAULT_STRICT,\n max_tries=PaLM.DEFAULT_MAX_TRIES,\n interval=PaLM.DEFAULT_INTERVAL,\n max_request_time=PaLM.DEFAULT_MAX_REQUEST_TIME,\n context_length=None,\n) -> Callable[[Iterable[Iterable[str]]], Iterable[Iterable[str]]]:\n \"\"\"Returns Google instance for PaLM Bison model using REST to prompt API.\n name (Literal[\"chat-bison-001\", \"text-bison-001\"]): Model to use.\n config (Dict[Any,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "\"cool\"", + "got": "\"cool\"", + "got_raw": " \"cool\"\n\n@pytest.mark.skipif(not has_tensorflow, reason=\"needs TensorFlow\")\ndef test_tensorflow_wrapper_thinc_set_model_name_with_args(tf_model):\n model = TensorFlowWrapper(tf_model, model_name=\"cool\", n_hidden=12, input_size=784)\n\n assert model.name == \"cool\"\n\n@pytest.mark.skipif(not has_tensorflow, reason=\"needs TensorFlow\")\ndef test_tensorflow_wrapper_thinc_set_model_name_with_kwargs(tf_model):\n model = TensorFlowWrapper(tf_model, model_name=\"cool\", n_hidden=12, input_size=784)\n\n assert model.name == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "10", + "got": "10", + "got_raw": "10\n assert model.get_dim(\"nO\") is None\n model.set_dim(\"nI\", 100)\n assert model.get_dim(\"nI\") == 100\n model.set_dim(\"nO\", 200)\n assert model.get_dim(\"nO\") == 200\n assert model.get_dim(\"nI\") == 100\n assert model.get_dim(\"nO\") == 200\n model.set_dim(\"nI\", 10)\n assert model.get_dim(\"nI\") == 10\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "d_inputs[i])", + "got": "0)", + "got_raw": "0)\n numpy.testing.assert_equal(d_inputs[i], 0)\n elif isinstance(outputs, Ragged):\n numpy.testing.assert_equal(outputs.data, inputs.data)\n\n numpy.testing.assert_equal(d_outputs.data, 0)\n numpy.testing.assert_equal(d_inputs.data, 0)\n elif isinstance(outputs, Padded):\n numpy.testing.assert_equal(outputs.data, inputs.data)\n\n numpy.testing.assert_equal(d_outputs.data, 0)\n numpy.testing.assert_equal(d_inputs.data, 0)\n else:\n numpy.testing.assert_equal(outputs, inputs)\n\n numpy.testing.assert_equal(d_outputs, 0)\n numpy.testing.assert_equal", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "ragged.lengths[start:end])", + "got": "1)", + "got_raw": "1)\n assert_allclose(r.indices, start)\n\n assert r.data[0] == 0\n assert r.data[1] == 1\n assert r.data[2] == 2\n assert r.data[3] == 3\n\ndef test_ragged_slice_index2(ragged, start=0, end=2):\n r = ragged[start:end]\n size = ragged.lengths[start:end].sum()\n assert r.data.shape == (size, r.data.shape[1])\n\n assert_allclose(r.lengths, 1)\n assert_allclose(r.indices, start)\n\n", + "exact_match": false, + "code_bleu": 0.11939665909150465, + "edit_similarity": 0.07142857142857142, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "target_scores[0])", + "got": "0.0)", + "got_raw": "0.0)\n\ndef test_predict_bias2(model2):\n input_ = model2.ops.alloc2f(1, model2.get_dim(\"nI\"))\n target_scores = model2.ops.alloc2f(1, model2.get_dim(\"nI\"))\n scores = model2.predict(input_)\n\n assert_allclose(scores[0], 0.0)\n\ndef test_predict_bias3(model2):\n input_ = model2.ops.alloc2f(1, model2.get_dim(\"nI\"))\n target_scores = model2.ops.alloc2f(1, model2.get_dim(\"nI\"))\n scores", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.19047619047619047, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "values3)", + "got": ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,", + "got_raw": "<|fim_suffix|>, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,", + "exact_match": false, + "code_bleu": 0.011835355601767182, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "[4, 6, 14, 15, 19]", + "got": "[4, 6, 14, 15, 15]", + "got_raw": " [4, 6, 14, 15, 15]\n\ndef test_ragged_getitem(ragged):\n assert ragged[0].data.shape == (4, 4)\n assert ragged[0].lengths.shape == (1,)\n assert ragged[0].lengths[0] == 4\n assert ragged[0].indices.shape == (1,)\n assert ragged[0].indices[0] == 0\n\n assert ragged[1].data.shape == (2, 4)\n assert ragged[1].lengths.shape ==", + "exact_match": false, + "code_bleu": 0.8265168183793802, + "edit_similarity": 0.9444444444444444, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "ops.alloc2f(10, 2))", + "got": "asscalar(a)", + "got_raw": "asscalar(a)\n ops.asnumpy(a)\n ops.ascontiguousarray(a)\n ops.ascontiguousarray(a, copy=True)\n ops.ascontiguousarray(a, copy=False)\n ops.ascontiguousarray(a, copy=None)\n ops.ascontiguousarray(a, copy=0)\n ops.ascontiguousarray(a, copy=1)\n ops.ascontiguousarray(a, copy=2)\n ops.ascontiguousarray(a, copy=3)\n ops.ascontiguousarray(a, copy=4)\n ops.ascontiguousarray(a, copy=5)\n ops.ascontiguous", + "exact_match": false, + "code_bleu": 0.17672682861490013, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "p_nonzero)", + "got": "ice(", + "got_raw": "ice(\n nonzero_empirical,\n p_nonzero,\n atol=0.01,\n rtol=0.01,\n err_msg=\"Nonzero rate is not as expected.\",\n )\n\ndef test_distribution_sparse():\n n_class = 10\n length = 2**18\n model = SparseLinear(nO=n_class, length=length).initialize()\n\n ii64 = numpy.iinfo(numpy.uint64)\n lengths = numpy.zeros((2,), dtype=\"int32\")\n\n for p_nonzero in range(1, 12):\n # Clear gradients from the previous", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "list(Xs[0][0])", + "got": "1", + "got_raw": "1\n assert list(Y[1]) == 2\n\n backprop(Y)\n assert list(X.data[0]) == 1\n assert list(X.data[1]) == 2\n\ndef test_reduce_last(Xs):\n model = reduce_last()\n lengths = model.ops.asarray([x.shape[0] for x in Xs], dtype=\"i\")\n X = Ragged(model.ops.flatten(Xs), lengths)\n Y, backprop = model(X, is_train=True)\n assert isinstance(Y, numpy.ndarray)\n assert Y.shape == (len(Xs), Xs[0].shape[", + "exact_match": false, + "code_bleu": 0.05, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "X.dataXd.shape", + "got": "(len(Xs), Xs[0].shape[1])", + "got_raw": " (len(Xs), Xs[0].shape[1])\n assert dX.dataXd.dtype == Xs[0].dtype\n assert list(dX.dataXd[0]) == list(Xs[0][0])\n assert list(dX.dataXd[1]) == list(Xs[1][0])\n\ndef test_reduce_last(Xs):\n model = reduce_last()\n lengths = model.ops.asarray([x.shape[0] for x in Xs], dtype=\"i\")\n X = Ragged(model.ops.flatten(Xs), lengths)\n Y, backprop = model(X, is_train=True)\n", + "exact_match": false, + "code_bleu": 0.10123734869668824, + "edit_similarity": 0.41025641025641024, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "(2, 45)", + "got": "2 * one.shape", + "got_raw": "2 * one.shape\n assert pairs[:2].two.shape == 2 * two.shape\n\n assert pairs[1:3].one.shape == 2 * one.shape\n assert pairs[1:3].two.shape == 2 * two.shape\n\n assert pairs[1:3, 1:3].one.shape == 2 * one.shape\n assert pairs[1:3, 1:3].two.shape == 2 * two.shape\n\n assert pairs[1:3, 1:3, 1:3].one.shape == 2 * one.shape\n assert pairs", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "rate2", + "got": "16", + "got_raw": "16\n assert rate2 > rate3\n assert rate1 > rate2\n assert rate0 == rate1\n\n\ndef test_compounding_rate_with_t():\n rates = compounding(1, 16, 1.01, t=10)\n rate0 = next(rates)\n assert rate0 == 1.0\n rate1 = next(rates)\n rate2 = next(rates)\n rate3 = next(rates)\n\n assert rate3 > 16\n assert rate2 > rate3\n assert rate1 > rate2\n assert rate", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "\"linear\"", + "got": "\"linear\"", + "got_raw": " \"linear\"\n\ndef test_linear_default_init(model):\n\n assert model.init == \"normal_init\"\n\ndef test_linear_default_init_params(model):\n\n assert model.init_params == {\"std\": 0.01}\n\ndef test_linear_default_init_params(model):\n\n assert model.init_params == {\"std\": 0.01}\n\ndef test_linear_default_init_params(model):\n\n assert model.init_params == {\"std\": 0.01}\n\ndef test_linear_default_init_params(model):\n\n assert model.init_params == {\"std\": 0.01}\n\ndef test_linear_default_init_params(model):\n\n assert model.init_params == {\"std\":", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "[0, 4, 6, 14, 15]", + "got": "[0, 4, 6, 14, 15]", + "got_raw": " [0, 4, 6, 14, 15]\n assert list(ends) == [4, 6, 14, 15, 15]\n\ndef test_ragged_starts_ends2(ragged):\n ragged.starts_ends = numpy.array([0, 4, 6, 14, 15], dtype=\"i\")\n starts = ragged._get_starts()\n ends = ragged._get_ends()\n\n assert list(starts) == [0, 4, 6, 14, 15]\n assert list", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "Y.data.dtype", + "got": "Y.data.dtype", + "got_raw": " Y.data.dtype\n assert X.data.shape[0] == Y.data.shape[0]\n assert X.data.shape[1] == Y.data.shape[1]\n return True\n\ndef assert_padded_data_match(X, Y):\n assert isinstance(X, Padded)\n assert isinstance(Y, Padded)\n assert_arrays_match(X.data, Y.data)\n return True\n\ndef assert_ragged_data_match(X, Y):\n assert isinstance(X, Ragged)\n assert isinstance(Y, Ragged)\n assert_arrays_match(X.data, Y.data)\n return True\n\ndef test_forward():\n with make_tempdir()", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "{}", + "got": "1", + "got_raw": "1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get() == 1\n assert Model._context_operators.get()", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "123", + "got": "123", + "got_raw": "123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(rates) == 123\n assert next(r", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "[[1.0], [1.0], [1.0]])", + "got": "", + "got_raw": "\n\n\n# File: thinc/layers/chain.py\nfrom typing import Callable, Dict, List, Optional, Tuple, TypeVar, Union, cast\n\nfrom ..config import registry\nfrom ..model import Model\nfrom ..types import Floats1d, Floats2d, Ints1d, Ints2d\nfrom ..util import get_width, partial\nfrom .array_getitem import ints_getitem\nfrom .array_setitem import ints_setitem\nfrom .array_slice import ints_slice\nfrom .array_slice import ints_slice_assign\nfrom .array_slice import ints_slice_assign_assign\nfrom .array_slice", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "explosion/thinc", + "expected": "5", + "got": "5", + "got_raw": "5\n assert model.get_dim(\"nO\") == 2\n\ndef test_forward():\n model = Relu(dropout=0.2)\n X = model.ops.alloc2f(4, 5)\n Y = model.ops.alloc2f(4, 2)\n model.initialize(X=X, Y=Y)\n model.forward(X)\n assert model.ops.isfinite(Y).all()\n\ndef test_backward():\n model = Relu(dropout=0.2)\n X = model.ops.alloc2f(4, 5)\n Y = model.ops.alloc2f(4, 2)\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "eyurtsev/kor", + "expected": "2", + "got": "2", + "got_raw": "2\n assert scheme.attributes[0].examples[0][0] == \"Here is 1 number\"\n assert scheme.attributes[0].examples[0][1] == 1\n assert scheme.attributes[0].examples[1][0] == \"Here are 0 numbers\"\n assert scheme.attributes[0].examples[1][1] == 0\n\n assert isinstance(scheme.attributes[1], Text)\n assert scheme.attributes[1].id == \"text_attribute\"\n assert scheme.attributes[1].description == \"Description for Text\"\n assert scheme.attributes[1].many is True\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "eyurtsev/kor", + "expected": "exception_class)", + "got": "", + "got_raw": "\n\n\n# File: kor/encoders.py\n\"\"\"Encoders are used to specify how we want the extracted content to be \nencoded. At the moment, JSONEncoder is the most flexible, the CSVEncoder\nmay be the most accurate, while the XMLEncoder may be neither.\n\n**create_extraction_chain** accepts an encoder as named argument allowing\na user to provide their own custom way to encode the input.\n\n.. autosummary::\n\n JSONEncoder\n CSVEncoder \n XMLEncoder \n\"\"\"\n\nfrom __future__ import annotations\n\nimport abc\nfrom typing import Any, Dict, List, Optional, Sequence,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "eyurtsev/kor", + "expected": "[(\"input\", {\"key1\": \"value1\"})]", + "got": "", + "got_raw": "\n\n\n# File: kor/nodes.py\n \"\"\"Built-in option input must be part of a selection input.\"\"\"\n\n examples: Sequence[str] = tuple()\n\n def accept(self, visitor: AbstractVisitor[T], **kwargs: Any) -> T:\n \"\"\"Accept a visitor.\"\"\"\n return visitor.visit_option(self, **kwargs)\n\n\nclass Selection(AbstractSchemaNode):\n \"\"\"Built-in selection node (aka Enum).\n\n A selection input is composed of one or more options.\n\n A selectio node supports both examples and null_examples.\n\n Null examples are segments of text for which nothing should be extracted.\n\n Examples:\n\n .. code-block", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "eyurtsev/kor", + "expected": "True", + "got": "assert scheme.attributes[0].many is True", + "got_raw": "<|fim_suffix|>\n assert scheme.attributes[0].many is True\n assert scheme.attributes[0].description == \"Description nested object\"\n assert len(scheme.attributes[0].attributes) == 1\n assert scheme.attributes[0].attributes[0].id == \"number_attribute\"\n assert scheme.attributes[0].attributes[0].description == \"Description for Number\"\n assert scheme.attributes[0].attributes[0].many is True\n assert len(scheme.attributes[0].attributes[0].examples) == 2\n assert scheme.attributes[0].attributes[0].examples[0][0]", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "eyurtsev/kor", + "expected": "[ (\"another number\", {\"object\": [{\"number\": [1]}]}), (\"number\", {\"object\": [{\"number\": [2]}]}), (\"text\", {\"object\": [{\"text\": [\"3\"]}]}), (\"selection\", {\"object\": [{\"selection\": [\"option\"]}]}), (\"foo\", {}), (\"1 2\", {\"object\": [{\"age\": [1, 2]}]}), ]", + "got": "", + "got_raw": " # type: ignore[operator]\n [\n (\"1 2\", {\"number\": [1, 2]}),\n (\"1 2\", {\"number\": [1, 2]}),\n (\"1 2\", {\"number\": [1, 2]}),\n (\"1 2\", {\"number\": [1, 2]}),\n (\"1 2\", {\"number\": [1, 2]}),\n (\"1 2\", {\"number\": [1, 2]}),\n (\"1 2\", {\"number\": [1, 2]}),\n (\"1 2\", {\"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "eyurtsev/kor", + "expected": "extraction_subclass.__name__", + "got": "", + "got_raw": " # type: ignore[attr-defined]\n assert node_type.dict()[\"$type\"] == # type: ignore[attr-defined]\n assert node_type.dict()[\"$type\"] == # type: ignore[attr-defined]\n assert node_type.dict()[\"$type\"] == # type: ignore[attr-defined]\n assert node_type.dict()[\"$type\"] == # type: ignore[attr-defined]\n assert node_type.dict()[\"$type\"] == # type: ignore[attr-defined]\n assert node_type.dict()[\"$type\"] == # type: ignore[attr-defined]\n assert node_type.dict()[\"$type\"] == # type", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "eyurtsev/kor", + "expected": "[ (\"another number\", {\"object\": [{\"number\": 1}]}), (\"number\", {\"object\": [{\"number\": [2]}]}), (\"text\", {\"object\": [{\"text\": [\"3\"]}]}), (\"selection\", {\"object\": [{\"selection\": [\"option\"]}]}), (\"foo\", {}), ]", + "got": "", + "got_raw": " # type: ignore[no-any-return]\n assert examples == # type: ignore[no-any-return]\n assert examples == # type: ignore[no-any-return]\n assert examples == # type: ignore[no-any-return]\n assert examples == # type: ignore[no-any-return]\n assert examples == # type: ignore[no-any-return]\n assert examples == # type: ignore[no-any-return]\n assert examples == # type: ignore[no-any-return]\n assert examples == # type: ignore[no-any-return]\n assert examples == # type", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "fabriziosalmi/certmate", + "expected": "True", + "got": "True", + "got_raw": " True\n assert result['output'] == 'ok\\n'\n\n def test_failure(self, deploy_manager, shell_executor):\n shell_executor.set_next_result(returncode=1, stdout='error\\n')\n hook = {\n 'id': 'h1', 'name': 'Test', 'command': 'echo test',\n 'enabled': True, 'timeout': 10, 'on_events': ['created'],\n }\n result = deploy_manager._run_hook(hook, 'example.com', 'created')\n\n assert result['success'] is False\n assert result['output'] == 'error\\n'\n\n def", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fabriziosalmi/certmate", + "expected": "200", + "got": "200", + "got_raw": "200\n assert len(r.json) == 0\n\n def test_03_certificate_not_in_list(self, api):\n r = api.get(\"/api/certificates\")\n\n assert r.status_code == 200\n assert len(r.json) == 0\n\n def test_04_certificate_not_in_list(self, api):\n r = api.get(\"/api/certificates\")\n\n assert r.status_code == 200\n assert len(r.json) == 0\n\n def test_05_certificate_not_in_list(self, api):\n r = api.get(\"/api/c", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fabriziosalmi/certmate", + "expected": "3", + "got": "3", + "got_raw": "3\n assert entries[0]['domain'] == 'c.com'\n assert entries[1]['domain'] == 'b.com'\n assert entries[2]['domain'] == 'a.com'\n\n def test_history_limit(self, deploy_manager, shell_executor):\n for i in range(3):\n shell_executor.set_next_result(returncode=0)\n hook = {\n 'id': 'h1', 'name': 'Multi', 'command': 'echo',\n 'enabled': True, 'timeout': 10, 'on_events': ['created'],\n }\n for d in ['a.com', '", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fabriziosalmi/certmate", + "expected": "data", + "got": "data", + "got_raw": " data\n assert \"has_users\" in data\n\n def test_update_auth_config(self, api):\n r = api.get(\"/api/auth/config\")\n assert r.status_code == 200\n data = r.json()\n\n assert \"local_auth_enabled\" in data\n assert \"has_users\" in data\n\n # Update local auth\n data[\"local_auth_enabled\"] = True\n r = api.post(\"/api/auth/config\", json=data)\n assert r.status_code == 200\n data = r.json()\n\n assert \"local_auth_enabled\" in data\n assert \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fabriziosalmi/certmate", + "expected": "3", + "got": "3", + "got_raw": "3\n assert s['valid'] == 2\n assert s['expiring_soon'] == 1\n assert s['expired'] == 0\n assert s['expiring_domains'] == ['expiring.com (10d)']\n\n def test_client_cert_stats(self, digest):\n data = digest.build_digest()\n s = data['client_certs']\n\n assert s['total'] == 3\n assert s['active'] == 2\n assert s['revoked'] == 1\n\n def test_weekly_activity(self, digest):\n data = digest.build_digest()\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fabriziosalmi/certmate", + "expected": "msg", + "got": "msg.lower()", + "got_raw": " msg.lower()\n\n def test_revoke_admin_fails(self, auth):\n ok, msg = auth.revoke_api_key('admin-uuid')\n assert ok is False\n\n assert 'admin' in msg.lower()\n\n def test_revoke_viewer_fails(self, auth):\n ok, msg = auth.revoke_api_key('viewer-uuid')\n assert ok is False\n\n assert 'viewer' in msg.lower()\n\n def test_revoke_operator_fails(self, auth):\n ok, msg = auth.revoke_api_key('operator-uuid')\n assert ok is False\n\n assert 'operator' in msg.lower", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.42857142857142855, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/partnr-planner", + "expected": "63", + "got": "1", + "got_raw": "1\n assert len(planner0.rag.data_dict[0]) == 1\n assert len(planner0.rag.data_dict[0][0]) == 1\n assert len(planner0.rag.data_dict[0][0][0]) == 1\n assert len(planner0.rag.data_dict[0][0][0][0]) == 1\n assert len(planner0.rag.data_dict[0][0][0][0][0]) == 1\n assert len(planner0.rag.data_dict[0][0][0][0][0][", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/partnr-planner", + "expected": "1", + "got": "1", + "got_raw": "1\n assert neighbors[0].name == \"floor_living_room_1\"\n\n # Move the hub back to the counter\n high_level_open_actions = {\n 0: (\n \"Rearrange\",\n f\"{multiport_hub_name},on,counter_22,none,none\",\n None,\n )\n }\n result, _ = execute_skill(high_level_open_actions, planner)\n assert result[0] == \"Successful execution!\"\n\n # assert that the cushion is on the counter now\n hub_node = env_interface.world_graph[robot_id].get_node_from_name(\n multi", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/partnr-planner", + "expected": "5", + "got": "1", + "got_raw": "1\n graph.remove_all_edges(test_nodes[0])\n assert len(graph.graph[test_nodes[0]]) == 0\n\ndef test_remove_all_edges_from():\n graph = Graph()\n with pytest.raises(ValueError) as e:\n graph.remove_all_edges_from(\"test\")\n assert \"test not present in the graph\" in str(e.value)\n test_nodes = []\n for index in range(5):\n test_nodes.append(Entity(f\"test{index}\", {\"type\": \"test_node\"}))\n graph.add_node(test_nodes[-1])\n graph.add_edge(test_nodes[-1], test_nodes[0], \"test", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/partnr-planner", + "expected": "gt_prompt", + "got": "gt_prompt", + "got_raw": " gt_prompt\n\n # Run the planner\n planner.run()\n\n # Check the planner info\n assert planner_info[\"task_done\"] == task_done\n assert planner_info[\"plan\"] == low_level_actions\n\n # Check the planner prompt\n assert planner.curr_prompt == first_prompt\n\n # Check the planner info\n assert planner_info[\"task_done\"] == task_done\n assert planner_info[\"plan\"] == low_level_actions\n\n # Check the planner prompt\n assert planner.curr_prompt == first_prompt\n\n # Check the planner info\n assert planner_info[\"task_done\"] == task_done\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/partnr-planner", + "expected": "TTT", + "got": "assert sac(state_sequence=ss_1, proposition_satisfied_at=[0, 1, 2]) == [True, True, True]", + "got_raw": "<|fim_suffix|>\n assert sac(state_sequence=ss_1, proposition_satisfied_at=[0, 1, 2]) == [True, True, True]\n assert sac(state_sequence=ss_2, proposition_satisfied_at=[0, 1, 1]) == [True, False, True]\n assert sac(state_sequence=ss_2, proposition_satisfied_at=[0, 1, 2]) == [True, False, True]\n\n # test: different arg constraint\n dac = DifferentArgConstraint(\n proposition_indices=[0, 1], arg_names=[\"x\", \"y\"], n", + "exact_match": false, + "code_bleu": 0.03925345689749394, + "edit_similarity": 0.06521739130434782, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/partnr-planner", + "expected": "1.5", + "got": "(", + "got_raw": " (\n base_pos.x == -5.14\n ), f\"Expected base_pos.x to be -5.14, but got {base_pos.x}\"\n assert (\n base_pos.y == -3.94\n ), f\"Expected base_pos.y to be -3.94, but got {base_pos.y}\"\n assert (\n base_pos.z == 0\n ), f\"Expected base_pos.z to be 0, but got {base_pos.z}\"\n\n # Check the agent's rotation matches the expected values\n base_rot = env_interface.sim.agents_mgr[0].", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/partnr-planner", + "expected": "\"\"", + "got": "dataset_cfg.data_path).endswith(\"dataset.json.gz\"), \"The dataset path should end with dataset.json.gz\"", + "got_raw": "dataset_cfg.data_path).endswith(\"dataset.json.gz\"), \"The dataset path should end with dataset.json.gz\"\n\n check_json_serialization(dataset)\n check_binary_serialization(dataset)\n\n # test that the dataset can be saved to disk\n dataset_file_out = \"dataset_test.json.gz\"\n with gzip.open(dataset_file_out, \"wt\") as f:\n f.write(dataset.to_json())\n with gzip.open(dataset_file_out, \"rt\") as f:\n dataset = CollaborationDatasetV0.from_json(f.read())\n assert len(dataset.episodes) > 0, \"The dataset shouldn't be empty.\"\n\n #", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.038461538461538464, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "len(all_ids)", + "got": "100", + "got_raw": "100\n\n\ndef test_theseus_function_copy():\n variables = [th.Variable(torch.ones(1, 1), name=\"var_1\")]\n aux_vars = [th.Variable(torch.ones(1, 1), name=\"aux_1\")]\n cost_weight = MockCostWeight(torch.ones(1, 1), name=\"cost_weight_1\")\n cost_function = MockCostFunction(variables, aux_vars, cost_weight, name=\"name_1\")\n new_cost_function = cost_function.copy()\n assert new_cost_function._id != cost_function._id\n assert new_cost_function.name == cost_function", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "2", + "got": "1", + "got_raw": "1\n assert cost_function.eff_radius.shape[0] == batch_size\n\ndef test_eff_obj_variable_type_jacobians():\n rng = torch.Generator()\n rng.manual_seed(0)\n for _ in range(10):\n for batch_size in BATCH_SIZES_TO_TEST:\n obj = create_random_se2(batch_size, rng)\n eff = create_random_se2(batch_size, rng)\n origin = random_origin(batch_size)\n sdf_data = random_sdf_data(batch_size, 10, 10)\n cell_size = random_scalar(batch_size)\n eff_radius = random_scalar(batch", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "(batch_size, err_dim, i + 1)", + "got": "", + "got_raw": " # type: ignore\n (batch_size, err_dim, i + 1)\n assert jacobians[i].allclose(\n variable_values[i] * torch.ones_like(jacobians[i])\n )\n\n # check that the error function returns the correct value\n cost_function = th.AutoDiffCostFunction(\n optim_vars,\n error_fn,\n err_dim,\n cost_weight=cost_weight,\n aux_vars=aux_vars,\n autograd_mode=autograd_mode,\n )\n err = cost_function.error()\n assert err.allclose(\n variable_values.sum() * torch.ones(batch_size, err", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "len(all_ids)", + "got": "100", + "got_raw": "100\n\n\ndef test_variable_copy():\n all_ids = []\n for i in range(100):\n if np.random.random() < 0.5:\n name = f\"name_{i}\"\n else:\n name = None\n data = torch.rand(1, 1)\n t = th.Variable(data, name=name)\n all_ids.append(t._id)\n if name is not None:\n assert name == t.name\n else:\n assert t.name == f\"Variable__{t._id}\"\n assert t.tensor.allclose(data)\n\n t_copy = t.copy()\n ", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "sol2[f\"x{i}\"])", + "got": "sol2[f\"x{i}\"], atol=1e-6, rtol=1e-6)", + "got_raw": " sol2[f\"x{i}\"], atol=1e-6, rtol=1e-6)\n\ndef test_vectorization():\n for vectorize in [True, False]:\n for batch_size in BATCH_SIZES_TO_TEST:\n for dof in [1, 4]:\n for num_costs in [1, 64]:\n for weight_cls in [th.ScaleCostWeight, th.DiagonalCostWeight]:\n with mock.patch(\n \"theseus.core.vectorizer._CostFunctionWrapper\"\n ) as mock_wrapper:\n _solve_fn_for_masked_jacobians(\n batch_size, dof, num", + "exact_match": false, + "code_bleu": 0.2592170537135687, + "edit_similarity": 0.56, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "aux_vars", + "got": "", + "got_raw": " # type:ignore\n assert odummy in # type:ignore\n assert adummy in # type:ignore\n assert cf1 in # type:ignore\n assert cf2 in # type:ignore\n\n assert _check_attr(cf, v1)\n assert _check_attr(cf, t1)\n assert _check_attr(cf, odummy)\n assert _check_attr(cf, adummy)\n assert _check_attr(cf, cw1)\n assert _check_attr(cf, cw2)\n\n assert _check_attr(cf, v2)\n assert _check_attr(cf, odummy", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "expected_jac[1].shape", + "got": "", + "got_raw": " # noqa: W503\n expected_jac[1].shape[:-1] + torch.Size([2])\n\n assert jacobians_unrotate[0].shape == expected_jac[0].shape\n\n assert jacobians_unrotate[1].shape == # noqa: W503\n expected_jac[1].shape[:-1] + torch.Size([2])\n\n assert torch.allclose(\n expected_jac[0], jacobians_rotate[0], atol=EPS\n ) # noqa: W503\n\n assert torch.allclose(\n expected_jac", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "default_order.index_of(var.name)", + "got": "default_order.index_of(var.name)", + "got_raw": " default_order.index_of(var.name)\n assert var == default_order[i]\n\n # check that the default variable order is complete\n assert len(default_order) == num_variables\n\ndef test_variable_ordering():\n # repeat test a few times with different inputs\n for _ in range(5):\n # vary the number of variables to have in the objective\n for num_variables in range(2, 11):\n # generate all possible 2-variable cost functions, then shuffle their add order\n variables = []\n for i in range(num_variables):\n variables.append(MockVar(1, tensor=None, name", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "av)", + "got": "av)", + "got_raw": " av)\n\n # Test diagonal_scaling() with a random v\n rng = torch.Generator()\n rng.manual_seed(1009)\n for _ in range(20):\n v = torch.randn(A.shape[0], A.shape[2], 1)\n vscaled_expected = v * linearization.diagonal_scaling(v.squeeze(2))\n vscaled = linearization.diagonal_scaling(v.squeeze(2))\n\n torch.testing.assert_close(vscaled_expected, vscaled)\n\n # Test hessian_approx()\n hessian_approx = linearization.hessian_approx()\n torch.testing.assert_close(hessian_approx, linear", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "1", + "got": "1", + "got_raw": "1\n assert cf3 in cost_fns\n seen_cnt[2] += 1\n assert f\"{th.Vectorize._SHARED_TOKEN}{w1.scale.name}\" in var_names\n assert f\"{th.Vectorize._SHARED_TOKEN}{v1.name}\" in var_names\n assert f\"{th.Vectorize._SHARED_TOKEN}{v2.name}\" in var_names\n if cf4 in cost_fns:\n assert len(cost_fns) == 1\n assert cf4 in cost_fns\n seen_cnt[3] += 1\n assert f\"{th.Vectorize", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "q_inv_v", + "got": "", + "got_raw": " # type: ignore\n assert cost_weight.dt is # type: ignore\n\n cost_weight = th.eb.GPCostWeight(q_inv, dt)\n assert cost_weight.Qc_inv is # type: ignore\n assert cost_weight.dt is # type: ignore\n\n cost_weight = th.eb.GPCostWeight(q_inv_v, dt_v)\n assert cost_weight.Qc_inv is # type: ignore\n assert cost_weight.dt is # type: ignore\n\n cost_weight = th.eb.GPCostWeight(q_inv, dt_v)\n assert cost_weight.Qc_inv is", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "da_dx_unroll)", + "got": "2 * data_x_np, atol=1e-3)", + "got_raw": "2 * data_x_np, atol=1e-3)\n torch.testing.assert_close(da_dx_unroll, 2 * data_x_np, atol=1e-3)\n\n theseus_inputs[\"x\"] = data_x\n updated_inputs, _ = theseus_optim.forward(\n theseus_inputs,\n optimizer_kwargs={\n \"track_best_solution\": True,\n \"verbose\": False,\n \"backward_mode\": \"implicit\",\n },\n )\n da_dx_implicit = torch.autograd.grad(updated_inputs[\"a\"], data_x, retain_graph=True)[\n 0\n ].squeeze()\n\n torch", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.47368421052631576, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "1e-5", + "got": "1e-6, f\"Jacobian difference: {diff}\"", + "got_raw": "1e-6, f\"Jacobian difference: {diff}\"\n\n def _check_jacobian_numerically(\n actual_, expected_, eps_, atol_, rtol_, device_, dtype_\n ):\n # This makes failures more explicit than torch.allclose()\n diff = (expected_ - actual_).norm(p=float(\"inf\"))\n\n assert diff < atol_ + rtol_ * expected_.norm(p=float(\"inf\")), f\"Jacobian difference: {diff}\"\n\n def _check_jacobian_numerically(\n actual_, expected_, eps_, atol_, rtol_, device_, dtype_\n ):\n # This makes", + "exact_match": false, + "code_bleu": 0.2907153684841096, + "edit_similarity": 0.15, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "expected_jac[0].shape", + "got": "expected_jac.shape", + "got_raw": " expected_jac.shape\n assert jacobians_unrotate[0].shape == expected_jac.shape\n assert torch.allclose(\n expected_jac, jacobians_rotate[0], atol=EPS\n )\n assert torch.allclose(\n expected_jac, jacobians_unrotate[0], atol=EPS\n )\n\n # Check that the jacobians are correct for the inverse operation\n expected_jac = numeric_jacobian(\n lambda groups: groups[0].unrotate(groups[1]),\n [so2, th.Point2(rotated_point.tensor)],\n function_dim=2", + "exact_match": false, + "code_bleu": 0.3194715521231362, + "edit_similarity": 0.9230769230769231, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "data.shape", + "got": "assert t.shape == (batch_size, length)", + "got_raw": "<|fim_suffix|> assert t.shape == (batch_size, length)\n assert t.dtype == dtype\n assert t.device == device\n assert t.requires_grad == requires_grad\n assert t.name == name\n assert t.is_leaf == is_leaf\n assert t.is_shared == is_shared\n assert t.is_shared_leaf == is_shared_leaf\n assert t.is_shared_shared_leaf == is_shared_shared_leaf\n assert t.is_shared_shared_shared_leaf == is_shared_shared_shared_leaf\n assert t.is_shared_shared_shared_shared_leaf == is_shared_shared_shared_shared_leaf\n assert t.is_shared_shared_shared_shared_shared_leaf == is", + "exact_match": false, + "code_bleu": 0.14991106946711685, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "info.best_err)", + "got": "", + "got_raw": " # type: ignore\n updated_inputs[\"theta\"],\n torch.tile(HOME_POSE.unsqueeze(0), (batch_size, 1)),\n rtol=1e-3,\n atol=1e-3,\n )\n\n # Check error\n pose_err = ee_pose_err_fn(updated_inputs[\"theta\"], updated_inputs[\"ee_pose_target\"])\n torch.testing.assert_close( # type: ignore\n pose_err,\n torch.zeros_like(pose_err),\n rtol=1e-3,\n atol=1e-3,\n )\n\n # Check error history\n error_history = info", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "None", + "got": "None", + "got_raw": " None\n assert objective.get_optim_var(\"bad-name\") is None\n assert objective.get_aux_var(\"bad-name\") is None\n\ndef test_add():\n objective = th.Objective()\n cost_function = MockCostFunction()\n objective.add(cost_function)\n assert objective.get_cost_function(\"MockCostFunction\") == cost_function\n assert objective.get_optim_var(\"MockCostFunction\") == cost_function.optim_vars[0]\n assert objective.get_aux_var(\"MockCostFunction\") == cost_function.aux_vars[0]\n\n cost_function2 = MockCostFunction()\n objective.add(cost_function2)\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "t1.norm()", + "got": "0", + "got_raw": "0\n assert v1.norm(2) == 0\n assert v1.norm(1) == 0\n assert v1.norm(\"fro\") == 0\n assert v1.norm(\"nuc\") == 0\n assert v1.norm(\"inf\") == 0\n assert v1.norm(\"fro\", keepdim=True) == 0\n assert v1.norm(\"nuc\", keepdim=True) == 0\n assert v1.norm(\"inf\", keepdim=True) == 0\n\n v1.norm_(keepdim=True)\n assert v1.norm", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "facebookresearch/theseus", + "expected": "new_name", + "got": "new_name", + "got_raw": " new_name\n assert fn.name == new_name\n assert fn._autograd_mode == other_fn._autograd_mode\n assert fn._err_fn == other_fn._err_fn\n assert fn._dim == other_fn._dim\n assert fn._weight == other_fn._weight\n assert fn._weight._err_fn == other_fn._weight._err_fn\n assert fn._weight._dim == other_fn._weight._dim\n assert fn._weight._weight == other_fn._weight._weight\n assert fn._weight._weight._err_fn == other_fn._weight._weight._err_fn", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-mvc/fastapi-mvc", + "expected": "router2_expected", + "got": "router2_expected", + "got_raw": " router2_expected\n\n def test_should_insert_router_import_at_file_end_with_existing_router(self, monkeypatch, fake_project, fake_router):\n # given\n monkeypatch.chdir(fake_project[\"root\"])\n\n # when\n insert_router_import(\"fake_project\", \"fake_router\")\n # test idempotence\n insert_router_import(\"fake_project\", \"fake_router\")\n\n # then\n\n assert fake_router.read_text() == router_expected\n\n def test_should_insert_router_import_at_file_end_with_existing_router2(self, monkeypatch, fake_project, fake_router2):\n # given\n monkeypatch.chdir(fake_project", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-mvc/fastapi-mvc", + "expected": "2", + "got": "2", + "got_raw": "2\n assert \"Invalid option\" in result.output\n\n def test_should_exit_error_when_invoked_with_invalid_option(self, cli_runner):\n # given / when\n result = cli_runner.invoke(new, [\"--not_exists\"])\n\n # then\n\n assert result.exit_code == 2\n assert \"Invalid option\" in result.output\n\n def test_should_exit_error_when_invoked_with_invalid_option(self, cli_runner):\n # given / when\n result = cli_runner.invoke(new, [\"--not_exists\"])\n\n # then\n\n assert result.exit_code == 2\n assert \"Invalid option\" in result", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-mvc/fastapi-mvc", + "expected": "caplog.text", + "got": "assert result.exit_code == 0", + "got_raw": "<|fim_suffix|>\n assert result.exit_code == 0\n assert \"Run 'make install` to install the project.\" in caplog.text\n\n def test_should_run_with_host_and_port(self, cli_runner, caplog):\n # given\n result = cli_runner.invoke(run, [\"--host\", \"127.0.0.1\", \"--port\", \"8000\"])\n\n # then\n assert result.exit_code == 0\n assert \"Run 'make install` to install the project.\" in caplog.text\n\n def test_should_run_with_host_and_port_and_reload(self, cli_runner", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.2564102564102564, + "n_retrieved": 10 + }, + { + "repo": "fastapi-mvc/fastapi-mvc", + "expected": "[f\"{tmp}/my-script.sh\"])", + "got": "SCRIPTS, tmp)", + "got_raw": "SCRIPTS, tmp)\n\n @pytest.mark.parametrize(\"args\", [\n [\"my-script.sh\"],\n [\"--use-nix\", \"my-script.sh\"]\n ])\n def test_should_generate_script_using_default_arguments(self, cli_runner, args):\n with cli_runner.isolated_filesystem() as tmp:\n # given / when\n result = cli_runner.invoke(ScriptGenerator, args)\n\n # then\n assert result.exit_code == 0\n\n assert_paths(SCRIPTS, tmp)\n\n @pytest.mark.parametrize(\"args\", [\n [\"my-script.sh\"],\n [\"--use-nix\", \"my-script.sh", + "exact_match": false, + "code_bleu": 0.28744328957046744, + "edit_similarity": 0.21621621621621623, + "n_retrieved": 10 + }, + { + "repo": "fastapi-mvc/fastapi-mvc", + "expected": "[ mock.call(cmd=[\"git\", \"init\"], cwd=f\"{DIR}/test-project\"), mock.call(cmd=[\"make\", \"install\"], cwd=f\"{DIR}/test-project\"), ])", + "got": "assert result.output == \"fastapi-mvc new ~/apis/Skynet\\n\\nThis generates a skeletal fastapi-mvc project in ~/apis/Skynet.\\n\"", + "got_raw": "<|fim_suffix|>\n assert result.output == \"fastapi-mvc new ~/apis/Skynet\\n\\nThis generates a skeletal fastapi-mvc project in ~/apis/Skynet.\\n\"\n\n def test_should_exit_zero_and_call_copier_with_custom_answers_file(self, patched_new, cli_runner):\n # given\n answers_file = \"test-answers.yml\"\n with open(answers_file, \"w\") as f:\n f.write(\"test: value\")\n\n # when\n result = cli_runner.invoke(patched_new, [\"test-project\", \"--answers-file\", answers_file])\n\n # then\n assert result", + "exact_match": false, + "code_bleu": 0.03964798408695005, + "edit_similarity": 0.216, + "n_retrieved": 10 + }, + { + "repo": "fastapi-mvc/fastapi-mvc", + "expected": "0", + "got": "0", + "got_raw": "0\n assert \"Usage\" in result.output\n assert \"fastapi-mvc generate\" in result.output\n\n def test_should_exit_zero_when_invoked_with_short_help(self, monkeypatch, fake_project_with_generators, cli_runner):\n # given / when\n monkeypatch.chdir(fake_project_with_generators[\"root\"])\n result = cli_runner.invoke(get_generate_cmd(), [\"-h\"])\n\n # then\n\n assert result.exit_code == 0\n assert \"Usage\" in result.output\n assert \"fastapi-mvc generate\" in result.output\n\n def test_should_exit_zero_when_invoked_with_short", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-mvc/fastapi-mvc", + "expected": "\"fake_project\"", + "got": "\"fake-project\".lower().replace(\" \", \"_\").replace(\"-\", \"_\")", + "got_raw": " \"fake-project\".lower().replace(\" \", \"_\").replace(\"-\", \"_\")\n\n def test_should_return_loaded_answers_file_using_custom_answers_file(self, fake_project, monkeypatch):\n # given\n monkeypatch.chdir(fake_project[\"root\"])\n monkeypatch.setenv(\"FMVC_ANSWERS_FILE\", \"custom-answers.yml\")\n\n # when\n project_data = load_answers_file()\n\n # then\n assert project_data[\"project_name\"] == \"custom-answers\"\n\n assert project_data[\"package_name\"] == \"custom-answers\".lower().replace(\" \", \"_\").replace(\"-\", \"_\")\n\n def test_should_raise", + "exact_match": false, + "code_bleu": 0.05415315253510895, + "edit_similarity": 0.3611111111111111, + "n_retrieved": 10 + }, + { + "repo": "fastapi-mvc/fastapi-mvc", + "expected": "dirhash(str(reference_projects[target]))", + "got": "dirhash(str(update_copy))", + "got_raw": " dirhash(str(update_copy))\n\n def test_should_update_project_to_latest_version(self, tmp_path, monkeypatch, new_copy, update_copy, cli_runner, reference_projects):\n # given\n old_project = tmp_path / \"update-test\"\n old_project.mkdir(parents=True)\n create_result = cli_runner.invoke(\n new_copy,\n [\n \"--skip-install\",\n \"--no-interaction\",\n \"--use-version\",\n \"0.1.0\",\n str(old_project),\n ],\n )\n # make sure project was generated successfully\n assert create_result.exit_code == 0\n monkeypatch.chdir", + "exact_match": false, + "code_bleu": 0.4162224902509523, + "edit_similarity": 0.5230769230769231, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "[\"200\", \"401\"]", + "got": "[", + "got_raw": " [\n \"200\",\n \"401\",\n \"403\",\n ]\n\n def test_get_me(self, test_app: FastAPI, client: httpx.AsyncClient, user: User):\n response = client.get(\"/me\", headers={\"Authorization\": f\"Bearer {user.token}\"})\n\n assert response.status_code == status.HTTP_200_OK\n assert response.json() == {\n \"id\": str(user.id),\n \"email\": user.email,\n \"is_active\": True,\n \"is_superuser\": False,\n \"is_verified\": False,\n }\n\n def test_get", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "status.HTTP_200_OK", + "got": "200", + "got_raw": "200\n assert response.json() == {\"access_token\": \"access_token\", \"token_type\": \"bearer\"}\n\n @pytest.mark.parametrize(\"email\", [\"lake.lady@camelot.bt\", \"Lake.Lady@camelot.bt\"])\n async def test_valid_credentials_unverified(\n self,\n path,\n email,\n test_app_client: tuple[httpx.AsyncClient, bool],\n user_manager,\n unverified_user: UserModel,\n ):\n client, _ = test_app_client\n data = {\"username\": email, \"password\": \"excalibur\"}\n response = await client.post(path", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "True", + "got": "False", + "got_raw": " False\n\n async def test_invalid_body_is_active_verified_user(\n self,\n test_app_client: tuple[httpx.AsyncClient, bool],\n verified_user: UserModel,\n ):\n client, _ = test_app_client\n json = {\"is_active\": \"false\"}\n response = await client.patch(\n \"/me\", json=json, headers={\"Authorization\": f\"Bearer {verified_user.id}\"}\n )\n assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY\n\n data = cast(dict[str, Any], response.json())\n\n assert data[\"detail\"][0][\"loc\"] == [\"body", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "[ \"200\", \"401\", \"403\", \"404\", \"400\", \"422\", ]", + "got": "[", + "got_raw": " [\n status.HTTP_200_OK,\n status.HTTP_404_NOT_FOUND,\n status.HTTP_422_UNPROCESSABLE_ENTITY,\n ]\n\n def test_patch_id_body(self, openapi_dict):\n route = openapi_dict[\"paths\"][\"/{id}\"][\"patch\"]\n\n assert route[\"requestBody\"][\"content\"][\"application/json\"][\"schema\"] == {\n \"type\": \"object\",\n \"properties\": {\n \"password\": {\"type\": \"string\"},\n \"current_password\": {\"type\": \"string\"},\n },\n \"required\": [\"password\"],\n }\n\n def test_patch_id_responses(self", + "exact_match": false, + "code_bleu": 0.042471682678668604, + "edit_similarity": 0.043478260869565216, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "False", + "got": "False", + "got_raw": " False\n\n async def test_already_exists_error_with_associate(\n self,\n async_method_mocker: AsyncMethodMocker,\n test_app_client: httpx.AsyncClient,\n oauth_client: BaseOAuth2,\n user_oauth: UserOAuthModel,\n user_manager_oauth: UserManagerMock,\n access_token: str,\n ):\n state_jwt = generate_state_token({\"csrftoken\": \"CSRFTOKEN\"}, JWT_SECRET)\n async_method_mocker(oauth_client, \"get_access_token\", return_value=access_token)\n async_method_mocker(\n oauth_client, \"get_id_email\", return_value=(\"user", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "123", + "got": "123", + "got_raw": "123\n assert integer_id_mixin.parse_id(\"123.456\") == 123\n assert integer_id_mixin.parse_id(\"123.456\") == 123\n assert integer_id_mixin.parse_id(\"123.456\") == 123\n assert integer_id_mixin.parse_id(\"123.456\") == 123\n assert integer_id_mixin.parse_id(\"123.456\") == 123\n assert integer_id_mixin.parse_id(\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "False", + "got": "False", + "got_raw": " False\n\n async def test_bad_credentials(\n self,\n path,\n test_app_client: tuple[httpx.AsyncClient, bool],\n user_manager,\n ):\n client, _ = test_app_client\n response = await client.post(path, data={\"username\": \"bad\", \"password\": \"bad\"})\n assert response.status_code == status.HTTP_400_BAD_REQUEST\n\n assert user_manager.on_after_login.called is False\n\n async def test_login(\n self,\n path,\n test_app_client: tuple[httpx.AsyncClient, bool],\n user_manager,\n ):\n client, _ =", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "1", + "got": "1", + "got_raw": "1\n cookie = cookies[0]\n\n assert cookie[0] == b\"set-cookie\"\n assert cookie[1].decode() == f\"{COOKIE_NAME}=TOKEN; Path={path}; Domain={domain}; Secure={secure}; HttpOnly={httponly}; SameSite=lax\"\n\n@pytest.mark.authentication\n@pytest.mark.asyncio\nasync def test_get_logout_response(cookie_transport: CookieTransport):\n response = await cookie_transport.get_logout_response()\n\n assert isinstance(response, Response)\n assert response.status_code == status.HTTP_204_NO_CONTENT\n\n cookies = [header for header in response.raw_headers if header[", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "\"/oauth/callback\"", + "got": "\"/oauth/callback\"", + "got_raw": " \"/oauth/callback\"\n\n@pytest.mark.asyncio\n@pytest.mark.oauth\n@pytest.mark.router\nasync def test_oauth_router(\n test_app: FastAPI, oauth_client: OAuth2, mock_authentication: AuthenticationBackend\n):\n oauth_router = get_oauth_router(\n oauth_client,\n mock_authentication,\n UserManagerMock,\n JWT_SECRET,\n )\n\n assert oauth_router.routes[0].name == \"oauth:google.authorize\"\n assert oauth_router.routes[1].name == \"oauth:google.callback\"\n\n@pytest.mark.asyncio\n@pytest.mark.oauth\n@pytest.mark.router\nasync def test_oauth_associate_router(\n test_app: Fast", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi-users/fastapi-users", + "expected": "str(user.id)", + "got": "1", + "got_raw": "1\n assert decoded[\"aud\"] == \"fastapi-users:auth\"\n\n@pytest.mark.parametrize(\"jwt_strategy\", [\"HS256\", \"RS256\", \"ES256\"], indirect=True)\n@pytest.mark.authentication\n@pytest.mark.asyncio\nasync def test_read_token(jwt_strategy: JWTStrategy[UserModel, IDType], user):\n token = await jwt_strategy.write_token(user)\n\n decoded = decode_jwt(\n token,\n jwt_strategy.decode_key,\n audience=jwt_strategy.token_audience,\n algorithms=[jwt_strategy.algorithm],\n )\n\n assert decoded[\"sub\"] == 1\n ", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "None", + "got": "None", + "got_raw": " None\n assert hero.name == \"Deadpond\"\n assert hero.secret_name == \"Dive Wilson\"\n assert hero.age == 25\n```\n\n{!./docs_src/tutorial/automatic_id_none_refresh/annotations/en/tutorial002_py310.md!}\n\n////\n\nAnd here's all the output generated by running this program, all together:\n\n
\n\n```console\n$ python app.py\n\nINFO Engine BEGIN (implicit)\nINFO Engine PRAGMA main.table_info(\"hero\")\nINFO Engine [raw sql] ()\nINFO Engine PRAGMA temp.table_info(\"hero\")\nINFO Engine [raw sql]", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "2", + "got": "2", + "got_raw": "2\n assert data[0][\"id\"] == hero1_data[\"id\"]\n assert data[0][\"name\"] == hero1_data[\"name\"]\n assert data[0][\"secret_name\"] == hero1_data[\"secret_name\"]\n assert data[0][\"age\"] is None\n assert data[1][\"id\"] == hero3_data[\"id\"]\n assert data[1][\"name\"] == hero3_data[\"name\"]\n assert data[1][\"secret_name\"] == hero3_data[\"secret_name\"]\n assert data[1][\"age\"] == hero3_data[\"age\"]\n response = client.get(\"/", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "200", + "got": "200", + "got_raw": "200\n assert data[\"name\"] == hero1_data[\"name\"]\n assert data[\"secret_name\"] == hero1_data[\"secret_name\"]\n assert data[\"id\"] == 1\n\n response = client.post(\"/heroes/\", json=hero2_data)\n data = response.json()\n\n assert response.status_code == 200\n assert data[\"name\"] == hero2_data[\"name\"]\n assert data[\"secret_name\"] == hero2_data[\"secret_name\"]\n assert data[\"id\"] == 9000\n\n response = client.get(\"/heroes/1\")\n data = response", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "heroes[1].name", + "got": "\"Deadpond\"", + "got_raw": " \"Deadpond\"\n assert heroes[0].secret_name == \"Dive Wilson\"\n assert heroes[0].age is None\n\n assert heroes[1].name == \"Deadpond\"\n assert heroes[1].secret_name == \"Dive Wilson\"\n assert heroes[1].age is None\n\n with Session(engine) as session:\n session.add(hero_1)\n session.commit()\n session.refresh(hero_1)\n\n with Session(engine) as session:\n session.add(hero_2)\n session.commit()\n session.refresh(hero_2)\n\n with Session(engine) as session:\n heroes =", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "captured.out", + "got": "captured.out", + "got_raw": " captured.out\n assert \"CREATE TYPE myenum2 AS ENUM ('A', 'B');\" in captured.out\n assert \"CREATE TYPE myenum3 AS ENUM ('A', 'B');\" in captured.out\n assert \"CREATE TYPE myenum4 AS ENUM ('A', 'B');\" in captured.out\n assert \"CREATE TYPE myenum5 AS ENUM ('A', 'B');\" in captured.out\n assert \"CREATE TYPE myenum6 AS ENUM ('A', 'B');\" in captured.out\n assert \"CREATE TYPE myenum7 AS ENUM ('A', 'B');\" in captured.out", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "[ [{\"secret_name\": \"Dive Wilson\", \"age\": None, \"id\": 1, \"name\": \"Deadpond\"}] ]", + "got": "1", + "got_raw": "1\n assert \"SQLModel.metadata.create_all(mod.engine)\" in print_mock.calls[0][0]\n\n inspector = inspect(mod.engine)\n assert inspector.has_table(\"hero\")\n\n inspector = inspect(mod.engine)\n assert inspector.get_table_names() == [\"hero\"]\n\n inspector = inspect(mod.engine)\n assert inspector.get_columns(\"hero\") == [\n {\"name\": \"id\", \"type\": \"INTEGER\", \"nullable\": False, \"autoincrement\": True},\n {\"name\": \"name\", \"type\": \"VARCHAR\", \"nullable\": False},\n {\"name\": \"secret_name\", \"type\": \"VARCHAR\",", + "exact_match": false, + "code_bleu": 0.028314455119112403, + "edit_similarity": 0.02531645569620253, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "\"Dive Wilson\"", + "got": "\"Dive Wilson\"", + "got_raw": " \"Dive Wilson\"\n\n assert data[\"id\"] is not None\n\n hero = session.get(Hero, data[\"id\"])\n\n assert hero.name == \"Deadpond\"\n assert hero.secret_name == \"Dive Wilson\"\n assert hero.id == data[\"id\"]\n```\n\nThat's it! \u2728\n\n## Run The Program\n\nLet's run the program to see it all working.\n\nPut the code in a file `app.py` if you haven't already.\n\n{* ./docs_src/tutorial/create_db_and_table/tutorial001_py310.py *}\n\n/// tip\n\nRemember to [activate the virtual environment](../", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "expected_calls", + "got": "2", + "got_raw": "2\n assert print_mock.calls[0][0] == \"Before interacting with the database\"\n assert print_mock.calls[1][0] == \"After committing the session\"\n\n for i, call in enumerate(expected_calls):\n assert print_mock.calls[i][1] == call\n\n\n# File: docs/tutorial/connect/select/tutorial001_py310.py\n name: str\n secret_name: str\n age: int | None = None\n\n\nhero_1 = Hero(name=\"Deadpond\", secret_name=\"Dive Wilson\")\nhero_2 = Hero(name=\"Spider-Boy\", secret_name=\"Ped", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "[ [ \"Hero:\", { \"id\": 1, \"name\": \"Test Hero\", \"secret_name\": \"Secret Test Hero\", \"age\": 24, }, ] ]", + "got": "2", + "got_raw": "2\n assert print_mock.calls[0].args[0] == \"Deadpond\"\n assert print_mock.calls[1].args[0] == \"Test Hero\"\n\n with Session(mod.engine) as session:\n session.exec(delete(mod.Hero))\n session.commit()\n\n mod.select_heroes()\n\n assert print_mock.calls == 2\n assert print_mock.calls[0].args[0] == \"Deadpond\"\n assert print_mock.calls[1].args[0] == \"Test Hero\"\n\n with Session(mod.engine) as session:\n session.exec(delete(mod.Hero))\n session.commit()\n\n ", + "exact_match": false, + "code_bleu": 0.02, + "edit_similarity": 0.02040816326530612, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "RuntimeError)", + "got": "", + "got_raw": "\n\n\n# File: docs/tutorial/create-db-and-table.md\n # Some code here omitted, we will see it later \ud83d\udc48\n{!./docs_src/tutorial/create_db_and_table/tutorial001_py310.py[ln:1-7]!}\n # Some code here omitted, we will see it later \ud83d\udc48\n{!./docs_src/tutorial/create_db_and_table/tutorial001_py310.py[ln:15-32]!}\n\n# Code below omitted \ud83d\udc47\n```\n\n{!./docs_src/tutorial/create_db_and_table/tutorial001_py310/", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "hero_2.id", + "got": "2", + "got_raw": "2\n\ndef test_read_hero(session: Session, client: TestClient):\n hero_1 = Hero(name=\"Deadpond\", secret_name=\"Dive Wilson\")\n hero_2 = Hero(name=\"Rusty-Man\", secret_name=\"Tommy Sharp\", age=48)\n session.add(hero_1)\n session.add(hero_2)\n session.commit()\n\n response = client.get(\"/heroes/1\")\n data = response.json()\n\n assert response.status_code == 200\n\n assert data[\"name\"] == hero_1.name\n assert data[\"secret_name\"] == hero_1.secret_name\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "\"CASCADE\"", + "got": "", + "got_raw": " # type: ignore[attr-defined]\n \"CASCADE\"\n\n with Session(engine) as session:\n team = Team(name=\"The Incredibles\")\n hero = Hero(name=\"Elastigirl\", team_id=team.id)\n session.add(team)\n session.add(hero)\n session.commit()\n\n hero = session.get(Hero, hero.id)\n assert hero.team_id == team.id\n\n team = session.get(Team, team.id)\n assert team is None\n\n with pytest.raises(IntegrityError):\n session.add(Hero(name=\"Elastigirl\", team_id=team.id))\n session.commit()\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "IntegrityError)", + "got": "", + "got_raw": " # type: ignore\n IntegrityError, match=\"duplicate key value violates unique constraint\"\n ):\n session.commit()\n\n # We can create a hero with `None` set for the optional non-nullable field\n hero = Hero(primary_key=123, optional_non_nullable_no_default=None)\n # But we cannot commit it.\n with Session(engine) as session:\n session.add(hero)\n\n with pytest.raises( # type: ignore\n IntegrityError, match=\"duplicate key value violates unique constraint\"\n ):\n session.commit()\n\n # We can create a hero with `None` set for the", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "None", + "got": "None, \"name, secret_name, and age must be provided\"", + "got_raw": " None, \"name, secret_name, and age must be provided\"\n\n return v\n\n def test_hero():\n with pytest.raises(ValidationError):\n Hero(name=\"Deadpond\", secret_name=\"Dive Wilson\", age=42)\n\n with pytest.raises(ValidationError):\n Hero(name=\"Deadpond\", secret_name=\"Dive Wilson\", age=None)\n\n with pytest.raises(ValidationError):\n Hero(name=\"Deadpond\", secret_name=\"Dive Wilson\", age=42.0)\n\n with pytest.raises(ValidationError):\n Hero(name=\"Deadpond\", secret_name=\"Dive Wilson\", age=\"42\")\n\n ", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.14545454545454545, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "\"Dive Wilson\"", + "got": "\"Dive Wilson\"", + "got_raw": " \"Dive Wilson\"\n assert data[\"id\"] is not None\n assert data[\"age\"] is None\n```\n\nThat will save a **SQLite** database with the 3 heroes.\n\n### Select from the Database\n\nThen you could write queries to select from that same database, for example with:\n\n```Python hl_lines=\"13-17\"\nfrom sqlmodel import Field, Session, SQLModel, create_engine, select\n\n\nclass Hero(SQLModel, table=True):\n id: int | None = Field(default=None, primary_key=True)\n name: str\n secret_name: str\n age: int |", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "200", + "got": "200", + "got_raw": "200\n assert data[\"name\"] == hero_data[\"name\"]\n assert data[\"secret_name\"] == hero_data[\"secret_name\"]\n assert data[\"id\"] == 1\n assert data[\"created_at\"] == IsOneOf(\n [\n \"2022-01-01T00:00:00+00:00\",\n \"2022-01-01T00:00:00+01:00\",\n \"2022-01-01T00:00", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "\"B\"", + "got": "\"A\"", + "got_raw": " \"A\"\n assert m.v_name == \"B\"\n\n with pytest.raises(ValidationError):\n M.model_validate({\"fullName\": \"A\", \"v_name\": \"B\", \"first_name\": \"C\"})\n\n with pytest.raises(ValidationError):\n M.model_validate({\"fullName\": \"A\", \"v_name\": \"B\", \"v_name\": \"C\"})\n\n with pytest.raises(ValidationError):\n M.model_validate({\"fullName\": \"A\", \"v_name\": \"B\", \"v_name\": \"C\", \"first_name\": \"D\"})\n\n with pytest.raises(ValidationError):\n M.model_validate({\"fullName", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "0", + "got": "0, \"There should be no more items in the list\"", + "got_raw": "0, \"There should be no more items in the list\"\n\n# File: docs/tutorial/where.md\n \"ix_hero_name\",\n \"ix_hero_age\",\n]\n\n# File: docs/tutorial/create-db-and-table.md\n \"ix_hero_name\",\n \"ix_hero_age\",\n]\n\n# File: docs/tutorial/indexes.md\n \"ix_hero_name\",\n \"ix_hero_age\",\n]\n\n# File: docs/tutorial/where.md\n \"ix_hero_name\",\n \"ix_hero_age\",\n]\n\n# File: docs/tutorial/create-db-and-table.md\n \"ix_hero_name\",\n \"ix_hero_age\",\n]\n\n#", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0425531914893617, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "str", + "got": "", + "got_raw": " # type: ignore\n assert name_3 == \"Deadpond\"\n\n # check typing of select with 2 fields\n with Session(engine) as session:\n statement_2 = select(Hero.id, Hero.name)\n results_2 = session.exec(statement_2)\n for hero_2 in results_2:\n assert len(hero_2) == 2\n name_2: str = hero_2[1]\n\n assert type(name_2) is # type: ignore\n assert name_2 == \"Deadpond\"\n\n # check typing of select with 1 field\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "fastapi/sqlmodel", + "expected": "0", + "got": "0, \"There should be no other indexes in the DB\"", + "got_raw": "0, \"There should be no other indexes in the DB\"\n\n module.engine.dispose()\n\n\n# File: docs/tutorial/fastapi/relationships.md\n },\n {\n \"name\": \"Tarantula\",\n \"secret_name\": \"Natalia Roman-on\",\n \"age\": 32,\n \"team_id\": 2,\n \"id\": 6\n },\n {\n \"name\": \"Dr. Weird\",\n \"secret_name\": \"Steve Weird\",\n \"age\": 36,\n \"team_id\": 2,\n \"id\": 7\n },\n {\n \"", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.041666666666666664, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "0", + "got": "0", + "got_raw": "0\n\n client = TestClient(app)\n\n response = client.get(\"/test\")\n assert response.status_code == 200\n assert response.json() == {\"content\": \"Test\"}\n\n\ndef test_app_exception_handlers() -> None:\n \"\"\"Test that app.exception_handlers property exposes the exception handlers.\"\"\"\n app = air.Air()\n\n @app.exception_handler(air.HTTPException)\n def exception_handler(request: Request, exc: air.HTTPException) -> air.AirResponse:\n return air.AirResponse(air.P(exc.detail), status_code=exc.status_code)\n\n assert isinstance(app.exception_handlers, dict)\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "html", + "got": "html", + "got_raw": " html\n\n # render with validation error\n cheese.data.name = \"Cheese\"\n cheese.data.age = 1000\n\n html = cheese.render()\n\n assert \"Please correct this error.\" in html\n assert \"Please correct this error.\" in html\n\n # render with validation error and preserve user input\n cheese.data.name = \"Cheese\"\n cheese.data.age = 1000\n\n html = cheese.render()\n\n assert \"Please correct this error.\" in html\n assert \"Please correct this error.\" in html\n\n # render with validation error and preserve user input\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "response.text", + "got": "", + "got_raw": " # (1)!\n assert \"Custom widget wrapper\" in # (2)!\n assert \"CustomContactForm\" in # (3)!\n assert \"name\" in # (4)!\n assert \"email\" in # (5)!\n assert \"phone\" not in # (6)!\n assert \"CustomContactForm\" in # (7)!\n assert \"CustomContactForm\" in # (8)!\n assert \"CustomContactForm\" in # (9)!\n assert \"CustomContactForm\" in # (10)!\n assert \"CustomContactForm\" in # (", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "0", + "got": "0", + "got_raw": "0\n assert \"Usage: air [OPTIONS] COMMAND [ARGS]...\" in result.stdout\n assert \"Options\" in result.stdout\n assert \"Commands\" in result.stdout\n assert \"air run\" in result.stdout\n assert \"air dev\" in result.stdout\n assert \"air help\" in result.stdout\n assert \"air --help\" in result.stdout\n assert \"air --version\" in result.stdout\n assert \"air --help\" in result.stdout\n assert \"air --version\" in result.stdout\n assert \"air --help\" in result.stdout\n assert \"air --", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "r.text", + "got": "r.text", + "got_raw": " r.text\n assert \"URL: /where?\" in r.text\n\n assert \"404 Not Found\" in r.text\n assert \"HTTPException\" in r.text\n assert \"status_code=404\" in r.text\n assert \"detail='Not Found'\" in r.text\n\n assert \"404 Not Found\" in r.text\n assert \"HTTPException\" in r.text\n assert \"status_code=404\" in r.text\n assert \"detail='Not Found'\" in r.text\n\n assert \"404 Not Found\" in r.text\n assert", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "\"Bar\"", + "got": "\"Bar\"", + "got_raw": " \"Bar\"\n\n assert r.headers.get(\"X-Request-Id\") is not None\n assert r.headers.get(\"X-Request-Id\") != \"1234567890\"\n\n assert r.headers.get(\"X-Request-Id\") != \"1234567890\"\n\n assert r.headers.get(\"X-Request-Id\") != \"1234567890\"\n\n assert r.headers.get(\"X-Request-Id\") != \"1234567890\"\n\n assert r.headers.get(\"X-Request", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "\"id_\"", + "got": "assert utils.migrate_attribute_name_to_air_tag(\"for\") == \"for_\"", + "got_raw": "<|fim_suffix|>\n assert utils.migrate_attribute_name_to_air_tag(\"for\") == \"for_\"\n\n assert utils.migrate_attribute_name_to_air_tag(\"async\") == \"async_\"\n\n assert utils.migrate_attribute_name_to_air_tag(\"as\") == \"as_\"\n\n assert utils.migrate_attribute_name_to_air_tag(\"class\") == \"class_\"\n\n assert utils.migrate_attribute_name_to_air_tag(\"for\") == \"for_\"\n\n assert utils.migrate_attribute_name_to_air_tag(\"async\") == \"async_\"\n\n assert utils.migrate_attribute_name_to_air_tag(\"as\") == \"as_\"\n\n", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.08823529411764706, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "None", + "got": "assert jinja.templates.directory == \"tests/templates\"", + "got_raw": "<|fim_suffix|>\n assert jinja.templates.directory == \"tests/templates\"\n\n assert jinja.templates.env is not None\n assert jinja.templates.env.loader is not None\n assert jinja.templates.env.loader.searchpath == [\"tests/templates\"]\n\n assert jinja.templates.env.globals == {\"global_var\": \"test_value\"}\n\n assert jinja.templates.env.filters == {}\n assert jinja.templates.env.tests == {}\n assert jinja.templates.env.tests == {}\n assert jinja.templates.env.extensions == []\n\n assert jinja.templates.env.undefined is jinja2.StrictUndefined\n\n assert jinja.templates.env.autoescape is jinja2.select", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.03508771929824561, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "False", + "got": "assert \"Example:\" in docstring", + "got_raw": "<|fim_suffix|>\n assert \"Example:\" in docstring\n assert \"example()\" in docstring\n\n\ndef test_update_example_section_returns_true_for_existing_example_section(\n tmp_path: Path, capsys: pytest.CaptureFixture[str]\n) -> None:\n test_code = '''def my_function():\n \"\"\"Function with example section.\"\"\"\n pass\n'''\n temp_file = tmp_path / \"test.py\"\n temp_file.write_text(test_code)\n\n result = update_example_section(temp_file, None, \"my_function\", \"example()\")\n\n assert result is True\n captured = capsys.readouterr()\n assert captured.out", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.17142857142857143, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "2", + "got": "2", + "got_raw": "2\n assert \"a\" in result.parameters\n assert \"b\" in result.parameters\n\ndef test_signature_with_existing_attribute_benchmark(benchmark: BenchmarkFixture) -> None:\n \"\"\"Benchmark signature lookup when __signature__ is already set.\n\n This tests the optimization path where we check for an existing\n __signature__ attribute before calling inspect.signature.\n \"\"\"\n\n # Create a function with pre-computed signature\n def func_with_sig(a: int, b: str) -> None:\n pass\n\n func_with_sig.__signature__ = inspect.signature(func_with_sig)\n\n def get_cached_signature_with_attr() ->", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "404", + "got": "404", + "got_raw": "404\n assert r.json() == {\"detail\": \"Not Found in router 'boom'\"}\n\n\ndef test_fastapi_integration_500() -> None:\n app = air.Air()\n\n @app.get(\"/\")\n def boom() -> NoReturn:\n raise air.HTTPException(status_code=500)\n\n client = TestClient(app)\n r = client.get(\"/where?\")\n\n assert r.status_code == 500\n assert r.json() == {\"detail\": \"Internal Server Error in router 'boom'\"}\n\n\ndef test_fastapi_integration_404_router() -> None:\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "\"

Is boosted: True

\"", + "got": "\"Is boosted: True\"", + "got_raw": " \"Is boosted: True\"\n\n response = client.get(\"/test\")\n\n assert response.text == \"Is boosted: False\"\n\n response = client.get(\"/test\", headers={\"hx-boosted\": \"false\"})\n\n assert response.text == \"Is boosted: False\"\n\n response = client.get(\"/test\", headers={\"hx-boosted\": \"1\"})\n\n assert response.text == \"Is boosted: True\"\n\n response = client.get(\"/test\", headers={\"hx-boosted\": \"0\"})\n\n assert response.text == \"Is boosted: False\"\n\n response = client.get(\"/test\", headers", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "\"minified\"", + "got": "\"minified\"", + "got_raw": " \"minified\"\n assert captured == [HTML_SAMPLE]\n\ndef test_compact_render_passes_html_to_compact_formatter_with_indent(monkeypatch: pytest.MonkeyPatch) -> None:\n captured: list[str] = []\n\n def fake_compact_formatter(html: str) -> str:\n captured.append(html)\n return \"minified\"\n\n monkeypatch.setattr(base_module, \"compact_format_html\", fake_compact_formatter)\n\n result = SampleTag(\"body\").compact_render(indent=2)\n\n\n assert result == \"minified\"\n assert captured == [HTML_SAMPLE]\n\ndef test_compact_render_passes_html_to", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "feldroy/air", + "expected": "expected_html", + "got": "expected_html", + "got_raw": " expected_html\n\ndef test_pico_layout_with_htmx() -> None:\n actual_html = air.layouts.picocss(air.H1(\"Cheese Monger\"), air.Title(\"Cheese Monger\"), hx_boost=\"true\").pretty_render()\n expected_html = clean_doc_with_broken_lines(\n r\"\"\"\n \n \n \n \n '\n \n # Restore the original method for this test\n original_method = NotebookLMClient", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.9, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "str(err)", + "got": "assert \"abc-123\" in str(err)", + "got_raw": "<|fim_suffix|>\n assert \"abc-123\" in str(err)\n\n # Test ArtifactNotFoundError\n err = ArtifactNotFoundError(\"audio\", \"abc-123\")\n\n assert \"audio\" in str(err)\n assert \"abc-123\" in str(err)\n\n # Test ClientAuthenticationError\n err = ClientAuthenticationError(\"Invalid credentials\")\n\n assert \"Invalid credentials\" in str(err)\n\n # Test ArtifactDownloadError\n err = ArtifactDownloadError(\"audio\", \"abc-123\", \"Error downloading artifact\")\n\n assert \"audio\" in str(err)\n assert \"abc-1", + "exact_match": false, + "code_bleu": 0.5169731539571706, + "edit_similarity": 0.4444444444444444, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "None", + "got": "assert isinstance(client, BaseClient)", + "got_raw": "<|fim_suffix|>\n assert isinstance(client, BaseClient)\n\ndef test_base_client_init():\n \"\"\"Test that BaseClient can be initialized.\"\"\"\n from notebooklm_tools.core.base import BaseClient\n\n client = BaseClient()\n assert client is not None\n\ndef test_base_client_get_cookies():\n \"\"\"Test that BaseClient can get cookies.\"\"\"\n from notebooklm_tools.core.base import BaseClient\n\n client = BaseClient()\n cookies = client.get_cookies()\n assert cookies is not None\n\ndef test_base_client_get_csrf_token():\n \"\"\"Test that BaseClient can get CSRF token.\"\"\"\n from notebooklm_tools.core.base import BaseClient", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.04878048780487805, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "body", + "got": "body", + "got_raw": " body\n assert \"f.args=[\\\"param1\\\"]\" in body\n assert \"f.method=testRpc\" in body\n assert \"f.session_id=\" in body\n assert \"f.csrf_token=\" in body\n assert \"f.cookies=\" in body\n assert \"f.build_label=\" in body\n\ndef test_build_request_body_with_session_id():\n \"\"\"Test building RPC request body with session ID.\"\"\"\n from notebooklm_tools.core.base import BaseClient\n \n with patch.object(BaseClient, '_refresh_auth_tokens'):\n client = BaseClient(cookies={}, csrf_token=\"test_token\", session_id=\"test_session", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "\"art-8\"", + "got": "\"art-8\"", + "got_raw": " \"art-8\"\n assert result[\"status\"] == \"in_progress\"\n\n def test_create_data_table_with_description(self, mock_client):\n result = create_artifact(\n mock_client, \"nb-1\", \"data_table\",\n description=\"Compare features\",\n )\n assert result[\"description\"] == \"Compare features\"\n\n def test_create_data_table_with_invalid_type(self, mock_client):\n with pytest.raises(ValidationError):\n create_artifact(mock_client, \"nb-1\", \"invalid_type\")\n\n def test_create_data_table_with_invalid_description(self, mock_client):\n with pytest.raises(ValidationError):\n create", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "\"abc-123\"", + "got": "\"abc-123\"", + "got_raw": " \"abc-123\"\n assert err.artifact_type == \"report\"\n\ndef test_artifact_not_ready_error():\n \"\"\"Test ArtifactNotReadyError stores artifact info.\"\"\"\n err = ArtifactNotReadyError(\"abc-123\", \"report\")\n assert \"abc-123\" in str(err)\n assert \"report\" in str(err)\n\n assert err.artifact_id == \"abc-123\"\n assert err.artifact_type == \"report\"\n\ndef test_artifact_parse_error():\n \"\"\"Test ArtifactParseError stores artifact info.\"\"\"\n err = ArtifactParseError(\"abc-12", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "constants.VIDEO_STYLES.names", + "got": "constants.VALID_VIDEO_STYLES", + "got_raw": " constants.VALID_VIDEO_STYLES\n\n def test_style_invalid_raises_error(self):\n\n with pytest.raises(ValueError):\n constants.VALID_VIDEO_STYLES[\"invalid_style\"]\n\n def test_style_invalid_raises_error(self):\n\n with pytest.raises(ValueError):\n constants.VALID_VIDEO_STYLES[\"invalid_style\"]\n\n def test_style_invalid_raises_error(self):\n\n with pytest.raises(ValueError):\n constants.VALID_VIDEO_STYLES[\"invalid_style\"]\n\n def test_style_invalid_raises_error(self):\n\n with pytest.raises(ValueError):\n constants.VALID_VIDEO_STYLES[\"invalid_style\"]\n\n def test_style_invalid_raises_error(self):\n\n with pytest.raises(ValueError):\n constants", + "exact_match": false, + "code_bleu": 0.3567621345008163, + "edit_similarity": 0.7857142857142857, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "\"sheets\"", + "got": "\"sheets\"", + "got_raw": " \"sheets\"\n assert result[\"url\"] == \"https://docs.google.com/spreadsheets/123\"\n\n def test_docs_export_returns_correct_result(self, mock_client):\n mock_client.export_artifact.return_value = {\n \"url\": \"https://docs.google.com/document/d/123\"\n }\n result = export_artifact(\n client=mock_client,\n notebook_id=\"nb-123\",\n artifact_id=\"art-456\",\n export_type=\"docs\",\n )\n assert result[\"status\"] == \"success\"\n\n assert result[\"export_type\"] == \"docs", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "\"task-123\"", + "got": "\"task-123\"", + "got_raw": " \"task-123\"\n assert result[\"notebook_id\"] == \"nb-1\"\n\n def test_invalid_mode(self, mock_client):\n with pytest.raises(ValidationError):\n start_research(mock_client, \"nb-1\", \"invalid_mode\")\n\n def test_invalid_source(self, mock_client):\n with pytest.raises(ValidationError):\n start_research(mock_client, \"nb-1\", \"invalid_source\")\n\n def test_no_research(self, mock_client):\n mock_client.poll_research.return_value = {\n \"status\": \"no_research\",\n }\n\n with pytest.raises(ServiceError):\n start", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "\"video\"", + "got": "assert result[\"status\"] == \"in_progress\"", + "got_raw": "<|fim_suffix|>\n assert result[\"status\"] == \"in_progress\"\n\n def test_create_report(self, mock_client):\n result = create_artifact(mock_client, \"nb-1\", \"report\")\n\n assert result[\"artifact_type\"] == \"report\"\n assert result[\"status\"] == \"in_progress\"\n\n def test_create_quiz(self, mock_client):\n result = create_artifact(mock_client, \"nb-1\", \"quiz\")\n\n assert result[\"artifact_type\"] == \"quiz\"\n assert result[\"status\"] == \"in_progress\"\n\n def test_create_flashcards(self, mock_client):\n result = create_artifact", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.0851063829787234, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "\"public\"", + "got": "assert result[\"collaborators\"][0][\"email\"] == \"alice@example.com\"", + "got_raw": "<|fim_suffix|>\n assert result[\"collaborators\"][0][\"email\"] == \"alice@example.com\"\n assert result[\"collaborators\"][0][\"role\"] == \"owner\"\n assert result[\"collaborators\"][0][\"is_pending\"] is False\n\n assert result[\"collaborators\"][1][\"email\"] == \"bob@example.com\"\n assert result[\"collaborators\"][1][\"role\"] == \"editor\"\n assert result[\"collaborators\"][1][\"is_pending\"] is True\n\n assert result[\"public_link\"] == \"https://notebooklm.google.com/notebook/abc123\"\n\n ", + "exact_match": false, + "code_bleu": 0.07432998184513635, + "edit_similarity": 0.1643835616438356, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "\"url\"", + "got": "1", + "got_raw": "1\n assert result[\"title\"] == \"Example Page\"\n assert result[\"url\"] == \"https://example.com\"\n\n def test_add_text_source(self, mock_client):\n result = add_source(mock_client, \"nb-1\", \"text\", text=\"Hello world\")\n\n assert result[\"source_type\"] == 1\n assert result[\"title\"] == \"My Text\"\n assert result[\"text\"] == \"Hello world\"\n\n def test_add_drive_source(self, mock_client):\n result = add_source(mock_client, \"nb-1\", \"drive\", document_id=\"d1\")\n\n assert result[\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "\"completed\"", + "got": "2", + "got_raw": "2\n assert result[\"task_id\"] == \"task-1\"\n assert result[\"sources\"] == [{\"title\": \"Source A\"}]\n assert result[\"report\"] == \"Research complete.\"\n\n def test_in_progress_status(self, mock_client):\n mock_client.poll_research.return_value = {\n \"status\": \"in_progress\",\n \"task_id\": \"task-1\",\n \"sources\": [],\n \"report\": \"Research in progress.\",\n }\n\n result = poll_research(mock_client, \"nb-1\")\n\n\n assert result[\"status\"] == 1\n assert result[\"task_id\"] ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jacob-bd/notebooklm-mcp-cli", + "expected": "0", + "got": "0", + "got_raw": "0\n assert result[\"notebooks\"] == []\n\n def test_list_with_notebooks(self, mock_client):\n mock_client.list_notebooks.return_value = [\n _make_notebook(),\n _make_notebook(),\n ]\n\n result = list_notebooks(mock_client)\n\n assert result[\"count\"] == 2\n assert len(result[\"notebooks\"]) == 2\n assert result[\"notebooks\"][0].id == \"nb-1\"\n assert result[\"notebooks\"][1].id == \"nb-2\"\n\nclass TestGetNotebook:\n\n def test_get_notebook(self, mock_client):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "1", + "got": "1", + "got_raw": "1\n\n def test_fetch_and_process_papers(self, metadata_fetcher, sample_arxiv_papers, tmp_path):\n \"\"\"Test fetch_and_process_papers method.\"\"\"\n # Mock ArxivClient and PDFParserService\n mock_arxiv_client = self.mock_arxiv_client()\n mock_pdf_parser = self.mock_pdf_parser()\n\n # Mock ArxivClient.download_pdf method\n mock_arxiv_client.download_pdf.return_value = Path(\"mock_pdf.pdf\")\n\n # Mock PDFParserService.parse_pdf method\n mock_pdf_parser.parse_pdf.return_value = self.sample_pdf_content()\n\n # Mock ArxivClient.fetch_papers method", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "\"retrieve_papers\"", + "got": "\"retrieve_papers\"", + "got_raw": " \"retrieve_papers\"\n assert result[\"messages\"][0].tool_calls[0][\"arguments\"] == {\n \"query\": sample_human_message.content,\n \"top_k\": 10,\n }\n\n @pytest.mark.asyncio\n async def test_retrieve_does_not_create_tool_call(self, test_context, sample_human_message):\n \"\"\"Test retrieve node does not create tool call if already exists.\"\"\"\n state: AgentState = {\n \"messages\": [sample_human_message],\n \"retrieval_attempts\": 1,\n \"messages\": [\n ToolMessage(\n name=\"retrieve_papers\",\n tool_call", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "ValueError, match=\"Query cannot be empty\")", + "got": "", + "got_raw": "\n\n\n# File: src/services/agents/agentic_rag.py\n # Create graph configuration with the provided parameters\n graph_config = GraphConfig(\n top_k=top_k,\n use_hybrid=use_hybrid,\n )\n\n return AgenticRAGService(\n opensearch_client=opensearch_client,\n ollama_client=ollama_client,\n embeddings_client=embeddings_client,\n langfuse_tracer=langfuse_tracer,\n graph_config=graph_config,\n )\n\n @pytest.mark.asyncio\n async def test_ask(self, test_service):\n \"\"\"Test that the ask", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "\"http://localhost:9200\"", + "got": "\"http://localhost:9200\"", + "got_raw": " \"http://localhost:9200\"\n assert settings.opensearch.index_name == \"arxiv-papers\"\n assert settings.opensearch.chunk_index_suffix == \"chunks\"\n assert settings.opensearch.max_text_size == 1000000\n assert settings.opensearch.vector_dimension == 1024\n assert settings.opensearch.vector_space_type == \"cosinesimil\"\n assert settings.opensearch.r\n\n\ndef test_settings_opensearch_custom():\n \"\"\"Test OpenSearch custom configuration.\"\"\"\n settings = Settings(\n opensearch_host=\"http://localhost:9", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "1", + "got": "1", + "got_raw": "1\n assert papers[0].arxiv_id == \"2024.0001v1\"\n assert papers[0].title == \"Test Paper Title\"\n assert papers[0].authors == [\"Test Author\"]\n assert papers[0].abstract == \"Test abstract content\"\n assert papers[0].categories == [\"cs.AI\"]\n assert papers[0].pdf_url == \"http://arxiv.org/pdf/2024.0001v1\"\n\n @pytest.mark.asyncio\n async def test_fetch_papers_timeout(self, arxiv_client):\n \"\"\"Test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "150", + "got": "150", + "got_raw": "150\n\n def test_invalid_step_name(self):\n \"\"\"Test creating invalid reasoning step.\"\"\"\n with pytest.raises(ValidationError):\n ReasoningStep(\n step_name=\"invalid_step\",\n description=\"Retrieved 3 relevant papers from OpenSearch\",\n metadata={\"num_docs\": 3, \"retrieval_time_ms\": 150}\n )\n\n def test_invalid_description(self):\n \"\"\"Test creating invalid reasoning step.\"\"\"\n with pytest.raises(ValidationError):\n ReasoningStep(\n step_name=\"retrieve\",\n description=\"Retrieved 3 relevant papers from OpenSearch\",\n metadata={\"num_docs\": ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "custom_fields", + "got": "custom_fields", + "got_raw": " custom_fields\n\ndef test_query_builder_default_fields():\n builder = QueryBuilder(query=\"test\")\n\n query = builder.build()\n\n multi_match = query[\"query\"][\"bool\"][\"must\"][0][\"multi_match\"]\n\n assert multi_match[\"fields\"] == [\"title^3\", \"abstract^2\", \"authors^1\"]\n\ndef test_query_builder_latest_papers():\n builder = QueryBuilder(query=\"test\", latest_papers=True)\n\n query = builder.build()\n\n sort = query[\"sort\"]\n\n assert sort == [{\"published_date\": {\"order\": \"desc\"}}, \"_score\"]\n\ndef test_query_builder_sort_by_date():\n builder", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "None", + "got": "rchHit(", + "got_raw": "<|fim_suffix|>rchHit(\n arxiv_id=\"123456\",\n title=\"Test Title\",\n authors=\"John Doe\",\n abstract=\"Test Abstract\",\n published_date=\"2023-01-01\",\n pdf_url=\"https://example.com/pdf\",\n score=0.85,\n highlights={\"title\": \"Test Title\", \"abstract\": \"Test Abstract\"},\n chunk_text=\"This is a test chunk.\",\n chunk_id=\"chunk123\",\n section_name=\"Section A\",\n )\n\n # Test with a single chunk\n search_response = SearchResponse(\n query", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "75", + "got": "75", + "got_raw": "75\n assert scoring.reason == \"Query is relevant to AI research papers\"\n\n def test_invalid_score(self):\n \"\"\"Test creating invalid guardrail scoring.\"\"\"\n with pytest.raises(ValidationError):\n GuardrailScoring(score=-10, reason=\"Query is irrelevant to AI research papers\")\n\n def test_invalid_reason(self):\n \"\"\"Test creating invalid guardrail scoring.\"\"\"\n with pytest.raises(ValidationError):\n GuardrailScoring(score=75, reason=123456789012345678901234567890123", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "\"2024.0001v1.pdf\"", + "got": "with patch(\"pathlib.Path.exists\", return_value=False):", + "got_raw": "<|fim_suffix|>\n with patch(\"pathlib.Path.exists\", return_value=False):\n pdf_path = await arxiv_client.download_pdf(paper)\n\n assert pdf_path is not None\n\n assert pdf_path.name == \"2024.0001v1.pdf\"\n\n # Check that the PDF was downloaded\n assert pdf_path.is_file()\n\n @pytest.mark.asyncio\n async def test_download_pdf_cached_timeout(self, arxiv_client):\n \"\"\"Test that cached PDFs are returned without downloading.\"\"\"\n paper = ArxivPaper(\n arxiv_id=\"2024.0001v1", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.056338028169014086, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "PDFValidationError)", + "got": "", + "got_raw": "\n\n\n\n# File: src/services/pdf_parser/parser.py\n logger.error(f\"Docling parsing error for {pdf_path.name}: {e}\")\n raise PDFParsingException(f\"Docling parsing error for {pdf_path.name}: {e}\")\n\n\n\n# File: src/services/pdf_parser/parser.py\n logger.error(f\"Docling parsing error for {pdf_path.name}: {e}\")\n raise PDFParsingException(f\"Docling parsing error for {pdf_path.name}: {e}\")\n\n\n\n# File: src/services/pdf_parser/parser.py\n logger.error(f\"Docling parsing error for {pdf_path.name}: {e}\")\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "[\"http://localhost:11434\", \"http://ollama:11434\"]", + "got": "assert settings.ollama_model == \"llama3.2:1b\"", + "got_raw": "<|fim_suffix|>\n assert settings.ollama_model == \"llama3.2:1b\"\n\ndef test_settings_pdf_parser_defaults():\n \"\"\"Test PDF parser default configuration.\"\"\"\n settings = Settings()\n\n assert settings.pdf_parser.model == \"pdf-parser\"\n\ndef test_settings_chunking_defaults():\n \"\"\"Test chunking default configuration.\"\"\"\n settings = Settings()\n\n assert settings.chunking.chunk_size == 600\n assert settings.chunking.overlap_size == 100\n assert settings.chunking.min_chunk_size == 100\n assert settings.chunking.section_based == True\n\ndef test_settings_open_search_defaults", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.2553191489361702, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "0.0", + "got": "0.0", + "got_raw": "0.0\n\n def test_required_fields(self):\n \"\"\"Test required fields.\"\"\"\n with pytest.raises(ValidationError):\n SourceItem()\n\n def test_arxiv_id(self):\n \"\"\"Test arxiv_id field.\"\"\"\n source = SourceItem(\n arxiv_id=\"1234.5678\",\n title=\"Test Paper\",\n url=\"https://arxiv.org/abs/1234.5678\"\n )\n assert source.arxiv_id == \"1234.5678\"\n\n def test_title(self):\n \"\"\"Test title field.\"\"\"\n source = Source", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jamwithai/production-agentic-rag-course", + "expected": "422", + "got": "422", + "got_raw": "422\n assert response.json() == {\"detail\": [\"Query is required\"]}\n\n response = await client.post(\"/api/v1/hybrid-search/\", json={\"query\": \"test\", \"size\": -1})\n\n assert response.status_code == 422\n assert response.json() == {\"detail\": [\"Size must be a positive integer\"]}\n\n response = await client.post(\"/api/v1/hybrid-search/\", json={\"query\": \"test\", \"size\": 0})\n\n assert response.status_code == 422\n assert response.json() == {\"detail\": [\"Size must be a positive", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jannisborn/paperscraper", + "expected": "\"Kacper Wyrwal\"", + "got": "\"J. M. M. van der Veen\"", + "got_raw": " \"J. M. M. van der Veen\"\n assert result.num_citations == 1\n assert result.num_references == 1\n assert result.self_citations == {\n \"J. M. M. van der Veen\": 100.0\n }\n assert result.self_reference_ratio == 100.0\n assert result.self_citation_ratio == 100.0\n\n def test_citation_result(self):\n \"\"\"\n Tests the CitationResult class.\n \"\"\"\n citation = CitationResult(\n ssid=\"10.1038/s41", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "jannisborn/paperscraper", + "expected": "\"Juan M. Galeazzi\"", + "got": "\"J. M. M. van der Linden\"", + "got_raw": " \"J. M. M. van der Linden\"\n assert result.num_references == 10\n assert result.self_reference_ratio == 0.0\n assert result.self_citation_ratio == 0.0\n assert result.num_citations == 10\n assert result.self_references == {\n \"J. M. M. van der Linden\": 10.0,\n }\n assert result.self_citations == {\n \"J. M. M. van der Linden\": 0.0,\n }\n\n def test_researcher_from_name(self):\n \"\"\"\n Tests calculation of self", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.46511627906976744, + "n_retrieved": 10 + }, + { + "repo": "jannisborn/paperscraper", + "expected": "-1", + "got": "10", + "got_raw": "10\n assert isinstance(result.self_citations, dict)\n assert len(result.self_citations) == 10\n assert isinstance(result.self_citations[\"10.1038/s41586-023-06600-9\"], float)\n assert isinstance(result.self_citations[\"ed69978f1594a4e2b9dccfc950490fa1df817ae8\"], float)\n\n def test_citation_result(self):\n \"\"\"\n Tests calculation of self-citations for a single paper.\n", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "jannisborn/paperscraper", + "expected": "5", + "got": "2", + "got_raw": "2\n\n def test_dump_arxiv(self):\n dump_queries(covid19, \"test_dump_arxiv\")\n assert os.path.exists(\"test_dump_arxiv/arxiv.jsonl\")\n\n def test_dump_biorxiv(self):\n dump_queries(covid19, \"test_dump_biorxiv\")\n assert os.path.exists(\"test_dump_biorxiv/biorxiv.jsonl\")\n\n def test_dump_chemrxiv(self):\n dump_queries(covid19, \"test_dump_chemrxiv\")\n assert os.path.exists(\"test_dump_chemrxiv/chemrxiv.jsonl\")\n\n def test", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jannisborn/paperscraper", + "expected": "0", + "got": "0.0", + "got_raw": "0.0\n assert result.citation_score < 1.0\n\n def test_multiple_doi(self, dois):\n results = self_citations_paper(dois)\n assert isinstance(results, list)\n assert len(results) == len(dois)\n for result in results:\n assert isinstance(result, CitationResult)\n assert isinstance(result.ssid, str)\n assert isinstance(result.num_citations, int)\n assert result.num_citations > 10\n assert isinstance(result.citation_score, float)\n\n assert result.citation_score > 0.0\n assert result.citation_score < 1", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-axes", + "expected": "3)", + "got": "3)", + "got_raw": "3)\n self.assertEqual(AccessLog.objects.count(), 0)\n self.assertEqual(AccessFailureLog.objects.count(), 0)\n\n def test_handler_reset_attempts_ip(self):\n self.assertEqual(2, AxesProxyHandler.reset_attempts(ip_address=self.IP_1))\n\n self.assertEqual(AccessAttempt.objects.count(), 3)\n self.assertEqual(AccessLog.objects.count(), 0)\n self.assertEqual(AccessFailureLog.objects.count(), 0)\n\n def test_handler_reset_attempts_username_ip(self):\n self.assertEqual(2, AxesProxyHandler.reset_attempts(username=self.USERNAME_1, ip_address=self.IP_1))\n\n self", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-axes", + "expected": "[warning])", + "got": "1)", + "got_raw": "1)\n self.assertEqual(warnings[0], warning)\n\n\nclass MiddlewareCheckTestCase(AxesTestCase):\n\n @override_settings(MIDDLEWARE=[\"axes.middleware.AxesMiddleware\"])\n def test_middleware_check_warnings(self):\n warnings = run_checks()\n warning = Warning(\n msg=Messages.MIDDLEWARE_INVALID,\n hint=Hints.MIDDLEWARE_INVALID,\n id=Codes.MIDDLEWARE_INVALID,\n )\n\n\n self.assertEqual(warnings, 1)\n self.assertEqual(warnings[0], warning)\n\n\nclass BackendCheckTestCase(AxesTestCase):\n\n @override_settings(\n AUTHENTICATION_BACKENDS=[\"axes.backends.AxesStandaloneBackend", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-axes", + "expected": "self.SUCCESS_RESPONSE.content)", + "got": "", + "got_raw": " # type: ignore\n self.SUCCESS_RESPONSE.content)\n\n @patch(\"axes.handlers.proxy.AxesProxyHandler.is_allowed\", return_value=False)\n @patch(\"axes.decorators.get_lockout_response\", return_value=LOCKOUT_RESPONSE)\n def test_axes_dispatch_lockout(self, _, __):\n response = axes_dispatch(self.func)(self.request)\n\n self.assertEqual(response.content, # type: ignore\n self.LOCKOUT_RESPONSE.content)\n\n @patch(\"axes.handlers.proxy.AxesProxyHandler.is_allowed\", return_value=True)\n @patch(\"axes.decorators.get_lockout_response\", return_value=LOCKOUT_RESPONSE)\n def", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-axes", + "expected": "threshold_none)", + "got": "42)", + "got_raw": "42)\n self.assertEqual(threshold_none, 42)\n\n\n# File: tests/test_attemps.py\nfrom unittest.mock import patch\n\nfrom django.http import HttpRequest\nfrom django.test import override_settings, RequestFactory\nfrom django.utils.timezone import now\n\nfrom axes.attempts import get_cool_off_threshold\nfrom axes.models import AccessAttempt\nfrom axes.utils import reset, reset_request\nfrom tests.base import AxesTestCase\n\nclass GetCoolOffThresholdTestCase(AxesTestCase):\n @override_settings(AXES_COOLOFF_TIME=42)\n def test_get_cool_off_threshold(self):\n timestamp = now()\n\n ", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-axes", + "expected": "0)", + "got": "1, AxesProxyHandler.reset_attempts(username=self.USERNAME_1))", + "got_raw": "1, AxesProxyHandler.reset_attempts(username=self.USERNAME_1))\n self.assertEqual(AccessAttempt.objects.count(), 2)\n\n self.assertEqual(0, AxesProxyHandler.reset_attempts(username=self.USERNAME_1))\n self.assertEqual(AccessAttempt.objects.count(), 2)\n\n self.assertEqual(0, AxesProxyHandler.reset_attempts(username=self.USERNAME_2))\n self.assertEqual(AccessAttempt.objects.count(), 2)\n\n def test_handler_reset_attempts_ip(self):\n self.assertEqual(2, AxesProxyHandler.reset_attempts(ip_address=self.IP_1))\n self.assertEqual(AccessAttempt.objects.count(), 3)\n\n self.assertEqual", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.031746031746031744, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-axes", + "expected": "5)", + "got": "0)", + "got_raw": "0)\n\n def test_reset_ip(self):\n reset(ip=self.IP_1)\n\n self.assertEqual(AccessAttempt.objects.count(), 2)\n\n def test_reset_ip_username(self):\n reset(ip=self.IP_1, username=self.USERNAME_1)\n\n self.assertEqual(AccessAttempt.objects.count(), 1)\n\n def test_reset_ip_username(self):\n reset(ip=self.IP_1, username=self.USERNAME_1)\n\n self.assertEqual(AccessAttempt.objects.count(), 1)\n\n def test_reset_ip_username(self):\n reset(ip=self.IP_1, username=self.USERNAME_1)\n\n self.assertEqual(AccessAttempt", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-rest-knox", + "expected": "32", + "got": "32", + "got_raw": "32\n assert knox_settings.TOKEN_TTL == timedelta(hours=5)\n assert knox_settings.AUTO_REFRESH == True\n\n @override_settings(REST_KNOX={\n 'AUTH_TOKEN_CHARACTER_LENGTH': 32,\n 'TOKEN_TTL': timedelta(hours=5),\n 'AUTO_REFRESH': True,\n })\n def test_override_settings_with_import_strings(self):\n \"\"\"\n Test that settings can be overridden with IMPORT_STRINGS.\n \"\"\"\n\n assert knox_settings.AUTH_TOKEN_CHARACTER_LENGTH == 32\n assert knox_settings.TOKEN_TTL == timedelta(hours=5)\n assert knox", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-rest-knox", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n self.assertEqual(token1, user_tokens[0])\n self.assertEqual(token2, user_tokens[1])\n\n def test_token_expiry(self):\n \"\"\"\n Test that a token expires after the specified time.\n \"\"\"\n token, _ = AuthToken.objects.create(user=self.user, expiry=timezone.now() + timedelta(days=1))\n self.assertEqual(token.expiry, timezone.now() + timedelta(days=1))\n\n with freeze_time(timezone.now() + timedelta(days=2)):\n self.assertEqual(token.expiry, timezone.now() + timedelta(days=1))\n\n def test_token_expiry_limit(self):\n \"\"\"\n Test", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-rest-knox", + "expected": "'Token'", + "got": "'Token'", + "got_raw": " 'Token'\n assert knox_settings.EXPIRY_DATETIME_FORMAT == api_settings.DATETIME_FORMAT\n assert knox_settings.TOKEN_MODEL == 'knox.AuthToken'\n assert knox_settings.TOKEN_PREFIX == ''\n\n @override_settings(REST_KNOX={\n 'AUTH_TOKEN_CHARACTER_LENGTH': 32,\n 'TOKEN_TTL': timedelta(hours=5),\n 'AUTO_REFRESH': True,\n })\n def test_override_settings_with_import_strings(self):\n \"\"\"\n Test that settings can be overridden with IMPORT_STRINGS.\n \"\"\"\n assert knox_settings.AUTH_TOKEN_CHARACTER_LENGTH == 32\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-rest-knox", + "expected": "bytes)", + "got": "bytes)", + "got_raw": " bytes)\n self.assertEqual(len(result), 32)\n\n def test_make_hex_compatible_with_invalid_input(self):\n \"\"\"\n Ensure invalid strings are correctly converted to hex-compatible bytes.\n \"\"\"\n test_token = 12345\n result = make_hex_compatible(test_token)\n\n self.assertIsInstance(result, bytes)\n self.assertEqual(len(result), 32)\n\n def test_hash_token_with_valid_input(self):\n \"\"\"\n Ensure the hash_token function returns a valid hash digest.\n \"\"\"\n test_token = \"test123\"\n result = hash_token(test_token)\n\n self.assertIsInstance(result,", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "200)", + "got": "200)", + "got_raw": "200)\n\n def test_custom_authorisation(self):\n SilkyConfig().SILKY_AUTHENTICATION = True\n SilkyConfig().SILKY_AUTHORISATION = True\n SilkyConfig().SILKY_PERMISSIONS = lambda user: user.is_superuser\n username_and_password = 'bob' # bob is an imbecile and uses the same pass as his username\n user = User.objects.create(username=username_and_password)\n user.set_password(username_and_password)\n user.save()\n self.client.login(username=username_and_password, password=username_and_password)\n response = self.client.get(silky", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "params)", + "got": "self._query().query)", + "got_raw": " self._query().query)\n self.assertIn(prefix, self._query().analysis)\n\n def test_explain_unicode(self):\n DataCollector().configure(request=Request.objects.create(path='/path/to/somewhere'))\n sql, params = mock_sql(_unicode_binary_mock_query_params)\n prefix = \"EXPLAIN\"\n mock_cursor = sql.connection.cursor.return_value.__enter__.return_value\n sql.connection.ops.explain_query_prefix.return_value = prefix\n execute_sql(sql)\n\n self.assertNotIn(prefix, self._query().query)\n self.assertIn(prefix, self._query().analysis)\n\n def test_explain_non_unicode", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.14814814814814814, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "p.name == name)", + "got": "", + "got_raw": "\n\n\n# File: silk/views/requests.py\nfrom django.db.models import Sum\nfrom django.shortcuts import render\nfrom django.template.context_processors import csrf\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic import View\n\nfrom silk.auth import login_possibly_required, permissions_possibly_required\nfrom silk.models import Request, Response\nfrom silk.request_filters import BaseFilter, FiltersManager, filters_from_request\n\n__author__ = 'mtford'\n\n\nclass RequestsView(View):\n show = [5, 10, 25, 100, 250]\n default_show = 2", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "round(c))", + "got": "0)", + "got_raw": "0)\n self.assertLessEqual(round(f.time_taken), c)\n\n def test_time_spent_filter_with_seconds(self):\n requests = [mock_suite.mock_request() for _ in range(0, 10)]\n time_taken = sorted(x.time_taken for x in requests)\n c = time_taken[int(floor(len(time_taken) / 2))]\n time_taken_filter = SecondsFilter(c)\n query_set = models.Request.objects.all()\n query_set = time_taken_filter.contribute_to_query_set(query_set)\n filtered = query_set.filter(time_taken_filter)\n for f in filtered:\n\n self.assertGreaterEqual(round", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(DataCollector().profiles[0]['name'], 'test_profile')\n\n def test_two_objects(self):\n\n with silk_profile(name='test_profile2'):\n sleep(0.1)\n\n self.assertEqual(len(DataCollector().profiles), 2)\n self.assertEqual(DataCollector().profiles[1]['name'], 'test_profile2')\n\n def test_profile_time(self):\n\n with silk_profile(name='test_profile2'):\n sleep(0.1)\n\n self.assertEqual(DataCollector().profiles[1]['end_time'] - DataCollector().profiles[1]['start_time'], 0.1)\n\n def test_profile", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "context)", + "got": "context)", + "got_raw": " context)\n self.assertNotIn('view_names', context)\n self.assertNotIn('filters', context)\n\n def test_with_filters(self):\n request = Mock(spec_set=['GET', 'session'])\n request.session = {}\n request.GET = {'show': 100, 'order_by': 'path', 'order_dir': 'DESC', 'view_style': 'card'}\n context = RequestsView()._create_context(request)\n self.assertTrue(dict_contains({\n 'show': 100,\n 'order_by': 'path',\n 'order_dir': 'DESC',\n 'view_style': 'card',\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "len(results))", + "got": "5)", + "got_raw": "5)\n self.assertEqual(5, len(results))\n\n def test_order_by(self):\n results = ProfilingView()._get_objects(order_by='Recent')\n\n self.assertEqual(10, len(results))\n self.assertEqual(10, results[0].start_time)\n self.assertEqual(1, results[9].start_time)\n\n def test_order_by_name(self):\n results = ProfilingView()._get_objects(order_by='Name')\n\n self.assertEqual(10, len(results))\n self.assertEqual('Name', results[0].name)\n self.assertEqual('Name', results[9].name)\n\n def test", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "len(DataCollector().queries))", + "got": "0)", + "got_raw": "0)\n\n def test_sql_query(self):\n self.assertEqual(1, 1)\n\n def test_request(self):\n self.assertEqual(1, 1)\n\n def test_sql_query(self):\n self.assertEqual(1, 1)\n\n def test_sql_query(self):\n self.assertEqual(1, 1)\n\n def test_sql_query(self):\n self.assertEqual(1, 1)\n\n def test_sql_query(self):\n self.assertEqual(1, 1)\n\n def test_sql_query(self):\n self.assertEqual(1, 1)\n\n def test_sql_query(self):\n self.assertEqual(1, 1", + "exact_match": false, + "code_bleu": 0.11939665909150465, + "edit_similarity": 0.06451612903225806, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "expected_regex)", + "got": "", + "got_raw": "\n\n\n# File: silk/profiling/profiler.py\n def _query_identifiers_from_collector(self):\n return [x for x in DataCollector().queries]\n\n def _start_queries(self):\n \"\"\"record queries that have been executed before profiling began\"\"\"\n self._queries_before = self._query_identifiers_from_collector()\n\n def _end_queries(self):\n \"\"\"record queries that have been executed after profiling has finished\"\"\"\n self._queries_after = self._query_identifiers_from_collector()\n\n def __enter__(self):\n if self._silk_installed() and self._should_profile():\n with silk", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n\n def test_save_if_has_pk(self):\n\n obj = SQLQueryFactory.create(start_time=self.start_time, end_time=self.end_time)\n obj.save()\n\n self.assertEqual(obj.request.num_sql_queries, 1)\n\n def test_save_if_has_no_pk_and_no_request(self):\n\n obj = SQLQueryFactory.build(start_time=self.start_time, end_time=self.end_time)\n obj.save()\n\n self.assertEqual(obj.request.num_sql_queries, 1)\n\n def test_save_if_has_no_pk_and_no_request_and_no_end_time(self):\n\n obj = SQLQueryFactory.build(start_time=self.start_time)\n obj.save()\n\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "mock_DataCollector.return_value.register_profile.call_count)", + "got": "1 in mock.DataCollector.objects)", + "got_raw": "1 in mock.DataCollector.objects)\n self.assertEqual(mock.DataCollector.objects[1]['name'], 'Slow Foo')\n\n def test_dynamic_method_decorator(self):\n middleware = SilkyMiddleware(fake_get_response)\n SilkyConfig().SILKY_DYNAMIC_PROFILING = [\n {\n 'module': 'tests.data.dynamic',\n 'function': 'MyClass.bar'\n }\n ]\n middleware._apply_dynamic_mappings()\n from .data.dynamic import MyClass\n\n mock = mock_data_collector()\n with patch('silk.profiling.profiler.DataCollector', return_value=mock) as mock_DataCollector:\n MyClass().bar", + "exact_match": false, + "code_bleu": 0.19070828081828378, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "code == 200)", + "got": "200 <= code <= 300)", + "got_raw": "200 <= code <= 300)\n\n def test_cprofile(self):\n request_query_data = random.choice(\n models.Request.objects\n .values('id')\n .filter(body__isnull=False)\n )\n request_id = request_query_data['id']\n url = silky_reverse('silk:cprofile', kwargs={\n 'request_id': request_id\n })\n response = self.client.get(url)\n code = response.status_code\n\n self.assertTrue(200 <= code <= 300)\n\n def test_sql(self):\n request_query_data = random.choice(\n models.Request", + "exact_match": false, + "code_bleu": 0.21105340631872638, + "edit_similarity": 0.6451612903225806, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "13.8)", + "got": "13.8)", + "got_raw": "13.8)\n\n def test_total_meta_if_self_have_it_meta_and_no_queries_time(self):\n\n obj = RequestMinFactory.create(meta_time=3.3)\n\n self.assertEqual(obj.total_meta_time, 3.3)\n\n def test_total_meta_if_self_have_it_no_meta_and_queries_time(self):\n\n obj = RequestMinFactory.create(meta_time_spent_queries=10.5)\n\n self.assertEqual(obj.total_meta_time, 10.5)\n\n def test_total_meta_if_self_have_it_no_meta_and_no_queries_time(self):\n\n obj = RequestMinFactory.create()\n\n self.assertEqual(obj.total_meta_time", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(objs[0].status_code, 200)\n self.assertEqual(objs[0].raw_body, 'hello world')\n self.assertEqual(objs[0].body, 'hello world')\n self.assertEqual(objs[0].content_type, 'text/html; charset=utf-8')\n self.assertEqual(objs[0].headers, {})\n\n def test_config_meta(self):\n delete_all_models(Request)\n DataCollector().configure(Request.objects.create())\n self.assertTrue(SilkyConfig().SILKY_META)\n self.assertTrue(SilkyConfig().SILKY_MAX_RECOR", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "110)", + "got": "200)", + "got_raw": "200)\n\n def test_meta_time_taken(self):\n profile = list(DataCollector().profiles.values())[0]\n time_taken = _time_taken(start_time=profile['start_time'], end_time=profile['end_time'])\n self.assertGreaterEqual(time_taken, 100)\n\n self.assertLess(time_taken, 200)\n\n def test_meta_time_taken(self):\n profile = list(DataCollector().profiles.values())[0]\n time_taken = _time_taken(start_time=profile['start_time'], end_time=profile['end_time'])\n self.assertGreaterEqual(time_taken, 100)\n\n", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "jazzband/django-silk", + "expected": "'normal_uri_')", + "got": "'normal/uri/')", + "got_raw": " 'normal/uri/')\n\n def test_profile_file_name_with_disabled_extended_file_name(self):\n\n SilkyConfig().SILKY_PYTHON_PROFILER_EXTENDED_FILE_NAME = False\n request_path = 'normal/uri/'\n resulting_prefix = self._get_prof_file_name(request_path)\n\n self.assertEqual(resulting_prefix, 'normal_uri')\n\n def test_profile_file_name_with_enabled_extended_file_name_and_no_path(self):\n\n SilkyConfig().SILKY_PYTHON_PROFILER_EXTENDED_FILE_NAME = True\n request_path = ''\n resulting_prefix = self._get_prof_file_name(request_path)\n\n self.assertEqual(resulting", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.8571428571428571, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n self.assertEqual(BlacklistedToken.objects.count(), 0)\n\n serializer = TokenRefreshSerializer(\n data={\"refresh\": str(RefreshToken.for_user(self.user))}\n )\n\n serializer.is_valid(raise_exception=True)\n\n self.assertEqual(OutstandingToken.objects.count(), 1)\n self.assertEqual(BlacklistedToken.objects.count(), 0)\n\n @override_api_settings(\n ROTATE_REFRESH_TOKENS=True,\n BLACKLIST_AFTER_ROTATION=False,\n )\n def test_it_should_not_blacklist_refresh_token_if_tokens_should_be_rotated_and_not_blacklisted(\n self,\n ):\n\n self.assertEqual(Out", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "946684800)", + "got": "aware_utcnow(), datetime_to_epoch(aware_utcnow()))", + "got_raw": "aware_utcnow(), datetime_to_epoch(aware_utcnow()))\n\n self.assertEqual(\n datetime_to_epoch(datetime(year=2017, month=10, day=17, hour=20, minute=13)),\n 1508252293,\n )\n\n self.assertEqual(\n datetime_to_epoch(datetime(year=2017, month=10, day=17, hour=20, minute=13, second=1)),\n 1508252293,\n )\n\n self.assertEqual(\n datetime_to_epoch(datetime(year", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.03333333333333333, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "\"TokenUser 42\")", + "got": "", + "got_raw": " # type: ignore\n \"TokenUser 42\")\n\n def test_id(self):\n self.assertEqual(self.user.id, # type: ignore\n \"42\")\n\n def test_pk(self):\n self.assertEqual(self.user.pk, # type: ignore\n \"42\")\n\n def test_username(self):\n self.assertEqual(self.user.username, # type: ignore\n \"deep-thought\")\n\n def test_is_staff(self):\n self.assertEqual(self.user.is_staff, # type: ignore\n False)\n\n def test_is_superuser(self):\n self.assertEqual(self.user.is_superuser, # type", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "TokenError)", + "got": "ValidationError):", + "got_raw": "ValidationError):\n s.is_valid(raise_exception=True)\n\n def test_it_should_not_validate_if_token_expired(self):\n token = SlidingToken()\n token[\"exp\"] = datetime_from_epoch(1600000000)\n\n s = TokenRefreshSlidingSerializer(data={\"token\": str(token)})\n\n\n with self.assertRaises(ValidationError):\n s.is_valid(raise_exception=True)\n\n def test_it_should_not_validate_if_token_is_blacklisted(self):\n token = SlidingToken()\n token[\"jti\"] = \"test_jti\"\n\n s = TokenRefreshSlidingSerializer(data={\"token\":", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "res.data[\"code\"])", + "got": "res.data[\"detail\"].code)", + "got_raw": " res.data[\"detail\"].code)\n\n @override_api_settings(\n AUTH_TOKEN_CLASSES=(\"rest_framework_simplejwt.tokens.AccessToken\",),\n )\n def test_expired_token_with_refresh(self):\n old_lifetime = AccessToken.lifetime\n AccessToken.lifetime = timedelta(seconds=0)\n try:\n res = self.client.post(\n reverse(\"token_obtain_pair\"),\n data={\n User.USERNAME_FIELD: self.username,\n \"password\": self.password,\n },\n )\n finally:\n AccessToken.lifetime = old_lifetime\n\n access = res.data[\"access\"]\n refresh = res.data[\"refresh\"]\n self.authenticate_with", + "exact_match": false, + "code_bleu": 0.42728700639623407, + "edit_similarity": 0.7317073170731707, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "hash(self.user.id))", + "got": "42)", + "got_raw": "42)\n\n def test_eq(self):\n self.assertEqual(self.user, self.user)\n\n def test_ne(self):\n self.assertNotEqual(self.user, object())\n\n def test_str(self):\n self.assertEqual(str(self.user), \"TokenUser 42\")\n\n def test_repr(self):\n self.assertEqual(repr(self.user), \"TokenUser 42\")\n\n def test_hash(self):\n self.assertEqual(hash(self.user), 42)\n\n def test_eq(self):\n self.assertEqual(self.user, self.user)\n\n def test_ne(self):\n self.assertNotEqual(self.user, object())\n\n def test_str(self):\n ", + "exact_match": false, + "code_bleu": 0.11939665909150465, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "self.payload)", + "got": "self.payload)", + "got_raw": " self.payload)\n\n def test_decode_aud_iss_failure(self):\n self.payload[\"exp\"] = aware_utcnow() + timedelta(days=1)\n self.payload[\"foo\"] = \"baz\"\n self.payload[\"aud\"] = AUDIENCE\n self.payload[\"iss\"] = \"wrong_issuer\"\n\n token = jwt.encode(self.payload, PRIVATE_KEY, algorithm=\"RS256\")\n if IS_OLD_JWT:\n token = token.decode(\"utf-8\")\n else:\n # Payload copied\n self.payload[\"exp\"] = datetime_to_epoch(self.payload[\"exp\"])\n\n\n with self.assertRaises(TokenBackend", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n\n def test_tokens_can_be_manually_blacklisted_with_custom_jti(self):\n token = RefreshToken.for_user(self.user)\n\n # Should raise no exception\n RefreshToken(str(token))\n\n self.assertEqual(OutstandingToken.objects.count(), 1)\n\n # Add token to blacklist\n blacklisted_token, created = token.blacklist(jti=\"custom_jti\")\n\n # Should not add token to outstanding list if already present\n self.assertEqual(OutstandingToken.objects.count(), 1)\n\n # Should return blacklist record and boolean to indicate creation\n self.assertEqual(blacklisted_token.token.jti, \"", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jazzband/djangorestframework-simplejwt", + "expected": "token.payload)", + "got": "1, self.backend.get_validated_token(str(token)).payload[\"exp\"])", + "got_raw": "1, self.backend.get_validated_token(str(token)).payload[\"exp\"])\n\n def test_get_validated_token_with_exp(self):\n # Should raise InvalidToken if token not valid\n token = AuthToken()\n token.set_exp(lifetime=-timedelta(days=1))\n with self.assertRaises(InvalidToken):\n self.backend.get_validated_token(str(token))\n\n # Otherwise, should return validated token\n token.set_exp()\n\n self.assertEqual(1, self.backend.get_validated_token(str(token)).payload[\"exp\"])\n\n def test_get_validated_token_with_exp_in_past(self):\n # Should raise InvalidToken if token", + "exact_match": false, + "code_bleu": 0.09629943614188137, + "edit_similarity": 0.36363636363636365, + "n_retrieved": 10 + }, + { + "repo": "jdemaeyer/brightsky", + "expected": "[ { 'url': k, 'parser': v[0], 'last_modified': datetime.datetime.strptime( v[1], '%Y-%m-%d %H:%M').replace(tzinfo=tzutc()), 'file_size': v[2], } for k, v in expected.items()]", + "got": "expected", + "got_raw": " expected\n\n\ndef test_dwdpoller_parse_with_offset(data_dir):\n with open(data_dir / 'dwd_opendata_index.html') as f:\n resp_text = f.read()\n expected = {\n '/dir/stundenwerte_FF_00011_akt.zip': (\n 'WindObservationsParser', '2020-03-29 08:55', 70523),\n '/dir/stundenwerte_FF_00090_akt.zip': (\n 'WindObservationsParser', '2020-03", + "exact_match": false, + "code_bleu": 0.010431641359672991, + "edit_similarity": 0.08791208791208792, + "n_retrieved": 10 + }, + { + "repo": "jdemaeyer/brightsky", + "expected": "237667", + "got": "1000000000", + "got_raw": "1000000000\n assert np.sum(data[1000:1000 + 1000]) == 100000000\n assert np.sum(data[1000 + 1000:1000 + 2000]) == 100000000\n assert np.sum(data[1000 + 2000:1000 + 3000]) == 100000000\n assert np", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jdemaeyer/brightsky", + "expected": "[ [13, 11, 8, 9, 9], [12, 11, 7, 8, 9], [9, 10, 8, 8, 9], [0, 0, 2, 6, 8], [0, 0, 0, 0, 0], ]", + "got": "", + "got_raw": " # noqa\n [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jdemaeyer/brightsky", + "expected": "db_sources[0]['id'] + 2", + "got": "2", + "got_raw": "2\n assert db_sources[2]['observation_type'] == 'historical'\n assert db_sources[2]['lat'] == 60.6\n assert db_sources[2]['lon'] == 70.7\n assert db_sources[2]['height'] == 80.8\n assert db_sources[2]['wmo_station_id'] == '10003'\n assert db_sources[2]['dwd_station_id'] is None\n assert db_sources[2]['station_name'] == 'G\u00f6ttingen'\n\ndef test_db_exporter_reuses_existing_records(db,", + "exact_match": false, + "code_bleu": 0.0660670619445956, + "edit_similarity": 0.08333333333333333, + "n_retrieved": 10 + }, + { + "repo": "jdemaeyer/brightsky", + "expected": "[]", + "got": "ttings().CORS_ALLOWED_ORIGINS == ['*']", + "got_raw": "<|fim_suffix|>ttings().CORS_ALLOWED_ORIGINS == ['*']\n with environ(BRIGHTSKY_CORS_ALLOWED_ORIGINS='http://example.com'):\n\n assert Settings().CORS_ALLOWED_ORIGINS == ['http://example.com']\n with environ(BRIGHTSKY_CORS_ALLOWED_ORIGINS='http://example.com,http://example.org'):\n\n assert Settings().CORS_ALLOWED_ORIGINS == ['http://example.com', 'http://example.org']\n with environ(BRIGHTSKY_CORS_ALLOWED_ORIGINS='http://example.com,http://example.org,http://example.net')", + "exact_match": false, + "code_bleu": 0.13950796967929133, + "edit_similarity": 0.1, + "n_retrieved": 10 + }, + { + "repo": "jdemaeyer/brightsky", + "expected": "1", + "got": "0", + "got_raw": "0\n\n exporter.export(\n [\n {**SOURCES[0], **RECORDS[0]},\n {**SOURCES[1], **RECORDS[1]},\n ],\n fingerprint=FINGERPRINT)\n\n parsed_files = db.fetch(\"SELECT * FROM parsed_files\")\n\n assert len(parsed_files) == 1\n assert parsed_files[0]['url'] == FINGERPRINT['url']\n assert parsed_files[0]['last_modified'] == FINGERPRINT['last_modified']\n assert parsed_files[0]['file_size'] == FINGERPRINT['file_size']\n\ndef test_db_exporter_updates_parsed", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jdepoix/youtube-transcript-api", + "expected": "CookieInvalid)", + "got": "InvalidVideoId):", + "got_raw": "InvalidVideoId):\n YouTubeTranscriptApi().fetch(\"GJLlxj_dtq8\")\n\n with self.assertRaises(CookiePathInvalid):\n YouTubeTranscriptApi().fetch(\"GJLlxj_dtq8\", cookies_path=cookie_path)\n\n with self.assertRaises(CookieInvalid):\n YouTubeTranscriptApi().fetch(\"GJLlxj_dtq8\", cookies_path=cookie_path)\n\n @pytest.mark.skip(\n reason=\"This test is temporarily disabled because cookie auth is currently not \"\n \"working due to YouTube changes.\"\n )\n def test_load_cookies__valid_cookies(self):\n cookie_path", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5333333333333333, + "n_retrieved": 10 + }, + { + "repo": "jdepoix/youtube-transcript-api", + "expected": "\"\")", + "got": "", + "got_raw": " # last line\n \"00:00:00.000 --> 00:00:00.000\\n\"\n \"00:00:00.000 --> 00:00:00.000\\n\"\n \"00:00:00.000 --> 00:00:00.000\\n\"\n \"00:00:00.000 --> 00:00:00.000\\n\"\n \"00", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jdepoix/youtube-transcript-api", + "expected": "IpBlocked)", + "got": "YouTubeRequestFailed):", + "got_raw": "YouTubeRequestFailed):\n YouTubeTranscriptApi().fetch(\"GJLlxj_dtq8\")\n\n def test_fetch__exception_if_video_unplayable(\n self,\n ):\n httpretty.register_uri(\n httpretty.GET,\n \"https://www.youtube.com/watch\",\n body=load_asset(\"youtube_unplayable.html.static\"),\n )\n\n with self.assertRaises(VideoUnplayable):\n YouTubeTranscriptApi().fetch(\"GJLlxj_dtq8\")\n\n def test_fetch__exception_if_video_unavailable(\n self,\n ):\n httpretty.register_uri(\n httpretty.GET,\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "jdepoix/youtube-transcript-api", + "expected": "NotImplementedError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n Formatter().format_transcript(self.transcript)\n\n with self.assertRaises(NotImplementedError):\n Formatter().format_transcripts(self.transcripts)\n\n def test_json_formatter_format_call(self):\n formatter = JSONFormatter()\n self.assertEqual(\n json.dumps(self.transcript_raw, indent=4, sort_keys=True),\n formatter.format_transcript(self.transcript),\n )\n self.assertEqual(\n json.dumps(self.transcripts_raw, indent=4, sort_keys=True),\n formatter.format_transcripts(self.transcripts),\n )\n\n def test_text_formatter_format_call(self):\n formatter = TextFormatter()\n self.assertEqual", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.975609756097561, + "n_retrieved": 10 + }, + { + "repo": "jdepoix/youtube-transcript-api", + "expected": "\"ar\")", + "got": "\"ar\")", + "got_raw": " \"ar\")\n self.assertEqual(translated_transcript.language, \"\u0627\u0644\u0639\u0631\u0628\u064a\u0629\")\n self.assertEqual(translated_transcript.is_translatable, True)\n self.assertEqual(translated_transcript.translation_languages, [\"en\"])\n\n self.assertEqual(translated_transcript.fetch().snippets[0].text, \"\u0645\u0631\u062d\u0628\u0627\u060c \u0647\u0630\u0627 \u0647\u0648 \u0645\u062c\u0631\u062f \u062a\u062c\u0631\u0628\u0629\")\n self.assertEqual(translated_transcript.fetch().snippets[1].text, \"\u0647\u0630\u0627 \u0644\u064a\u0633 \u0627\u0644\u0646\u0635 \u0627\u0644\u0623\u0635\u0644\u064a\")\n self.assertEqual(translated_transcript.fetch().snippets[2].text, \"\u0623\u062d\u0646\u0627 \u0646\u062d\u0646 \u0642\u0644\u064a\u0644\u064b\u0627 \u0645\u0646 \u0627\u0644\u0646\u0635\u060c \u0623", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jeertmans/manim-slides", + "expected": "api_name", + "got": "api_name", + "got_raw": " api_name\n assert slide.MANIM == manim\n assert slide.MANIMGL == manimgl\n\n\ndef test_api_names() -> None:\n assert_import(api_name=\"manim\", manim=True, manimgl=False)\n assert_import(api_name=\"manimlib\", manim=False, manimgl=True)\n\n\ndef test_api_names_force() -> None:\n os.environ[\"MANIM_API\"] = \"manim\"\n os.environ[\"FORCE_MANIM_API\"] = \"1\"\n\n assert_import(api_name=\"manim\", manim=True, manimgl=False)\n assert_import(api_name", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jeertmans/manim-slides", + "expected": "expected", + "got": "1", + "got_raw": "1\n\n def test_revealjs_multiple_scenes_converter_with_one_file(\n self,\n tmp_path: Path,\n presentation_config: PresentationConfig,\n ) -> None:\n out_file = tmp_path / \"slides.html\"\n RevealJS(\n presentation_configs=[presentation_config for _ in range(2)],\n one_file=True,\n ).convert_to(out_file)\n assert out_file.exists()\n assets_dir = Path(tmp_path / \"slides_assets\")\n assert assets_dir.is_dir()\n\n got = sum(1 for _ in assets_dir.iterdir())\n expected = len(presentation_config.slides)\n\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jeertmans/manim-slides", + "expected": "results.stdout", + "got": "", + "got_raw": " # noqa: D401\n assert \" Check Manim Slides' installation.\" in # noqa: D401\n assert \" Render SCENE(s) from the input FILE, using the specified renderer.\" in # noqa: D401\n assert \" Present SCENE(s) from the input FILE, using the specified renderer.\" in # noqa: D401\n assert \" Convert SCENE(s) from the input FILE, using the specified renderer.\" in # noqa: D401\n assert \" Initialize a new Manim Slides", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jeertmans/manim-slides", + "expected": "result.output", + "got": "result.output", + "got_raw": " result.output\n assert f\"Python executable: {sys.executable}\" in result.output\n\n if manim_missing:\n assert \"manim not found\" in result.output\n else:\n assert \"manim\" in result.output\n\n if manimlib_missing:\n assert \"manimlib not found\" in result.output\n else:\n assert \"manimlib\" in result.output\n\n if pyqt6_missing:\n assert \"Qt API: PyQt6 (version: 6.4.0)\" in result.output\n else:\n assert \"Qt API: PyQt6 (version: ", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jeertmans/manim-slides", + "expected": "ImportError)", + "got": "ImportError):", + "got_raw": "ImportError):\n importlib.reload(slide)\n\n assert_import(\n api_name=\"manim\",\n manim=True,\n manimgl=False,\n )\n\n assert_import(\n api_name=\"manimgl\",\n manim=False,\n manimgl=True,\n )\n\n del os.environ[slide.MANIM_API]\n\ndef test_default_api() -> None:\n assert_import(\n api_name=\"manim\",\n manim=True,\n manimgl=False,\n )\n\n assert_import(\n api_name=\"manimgl\",\n manim=False,\n manimgl=True,\n )\n\ndef", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.96, + "n_retrieved": 10 + }, + { + "repo": "jeertmans/manim-slides", + "expected": "3", + "got": "3", + "got_raw": "3\n assert base_slide.canvas[\"a\"] == 1\n assert base_slide.canvas[\"b\"] == 3\n assert base_slide.canvas[\"c\"] == 4\n\n base_slide.remove_from_canvas(\"a\", \"b\")\n\n assert len(base_slide.canvas) == 1\n assert base_slide.canvas[\"c\"] == 4\n\n with pytest.raises(KeyError):\n _ = base_slide.canvas[\"a\"]\n\n with pytest.raises(KeyError):\n _ = base_slide.canvas[\"b\"]\n\n def test_mobjects_without_canvas(self, base_slide: BaseSlide) -> None:\n assert len(base_slide", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "engine", + "got": "engine", + "got_raw": " engine\n assert config['NAME'] == name\n assert config['HOST'] == host\n assert config['USER'] == user\n assert config['PASSWORD'] == passwd\n assert config['PORT'] == port\n\n\n@pytest.mark.parametrize(\n 'url,engine,name,host,user,passwd,port',\n [\n # pyodbc://\n ('pyodbc://',\n 'sql_server.pyodbc',\n '',\n '',\n '',\n '',\n ''),\n # pyodbc://user:password@host\n ('pyodbc://enigma:secret@example.com',\n 'sql_server.py", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "3", + "got": "3", + "got_raw": "3\n\n def test_not_present_with_default_and_cast(self):\n\n assert self.env('not_present', default=3, cast=int) == 3\n\n def test_not_present_with_default_and_cast_and_interpolate(self):\n\n assert self.env('not_present', default=3, cast=int, interpolate=True) == 3\n\n def test_not_present_with_default_and_cast_and_interpolate_and_escape_proxy(self):\n\n assert self.env('not_present', default=3, cast=int, interpolate=True, escape_proxy=True) == 3\n\n def test_not_present_with_default_and_cast_and_interpolate_and_escape_proxy_and_prefix", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "str(excinfo.value)", + "got": "assert 'not_existing_dir' in str(excinfo.value)", + "got_raw": "<|fim_suffix|>\n assert 'not_existing_dir' in str(excinfo.value)\n\n\ndef test_path():\n root = Path('/home')\n assert root('dev', 'not_existing_dir') == '/home/dev/not_existing_dir'\n assert root('dev', 'not_existing_dir', required=True) == '/home/dev/not_existing_dir'\n assert root('dev', 'not_existing_dir', required=False) == '/home/dev/not_existing_dir'\n\n\ndef test_path_with_absolute():\n root = Path('/home')\n assert root('/home/dev/not_existing_dir') == '/home/dev/not_existing_dir'\n assert root('/home/dev/not_existing", + "exact_match": false, + "code_bleu": 0.6389431042462724, + "edit_similarity": 0.5538461538461539, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "backend", + "got": "backend", + "got_raw": " backend\n assert url['EMAIL_HOST_USER'] == 'user'\n assert url['EMAIL_HOST_PASSWORD'] == 'password'\n assert url['EMAIL_HOST'] == 'smtp.example.com'\n assert url['EMAIL_PORT'] == 587\n assert url['EMAIL_USE_TLS'] is True\n assert url['OPTIONS'] == {'use_ssl': False}\n\n # Test with a custom backend that doesn't support TLS\n backend = 'django.core.mail.backends.smtp.EmailBackend'\n url = Env.email_url_config(url, backend=backend)\n\n assert url['EMAIL_BACKEND'] == backend\n assert url['", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "587", + "got": "587", + "got_raw": "587\n assert email_config['EMAIL_USE_TLS'] is True\n\n def test_email_url_value_with_default(self):\n email_config = self.env.email_url(default='smtp://user:password@localhost:25')\n assert email_config['EMAIL_BACKEND'] == (\n 'django.core.mail.backends.smtp.EmailBackend'\n )\n assert email_config['EMAIL_HOST'] == 'localhost'\n assert email_config['EMAIL_HOST_PASSWORD'] == 'password'\n assert email_config['EMAIL_HOST_USER'] == 'user@domain.com'\n\n assert email_config['EMAIL_PORT'] == 25\n assert email_config['", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "1234", + "got": "1234", + "got_raw": "1234\n\ndef test_ldap_url_with_port_and_default():\n \"\"\"Keep LDAP host and include port in NAME when explicitly provided.\"\"\"\n env_url = 'ldap://cn=admin,dc=nodomain,dc=org:secret@example.com'\n url = Env.db_url_config(env_url)\n\n assert url['ENGINE'] == 'ldapdb.backends.ldap'\n assert url['NAME'] == 'ldap://example.com'\n assert url['HOST'] == 'example.com'\n assert url['USER'] == 'cn=admin,dc=nodomain,dc=org'\n assert url['PASSWORD'] == '", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "{'TIMEOUT': 30}", + "got": "{", + "got_raw": " {\n 'timeout': 30,\n }\n\ndef test_smtp_tls_and_options_parsing():\n url = (\n \"smtp+tls://user@domain.com:password@smtp.example.com:465\"\n \"?EMAIL_USE_TLS=true&timeout=30\"\n )\n url = Env.email_url_config(url)\n\n assert url['EMAIL_BACKEND'] == 'django.core.mail.backends.smtp.EmailBackend'\n assert url['EMAIL_USE_TLS'] == 'true'\n\n assert url['OPTIONS'] == {\n 'timeout': 30,\n }\n\ndef test_smtp_and_options_parsing():\n url", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "\"channels_redis.core.RedisChannelLayer\"", + "got": "\"channels_redis.core.RedisChannelLayer\"", + "got_raw": " \"channels_redis.core.RedisChannelLayer\"\n assert result[\"CONFIG\"] == {\n \"hosts\": [\"redis://user:password@localhost:6379/0\"]\n }\n\n url = \"rediss://user:password@localhost:6379/0\"\n result = Env.channels_url_config(url)\n\n assert result[\"BACKEND\"] == \"channels_redis.core.RedisChannelLayer\"\n assert result[\"CONFIG\"] == {\n \"hosts\": [\"rediss://user:password@localhost:6379/0\"]\n }\n\n url = \"redis+pubsub://user:password@", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "None", + "got": "None", + "got_raw": " None\n\n def test_str(self):\n assert_type_and_value(self.env.str('FOO'), 'bar', str)\n\n def test_bool(self):\n assert_type_and_value(self.env.bool('FOO'), True, bool)\n\n def test_int(self):\n assert_type_and_value(self.env.int('FOO'), 1, int)\n\n def test_float(self):\n assert_type_and_value(self.env.float('FOO'), 1.1, float)\n\n def test_json(self):\n assert_type_and_value(self.env.json('FOO'), {'a': 1}, dict)\n\n def test_url(self):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/django-environ", + "expected": "old", + "got": "old", + "got_raw": " old\n else:\n assert driver == new\n\n\n@pytest.mark.parametrize('django_version', ((3, 2), (3, 1)))\n@pytest.mark.parametrize('redis_installed', (True, False))\ndef test_redis_compat(django_version, redis_installed):\n old = 'django.core.cache.backends.redis.RedisCache'\n new = REDIS_DRIVER\n with mock.patch.object(django, 'VERSION', django_version):\n with mock.patch('environ.compat.find_spec') as mock_find_spec:\n mock_find_spec.return_value = redis_installed\n driver = environ.compat.choose_rediscache_driver()\n if django_version and", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "\"0\"", + "got": "0", + "got_raw": "0\n\n def test_check_digit_is_incorrect(self):\n isbn = ISBN10(group=\"1\", registrant=\"4516\", publication=\"7331\")\n\n assert isbn.check_digit == 1\n\n def test_check_digit_is_correct_with_group(self):\n isbn = ISBN10(group=\"1\", registrant=\"4516\", publication=\"7331\")\n\n assert isbn.check_digit == 0\n\n def test_check_digit_is_incorrect_with_group(self):\n isbn = ISBN10(group=\"1\", registrant=\"4516\", publication=\"7331\")\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "states", + "got": "states", + "got_raw": " states\n\n def test_state_abbr(self, faker, num_samples):\n for _ in range(num_samples):\n state_abbr = faker.state_abbr()\n assert isinstance(state_abbr, str)\n\n assert state_abbr in EsMxAddressProvider.states\n\n def test_state_name(self, faker, num_samples):\n states = [state_name for state_abbr, state_name in EsMxAddressProvider.states]\n for _ in range(num_samples):\n state_name = faker.state_name()\n assert isinstance(state_name, str)\n\n assert state_name in states\n\n def test_city(self, faker, num", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "(0,)", + "got": "0", + "got_raw": "0\n assert kwargs == {}\n\n def test_seed(self):\n locale = [\"de_DE\", \"en-US\", \"en-PH\", \"ja_JP\"]\n fake = Faker(locale)\n\n with patch(\"faker.generator.Generator.seed\") as mock_seed:\n mock_seed.assert_not_called()\n fake.seed(0)\n\n # Verify `seed(0)` was called 4 times (one for each locale)\n calls = mock_seed.call_args_list\n assert len(calls) == 4\n for call in calls:\n args, kwargs = call\n\n assert args == 0\n assert kwargs", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "[DEFAULT_LOCALE]", + "got": "assert faker.locales == [\"it_IT\", \"en_US\", \"ja_JP\"]", + "got_raw": "<|fim_suffix|>\n assert faker.locales == [\"it_IT\", \"en_US\", \"ja_JP\"]\n\n assert faker.factories == [\n FakerFactory(locale=\"it_IT\"),\n FakerFactory(locale=\"en_US\"),\n FakerFactory(locale=\"ja_JP\"),\n ]\n\n assert faker.factories[0] == _session_faker.factories[0]\n\n assert faker.factories[1] == _session_faker.factories[1]\n\n assert faker.factories[2] == _session_faker.factories[2]\n\n assert faker.factories[0].locale == \"it_IT\"\n\n assert faker.factories", + "exact_match": false, + "code_bleu": 0.10571070857151538, + "edit_similarity": 0.08955223880597014, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "{\"A\", \"B\", \"C\"}", + "got": "[\"A\", \"B\", \"C\"]", + "got_raw": " [\"A\", \"B\", \"C\"]\n\n def test_weighted_dynamic_with_use_weighting(self):\n elements = OrderedDict([(\"A\", 0.75), (\"B\", 0.25), (\"C\", 0.0)])\n provider_name = \"my_provider\"\n provider = DynamicProvider(\n provider_name=provider_name,\n elements=elements,\n )\n faker = Faker()\n faker.add_provider(provider)\n\n fake_data = [faker.my_provider(use_weighting=True) for _ in range(10_000)]\n\n for i in fake_data:\n\n assert i in ", + "exact_match": false, + "code_bleu": 0.6803749333171202, + "edit_similarity": 0.8666666666666667, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "self.cryptocurrencies", + "got": "", + "got_raw": " # noqa: E711\n assert cur[0] in self.cryptocurrency_codes\n assert cur[1] in self.cryptocurrency_names\n\n def test_cryptocurrency_code(self, faker, num_samples):\n for _ in range(num_samples):\n cur = faker.cryptocurrency_code()\n assert isinstance(cur, str)\n\n assert cur in self.cryptocurrency_codes\n\n def test_cryptocurrency_name(self, faker, num_samples):\n for _ in range(num_samples):\n cur = faker.cryptocurrency_name()\n assert isinstance(cur, str)\n\n assert cur in self.cryptocurrency", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "3", + "got": "3", + "got_raw": "3\n assert sample[0] in \"abcde\"\n assert sample[1] in \"abcde\"\n assert sample[2] in \"abcde\"\n\n # Length = 1\n sample = faker.random_sample(\"abcde\", 1)\n\n assert len(sample) == 1\n assert sample[0] in \"abcde\"\n\n # Length = 0\n sample = faker.random_sample(\"abcde\", 0)\n\n assert len(sample) == 0\n\n # Length = 1000\n sample = faker.random_sample(\"abcde\", 100", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "0", + "got": "0", + "got_raw": "0\n assert int(unicast_address[2:4], base=16) % 2 == 0\n assert int(unicast_address[4:6], base=16) % 2 == 0\n assert int(unicast_address[6:8], base=16) % 2 == 0\n assert int(unicast_address[8:10], base=16) % 2 == 0\n assert int(unicast_address[10:12], base=16) % 2 == 0\n\n assert int", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "UaProvider.apple_devices", + "got": "assert match.group(\"ios_version\") in (\"10.1\", \"10.2\", \"10.3\", \"10.4\", \"10.5\", \"10.6\", \"10.7\", \"10.8\", \"10.9\", \"10.10\", \"10.11\", \"10.12\", \"10.13\", \"10.14\", \"10.15\", \"11.0\", \"11.1\", \"11.2\", \"11", + "got_raw": "<|fim_suffix|>\n assert match.group(\"ios_version\") in (\"10.1\", \"10.2\", \"10.3\", \"10.4\", \"10.5\", \"10.6\", \"10.7\", \"10.8\", \"10.9\", \"10.10\", \"10.11\", \"10.12\", \"10.13\", \"10.14\", \"10.15\", \"11.0\", \"11.1\", \"11.2\", \"11", + "exact_match": false, + "code_bleu": 0.02558174341959753, + "edit_similarity": 0.05581395348837209, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "0", + "got": "1", + "got_raw": "1\n assert local_regon_checksum([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3]) == 0\n assert local_regon_checksum([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 4]) == 4\n\n def test_regon_checksum(self):\n assert regon_checksum([1, 2, 3, 4, 5,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "{\"A\", \"B\"}", + "got": "[\"A\", \"B\", \"C\"]", + "got_raw": " [\"A\", \"B\", \"C\"]\n\n def test_weighted_dynamic_without_use_weighting(self):\n elements = OrderedDict([(\"A\", 0.75), (\"B\", 0.25), (\"C\", 0.0)])\n provider_name = \"my_provider\"\n provider = DynamicProvider(\n provider_name=provider_name,\n elements=elements,\n )\n faker = Faker()\n faker.add_provider(provider)\n\n fake_data = [faker.my_provider(use_weighting=False) for _ in range(10_000)]\n\n for i in fake_data:\n\n assert i in ", + "exact_match": false, + "code_bleu": 0.345720784641941, + "edit_similarity": 0.64, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "\"xml\"", + "got": "\"xmltodict\"", + "got_raw": " \"xmltodict\"\n\n def test_xml_no_lxml(self, faker):\n with patch.dict(\"sys.modules\", {\"lxml\": None}):\n with pytest.raises(exceptions.UnsupportedFeature) as excinfo:\n faker.xml()\n\n\n assert excinfo.value.name == \"lxml\"\n\n def test_xml_no_html5lib(self, faker):\n with patch.dict(\"sys.modules\", {\"html5lib\": None}):\n with pytest.raises(exceptions.UnsupportedFeature) as excinfo:\n faker.xml()\n\n\n assert excinfo.value.name == \"html5lib\"\n\n def test_xml_no_html5lib(self,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.625, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "1", + "got": "0", + "got_raw": "0\n assert some_list\n for item in some_list:\n assert isinstance(item, int)\n\n with warnings.catch_warnings(record=True) as w:\n some_list = self.factory.pylist(10, True, value_types=int)\n assert len(w) == 0\n assert some_list\n for item in some_list:\n assert isinstance(item, int)\n\n with warnings.catch_warnings(record=True) as w:\n some_list = self.factory.pylist(10, True, value_types=[int, str])\n assert len(w) == 0\n assert some_list\n for item in", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "\"X\"", + "got": "0", + "got_raw": "0\n\n def test_check_digit_is_incorrect(self):\n isbn = ISBN10(group=\"1\", registrant=\"4516\", publication=\"7331\")\n assert isbn.check_digit == \"0\"\n isbn = ISBN10(group=\"0\", registrant=\"06\", publication=\"230125\")\n\n assert isbn.check_digit == 0\n\n def test_check_digit_is_incorrect(self):\n isbn = ISBN10(group=\"1\", registrant=\"4516\", publication=\"7331\")\n assert isbn.check_digit == \"0\"\n isbn = ISBN", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "5", + "got": "5", + "got_raw": "5\n\n # Booleans should not be unique\n for _ in range(5):\n proxy.pybool()\n\n assert len(set([proxy.pybool() for _ in range(5)])) == 1\n\n def test_clear(self):\n \"\"\"Test that calling clear() clears the already seen values.\"\"\"\n self.fake.unique.clear()\n\n # Calling a unique method should still raise UniquenessException\n with pytest.raises(UniquenessException):\n self.fake.unique.pybool()\n\n # Calling a non-unique method should still work\n self.fake.pybool()\n\n def test_seed_instance(self):\n \"\"\"Test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "[]", + "got": "0", + "got_raw": "0\n\n def test_words_with_negative_nb(self, faker, num_samples):\n for _ in range(num_samples):\n\n assert faker.words(-1) == 0\n\n def test_words_with_one_nb(self, faker, num_samples):\n for _ in range(num_samples):\n\n assert len(faker.words(1)) == 1\n\n def test_words_with_two_nb(self, faker, num_samples):\n for _ in range(num_samples):\n\n assert len(faker.words(2)) == 2\n\n def test_words_with_three_nb(self, faker, num_samples):\n for _ in range(num_samples):\n\n ", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "\"3\"", + "got": "2", + "got_raw": "2\n assert sbn.check_digit == \"2\"\n\n def test_check_digit_is_incorrect(self):\n sbn = SBN9(registrant=\"340\", publication=\"01381\")\n assert sbn.check_digit == \"X\"\n sbn = SBN9(registrant=\"06\", publication=\"230125\")\n assert sbn.check_digit == \"2\"\n sbn = SBN9(registrant=\"10103\", publication=\"202\")\n\n assert sbn.check_digit == 2\n assert sbn.check_digit ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "random", + "got": "random", + "got_raw": " random\n assert faker.random.getstate() == random.getstate()\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales == _MODULE_LOCALES\n\n assert faker.locales ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "3", + "got": "3", + "got_raw": "3\n assert country_code.isalpha()\n assert country_code.isupper()\n\n def test_alpha_2_country_codes(self, faker, num_samples):\n for _ in range(num_samples):\n country_code = faker.country_code(representation=\"alpha-2\")\n\n assert len(country_code) == 2\n assert country_code.isalpha()\n assert country_code.isupper()\n\n def test_country(self, faker, num_samples):\n for _ in range(num_samples):\n country = faker.country()\n\n assert isinstance(country, str)\n assert country.isalpha()\n assert country.isupper()\n\n def test_country_code(self,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joke2k/faker", + "expected": "count", + "got": "5", + "got_raw": "5\n\n Faker.seed(2043)\n second_list = [fake.name() for _ in range(count)]\n # We convert the list to a set to remove duplicates and ensure\n # that we have exactly `count` unique fake values\n\n assert len(set(second_list)) == 5\n\n Faker.seed(2043)\n third_list = [fake.name() for _ in range(count)]\n # We convert the list to a set to remove duplicates and ensure\n # that we have exactly `count` unique fake values\n\n assert len(set(third_list)) == 5\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jonatasgrosman/findpapers", + "expected": "paper_entry.get(\"issn\")", + "got": "paper_entry.get(\"issn\")", + "got_raw": " paper_entry.get(\"issn\")\n assert publication.publisher == paper_entry.get(\"publisher\")\n assert publication.category == paper_entry.get(\"content_type\")\n\n assert publication.cite_score == 0\n assert publication.sjr == 0\n assert publication.snip == 0\n\n assert publication.subject_areas == set()\n\n assert publication.is_potentially_predatory == False\n\ndef test_get_publication_with_subject_areas():\n\n paper_entry[\"subject_areas\"] = [\"subject A\", \"subject B\"]\n\n publication = ieee_searcher._get_publication(paper_entry)\n\n assert publication.subject_areas == set([\"subject A\", \"", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jonatasgrosman/findpapers", + "expected": "0", + "got": "0", + "got_raw": "0\n\n search.run()\n\n assert len(search.papers) == 1\n\n assert search.papers[0].doi == paper.doi\n\n assert search.papers[0].title == paper.title\n\n assert search.papers[0].abstract == paper.abstract\n\n assert search.papers[0].authors == paper.authors\n\n assert search.papers[0].publication == paper.publication\n\n assert search.papers[0].publication_date == paper.publication_date\n\n assert search.papers[0].urls == paper.urls\n\n assert search.papers[0].keywords == paper.keywords\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jonatasgrosman/findpapers", + "expected": "None", + "got": "None", + "got_raw": " None\n\n\ndef test_get_publication():\n\n\n publication = ieee_searcher._get_publication(paper_entry)\n\n assert publication is not None\n assert publication.title == \"title fake\"\n assert publication.isbn == \"fake ISBN\"\n assert publication.issn == \"fake ISSN\"\n assert publication.publisher == \"publisher X\"\n assert publication.category == \"journal\"\n\n\ndef test_get_paper():\n\n\n paper = ieee_searcher._get_paper(paper_entry, datetime.date(2020, 3, 1), Publication(\"fake publication title\"))\n\n assert paper is not None\n assert paper.title ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jonatasgrosman/findpapers", + "expected": "paper_entry.get(\"publication_title\")", + "got": "\"title fake\"", + "got_raw": " \"title fake\"\n assert publication.isbn == \"fake ISBN\"\n assert publication.issn == \"fake ISSN\"\n assert publication.publisher == \"publisher X\"\n assert publication.category == \"journal\"\n assert publication.cite_score == 10\n assert publication.sjr == 10\n assert publication.snip == 10\n assert publication.subject_areas == {\"term A\", \"term B\"}\n assert publication.is_potentially_predatory == False\n\n\ndef test_get_publication_with_no_subject_areas():\n\n paper_entry = paper_entry.copy()\n paper_entry[\"index_terms\"] = None\n\n publication", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.2916666666666667, + "n_retrieved": 10 + }, + { + "repo": "jonatasgrosman/findpapers", + "expected": "numeric_format", + "got": "numeric_format", + "got_raw": " numeric_format\n\n\ndef test_get_numeric_month_by_string_error():\n\n\n assert util.get_numeric_month_by_string(\"invalid\") is None\n\n\ndef test_try_success():\n\n\n def function():\n return \"success\"\n\n\n assert util.try_success(function) == \"success\"\n\n\ndef test_try_success_error():\n\n\n def function():\n raise Exception(\"error\")\n\n\n assert util.try_success(function) is None\n\n\ndef test_try_success_error_with_attempts():\n\n\n def function():\n raise Exception(\"error\")\n\n\n assert util.try_success(function, attempts=2) is None\n\n\ndef test_try_success_error_with_attempts_and_pre_delay():\n\n\n def function", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jonatasgrosman/findpapers", + "expected": "None", + "got": "None", + "got_raw": " None\n\n publication.category = \"newspaper\"\n assert publication.category is None\n\n publication.category = \"newspaper article\"\n assert publication.category is None\n\n publication.category = \"newspaper\"\n assert publication.category is None\n\n publication.category = \"newspaper\"\n assert publication.category is None\n\n publication.category = \"newspaper\"\n assert publication.category is None\n\n publication.category = \"newspaper\"\n assert publication.category is None\n\n publication.category = \"newspaper\"\n assert publication.category is None\n\n publication.category = \"new", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jonatasgrosman/findpapers", + "expected": "result", + "got": "10 / 0", + "got_raw": "10 / 0\n\n\ndef test_try_success_with_exception():\n with pytest.raises(ZeroDivisionError):\n util.try_success(lambda: 10 / 0, 2, 1)\n\n\ndef test_try_success_with_exception_and_no_attempts():\n with pytest.raises(ZeroDivisionError):\n util.try_success(lambda: 10 / 0, 0, 1)\n\n\ndef test_try_success_with_exception_and_no_attempts_and_no_delay():\n with pytest.raises(ZeroDivisionError):\n util.try_success(lambda: 10 / 0, 0, 0)\n\n\ndef test_try_success_with_exception_and_no", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jonghwanhyeon/python-ffmpeg", + "expected": "target[\"streams\"][0][\"codec_name\"]", + "got": "target[\"streams\"][0][\"codec_name\"]", + "got_raw": " target[\"streams\"][0][\"codec_name\"]\n assert source[\"streams\"][1][\"codec_name\"] == target[\"streams\"][1][\"codec_name\"]\n\n\n# File: docs/examples/record-rtsp.md\n# Recording\n\nYou can use **python-ffmpeg** to record an RTSP stream.\n\n=== \"Synchronous API\"\n\n ```python\n from ffmpeg import FFmpeg, Progress\n\n\n def main():\n ffmpeg = (\n FFmpeg()\n .option(\"y\")\n .input(\n \"rtsp://username:password@127.0.0.1/cam\",\n rtsp_transport", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jonghwanhyeon/python-ffmpeg", + "expected": "[\"-y\", \"-codec\", \"copy\", \"-i\", os.fspath(pier39_path)]", + "got": "assert [*options.build()] == [\"-y\", \"-i\", str(pier39_path), \"-codec:v\", \"copy\"]", + "got_raw": "<|fim_suffix|>\n assert [*options.build()] == [\"-y\", \"-i\", str(pier39_path), \"-codec:v\", \"copy\"]\n\n options = Options()\n options.option(\"y\")\n options.input(pier39_path, codec=\"copy\")\n options.input(snow_path, codec=\"copy\")\n\n assert [*options.build()] == [\"-y\", \"-i\", str(pier39_path), \"-codec:v\", \"copy\", \"-i\", str(snow_path), \"-codec:v\", \"copy\"]\n\n options = Options()\n options.option(\"y\")\n options.input(pier39_path,", + "exact_match": false, + "code_bleu": 0.19359517339258708, + "edit_similarity": 0.43609022556390975, + "n_retrieved": 10 + }, + { + "repo": "jonghwanhyeon/python-ffmpeg", + "expected": "target[\"streams\"][0][\"codec_name\"]", + "got": "target[\"streams\"][0][\"codec_name\"]", + "got_raw": " target[\"streams\"][0][\"codec_name\"]\n assert source[\"streams\"][0][\"codec_type\"] == target[\"streams\"][0][\"codec_type\"]\n assert source[\"streams\"][0][\"codec_time_base\"] == target[\"streams\"][0][\"codec_time_base\"]\n assert source[\"streams\"][0][\"codec_tag_string\"] == target[\"streams\"][0][\"codec_tag_string\"]\n assert source[\"streams\"][0][\"codec_tag\"] == target[\"streams\"][0][\"codec_tag\"]\n assert source[\"streams\"][0][\"codec_long_name\"] == target[\"streams\"][0][\"codec_long_name\"]\n assert source", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jonghwanhyeon/python-ffmpeg", + "expected": "target[\"format\"][\"format_name\"]", + "got": "target[\"format\"][\"codec_name\"]", + "got_raw": " target[\"format\"][\"codec_name\"]\n assert \"mp4\" in target[\"format\"][\"codec_type\"]\n assert \"video\" in target[\"format\"][\"codec_type\"]\n assert \"video\" in target[\"format\"][\"codec_type\"]\n assert \"video\" in target[\"format\"][\"codec_type\"]\n assert \"video\" in target[\"format\"][\"codec_type\"]\n assert \"video\" in target[\"format\"][\"codec_type\"]\n assert \"video\" in target[\"format\"][\"codec_type\"]\n assert \"video\" in target[\"format\"][\"codec_type\"]\n assert \"video\" in target[\"format\"][\"codec_type\"]\n assert", + "exact_match": false, + "code_bleu": 0.7071067811865475, + "edit_similarity": 0.8524590163934426, + "n_retrieved": 10 + }, + { + "repo": "jonghwanhyeon/python-ffmpeg", + "expected": "FFmpegUnsupportedCodec)", + "got": "FFmpegUnsupportedCodec):", + "got_raw": "FFmpegUnsupportedCodec):\n ffmpeg = FFmpeg().input(source_path).output(target_path, codec=\"invalid\")\n await ffmpeg.execute()\n\n\n@pytest.mark.asyncio\nasync def test_asyncio_raises_unsupported_codec_for_invalid_filter(\n assets_path: Path,\n tmp_path: Path,\n):\n source_path = assets_path / \"pier-39.ts\"\n target_path = tmp_path / \"pier-39.mp4\"\n\n\n with pytest.raises(FFmpegUnsupportedCodec):\n ffmpeg = FFmpeg().input(source_path).output(target_path, vf=\"invalid\")\n await ffmpeg.execute()\n\n\n@pytest.mark.asyncio\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.9787234042553191, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "invalidate_count", + "got": "0", + "got_raw": "0\n assert app.invalidate.call_count == invalidate_count\n\n def check_cmd(\n cmd: Command,\n check: dict[str, bool],\n invalidate_count: int,\n is_async: bool,\n ) -> None:\n check[\"handled\"] = False\n # Run the command\n with set_app(Mock(spec=Application)):\n cmd.run()\n\n if is_async:\n assert cmd.handler.call_count == 1\n assert cmd.handler.call_args_list[0].args[0].is_repeat is False\n assert cmd.handler.call_args_list[0].args[0].key_sequence == []\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "sized_datum", + "got": "1", + "got_raw": "1\n assert Datum.get_size(key) == 1\n\n # Check keyed datum is the same\n result = Datum.get_size(key)\n assert result is not None\n\n assert result == 1\n assert Datum.get_size(key) == 1\n\n # Check keyed datum is the same\n result = Datum.get_size(key)\n assert result is not None\n\n assert result == 1\n assert Datum.get_size(key) == 1\n\n # Check keyed datum is the same\n result = Datum.get_size(key)\n assert result is not None\n\n assert result == 1\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "(10, 20)", + "got": "0, \"SVG should return 0,0\"", + "got_raw": "0, \"SVG should return 0,0\"\n\n datum_3 = Datum(Image.new(\"RGB\", (256, 128), color=\"red\"), format=\"pil\")\n size = await datum_3.pixel_size_async()\n assert size == (256, 128)\n\n datum_4 = Datum(Image.new(\"RGB\", (256, 128), color=\"red\"), format=\"pil\")\n size = await datum_4.pixel_size_async()\n assert size == (256, 128)\n\n datum_5 = Datum(Image", + "exact_match": false, + "code_bleu": 0.2710806010829534, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "\"a\"", + "got": "0", + "got_raw": "0\n assert text[-1] == 1\n # Text is rendered as spaces\n assert to_plain_text(result) == \" \"\n\n\ndef test_hidden_with_whitespace() -> None:\n \"\"\"Text with ``visibility: hidden`` is rendered as spaces.\"\"\"\n data = 'a b'\n result = to_formatted_text(HTML(data, width=1))\n style, text, *_ = result[0]\n # Hidden attribute is applied\n assert \"hidden\" in style\n # Text is still rendered\n\n assert text[0] == 0\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "\"", + "got": "0x123456", + "got_raw": "0x123456\n assert palette.test_color.base_rgb == (0x12, 0x34, 0x56)\n assert palette.test_color.base_rgb_hex == 0x123456\n assert palette.test_color.base_rgb_hex_str == \"#123456\"\n assert palette.test_color.base_rgb_str == \"rgb(0x12, 0x34, 0x56)\"\n assert palette.test_color.base_rgb_str_hex == \"rgb(0x12, 0x34, 0x", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "[]", + "got": "10", + "got_raw": "10\n\ndef test_distribute_dimensions_single() -> None:\n \"\"\"Test distributing dimensions with a single dimension.\"\"\"\n\n assert distribute_dimensions(10, (10,)) == 10\n\ndef test_distribute_dimensions_multiple() -> None:\n \"\"\"Test distributing dimensions with multiple dimensions.\"\"\"\n\n assert distribute_dimensions(10, (10, 20)) == 10\n\ndef test_distribute_dimensions_multiple_with_remainder() -> None:\n \"\"\"Test distributing dimensions with multiple dimensions and a remainder.\"\"\"\n\n assert distribute_dimensions(10, (10, 20, 30)) == ", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "0.25", + "got": "16 / 8", + "got_raw": "16 / 8\n\n\ndef test_cell_size() -> None:\n \"\"\"Tests the synchronous retrieval of a Datum object's cell size.\"\"\"\n datum = Datum(Image.new(\"RGB\", (256, 128), color=\"red\"), format=\"pil\")\n app = DummyApp()\n with (\n set_app(app),\n patch(\n \"euporie.core.app.dummy.DummyApp.cell_size_px\", new_callable=PropertyMock\n ) as mock_cell_size_px,\n ):\n mock_cell_size_px.return_value = (8, 16)\n cols, aspect = datum.cell_size", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "\"c\"", + "got": "0", + "got_raw": "0\n assert d.left == 0\n\n assert d == DiStr(top=\"a\", right=\"b\", bottom=\"c\", left=\"d\")\n assert d != DiStr(top=\"a\", right=\"b\", bottom=\"c\", left=\"e\")\n assert d != DiStr(top=\"a\", right=\"b\", bottom=\"c\", left=\"d\", extra=\"e\")\n\n assert d + DiStr(top=\"e\", right=\"f\", bottom=\"g\", left=\"h\") == DiStr(\n top=\"ae\", right=\"bf\", bottom=\"cg\", left=\"dh\"\n )\n\n assert d", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "\"text/html\"", + "got": "assert get_mime(\"tests/data/text/test.txt\") == \"text/plain\"", + "got_raw": "<|fim_suffix|>\n assert get_mime(\"tests/data/text/test.txt\") == \"text/plain\"\n assert get_mime(\"tests/data/text/test.txt\", \"text/plain\") == \"text/plain\"\n assert get_mime(\"tests/data/text/test.txt\", \"text/plain\", \"text/plain\") == \"text/plain\"\n assert get_mime(\"tests/data/text/test.txt\", \"text/plain\", \"text/plain\", \"text/plain\") == \"text/plain\"\n assert get_mime(\"tests/data/text/test.txt\", \"text/plain\", \"text/plain\", \"text/plain\", \"text/plain\") == \"text/plain\"\n assert get_mime(\"tests", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.22857142857142856, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "[ (\"ansigreen\", \"H\"), (\"ansigreen\", \"e\"), (\"ansigreen bg:ansimagenta\", \"l\"), (\"ansigreen bg:ansimagenta\", \"l\"), (\"ansigreen bg:ansimagenta\", \"o\"), ]", + "got": "[", + "got_raw": " [\n (\"ansi-yellow\", \"He\"),\n (\"ansi-red\", \"llo\"),\n ]\n\ndef test_ansi_colors_with_ansi_escape_sequences() -> None:\n \"\"\"ANSI color formatting is applied.\"\"\"\n value = ANSI(\"\\x1b[32mHe\\x1b[45mllo\\x1b[0m\")\n\n assert to_formatted_text(value) == [\n (\"ansi-yellow\", \"He\"),\n (\"ansi-red\", \"llo\"),\n ]\n\ndef test_ansi_colors_with_ansi_escape_sequences_and_ansi_escape_sequences() -> None:\n \"\"\"ANSI color formatting is applied.\"\"\"\n", + "exact_match": false, + "code_bleu": 0.018581361171917516, + "edit_similarity": 0.013422818791946308, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "\"my_cmd_2\"", + "got": "\"my_cmd_2\"", + "got_raw": " \"my_cmd_2\"\n assert commands[\"my_cmd_2\"].description == \"This is my second command\"\n\ndef test_get_cmd() -> None:\n \"\"\"Get a command from the centralized command system by name.\"\"\"\n @add_cmd(name=\"my_cmd\")\n def my_cmd() -> None:\n pass\n\n assert get_cmd(\"my_cmd\") == commands[\"my_cmd\"]\n\ndef test_command() -> None:\n \"\"\"Test the command class.\"\"\"\n @add_cmd(name=\"my_cmd\")\n def my_cmd() -> None:\n pass\n\n assert isinstance(commands[\"my_cmd\"], Command)\n assert commands[\"my", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "2", + "got": "2", + "got_raw": "2\n\n assert d.bottom == 3\n\n assert d.left == 4\n\n assert d == DiInt(top=1, right=2, bottom=3, left=4)\n\n assert d != DiInt(top=1, right=2, bottom=3, left=5)\n\n assert d != DiInt(top=1, right=2, bottom=3, left=4, middle=5)\n\n assert d != DiInt(top=1, right=2, bottom=3, left=4, middle=5, split=6)\n\n assert d != DiInt(top=1,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "\"value\"", + "got": "1", + "got_raw": "1\n assert icomm.data[\"state\"][\"key\"] == \"value\"\n\n def test_sync(self, icomm: IpyWidgetComm) -> None:\n \"\"\"The `sync` method is called.\"\"\"\n icomm.sync()\n\n icomm.kernel_tab.kernel.sync.assert_called_once_with(\n \"test_comm_id\", \"state\", {\"key\": \"value\"}\n )\n\n def test_update_views(self, icomm: IpyWidgetComm) -> None:\n \"\"\"The `update_views` method is called.\"\"\"\n icomm.update_views()\n\n icomm.kernel_tab.kernel.update_views.assert_called_once_with(\n \"test", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "{x[0] for x in result}", + "got": "", + "got_raw": " # noqa: WPS437\n assert to_plain_text(result) == \"a b c\"\n\n\ndef test_hidden_underline_removal_2() -> None:\n \"\"\"Underline attribute should be removed from hidden elements.\"\"\"\n data = 'a b c'\n result = HTML(data, width=5).formatted_text\n\n assert \"underline\" not in # noqa: WPS437\n assert to_plain_text(result) == \"a b c\"\n\n\ndef test_hidden_underline_removal_3() -> None:\n \"\"\"Underline attribute", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "joouha/euporie", + "expected": "async_utils._LOOPS", + "got": "async_utils._LOOPS", + "got_raw": " async_utils._LOOPS\n assert \"test\" in async_utils._THREADS\n\ndef test_get_or_create_loop_creates_new_loop() -> None:\n \"\"\"Test that get_or_create_loop creates a new loop for a new name.\"\"\"\n loop1 = async_utils.get_or_create_loop(\"test1\")\n loop2 = async_utils.get_or_create_loop(\"test2\")\n assert loop1 is not loop2\n\n assert \"test1\" in async_utils._LOOPS\n assert \"test1\" in async_utils._THREADS\n assert \"test2\" in async_utils._LOOPS", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "1)", + "got": "3)", + "got_raw": "3)\n self.assertEqual(config.ignore, \"body-is-missing,T3\")\n self.assertEqual(config.contrib, \"contrib-title-conventional-commits,CC1\")\n self.assertEqual(config.extra_path, \"/home/joe/mygitlint_rules\")\n\n # config file with invalid config\n with self.assertRaises(LintConfigError):\n config_builder.set_from_config_file(self.get_sample_path(\"config/gitlintconfig-invalid\"))\n\n def test_set_from_config_file_with_config_in_extra_path(self):\n # regular config file load, no problems\n config_builder = LintConfigBuilder()\n config_builder.set_from_config_file(self.get_sample_path", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "[])", + "got": "[])", + "got_raw": " [])\n\n # invalid value\n with self.assertRaises(RuleOptionError):\n option.set(\"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,4", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "3)", + "got": "3)", + "got_raw": "3)\n\n # Set a general option\n config.set_general_option(\"ignore-merge-commits\", False)\n self.assertFalse(config.ignore_merge_commits)\n\n # Set a general option that doesn't exist\n with self.assertRaises(LintConfigError):\n config.set_general_option(\"invalid-option\", True)\n\n # Set a general option that is not a bool\n with self.assertRaises(LintConfigError):\n config.set_general_option(\"verbosity\", \"invalid-value\")\n\n def test_set_option(self):\n config = LintConfig()\n\n # Check that default options are correct\n self.assertEqual(config.ignore, [])\n self", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "[\"T1\", \"B3\"])", + "got": "[\"T1\", \"B3\", \"title-trailing-whitespace\", \"B2\"])", + "got_raw": " [\"T1\", \"B3\", \"title-trailing-whitespace\", \"B2\"])\n\n # ignore - set by list of strings\n config.set_general_option(\"ignore\", [\"T1\", \"B3\", \"title-trailing-whitespace\", \"B2\"])\n\n self.assertEqual(config.ignore, [\"T1\", \"B3\", \"title-trailing-whitespace\", \"B2\"])\n\n # ignore - set by list of strings\n config.set_general_option(\"ignore\", [\"T1\", \"B3\", \"title-trailing-whitespace\", \"B2\"])\n\n self.assertEqual(config.ignore, [\"T", + "exact_match": false, + "code_bleu": 0.403527863746399, + "edit_similarity": 0.4262295081967213, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "config)", + "got": "config)", + "got_raw": " config)\n\n def test_config_builder(self):\n config = LintConfig()\n config_builder = LintConfigGenerator()\n config_builder.set_config(config)\n self.assertEqual(config, config_builder.build())\n\n def test_config_builder_with_config(self):\n config = LintConfig()\n config_builder = LintConfigGenerator()\n config_builder.set_config(config)\n config_builder.set_config(LintConfig())\n self.assertEqual(config, config_builder.build())\n\n def test_config_builder_with_config_and_config_path(self):\n config = LintConfig()\n config_builder = LintConfigGenerator()\n config_builder.set_config(config)\n config", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "OrderedDict({\"my-r\u00fcle\": expected}))", + "got": "", + "got_raw": " # pylint: disable=protected-access\n OrderedDict([(\"my-r\u00fcle\", expected)]))\n\n def test_add_rules(self):\n collection = RuleCollection()\n collection.add_rules(rules.TitleMaxLength, rules.TitleMaxLength, rules.TitleMaxLength)\n\n expected = rules.TitleMaxLength()\n expected.id = \"R1\"\n expected.id = \"R2\"\n expected.id = \"R3\"\n\n self.assertEqual(len(collection), 3)\n\n self.assertDictEqual(collection._rules, # pylint: disable=protected-access\n OrderedDict([(\"R1\", expected), (\"R2\", expected), (\"R3\", expected)]", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "\"core.commentchar\")", + "got": "\"core.commentchar\", **self.expected_sh_special_args)", + "got_raw": " \"core.commentchar\", **self.expected_sh_special_args)\n\n @patch(\"gitlint.git._git\")\n def test_git_hooks_dir(self, git):\n git.return_value.exit_code = 1\n self.assertEqual(git_hooks_dir(), \"\")\n\n git.return_value.exit_code = 0\n git.return_value = \"\u00e4\"\n self.assertEqual(git_hooks_dir(), \"\u00e4\")\n\n git.return_value = \";\\n\"\n self.assertEqual(git_hooks_dir(os.path.join(\"/f\u00f6o\", \"bar\")), \";\")\n\n\n git.assert_called_with(\"rev-parse\", \"--git-path\", \"hooks\", **self.expected", + "exact_match": false, + "code_bleu": 0.17747405280050269, + "edit_similarity": 0.5352112676056338, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "violations)", + "got": "self.assertListEqual([], violations)", + "got_raw": "<|fim_suffix|>\n self.assertListEqual([], violations)\n\n def test_signedoff_by_no_soffby(self):\n # Violation when 'Signed-off-by' line is missing\n rule = SignedOffBy()\n violations = rule.validate(self.gitcommit(\"F\u00f6obar\\n\\nMy Body\"))\n\n self.assertListEqual(\n [\n RuleViolation(\n \"contrib-body-requires-signed-off-by\",\n \"Body does not contain a 'Signed-off-by' line\",\n line_nr=1,\n )\n ],\n violations,\n )\n\n def test_signedoff_by_no_soffby_in_body(self):\n # Viol", + "exact_match": false, + "code_bleu": 0.18575057999133596, + "edit_similarity": 0.46808510638297873, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "None)", + "got": "", + "got_raw": " # pragma: no cover\n rules.CommitRule.target)\n\n def test_extra_path_with_invalid_path(self):\n config = LintConfig()\n\n with self.assertRaises(LintConfigError) as e:\n config.set_general_option(\"extra-path\", \"invalid-path\")\n self.assertEqual(str(e.exception), \"Invalid extra-path: invalid-path\")\n\n def test_extra_path_with_invalid_path_type(self):\n config = LintConfig()\n\n with self.assertRaises(LintConfigError) as e:\n config.set_general_option(\"extra-path\", 123)\n self.assertEqual(str(e.exception), \"Invalid extra-path: 12", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "user_rules_path)", + "got": "user_rules_path)", + "got_raw": " user_rules_path)\n self.assertEqual(config.get_rule_option(\"my-\u00fcser-commit-rule\", \"violation-count\"), 3)\n\n def test_config_file_precedence(self):\n # Test that config file takes precedence over CLI flags\n config_builder = LintConfigBuilder()\n config_builder.set_option(\"my-\u00fcser-commit-rule\", \"violation-count\", 3)\n user_rules_path = self.get_sample_path(\"user_rules\")\n config_builder.set_option(\"general\", \"extra-path\", user_rules_path)\n config_builder.set_option(\"general\", \"verbosity\", 2)\n config_builder.set_option(\"", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "expected_log_messages)", + "got": "from gitlint import rules", + "got_raw": "\n\n\nfrom gitlint import rules\nfrom gitlint.config import LintConfig\nfrom gitlint.tests.base import (\n BaseTestCase,\n)\n\nclass ConfigurationRuleTests(BaseTestCase):\n def test_ignore_by_title(self):\n commit = self.gitcommit(\"Rele\u00e4se\\n\\nThis is the sec\u014dnd body line\")\n\n # No regex specified -> Config shouldn't be changed\n rule = rules.IgnoreByTitle()\n config = LintConfig()\n rule.apply(config, commit)\n self.assertEqual(config, LintConfig())\n self.assert_logged([]) # nothing logged -> nothing ignored\n\n # Matching regex -> expect", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.1702127659574468, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "72)", + "got": "80)", + "got_raw": "80)\n self.assertEqual(config.get_rule_option(\"title-min-length\", \"min-length\"), 5)\n\n # set a new option\n config_builder.set_rule_option(\"title-max-length\", \"line-length\", 100)\n config = config_builder.build()\n\n self.assertEqual(config.get_rule_option(\"title-max-length\", \"line-length\"), 100)\n\n def test_set_general_option(self):\n config_builder = LintConfigBuilder()\n config = config_builder.build()\n\n # assert some defaults\n\n self.assertEqual(config.get_general_option(\"verbosity\"), 3)\n\n # set a new option\n ", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "rules.BodyHardTab())", + "got": "1)", + "got_raw": "1)\n self.assertEqual(found.options[\"hur\"].value, \"d\u00fbr\")\n\n def test_find_rule(self):\n collection = RuleCollection()\n collection.add_rules([rules.TitleMaxLength, rules.TitleTrailingWhitespace], {\"foo\": \"b\u00e5r\"})\n collection.add_rules([rules.BodyHardTab], {\"hur\": \"d\u00fbr\"})\n\n # Assert all rules are there as expected\n self.assertEqual(len(collection), 3)\n for expected_rule in [rules.TitleMaxLength(), rules.TitleTrailingWhitespace(), rules.BodyHardTab()]:\n self.assertEqual(collection.find_rule(expected_rule.id), expected_rule)\n\n ", + "exact_match": false, + "code_bleu": 0.17909498863725698, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "expected)", + "got": "expected)", + "got_raw": " expected)\n self.assertEqual(result.exit_code, 0)\n install_hook.assert_called_once_with(self.config)\n\n @patch(\"gitlint.hooks.GitHookInstaller.uninstall_commit_msg_hook\")\n @patch(\"gitlint.hooks.git_hooks_dir\", return_value=os.path.join(\"/h\u00fcr\", \"dur\"))\n def test_uninstall_hook(self, _, uninstall_hook):\n \"\"\"Test for uninstall-hook subcommand\"\"\"\n result = self.cli.invoke(cli.cli, [\"uninstall-hook\"])\n expected_path = os.path.join(\"/h\u00fcr\", \"dur\", hooks.COMMIT_MSG_HOOK_DST_PATH)\n expected = f\"Successfully un", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "120)", + "got": "120)", + "got_raw": "120)\n\n self.assertEqual(config.get_rule_option(\"title-must-not-contain-word\", \"words\"), \"h\u00e5ha\")\n\n self.assertEqual(config.get_general_option(\"verbosity\"), 1)\n\n def test_set_config_from_string_list_with_invalid_option(self):\n config = LintConfig()\n\n # change and assert changes\n config_builder = LintConfigBuilder()\n with self.assertRaises(LintConfigError) as e:\n config_builder.set_config_from_string_list(\n [\n \"general.verbosity=1\",\n \"title-max-length.line-length=60\",\n \"body-max-line-length.line-length=", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "\"f\u00f6o\")", + "got": "\"f\u00f6o\")", + "got_raw": " \"f\u00f6o\")\n\n # invalid value\n with self.assertRaises(RuleOptionError):\n StrOption(\"t\u00ebst-name\", 123, \"T\u00ebst Description\")\n\n # invalid name\n with self.assertRaises(RuleOptionError):\n StrOption(\"t\u00ebst-name\", \"f\u00f6o\", \"T\u00ebst Description\")\n\n def test_int_option(self):\n # normal behavior\n option = IntOption(\"t\u00ebst-name\", 123, \"T\u00ebst Description\")\n self.assertEqual(option.name, \"t\u00ebst-name\")\n self.assertEqual(option.description, \"T\u00eb", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "len(class_names))", + "got": "1)", + "got_raw": "1)\n self.assertEqual(len(set(class_ids)), 1)\n\n def test_contrib_rule_names(self):\n \"\"\"Tests that all contrib rules have unique names.\n We can test for this at test time (and not during runtime like rule_finder.assert_valid_rule_class does)\n because these are contrib rules: once they're part of gitlint they can't change unless they pass this test\n again.\n \"\"\"\n rule_classes = rule_finder.find_rule_classes(self.CONTRIB_DIR)\n\n # Not very efficient way of checking uniqueness, but it works :-)\n class_names = [rule_class.name for rule_class in rule_classes", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.10526315789473684, + "n_retrieved": 10 + }, + { + "repo": "jorisroovers/gitlint", + "expected": "stdout.getvalue())", + "got": "de", + "got_raw": "de\n\n\n# File: gitlint-core/gitlint/display.py\nimport sys\n\nfrom gitlint.config import LintConfig\n\n\nclass Display:\n \"\"\"Utility class to print stuff to an output stream (stdout by default) based on the config's verbosity\"\"\"\n\n def __init__(self, config: LintConfig):\n self.config = config\n\n def v(self, message: str, exact: bool = False) -> None:\n self._output(message, 1, exact, sys.stdout)\n\n def vv(self, message: str, exact: bool = False) -> None:\n self._output(message, 2", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "303", + "got": "303", + "got_raw": "303\n assert response.headers[\"location\"] == \"/admin/record/2\"\n\n record = session.execute(select(Record)).scalar_one()\n assert record.id1 == \"second.record\"\n assert record.id2 == 2\n assert record.id3 == True\n assert record.name == \"2nd record\"\n\nasync def test_update(client: AsyncClient, session: Session):\n response = await client.post(\n \"/admin/record/1/update\",\n data={\n \"id1\": \"first,record\",\n \"id2\": 1,\n \"id3\": \"on\",\n \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "2", + "got": "2", + "got_raw": "2\n assert data[\"items\"][0][\"name\"] == \"Sheldon Cole\"\n assert data[\"items\"][1][\"name\"] == \"Hills Terrill\"\n\n response = await client.get(\"/admin/api/user?skip=1&limit=2&where={}&order_by=name desc\")\n assert response.status_code == 200\n data = response.json()\n assert data[\"total\"] == 3\n\n assert len(data[\"items\"]) == 2\n assert data[\"items\"][0][\"name\"] == \"Hills Terrill\"\n assert data[\"items\"][1][\"name\"] ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "303", + "got": "303", + "got_raw": "303\n assert response.headers[\"location\"] == \"/admin/setting/\"\n\n def test_create_with_empty_list(self, client: TestClient):\n response = client.post(\n \"/admin/setting/create\",\n data={\n \"hosts.1\": \"\",\n \"hosts.2\": \"\",\n \"extras.1.key\": \"\",\n \"extras.1.value\": \"\",\n \"extras.2.key\": \"\",\n \"extras.2.value\": \"\",\n },\n follow_redirects=False,\n )\n\n assert response.status_code == 303\n assert response.headers[\"location\"] == \"/admin/setting/\"\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "200", + "got": "200", + "got_raw": "200\n assert response.json() == [\n {\n \"id\": 1,\n \"name\": \"Albert Einstein\",\n \"quotes\": [\n {\n \"id\": 1,\n \"quote\": \"Strive not to be a success, but rather to be of value.\",\n \"author\": 1,\n },\n {\n \"id\": 2,\n \"quote\": \"Your time is limited, so don`t waste it living someone else`s life.\",\n \"author\": 1,\n },\n ],\n },\n {\n \"id\": 2,\n \"name\": \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "303", + "got": "303", + "got_raw": "303\n assert response.headers[\"location\"] == \"/admin/user/\"\n\n user = await aio_engine.find(User, User.name == \"John Doe\")\n assert user.name == \"John Doe\"\n assert user.birthday == datetime(1999, 1, 1)\n assert user.address.city == \"Nashville\"\n assert user.address.state == \"TN\"\n assert user.hobbies == [Hobby(name=\"sports\", reason=\"good health\"), Hobby(name=\"music\", reason=\"concentration :)\")\n\n\nasync def test_update(client: AsyncClient, aio_engine: AIOEngine):\n user", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "tuple(expected_output)", + "got": "expected_output", + "got_raw": " expected_output\n\n\n@pytest.mark.parametrize(\n \"input_value, expected_output\",\n [\n ([\"value1\", \"value2\", \"value3\"], \"value1,value2,value3\"),\n (\n [\"value.nested,1\", \"value,2\", \"value.3\", \"value4\"],\n \"value..nested.,1,value.,2,value..3,value4\",\n ),\n ],\n)\ndef test_iterencode(input_value, expected_output):\n result = iterencode(input_value)\n\n assert result == expected_output\n\n\n# File: starlette_admin/contrib/odmantic/helpers.py\n return Q.empty", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.8108108108108109, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "\"John Doe\"", + "got": "\"John Doe\"", + "got_raw": " \"John Doe\"\n\nasync def test_create_with_has_many_relationships(client: AsyncClient, session: Session):\n session.add(User(name=\"John Doe\"))\n session.commit()\n\n response = await client.post(\n \"/admin/todo/create\",\n data={\n \"todo\": \"Do something nice for someone I care about\",\n \"deadline\": datetime.now().isoformat(),\n \"completed\": \"on\",\n \"user\": 1,\n \"comments\": [\n {\"comment\": \"Comment 1\"},\n {\"comment\": \"Comment 2\"},\n ],\n },\n follow_redirects=False,\n )\n assert response.status", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "\"Edited Record\"", + "got": "\"Edited Record\"", + "got_raw": " \"Edited Record\"\n\nasync def test_delete_view(client: AsyncClient, session: Session):\n response = await client.post(\n \"/admin/record/delete/first.,record,1,False\",\n data={\"id1\": \"deleted,record\", \"id2\": 2, \"id3\": \"on\", \"name\": \"Deleted Record\"},\n follow_redirects=False,\n )\n assert response.status_code == 303\n\n stmt = select(Record).where(\n and_(\n Record.id1 == \"deleted,record\",\n Record.id2 == 2,\n Record.id3 == true(),\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "ValueError, match=re.escape( \"Invalid argument, Expected Tuple[str | InstrumentedAttribute, bool]\" ))", + "got": "pytest.raises(InvalidModelError) as excinfo:", + "got_raw": " pytest.raises(InvalidModelError) as excinfo:\n class TestModel(Base):\n __tablename__ = \"test\"\n id = Column(Integer, primary_key=True)\n name = Column(String(100))\n age = Column(Integer)\n date = Column(Date)\n time = Column(Time)\n datetime = Column(DateTime)\n float = Column(Float)\n decimal = Column(Decimal)\n boolean = Column(Boolean)\n enum = Column(Enum(\"A\", \"B\", \"C\"))\n array = Column(ARRAY(Integer))\n json = Column(JSON)\n file = Column(sqlalchemy_file.types.FileField)\n image", + "exact_match": false, + "code_bleu": 0.13732739693334162, + "edit_similarity": 0.27586206896551724, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "\"Other label\"", + "got": "\"Other label\"", + "got_raw": " \"Other label\"\n\n assert model_view.name == \"Other name\"\n\n assert model_view.icon == None\n\n assert model_view.pk_attr == \"id\"\n\n assert model_view.fields == [\n \"id\",\n \"name\",\n \"email\",\n \"password\",\n \"created_at\",\n \"updated_at\",\n \"deleted_at\",\n \"revision_id\",\n ]\n\n assert model_view.exclude_fields_from_list == [\n \"created_at\",\n \"updated_at\",\n \"deleted_at\",\n \"revision_id\",\n ]\n\n assert model_view.exclude_fields_from_detail == [\n \"created_at\",\n \"updated_at", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "303", + "got": "303", + "got_raw": "303\n assert response.headers[\"location\"] == \"/admin/post/\"\n\n def test_update(self, client):\n response = client.post(\n \"/admin/post/1/update\",\n data={\n \"name\": \"His mother had always taught him\",\n \"content\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit\",\n \"category.name\": \"education\",\n \"comments.1.content\": \"Nice article!\",\n \"comments.2.content\": \"Good work!\",\n },\n follow_redirects=False,\n )\n\n assert response.status_code == 303\n assert response.headers[\"location\"] == \"/admin", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "None", + "got": "None", + "got_raw": " None\n assert todo.todo == \"Do something nice for someone I care about\"\n assert todo.deadline == datetime.now()\n assert todo.completed\n\nasync def test_update(client: AsyncClient, session: Session):\n response = await client.post(\n \"/admin/todo/create\",\n data={\n \"todo\": \"Do something nice for someone I care about\",\n \"deadline\": datetime.now().isoformat(),\n \"completed\": \"on\",\n },\n follow_redirects=False,\n )\n assert response.status_code == 303\n stmt = select(Todo).where(Todo.todo == \"Do something nice", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "[ \"Do some magic\", \"Do something nice\", ]", + "got": "", + "got_raw": " # noqa: WPS432\n sorted([\"Do some magic\", \"Do something nice\"])\n\nasync def test_create_with_has_one_relationships(\n client: AsyncClient, session: Session\n):\n session.add(User(name=\"John Doe\"))\n session.add(Todo(todo=\"Do some magic\", deadline=datetime(2022, 1, 1)))\n session.add(Todo(todo=\"Do something nice\", deadline=datetime(2022, 1, 1)))\n session.commit()\n\n response = await client.post(\n \"/admin/user/create\",\n data={\"name\": \"John Doe\", \"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "303", + "got": "303", + "got_raw": "303\n assert response.headers[\"location\"] == \"/admin/todo/\"\n\n todo = session.execute(select(Todo)).scalar_one()\n assert todo.todo == \"Do something nice for someone I care about\"\n assert todo.deadline == datetime.now()\n assert todo.completed\n\nasync def test_update(client: AsyncClient, session: Session):\n todo = session.execute(select(Todo)).scalar_one()\n response = await client.post(\n \"/admin/todo/update\",\n data={\n \"todo\": \"Do something nice for someone I care about\",\n \"deadline\": datetime.now().isoformat(),\n \"completed\": \"on", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "\"other-id\"", + "got": "\"other-id\"", + "got_raw": " \"other-id\"\n assert model_view.label == \"Other label\"\n assert model_view.name == \"Other name\"\n\ndef test_view_meta_info_with_default_values():\n model_view = ModelView(User)\n\n assert model_view.identity == \"user\"\n assert model_view.label == \"Users\"\n assert model_view.name == \"Users\"\n\ndef test_view_meta_info_with_default_values_and_custom_fields():\n model_view = ModelView(\n User, identity=\"other-id\", label=\"Other label\", name=\"Other name\", fields=[\"id\", \"name\"]\n )\n\n assert model_view.identity == \"other-id\"\n assert model", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "200", + "got": "200", + "got_raw": "200\n assert client.get(\"admin/post/edit/1\").text == \"

Post edit

\"\n assert client.get(\"admin/post/edit/1\").text == \"

Post edit

\"\n assert client.get(\"admin/post/edit/1\").text == \"

Post edit

\"\n assert client.get(\"admin/post/edit/1\").text == \"

Post edit

\"\n assert client.get(\"admin/post/edit/1\").text == \"

Post edit

\"\n assert client.get(\"admin/post/edit/", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "None", + "got": "None", + "got_raw": " None\n assert admin.logo_width == 100\n assert admin.logo_height == 100\n assert admin.login_logo_url is None\n assert admin.login_logo_width == 100\n assert admin.login_logo_height == 100\n assert admin.login_logo_alt == \"Admin Logo\"\n assert admin.login_logo_width == 100\n assert admin.login_logo_height == 100\n assert admin.login_logo_alt == \"Admin Logo\"\n assert admin.login_logo_width == 100\n assert admin.login_logo_height == 100\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "1", + "got": "1", + "got_raw": "1\n assert response.json()[\"items\"][0][\"title\"] == \"Infinix INBOOK\"\n\n response = await client.get(\"/admin/api/product/1\")\n assert response.status_code == 200\n assert response.json()[\"title\"] == \"Infinix INBOOK\"\n\n response = await client.get(\"/admin/api/product/2\")\n assert response.status_code == 404\n\n response = await client.get(\"/admin/api/product/100\")\n assert response.status_code == 404\n\n response = await client.post(\"/admin/api/product\", json={\"title\": \"Samsung Galaxy", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "\"other-id\"", + "got": "\"other-id\"", + "got_raw": " \"other-id\"\n assert model_view.label == \"Other label\"\n assert model_view.name == \"Other name\"\n\ndef test_view_meta_info_with_default():\n model_view = ModelView(Other)\n\n assert model_view.identity == \"other-id\"\n assert model_view.label == \"Other\"\n assert model_view.name == \"Other\"\n\ndef test_view_meta_info_with_default_and_custom():\n model_view = ModelView(Other, identity=\"other-id\", label=\"Other label\", name=\"Other name\")\n\n assert model_view.identity == \"other-id\"\n assert model_view.label == \"Other label\"\n assert model", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jowilf/starlette-admin", + "expected": "3", + "got": "1", + "got_raw": "1\n assert data[\"data\"][0][\"price\"] == 200\n\n async def test_api_query2(self, client):\n where = '{\"or\": [{\"title\": {\"eq\": \"IPhone 9\"}}, {\"price\": {\"between\": [200,'\n ' 500]}}]}\"\n response = await client.get(f\"/admin/api/product?where={where}\")\n data = response.json()\n\n assert data[\"total\"] == 1\n assert data[\"data\"][0][\"price\"] == 200\n\n async def test_api_query3(self, client):\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jpadilla/pyjwt", + "expected": "\"nbf\"", + "got": "\"nbf\"", + "got_raw": " \"nbf\"\n\n def test_decode_should_raise_error_if_nbf_required_but_not_valid(\n self, jwt: PyJWT\n ) -> None:\n payload = {\n \"some\": \"payload\",\n \"nbf\": utc_timestamp() - 15,\n }\n token = jwt.encode(payload, \"secret\")\n\n with pytest.raises(ImmatureSignatureError) as exc:\n jwt.decode(\n token,\n \"secret\",\n options={\"require\": [\"nbf\"]},\n algorithms=[\"HS256\"],\n )\n\n assert exc.value.claim == \"nbf\"\n\n def test_decode", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jpadilla/pyjwt", + "expected": "False", + "got": "False", + "got_raw": " False\n\n assert msg_payload == payload\n\n def test_encode_detached_content_with_b64_header_false(\n self, jws: PyJWS, payload: bytes\n ) -> None:\n secret = \"secret\"\n\n # Check that detached content is automatically detected when b64 is false\n headers = {\"b64\": False}\n token = jws.encode(payload, secret, \"HS256\", headers)\n\n msg_header, msg_payload, _ = token.split(\".\")\n msg_header_bytes = base64url_decode(msg_header.encode())\n msg_header_obj = json.loads(msg_header", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jpadilla/pyjwt", + "expected": "\"iss\"", + "got": "\"iss\"", + "got_raw": " \"iss\"\n\n def test_raise_exception_token_without_issuer_and_audience(self, jwt: PyJWT) -> None:\n issuer = \"urn:wrong\"\n audience = \"urn:wrong\"\n\n payload = {\"some\": \"payload\"}\n\n token = jwt.encode(payload, \"secret\")\n\n with pytest.raises(MissingRequiredClaimError) as exc:\n jwt.decode(token, \"secret\", issuer=issuer, audience=audience, algorithms=[\"HS256\"])\n\n assert exc.value.claim == \"iss\"\n\n def test_raise_exception_token_without_issuer_and_audience_and_subject(self, jwt:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jpadilla/pyjwt", + "expected": "\"sig\"", + "got": "\"sig\"", + "got_raw": " \"sig\"\n\n @crypto_required\n def test_should_load_key_from_jwk_data_dict_with_no_kid(self) -> None:\n algo = RSAAlgorithm(RSAAlgorithm.SHA256)\n\n with open(key_path(\"jwk_rsa_pub.json\")) as keyfile:\n pub_key = algo.from_jwk(keyfile.read())\n\n key_data_str = algo.to_jwk(pub_key)\n key_data = json.loads(key_data_str)\n\n # TODO Should `to_jwk` set these?\n key_data[\"alg\"] = \"RS256\"\n key_data[\"use\"] = \"sig\"\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jpadilla/pyjwt", + "expected": "decoded", + "got": "decoded", + "got_raw": " decoded\n\n def test_decode_with_required_sub_claim(self, jwt: PyJWT) -> None:\n secret = \"your-256-bit-secret\"\n token = jwt.encode({}, secret, algorithm=\"HS256\")\n\n with pytest.raises(MissingRequiredClaimError):\n jwt.decode(token, secret, algorithms=[\"HS256\"], require=[\"sub\"])\n\n def test_decode_with_required_sub_claim_and_sub_claim(self, jwt: PyJWT) -> None:\n secret = \"your-256-bit-secret\"\n token = jwt.encode({\"sub\": \"jeff\"}, secret, algorithm=\"HS256", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jpadilla/pyjwt", + "expected": "None", + "got": "assert msg is not None", + "got_raw": "<|fim_suffix|>\n assert msg is not None\n assert \"key too short\" in msg\n\n def test_hmac_short_key_raises_on_enforce_minimum_key_length(self) -> None:\n algo = HMACAlgorithm(HMACAlgorithm.SHA256)\n key = algo.prepare_key(b\"short\")\n msg = algo.check_key_length(key)\n\n assert msg is not None\n assert \"key too short\" in msg\n\n with pytest.raises(InvalidKeyError):\n algo.verify(b\"msg\", key, b\"sig\")\n\n def test_hmac_short_key_raises_on_enforce_minimum_key_length_hs384", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.3076923076923077, + "n_retrieved": 10 + }, + { + "repo": "jpsca/jinjax", + "expected": "\"Test\"", + "got": "\"Test\"", + "got_raw": " \"Test\"\n\n assert attrs[\"some_object\"].lower() == \"test\"\n\n assert attrs[\"some_object\"].capitalize() == \"Test\"\n\n assert attrs[\"some_object\"].casefold() == \"test\"\n\n assert attrs[\"some_object\"].center(10) == \" test \"\n\n assert attrs[\"some_object\"].count(\"t\") == 2\n\n assert attrs[\"some_object\"].removeprefix(\"test\") == \"est\"\n\n assert attrs[\"some_object\"].removesuffix(\"test\") == \"test\"\n\n assert attrs[\"some_object\"].encode() == b\"test\"\n\n assert attrs[\"some", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jpsca/jinjax", + "expected": "{\"ipsum\": 4}", + "got": "4", + "got_raw": "4\n\n assert com.css == [\"a.css\"]\n\n assert com.js == [\"a.js\"]\n\n\ndef test_load_metadata_in_any_order_with_comments():\n com = Component(\n name=\"Test.jinja\",\n source=\"\"\"\n {#css a.css #}\n {#def lorem, ipsum=4 #}\n {#js a.js #}\n {#- lorem, ipsum=4 #}\n {#- css a.css #}\n {#- js a.js #}\n \"\"\",\n )\n assert com.required == [\"lorem\"]\n\n assert com.optional == 4\n\n assert com", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "jpsca/jinjax", + "expected": "None", + "got": "False", + "got_raw": " False\n assert attrs.get(\"foobar\") is None\n assert attrs.get(\"foobar\", \"meh\") == \"meh\"\n assert attrs.get(\"foobar\", \"meh\") == \"meh\"\n assert attrs.get(\"foobar\", \"meh\") == \"meh\"\n assert attrs.get(\"foobar\", \"meh\") == \"meh\"\n assert attrs.get(\"foobar\", \"meh\") == \"meh\"\n assert attrs.get(\"foobar\", \"meh\") == \"meh\"\n assert attrs.get(\"foobar\", \"meh\") == \"meh\"\n assert attrs.get", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "jpsca/jinjax", + "expected": "[\"arg\"]", + "got": "0", + "got_raw": "0\n assert com.optional == {}\n assert com.args == [\"arg\"]\n assert com.args_decl == \"arg\"\n assert com.args_decl_comment == \"Some comment.\"\n assert com.args_comment == \"\"\n assert com.args_comment_start == \"\"\n assert com.args_comment_end == \"\"\n assert com.args_comment_start_end == \"\"\n assert com.args_comment_start_end_comment == \"\"\n assert com.args_comment_start_end_comment_start == \"\"\n assert com.args_comment_start_end_comment_end == \"\"\n assert com.args_comment_start_end_comment_start_end == \"\"\n assert com.args_comment_start_end_comment_start_end_comment == \"\"\n assert com", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jpsca/jinjax", + "expected": "\"z4 c3 a1 b2\"", + "got": "\"z4 c3 a1 z4 b2\"", + "got_raw": " \"z4 c3 a1 z4 b2\"\n assert attrs[\"title\"] == \"hi\"\n assert attrs[\"open\"] == True\n assert attrs[\"unknown\"] is None\n assert attrs[\"unknown\"] == None\n assert attrs[\"unknown\"] == False\n assert attrs[\"unknown\"] == True\n assert attrs[\"unknown\"] == \"bar\"\n assert attrs[\"unknown\"] == 42\n assert attrs[\"unknown\"] == 42.0\n assert attrs[\"unknown\"] == \"42\"\n assert attrs[\"unknown\"] == \"42.0\"\n assert attrs", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.896551724137931, + "n_retrieved": 10 + }, + { + "repo": "jpsca/jinjax", + "expected": "catalog.prefixes[\"\"].searchpath", + "got": "", + "got_raw": " # noqa: WPS437\n assert \"file_path\" in # noqa: WPS437\n assert \"file_path\" in # noqa: WPS437\n assert \"file_path\" in # noqa: WPS437\n assert \"file_path\" in # noqa: WPS437\n assert \"file_path\" in # noqa: WPS437\n assert \"file_path\" in # noqa: WPS437\n assert \"file_path\" in # noqa: WPS437\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jrobichaud/django-structlog", + "expected": "user", + "got": "user", + "got_raw": " user\n\nclass TestUserRedirectView:\n\n def test_get_redirect_url(\n self, user: settings.AUTH_USER_MODEL, request_factory: RequestFactory\n ):\n view = UserRedirectView()\n request = request_factory.get(\"/fake-url/\")\n request.user = user\n\n view.request = request\n\n assert view.get_redirect_url() == f\"/users/{user.username}/\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jrobichaud/django-structlog", + "expected": "1", + "got": "1", + "got_raw": "1\n assert \"username\" in form.errors\n assert form.errors[\"username\"][0] == \"This username has already been taken.\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jrobichaud/django-structlog", + "expected": "\"users:update\"", + "got": "\"users:update\"", + "got_raw": " \"users:update\"\n\n\n\n# File: django_structlog_demo_project/home/views.py\nfrom django.contrib.auth.mixins import LoginRequiredMixin\nfrom django.shortcuts import get_object_or_404\nfrom django.urls import reverse\nfrom django.views.generic import DetailView, RedirectView, UpdateView\n\nfrom django_structlog_demo_project.home.models import Home\n\n\nclass HomeDetailView(LoginRequiredMixin, DetailView):\n model = Home\n slug_field = \"name\"\n slug_url_kwarg = \"name\"\n\n\nhome_detail_view = HomeDetailView.as_view()\n\n\nclass HomeListView(LoginRequiredMixin, ListView):\n model = Home\n slug_field = \"name\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jrobichaud/django-structlog", + "expected": "201", + "got": "201", + "got_raw": "201\n\nclass TestEnqueueFailingTask:\n def test(self):\n response = views.enqueue_failing_task(None)\n\n assert response.status_code == 201\n\nclass TestEnqueueNestingTask:\n def test(self):\n response = views.enqueue_nesting_task(None)\n\n assert response.status_code == 201\n\nclass TestLogWithStandardLogger:\n def test(self):\n response = views.log_with_standard_logger(None)\n\n assert response.status_code == 200\n\nclass TestRevokeTask:\n def test(self):\n response = views.revoke_task(None)\n\n assert response", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jrobichaud/django-structlog", + "expected": "\"/users/{username}/\".format( username=user.username )", + "got": "reverse(\"users:detail\", kwargs={\"username\": user.username})", + "got_raw": " reverse(\"users:detail\", kwargs={\"username\": user.username})\n\n def test_get_object(\n self, user: settings.AUTH_USER_MODEL, request_factory: RequestFactory\n ):\n view = UserUpdateView()\n request = request_factory.get(\"/fake-url/\")\n request.user = user\n\n view.request = request\n\n assert view.get_object() == user\n\n\n\n# File: django_structlog_demo_project/users/tests.py\nfrom django.test import TestCase\n\nfrom django_structlog_demo_project.users.forms import UserCreationForm\n\n\nclass UserFormTest(TestCase):\n def test_valid_form(self):\n form = UserCreationForm(\n {\n", + "exact_match": false, + "code_bleu": 0.1892240568795935, + "edit_similarity": 0.5535714285714286, + "n_retrieved": 10 + }, + { + "repo": "jrobichaud/django-structlog", + "expected": "\"This is a rest-framework structured log\"", + "got": "\"This is a rest-framework structured log\"", + "got_raw": " \"This is a rest-framework structured log\"\n assert record.levelname == \"INFO\"\n assert record.levelno == logging.INFO\n assert record.name == \"django_structlog_demo_project.home.api_views\"\n assert record.request_id == \"12345678-1234-1234-1234-123456789012\"\n assert record.request_method == \"GET\"\n assert record.request_path == \"/\"\n assert record.request_protocol == \"HTTP/1.1\"\n assert record.request_user_agent == \"python-requests/", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "['']", + "got": "0", + "got_raw": "0\n assert kex.server.languages == 0\n\n assert kex.client.kex_policy == False\n assert kex.server.kex_policy == False\n\n assert kex.client.host_key_policy == False\n assert kex.server.host_key_policy == False\n\n assert kex.client.gss_kex_policy == False\n assert kex.server.gss_kex_policy == False\n\n assert kex.client.gss_host_key_policy == False\n assert kex.server.gss_host_key_policy == False\n\n assert kex.client.gss_host_key_policy == False\n assert kex.server.gss", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "4", + "got": "1", + "got_raw": "1\n # visible: head\n output_spy.begin()\n out.level = 'info'\n out.batch = True\n out.info('info color')\n out.head('head color')\n out.good('good color')\n out.warn('warn color')\n out.fail('fail color')\n out.write()\n\n assert len(output_spy.flush()) == 1\n # visible: all\n output_spy.begin()\n out.level = 'info'\n out.batch = False\n out.info('info color')\n out.head('head color')\n out.good('good color')\n out.warn('", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "'SSH-1.99-OpenSSH_3.6.1p2'", + "got": "", + "got_raw": " # noqa\n 'SSH-1.99-OpenSSH_3.6.1p2'\n assert str(b('SSH-1.99-OpenSSH_3.6.1p2\\r\\n')) == # noqa\n 'SSH-1.99-OpenSSH_3.6.1p2'\n assert str(b('SSH-1.99-OpenSSH_3.6.1p2\\r\\n\\r\\n')) == # noqa\n 'SSH-1.99-OpenSSH_3.6.1p2'\n assert str", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "1", + "got": "1", + "got_raw": "1\n assert lines[0] == 'Connection to localhost#22 failed: Name or service not known'\n\n def test_connection_unreachable(self, output_spy, virtual_socket):\n vsocket = virtual_socket\n vsocket.gsock.addrinfodata['localhost#22'] = [{'addr': '127.0.0.1', 'family': socket.AF_INET, 'type': socket.SOCK_STREAM}]\n lines = self._audit(output_spy, exit_expected=True)\n\n assert len(lines) == 1\n assert lines[0] == 'Connection to localhost#22 failed:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "2", + "got": "2", + "got_raw": "2\n assert r[0][0] == socket.AF_INET\n assert r[0][1] == '127.0.0.1'\n assert r[1][0] == socket.AF_INET6\n assert r[1][1] == '::1'\n\n def test_resolve_ipv4(self, virtual_socket):\n conf = self._conf()\n conf.ip_version_preference = [4]\n s = self.ssh_socket(self.OutputBuffer(), 'localhost', 22, conf.ip_version_preference)\n r = list(s._resolve())\n\n assert len(r) == 1\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "p[0]", + "got": "0x0", + "got_raw": "0x0\n assert mpint2r(self._b(p[1] + self.utf8rchar)) == 0x0\n\n assert mpint2r(self._b(p[1] + b'\\x00')) == p[0]\n assert mpint2r(self._b(p[1] + b'\\x00' + self.utf8rchar)) == p[0]\n\n assert mpint2r(self._b(p[1] + b'\\x00' + b'\\x00')) == p[0]\n assert mpint2r(self._b", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "0", + "got": "0", + "got_raw": "0\n\n # Ensure the commands are a list.\n assert type(guide[\"commands\"]) is list\n\n for command_dict in guide[\"commands\"]:\n\n # Ensure each command dict is a dict.\n assert type(command_dict) is dict\n\n # Ensure each required key is in this command dict.\n for required_command_field in required_command_fields:\n assert required_command_field in command_dict\n\n # Ensure the command is a string.\n assert type(command_dict[\"command\"]) is str\n\n # Ensure the heading is a string.\n assert type(command_dict[\"heading\"]) is str\n\n # Ensure the comment is", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "(2, 0)", + "got": "2, 'protocol'", + "got_raw": "2, 'protocol'\n assert b.software == 'OpenSSH', 'software'\n assert b.comments is None, 'comments'\n assert b.valid_ascii, 'valid_ascii'\n\n b = banner('SSH-2.0-OpenSSH_7.3p1')\n\n assert b.protocol == 2, 'protocol'\n assert b.software == 'OpenSSH', 'software'\n assert b.comments is None, 'comments'\n assert b.valid_ascii, 'valid_ascii'\n\n b = banner('SSH-2.0-OpenSSH_7.3p1 Debian-10+deb9", + "exact_match": false, + "code_bleu": 0.3567621345008163, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "rv", + "got": "rv", + "got_raw": " rv\n\n assert len(rv[key]) == 9\n\n for i in range(9):\n assert rv[key][i] is not None\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] == ['none']\n\n assert rv[\"languages\"] ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "level", + "got": "0", + "got_raw": "0\n assert conf.level == 1\n assert conf.level == 2\n\n def test_audit_conf_ipv4(self):\n conf = self.AuditConf()\n conf.ipv4 = True\n self._test_conf(conf, ipv4=True)\n\n def test_audit_conf_ipv6(self):\n conf = self.AuditConf()\n conf.ipv6 = True\n self._test_conf(conf, ipv6=True)\n\n def test_audit_conf_ipv4_ipv6(self):\n conf = self.AuditConf()\n conf.ipv4 = True\n conf.ipv6 = True\n self._test_conf(conf,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "4", + "got": "4", + "got_raw": "4\n assert int(year) > 0\n\n # Check that the month is 2 digits and greater than 0.\n month = date_fields[1]\n\n assert len(month) == 2\n assert int(month) > 0\n\n # Check that the day is 2 digits and greater than 0.\n day = date_fields[2]\n\n assert len(day) == 2\n assert int(day) > 0\n\n # Ensure the commands are a list.\n assert type(guide[\"commands\"]) is list\n\n for command in guide[\"commands\"]:\n\n # Ensure each", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "jtesta/ssh-audit", + "expected": "('libssh', '0.7.4', False)", + "got": "('LibSSH', '10.7.4', False)", + "got_raw": " ('LibSSH', '10.7.4', False)\n assert ver('l10.7.4C') == ('LibSSH', '10.7.4', True)\n assert ver('l10.7.4C1') == ('LibSSH', '10.7.4', True)\n assert ver('l10.7.4C2') == ('LibSSH', '10.7.4', True)\n assert ver('l10.7.4C3') == ('LibSSH', '10.7.4', True", + "exact_match": false, + "code_bleu": 0.38260294162784475, + "edit_similarity": 0.8301886792452831, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "pd.DataFrame(data={ 'value': ['aba' , np.nan , 'cde' , np.nan ], 'error': [np.nan, 'RuntimeError: whoops\\n', np.nan, \"RuntimeError: ('exception with datetime', datetime.datetime(2024, 8, 19, 22, 47, 1, tzinfo=datetime.timezone.utc))\\n\"],", + "got": "", + "got_raw": " # fmt: skip\n pd.DataFrame(data={\n 'value': ['aba', np.nan, 'cde', np.nan],\n 'error': ['aba', 'whoops', 'cde', 'exception with datetime'],\n 'dt' : [np.nan, np.nan, np.nan, np.nan],\n }).astype(dtype={'dt': 'float'}), # FIXME should be datetime64 as below\n ) # fmt: skip\n\n # TODO test with schema\n # TODO test with schema and error_col_policy\n # TODO test with schema and error_col_policy and dt_col\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "timedelta(days=7.0 + 5.0, hours=5.0, minutes=10.0, seconds=50.0)", + "got": "1 * 7 * 24 * 60 * 60 + 5 * 24 * 60 * 60 + 5 * 60 * 60 + 10 * 60 + 50", + "got_raw": "1 * 7 * 24 * 60 * 60 + 5 * 24 * 60 * 60 + 5 * 60 * 60 + 10 * 60 + 50\n\n res = parse_timedelta_string(\"2m4s\")\n\n assert res == 2 * 60 + 4\n\n res = parse_timedelta_string(\"1w2d8h5m20s\")\n\n assert res == 1 * 7 * 24 * 60 * 60 + 2 * ", + "exact_match": false, + "code_bleu": 0.04175872565419194, + "edit_similarity": 0.19696969696969696, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "123", + "got": "123", + "got_raw": "123\n assert fd['any'] == [1, 2, 3]\n\n # TODO test unfreeze\n\n # TODO test unfreeze with properties\n\n # TODO test unfreeze with properties and frozen fields\n\n # TODO test unfreeze with properties and frozen fields and frozen types\n\n # TODO test unfreeze with properties and frozen fields and frozen types and frozen any\n\n # TODO test unfreeze with properties and frozen fields and frozen types and frozen any and frozen nested\n\n # TODO test unfreeze with properties and frozen fields and frozen types and frozen any and frozen nested and frozen nested\n\n #", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "RuntimeError)", + "got": "StopIteration):", + "got_raw": "StopIteration):\n select(_mixed_iter_errors(), raise_exceptions=True)\n\n with pytest.raises(RuntimeError):\n select(_mixed_iter_errors(), raise_exceptions=True, drop_exceptions=False)\n\n with pytest.raises(RuntimeError):\n select(_mixed_iter_errors(), raise_exceptions=True, drop_exceptions=True)\n\n # drop exceptions\n\n with pytest.raises(StopIteration):\n select(_mixed_iter_errors(), drop_exceptions=True)\n\n with pytest.raises(StopIteration):\n select(_mixed_iter_errors(), drop_exceptions=True, raise_exceptions=False)\n\n with pytest.raises(StopIteration):\n select(_mixed_iter_errors(), drop_exceptions=True, raise_exceptions=True)\n\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "[\"0\", \"1\", \"2\"]", + "got": "[\"0\", \"1\", \"2\"]", + "got_raw": " [\"0\", \"1\", \"2\"]\n\n # items greater than 3, going 3.5 (converted to 3 by the coerce_int_parser) up\n rn = RangeTuple(3, None, \"3.5\")\n\n assert list(filter(int_filter_func(unparsed_range=rn, attr_func=identity), src())) == [\"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\"]\n\n # items greater than 3, going 3.5 (converted to 3 by", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "[obj]", + "got": "[_A(x=recent_time, y=2, z=-5)]", + "got_raw": " [_A(x=recent_time, y=2, z=-5)]\n\n # test passing just a within while using a datetime. should default to using current time\n recent_time = datetime.now() - timedelta(days=5)\n obj = _A(x=recent_time, y=2, z=-5)\n\n rng = RangeTuple(before=None, after=None, within=\"1w\")\n res = list(select_range(chain(_mixed_iter_errors(), iter([obj])),\n order_by_value_type=datetime,\n unparsed_range=rng, drop_exceptions=True))\n\n\n assert res == [_A(x=recent_time, y", + "exact_match": false, + "code_bleu": 0.07994607499472013, + "edit_similarity": 0.11428571428571428, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "'Europe/Rome'", + "got": "", + "got_raw": " # todo assert tz.zone == 'Europe/Vienna'\n\n tz = get_tz(datetime.fromisoformat('2017-07-30 10:00:00'))\n assert notnone(tz).zone == 'Europe/Vienna'\n\n tz = get_tz(datetime.fromisoformat('2017-07-30 10:00:00'))\n assert notnone(tz).zone == 'Europe/Vienna'\n\n tz = get_tz(datetime.fromisoformat('2017-07-30 10", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "None", + "got": "None", + "got_raw": " None\n if path == __file__:\n return \"is my.core.__init__.py\"\n if path == __name__:\n return \"is my.core.__name__\"\n if path == __package__:\n return \"is my.core.__package__\"\n if path == __path__:\n return \"is my.core.__path__\"\n if path == __file__:\n return \"is my.core.__file__\"\n if path == __name__:\n return \"is my.core.__name__\"\n if path == __package__:\n return \"is my.core.__package__", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "{f'total_{run_id}': 1 + 123}", + "got": "1", + "got_raw": "1\n assert item2.raw == 2\n\n assert item1.raw['total_{run_id}'] == 1\n assert item2.raw['total_{run_id}'] == 2\n\n\ndef test_dynamic_module_import_2(tmp_path: Path) -> None:\n \"\"\"\n Test for dynamic hackery in config properties\n e.g. importing some external modules\n \"\"\"\n\n ext = tmp_path / 'external'\n ext.mkdir()\n (ext / '__init__.py').write_text(\n '''\ndef transform(x):\n from .submodule import do_transform\n return do_transform(x)\n\n'''\n", + "exact_match": false, + "code_bleu": 0.07432544468767006, + "edit_similarity": 0.06896551724137931, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "cc", + "got": "1", + "got_raw": "1 # no new calls\n assert cc == called # no new calls\n\n # now let's try to disable it\n settings.ENABLE = False\n\n assert list(cf()) == [1, 2, 3] # still works\n\n assert called == 1 # no new calls\n assert cc == called # no new calls\n\n # now let's try to enable it again\n settings.ENABLE = True\n\n assert list(cf()) == [1, 2, 3] # still works\n\n assert called == 2 # new calls\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "Counter({\"_A\": 4, \"Unsortable\": 3})", + "got": "", + "got_raw": " # type: ignore[arg-type]\n Counter(\n [\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n \"Unsortable\",\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "sqlite3.OperationalError, match='readonly database')", + "got": "Warning):", + "got_raw": "Warning):\n sqlite_connect_immutable(db)\n\n with sqlite_connect_immutable(db) as conn:\n conn.execute('CREATE TABLE testtable (col)')\n\n with sqlite_connect_immutable(db) as conn:\n conn.execute('CREATE TABLE testtable (col)')\n\n with sqlite_connect_immutable(db) as conn:\n conn.execute('CREATE TABLE testtable (col)')\n\n with sqlite_connect_immutable(db) as conn:\n conn.execute('CREATE TABLE testtable (col)')\n\n with sqlite_connect_immutable(db) as conn:\n conn.execute('CREATE TABLE testtable (col)')\n\n with sqlite_connect", + "exact_match": false, + "code_bleu": 0.1694253756768459, + "edit_similarity": 0.13114754098360656, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "[123]", + "got": "123", + "got_raw": "123\n with pytest.raises(AssertionError):\n list(unique_everseen(fun_bad))\n\n with tmp_environ_set('HPI_CHECK_UNIQUE_EVERSEEN', 'no'):\n\n assert list(unique_everseen(fun_good)) == 123\n assert list(unique_everseen(fun_bad)) == [{1, 2}, {1, 3}]\n\ndef _warn_if_empty(func, *args, **kwargs):\n # so there is a more_itertools.peekable which could work nicely for these purposes\n # the downside is that it would start advancing the generator right after", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "QueryException, match=r\"Cannot specify 'after', 'before' and 'within'\")", + "got": "", + "got_raw": "\n\n\n# File: src/my/core/pandas.py\n\"\"\"\nVarious helpers for working with pandas dataframes\n\"\"\"\n\nfrom __future__ import annotations\n\nimport datetime\nimport logging\nimport re\nimport sys\nfrom collections.abc import Callable, Iterable, Iterator, Mapping, Sequence\nfrom datetime import date, datetime, timedelta\nfrom typing import Self\n\nimport pandas as pd\nfrom pandas import DataFrame, Series\n\nfrom my.core.orgmode import parse_org_datetime\nfrom my.core.pandas import check_dataframe as cdf\n\nlogger = logging.getLogger(__name__)\n\ndef _parse_timedelta_string(timedelta_str: str) -> timedelta:\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "{ 'df': { 'count': 7, 'dtypes': { 'index': np.dtype(' pd.DataFrame:\n dates = pd.date_range(start='2024-02-10 08:00', end='2024-02-11 16:00', freq='5h')\n return pd.DataFrame([f'value{i}' for i, _ in enumerate(dates)], index=dates,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "None", + "got": "", + "got_raw": "<|fim_suffix|>\n # TODO: add a kwarg to force lookup for every item? would sort of be like core.common.guess_datetime then\n order_by_lookup: dict[Any, OrderFunc] = {}\n\n # need to go through a copy of the whole iterator here to\n # pre-generate functions to support sorting mixed types\n for obj_res in itr:\n key: Any = _determine_order_by_value_key(obj_res)\n if key not in order_by_lookup:\n keyfunc: OrderFunc | None = _generate_order_by_func(\n obj_res,\n where_function=order_value,\n default", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "{'1970-01-01': 5}", + "got": "5", + "got_raw": "5\n\n # test simplejson\n if factory == 'simplejson':\n import simplejson\n\n # test simplejson option kwarg\n data = {datetime.date(year=1970, month=1, day=1): 5}\n res2 = json_builtin.loads(dumps(data, option=simplejson.OPT_NATURAL_NUMBERS))\n\n assert res2 == 5\n\n # test stdlib\n if factory == 'stdlib':\n import json\n\n # test stdlib option kwarg\n data = {datetime.date(year=1970, month=1,", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "'a'", + "got": "0", + "got_raw": "0\n assert exhausted == 0\n\n x = next(sit)\n\n assert x == 'a'\n assert exhausted == 1\n\n x = next(sit)\n\n assert x == 'b'\n assert exhausted == 2\n\n x = next(sit)\n\n assert x == 'c'\n assert exhausted == 3\n\n with warnings.catch_warnings(record=True) as w:\n warnings.simplefilter('always')\n x = next(sit)\n\n assert x == 'c'\n assert exhausted == 3\n assert len(w) == 1\n assert str(w[0].message", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "'some precious data'", + "got": "'aaand your data is gone!'", + "got_raw": " 'aaand your data is gone!'\n\n # now check that we can still import the module\n # (this is a bit of a hack, but it's the only way to test this)\n # TODO maybe we should just import the module and check its stats?\n # but that would require a way to get the module name from the path\n # (and we don't have that in the module itself)\n # and it's not clear if we can do that without importing the module\n # (and we don't want to import it just to check its stats)\n # so for now,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.43478260869565216, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/HPI", + "expected": "10", + "got": "0", + "got_raw": "0\n\n for m in all_modules():\n assert m.name in m.file.parts[-1]\n\n for m in all_modules():\n assert m.name in m.file.parts[-1]\n\n for m in all_modules():\n assert m.name in m.file.parts[-1]\n\n for m in all_modules():\n assert m.name in m.file.parts[-1]\n\n for m in all_modules():\n assert m.name in m.file.parts[-1]\n\n for m in all_modules():\n assert m.name in m.file.parts[-1]\n\n for m in all_modules():\n assert m.name in m.file.parts[-1]\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "v.context", + "got": "v.context", + "got_raw": " v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\" in v.context\n assert \"xxx /r/cpp\"", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "8", + "got": "1, len(srcs)", + "got_raw": "1, len(srcs)\n\n # wait for sidebar to be visible\n with addon.sidebar.ctx():\n # hmm not sure how come it returns anything at all.. but whatever\n srcs = driver.find_elements(By.CLASS_NAME, 'src')\n for s in srcs:\n # elements should be bound to the sidebar, but aren't displayed yet\n assert is_visible(driver, s), s\n\n assert len(srcs) >= 1, len(srcs)\n\n # check that sidebar is visible\n with addon.sidebar.ctx():\n # hmm not sure how come it returns anything at all.. but whatever\n", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "50", + "got": "0", + "got_raw": "0\n assert len(visits) == 1000000\n assert get_stats(tmp_path) == Counter(['example', 'example2', 'example3', 'example4', 'example5', 'example6', 'example7', 'example8', 'example9', 'example10', 'example11', 'example12', 'example13', 'example14', 'example15', 'example16', 'example17', 'example18', 'example19', 'example20', 'example21', 'example22', '", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "[]", + "got": "1", + "got_raw": "1\n assert r['normalised_url'] == 'whatever'\n assert r['original_url'] == 'whatever'\n assert r['visits'][0]['dt'] == '01 Jan 2000 00:00:00 -0500'\n assert r['visits'][0]['duration'] == 30\n assert r['visits'][0]['locator']['title'] == 'whatever'\n assert r['visits'][0]['locator']['href'] == 'whatever'\n assert r['visits'][0]['context'] == 'whatever'\n assert", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "'https://example.org/ref_example'", + "got": "", + "got_raw": " # noqa: PLR2004\n assert items[0].context == 'file:4'\n assert items[0].locator == Loc.make('file:4', 'file:4')\n\n assert items[1].url == # noqa: PLR2004\n assert items[1].context == 'file:4'\n assert items[1].locator == Loc.make('file:4', 'file:4')\n\ndef test_url_in_properties2() -> None:\n items = [v if isinstance(v, Visit) else throw(v) for v in extract_from_file(get_test", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "{'demo1': 10, 'demo2': 30, 'demo3': 40}", + "got": "{'demo1': 10, 'demo2': 30, 'demo3': 40}", + "got_raw": " {'demo1': 10, 'demo2': 30, 'demo3': 40}\n else:\n assert stats == {'demo2': 30, 'demo3': 40}\n\n def cfg3() -> None:\n from promnesia.common import Source\n from promnesia.sources import demo\n\n SOURCES = [ # noqa: F841\n Source(demo.index, count=10, base_dt='2000-01-01', delta=30, name='demo1'),\n Source(demo.index, count=", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "body['db']", + "got": "body['db']", + "got_raw": " body['db']\n assert 'ERROR' in body['stats']\n\n\ndef test_status_ok() -> None:\n \"\"\"\n If DB exists, server should respond with status\n \"\"\"\n with run_server() as server:\n response = server.post('/status')\n\n # TODO ugh currently returns 200? maybe should return proper error, but need to handle in extension\n # assert response.status_code == 404\n\n body = response.json()\n\n version = body['version']\n assert version is not None\n assert len(version.split('.')) >= 2 # random check..\n\n\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "{ 'python.org/one.html', 'https://python.org/two.html', 'whatever.org', }", + "got": "", + "got_raw": " # noqa: WPS515\n {\n 'https://python.org/two.html',\n 'whatever.org',\n }\n\n\ndef test_extract_4() -> None:\n lines = '''\npython.org/one.html ?? https://python.org/two.html some extra text\n\n whatever.org\n '''\n\n assert set(extract_urls(lines, syntax='org')) == # noqa: WPS515\n {\n 'https://python.org/two.html',\n 'whatever.org',\n }\n\n\ndef test_extract_5() -> None:\n lines = '''\npython.org/one.html ?? https://python", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "'right, so https://en.wikipedia.org/wiki/Dinic%27s_algorithm can be used for max flow'", + "got": "", + "got_raw": " # noqa: E203\n assert v2.context == # noqa: E203\n assert v2.context == # noqa: E203\n assert v2.context == # noqa: E203\n assert v2.context == # noqa: E203\n assert v2.context == # noqa: E203\n assert v2.context == # noqa: E203\n assert v2.context == # noqa: E203\n assert v2.context == # noqa: E203\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "RuntimeError)", + "got": "ImportError):", + "got_raw": "ImportError):\n index(cfg)\n\ndef test_no_sources_subset() -> None:\n cfg = make(\n '''\n'''\n )\n # raises because no SOURCES\n\n with pytest.raises(ImportError):\n index(cfg, sources_subset=[1])\n\ndef test_no_sources_subset2() -> None:\n cfg = make(\n '''\n'''\n )\n # raises because no SOURCES\n\n with pytest.raises(ImportError):\n index(cfg, sources_subset=[1, 2])\n\ndef test_no_sources_subset3() -> None:\n cfg = make(\n '''\n'''\n )\n # raises because no SOURCES\n\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5384615384615384, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "1_000 * run_id", + "got": "1_000 + 1000 * run_id", + "got_raw": "1_000 + 1000 * run_id\n\n # wait for indexer to finish\n indexer.wait()\n\n rj = server.post(\n '/search_around',\n json={'timestamp': datetime.fromisoformat('2005-01-01T00:00:00+06:00').timestamp()},\n ).json()\n assert rj['visits'] == []\n\n\ndef test_indexing(tmp_path: Path) -> None:\n moverwrite = ['--overwrite'] if overwrite else []\n\n def _index(run_id: str) -> Popen", + "exact_match": false, + "code_bleu": 0.3860973950960897, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "karlicoss/promnesia", + "expected": "0", + "got": "0", + "got_raw": "0\n\n\ndef test_index_urls(tmp_path: Path) -> None:\n idx = index_urls(\n {\n 'https://example.com': None,\n 'https://en.wikipedia.org/wiki/Saturn_V': None,\n 'https://plato.stanford.edu/entries/qualia': None,\n }\n )\n idx(tmp_path)\n db = tmp_path / 'promnesia.sqlite'\n assert db.exists()\n assert db.is_file()\n assert db.stat().st_size > 0\n\n\ndef test_index_urls_with_filters(tmp_path: Path) -> None:\n idx = index_urls(\n {\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "self.veb.member(3))", + "got": "3 in self.veb)", + "got_raw": "3 in self.veb)\n self.assertTrue(1 in self.veb)\n self.assertTrue(5 in self.veb)\n self.assertTrue(7 in self.veb)\n\n def test_min_max(self):\n for v in [1, 3, 5, 7]:\n self.veb.insert(v)\n\n self.assertEqual(self.veb.min, 1)\n self.assertEqual(self.veb.max, 7)\n\n def test_successor(self):\n for v in [1, 3, 5, 7]:\n self.veb.insert(v)\n\n self", + "exact_match": false, + "code_bleu": 0.3033294269365358, + "edit_similarity": 0.5454545454545454, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "set_bit(22, 3))", + "got": "1 << 3)", + "got_raw": "1 << 3)\n self.assertEqual(30, set_bit(22, 3))\n self.assertEqual(30, set_bit(22, 3, 1))\n self.assertEqual(18, set_bit(22, 2))\n self.assertEqual(18, set_bit(22, 2, 0))\n\n def test_clear_bit(self):\n # 22 = 10110 --> after clear bit at 3th position: 10 = 01010\n\n self.assertEqual(10, 1 << 3", + "exact_match": false, + "code_bleu": 0.2566457942593459, + "edit_similarity": 0.2727272727272727, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "is_valid(\"[[[]]\"))", + "got": "is_valid(\"[]()[](\"))", + "got_raw": " is_valid(\"[]()[](\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n self.assertFalse( is_valid(\"[]()[]((\"))\n", + "exact_match": false, + "code_bleu": 0.45180100180492244, + "edit_similarity": 0.8421052631578947, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "is_valid(\"{([])}\"))", + "got": "LinkedListStack().is_valid())", + "got_raw": "LinkedListStack().is_valid())\n self.assertTrue(ArrayStack().is_valid())\n self.assertFalse(OrderedStack().is_valid())\n\n def test_first_is_consecutive(self):\n\n self.assertTrue(first_is_consecutive([1, 2, 3, 4, 5]))\n self.assertFalse(first_is_consecutive([1, 2, 3, 4, 6]))\n\n self.assertTrue(LinkedListStack().first_is_consecutive())\n self.assertTrue(ArrayStack().first_is_consecutive())\n self.assertFalse(OrderedStack().first_is_consecutive())\n\n def test_first_stutter(self):\n\n self.assertEqual(first_stutter([", + "exact_match": false, + "code_bleu": 0.2653856085536222, + "edit_similarity": 0.4583333333333333, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "two_sum1(array, 9))", + "got": "self.assertEqual([1, 2], two_sum2(array, 9))", + "got_raw": "<|fim_suffix|>\n self.assertEqual([1, 2], two_sum2(array, 9))\n self.assertEqual([2, 4], two_sum2(array, 22))\n # test two_sum2\n\n self.assertEqual([1, 2], two_sum2(array, 9))\n self.assertEqual([2, 4], two_sum2(array, 22))\n # test two_sum2\n\n self.assertEqual([1, 2], two_sum2(array, 9))\n self.assertEqual([2, 4], two_sum2(array, 22))\n # test two_sum2\n\n", + "exact_match": false, + "code_bleu": 0.32702929224554894, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "y)", + "got": "self.assertEqual(result, y)", + "got_raw": "<|fim_suffix|>\n self.assertEqual(result, y)\n\n def test_complex_numbers(self):\n x = [1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 0.0 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j]\n y = [4.000 + 2.613j, 2.", + "exact_match": false, + "code_bleu": 0.21105340631872638, + "edit_similarity": 0.13793103448275862, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "self.veb.successor(12))", + "got": "self.veb.successor(12))", + "got_raw": " self.veb.successor(12))\n self.assertIsNone( self.veb.successor(13))\n\n def test_predecessor(self):\n for v in [2, 4, 8, 12]:\n self.veb.insert(v)\n\n self.assertEqual(2, self.veb.predecessor(4))\n self.assertEqual(8, self.veb.predecessor(8))\n\n self.assertIsNone( self.veb.predecessor(2))\n self.assertIsNone( self.veb.predecessor(1))\n\n def test_min(self):\n for", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n\n # Test 2\n n2 = 10\n k2 = 2\n\n self.assertEqual(find_k_factor(n2, k2), 2)\n\n # Test 3\n n3 = 100\n k3 = 5\n\n self.assertEqual(find_k_factor(n3, k3), 5)\n\n # Test 4\n n4 = 1000\n k4 = 10\n\n self.assertEqual(find_k_factor(n4, k4), 10)\n\n # Test 5\n n5 = 10", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "vertices)", + "got": "6)", + "got_raw": "6)\n\n # Verify correct order\n\n self.assertEqual(order, [5, 4, 2, 3, 1, 0])\n\n def test_simple_dag_with_cycles(self):\n vertices = 6\n edges = [(5, 2), (5, 0), (4, 0), (4, 1), (2, 3), (3, 1), (0, 1)]\n\n with self.assertRaises(ValueError):\n topological_sort(vertices, edges)\n\n def test_simple_dag_with_cycles2(self):\n vertices = 6\n edges = [(5", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "3)", + "got": "3)", + "got_raw": "3)\n self.assertEqual(exponential_search(arr, 13), 6)\n self.assertEqual(exponential_search(arr, 15), 7)\n self.assertEqual(exponential_search(arr, 1), 0)\n self.assertEqual(exponential_search(arr, 11), 5)\n self.assertEqual(exponential_search(arr, 10), -1)\n\n def test_not_found(self):\n arr = [1, 3, 5, 7, 9, 11, 13, 15]\n\n self.assertEqual(exponential_search(arr, 2), -1)\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "count_ones_iter(0))", + "got": "0)", + "got_raw": "0)\n\n def test_count_ones_recur(self):\n\n # 8 -> 1000\n self.assertEqual(1, count_ones_recur(8))\n\n # 109 -> 1101101\n self.assertEqual(5, count_ones_recur(109))\n\n # 63 -> 111111\n self.assertEqual(6, count_ones_recur(63))\n\n # 0 -> 0\n\n self.assertEqual(0, 0)\n\n def test_find_difference(self):\n\n # \"abcde\"", + "exact_match": false, + "code_bleu": 0.28284271247461906, + "edit_similarity": 0.19047619047619047, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "jump_search(array, 5))", + "got": "self.assertEqual(1, binary_search(array, 1))", + "got_raw": "<|fim_suffix|>\n self.assertEqual(1, binary_search(array, 1))\n self.assertEqual(1, binary_search(array, 2))\n self.assertEqual(1, binary_search(array, 3))\n self.assertEqual(1, binary_search(array, 4))\n self.assertEqual(1, binary_search(array, 5))\n self.assertEqual(1, binary_search(array, 6))\n self.assertEqual(1, binary_search(array, 7))\n self.assertEqual(1, binary_search(array, 8))\n self.assertEqual(1, binary_search(array, 9))\n self.assertEqual(1, binary_search(array", + "exact_match": false, + "code_bleu": 0.21142141714303078, + "edit_similarity": 0.5454545454545454, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "[])", + "got": "0)", + "got_raw": "0)\n\n def test_deletion_odd_degree(self):\n btree = BTree(3)\n key_list = set(self.keys_to_insert)\n for i in key_list:\n btree.insert_key(i)\n\n for key in key_list:\n btree.remove_key(key)\n self.assertFalse(btree.find(key))\n\n self.assertEqual(btree.root.keys, 0)\n\n def test_deletion_root(self):\n btree = BTree(3)\n key_list = set(self.keys_to_insert)\n for i in key_list:\n btree.insert_key(i)\n\n btree.remove_key(0)\n self", + "exact_match": false, + "code_bleu": 0.35818997727451396, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "count_ones_recur(8))", + "got": "count_ones_recur(8))", + "got_raw": " count_ones_recur(8))\n self.assertEqual(1, count_ones_recur(1))\n self.assertEqual(2, count_ones_recur(2))\n self.assertEqual(3, count_ones_recur(3))\n self.assertEqual(4, count_ones_recur(4))\n self.assertEqual(5, count_ones_recur(5))\n self.assertEqual(6, count_ones_recur(6))\n self.assertEqual(7, count_ones_recur(7))\n self.assertEqual(8, count_ones_recur(8))\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "jump_search(array, -1))", + "got": "def test_two_sum(self):", + "got_raw": "<|fim_suffix|>\n def test_two_sum(self):\n self.assertEqual([0, 1], two_sum([2, 7, 11, 15], 9))\n self.assertEqual([0, 1], two_sum1([2, 7, 11, 15], 9))\n self.assertEqual([0, 1], two_sum2([2, 7, 11, 15], 9))\n\n def test_two_sum1(self):\n self.assertEqual([0, 1], two_sum1([2, 7, 11, 15", + "exact_match": false, + "code_bleu": 0.18334613341308786, + "edit_similarity": 0.17391304347826086, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "remove_bit(21, 0))", + "got": "10101 & 0b11111111111111111111111111111110)", + "got_raw": "10101 & 0b11111111111111111111111111111110)\n self.assertEqual(10, remove_bit(21, 0))\n\n def test_count_flips_to_convert(self):\n \"\"\"\n Input: first = 29, second = 15\n count_flips_to_convert(first, second): output = 2\n Input: first = 34, second = 34\n count_flips_to_convert(first, second): output = ", + "exact_match": false, + "code_bleu": 0.20531663540747672, + "edit_similarity": 0.13114754098360656, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "self.tree.search(24))", + "got": "10 in self.tree)", + "got_raw": "10 in self.tree)\n self.assertTrue(15 in self.tree)\n self.assertTrue(6 in self.tree)\n self.assertTrue(4 in self.tree)\n self.assertTrue(9 in self.tree)\n self.assertTrue(12 in self.tree)\n self.assertTrue(24 in self.tree)\n self.assertTrue(7 in self.tree)\n self.assertTrue(20 in self.tree)\n self.assertTrue(30 in self.tree)\n self.assertTrue(18 in self.tree)\n\n self.assertFalse(11 in self.tree)\n self.assertFalse(16 in self.tree)\n self.assertFalse(5 in", + "exact_match": false, + "code_bleu": 0.2898139146299943, + "edit_similarity": 0.5405405405405406, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "sorted(answer1))", + "got": "answer1)", + "got_raw": " answer1)\n\n def test_permute_iter(self):\n nums1 = [1, 2, 3, 4]\n answer1 = [\n [1, 2, 3, 4],\n [2, 1, 3, 4],\n [2, 3, 1, 4],\n [2, 3, 4, 1],\n [1, 3, 2, 4],\n [3, 1, 2, 4],\n [3, 2, 1, 4],\n [3, ", + "exact_match": false, + "code_bleu": 0.28284271247461906, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "ft.get_sum(bit_tree, 4))", + "got": "12)", + "got_raw": "12)\n self.assertEqual(1, 1)\n self.assertEqual(1, 1)\n self.assertEqual(1, 1)\n self.assertEqual(1, 1)\n self.assertEqual(1, 1)\n self.assertEqual(1, 1)\n self.assertEqual(1, 1)\n self.assertEqual(1, 1)\n\n def test_construct_tree_with_update_4(self):\n freq = [2, 1, 4, 6, -1, 5, -32, 0, 1]\n ft = Fenwick_Tree(freq)\n bit_tree", + "exact_match": false, + "code_bleu": 0.11939665909150465, + "edit_similarity": 0.07407407407407407, + "n_retrieved": 10 + }, + { + "repo": "keon/algorithms", + "expected": "stack.pop())", + "got": "stack.pop())", + "got_raw": " stack.pop())\n self.assertEqual(2, stack.pop())\n self.assertEqual(1, stack.pop())\n self.assertTrue(stack.is_empty())\n\n def test_linked_list_stack(self):\n stack = LinkedListStack()\n stack.push(1)\n stack.push(2)\n stack.push(3)\n\n # test __iter__()\n it = iter(stack)\n self.assertEqual(3, next(it))\n self.assertEqual(2, next(it))\n self.assertEqual(1, next(it))\n self.assertRaises(StopIteration, next, it)\n\n # test __len__()\n self.assertEqual(3, len(stack))\n\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "kivy/buildozer", + "expected": "[ \"this\", \"is\", \"one\", \"way\", \"of\", \"representing\", \"lists\", ]", + "got": "[\"this\", \"is\", \"one\", \"way\", \"of\", \"representing\", \"lists\"]", + "got_raw": " [\"this\", \"is\", \"one\", \"way\", \"of\", \"representing\", \"lists\"]\n assert sp.getlist(\"section\", \"option4\") == [\"this_is\", \"another_way\", \"of\", \"representing\", \"4\", \"lists\"]\n\n def test_env_var_overrides(self):\n \"\"\"Test that environment variables override the config file.\n \"\"\"\n sp = SpecParser()\n sp.read_string(\n \"\"\"\n [app]\n # Comments can be indented.\n option1=a # This is not considered a comment\n option2=this is\n a multiline string (", + "exact_match": false, + "code_bleu": 0.8866327584404774, + "edit_similarity": 0.9752066115702479, + "n_retrieved": 10 + }, + { + "repo": "kivy/buildozer", + "expected": "\"full system\"", + "got": "\"full system\"", + "got_raw": " \"full system\"\n\n # After a profile is set, return the profile version.\n\n sp.apply_profile(\"demo1\")\n assert sp.get(\"section1\", \"attribute1\") == \"demo mode\"\n\n # After a profile is set, return the profile version.\n\n sp.apply_profile(\"demo2\")\n assert sp.get(\"section1\", \"attribute1\") == \"demo mode\"\n\n # After a profile is set, return the profile version.\n\n sp.apply_profile(\"demo1\")\n assert sp.get(\"section1\", \"attribute1\") == \"demo mode\"\n\n # After a profile is set", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "kivy/buildozer", + "expected": "0", + "got": "1", + "got_raw": "1\n assert m_cmd_expect.call_args_list == [\n mock.call(\n ['sdkmanager', '--install', 'platforms;android-30'],\n env=target_android.buildozer.environ,\n )\n ]\n\n def test_install_platform(self):\n \"\"\"Tests the install_platform() method.\"\"\"\n target_android = init_target(self.temp_dir)\n with patch_buildops_cmd() as m_cmd, patch_buildops_cmd_expect() as m_cmd_expect, patch_buildops_download() as m_download, patch_buildops_file_extract() as m_file_extract, patch_buildops_file_exists() as m_file_exists, patch_buildops", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "kivy/buildozer", + "expected": "any('main.py' in f for f in copied_files))", + "got": "('.hidden/secret.py' not in copied_files),", + "got_raw": "('.hidden/secret.py' not in copied_files),\n msg='Unexpected file copied: {}'.format(\n '.hidden/secret.py'))\n self.assertTrue('.hidden_file.py' in copied_files,\n msg='File not copied: .hidden_file.py')\n self.assertTrue('main.py' in copied_files,\n msg='File not copied: main.py')\n self.assertTrue('visible/code.py' in copied_files,\n msg='File not copied: visible/code.py')\n self.assertTrue('subdir/code2.py' in copied_files,\n msg='File not copied: subdir/code2.py')\n self.assertTrue('subdir", + "exact_match": false, + "code_bleu": 0.23262605090741692, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "kivy/buildozer", + "expected": "\"a", + "got": "", + "got_raw": "\n\n\n# File: buildozer/__init__.py\n def check_configuration_tokens(self):\n \"\"\"Check that all the configuration tokens are valid.\n \"\"\"\n self.check_build_layout()\n self.migrate_configuration_tokens()\n self.check_configuration_tokens()\n\n def check_build_layout(self):\n '''Ensure the build (local and global) directory layout and files are\n ready.\n '''\n self.logger.info('Ensure build layout')\n\n self.root_dir = dirname(__file__)\n self.buildozer_dir = join(self.root_dir, 'buildozer')\n self.global_buildozer_dir = join(self.root_dir, '", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "kivy/buildozer", + "expected": "'r')", + "got": "", + "got_raw": " # noqa: E125\n os.path.join(p4a_dir, 'pythonforandroid', 'recommendations.py'),\n 'r'\n )\n self.assertEqual(ndk_version, expected_ndk)\n\n @mock.patch('buildozer.targets.android.os.path.isfile')\n @mock.patch('buildozer.targets.android.os.path.exists')\n @mock.patch('buildozer.targets.android.open', create=True)\n def test_p4a_recommended_android_ndk_not_found(\n self, mock_open, mock_exists, mock_isfile\n ):\n self.set_specfile_log_level(self.specfile.name", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "kivy/buildozer", + "expected": "False", + "got": "1", + "got_raw": "1\n assert target_android.android_sdk_path is None\n assert target_android.android_ndk_path is None\n assert target_android.android_sdk_version is None\n assert target_android.android_ndk_version is None\n assert target_android.android_api is None\n assert target_android.android_minapi is None\n assert target_android.android_add_libs_armeabi is None\n assert target_android.android_add_libs_armeabi_v7a is None\n assert target_android.android_add_libs_arm64_v8a is None\n assert target_android.android_add_libs_x86 is None\n assert target", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "kivy/buildozer", + "expected": "AssertionError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n buildops.cmd('expect', 'not implemented')\n\n def test_cmd_expect_linux(self):\n\n with self.assertRaises(NotImplementedError):\n buildops.cmd('expect', 'not implemented')\n\n def test_cmd_expect_macos(self):\n\n with self.assertRaises(NotImplementedError):\n buildops.cmd('expect', 'not implemented')\n\n def test_cmd_expect_undefined(self):\n\n with self.assertRaises(NotImplementedError):\n buildops.cmd('expect', 'not implemented')\n\n def test_cmd_expect_undefined(self):\n\n with self.assertRaises(NotImplementedError):\n buildops.cmd('expect', 'not", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4444444444444444, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "helpers.MessageMatcher(header=header_clock_reply))", + "got": "ttpublish_mock = hamqtt_mock.async_publish_mock", + "got_raw": "ttpublish_mock = hamqtt_mock.async_publish_mock\n hamqttpublish_mock.assert_any_call(\n hass,\n topic_subscribe,\n helpers.MessageMatcher(\n header=helpers.DictMatcher(\n {\n mc.KEY_MESSAGEID: message_clock_push[mc.KEY_HEADER][\n mc.KEY_MESSAGEID\n ],\n mc.KEY_NAMESPACE: mn.Appliance_System_Clock.name,\n mc.KEY_METHOD: mc.METHOD_PUSHACK,\n mc.KEY_TRIGGERSRC: mc.HEADER_TRIGGERSRC_CLOUDCONTROL,\n mc.KEY_FROM: topic_publish,\n }\n )\n ),\n )\n #", + "exact_match": false, + "code_bleu": 0.16785418874204266, + "edit_similarity": 0.14432989690721648, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "RollerShutterMixin.SIGNALCLOSE", + "got": "await entity.async_get_state()) == haec.CoverState.OPEN", + "got_raw": "await entity.async_get_state()) == haec.CoverState.OPEN\n\n # test open\n await entity.async_open_cover()\n assert (await entity.async_get_state()) == haec.CoverState.OPENING\n await entity.async_stop_cover()\n assert (await entity.async_get_state()) == haec.CoverState.OPEN\n\n # test close\n await entity.async_close_cover()\n assert (await entity.async_get_state()) == haec.CoverState.CLOSING\n await entity.async_stop_cover()\n assert (await entity.async_get_state()) == haec.CoverState.CLOSED\n\n # test", + "exact_match": false, + "code_bleu": 0.08839374326825923, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "result", + "got": "obfuscate.obfuscate_key(key, src) == result) == True, f\"key: {key}, src: {src}, result: {result}\"", + "got_raw": "obfuscate.obfuscate_key(key, src) == result) == True, f\"key: {key}, src: {src}, result: {result}\"\n\n\ndef test_obfuscate_key():\n \"\"\"\n Verify the obfuscation\n \"\"\"\n key_samples = {\n mc.KEY_FROM: {\n # check the userid carried in topics (/app/{userid}-{appid}/subscribe\")\n \"/app/100000-eb40234d5ec8db162c08447c0dc7d772/subscribe\": \"/app/@0-", + "exact_match": false, + "code_bleu": 0.06809398432036522, + "edit_similarity": 0.11650485436893204, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "tc.MOCK_CLOUDAPI_HUB_GETSUBDEVICES[tc.MOCK_PROFILE_MSH300_UUID]", + "got": "tc.MOCK_CLOUDAPI_HUB_GETSUBDEVICES", + "got_raw": " tc.MOCK_CLOUDAPI_HUB_GETSUBDEVICES\n\n result = await cloudapiclient.async_hub_getsubdevice(\n tc.MOCK_PROFILE_MSH300_UUID, tc.MOCK_PROFILE_MSH300_SUBDEVICE_UUID\n )\n assert result == tc.MOCK_CLOUDAPI_HUB_GETSUBDEVICE\n\n result = await cloudapiclient.async_hub_getsubdevice(\n tc.MOCK_PROFILE_MSH300_UUID, tc.MOCK_PROFILE_MSH300_SUBDEVICE_UUID\n )\n assert result == tc.MOCK_CLOUDAPI_HUB_GETSUBDEVICE\n\n ", + "exact_match": false, + "code_bleu": 0.31533615572014295, + "edit_similarity": 0.7010309278350515, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "descriptor.uuid", + "got": "0", + "got_raw": "0\n assert data[mlc.CONF_HOST] == host\n assert data[mlc.CONF_KEY] == emulator.key\n assert data[mlc.CONF_PROTOCOL] == mc.CONF_PROTOCOL_HTTP\n assert data[mlc.CONF_POLLING_PERIOD] == 10\n assert data[mlc.CONF_TRACE] == json_dumps(\n {\n \"device_id\": 0,\n \"device_type\": descriptor.productnametype,\n \"device_name\": descriptor.productname,\n \"device_model\": descriptor.productmodel,\n \"device_uuid\": descriptor.uuid,\n \"device_mac", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "0", + "got": "0", + "got_raw": "0\n assert len(safe_start_calls) == len(expected_connections)\n # check the profile is ready to start\n assert profile.is_ready\n # check the profile is ready to start\n assert profile.is_ready\n # check the profile is ready to start\n assert profile.is_ready\n # check the profile is ready to start\n assert profile.is_ready\n # check the profile is ready to start\n assert profile.is_ready\n # check the profile is ready to start\n assert profile.is_ready\n # check the profile is ready to start\n assert profile.is_ready\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "3", + "got": "3", + "got_raw": "3\n assert result[\"type\"] == FlowResultType.ABORT # type: ignore\n assert result[\"reason\"] == \"abort\" # type: ignore\n assert result[\"reason\"] == \"CANNOT_CONNECT\" # type: ignore\n # put the cloud offline\n cloudapi_mock.online = False\n result = await config_flow.async_configure(\n result[\"flow_id\"],\n user_input=user_input,\n )\n assert cloudapi_mock.api_calls[cloudapi.API_AUTH_SIGNIN_PATH] == 4\n assert result[\"type\"] == FlowResultType.FORM # type", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "1 - digest[mc.KEY_TOGGLEX][0][mc.KEY_ONOFF]", + "got": "0", + "got_raw": "0\n assert context.device.switch_togglex.state == 1\n assert context.device._mqtt_publish is not None\n assert context.device._mqtt_publish.is_cloud_connection\n assert context.device._mqtt_publish.is_mqtt\n assert context.device._mqtt_publish.is_cloud_connection\n assert context.device._mqtt_publish.is_mqtt\n assert context.device._mqtt_publish.is_cloud_connection\n assert context.device._mqtt_publish.is_mqtt\n assert context.device._mqtt_publish.is_cloud_connection\n assert context.device._mqtt_publish.is_mqtt\n assert context.device._mqtt_publish.is_cloud_connection\n assert context", + "exact_match": false, + "code_bleu": 0.03716272234383503, + "edit_similarity": 0.045454545454545456, + "n_retrieved": 10 + }, + { + "repo": "krahabb/meross_lan", + "expected": "mlc.CONF_TRACE_VERSION", + "got": "1", + "got_raw": "1\n assert diagnostic[\"title\"] == self.config_entry.title\n assert diagnostic[\"unique_id\"] == self.config_entry.unique_id\n assert diagnostic[\"data\"] == self.config_entry.data\n assert diagnostic[\"data\"][\"key\"] == self.config_entry.data.get(\"key\")\n assert diagnostic[\"data\"][\"key\"] == self.config_entry.data.get(\"key\")\n assert diagnostic[\"data\"][\"key\"] == self.config_entry.data.get(\"key\")\n assert diagnostic[\"data\"][\"key\"] == self.config_entry.data.get(\"key\")\n assert diagnostic[\"data\"][\"key\"] == self.config_entry.data.get(\"key\")\n assert diagnostic", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "(device_name, \"Config output\")", + "got": "(device_name, \"Config output\")", + "got_raw": " (device_name, \"Config output\")\n\ndef test_ssh_conn_failure(mock_connecthandler):\n mock_net_connect = MagicMock()\n mock_net_connect.send_command.return_value = \"Command output\"\n mock_net_connect.send_config_set.return_value = \"Config output\"\n mock_connecthandler.return_value.__enter__.return_value = mock_net_connect\n\n device_name = \"test_device1\"\n device_params = {\"device_type\": \"cisco_ios\", \"host\": \"192.168.1.1\"}\n\n # Test with cli_command\n with pytest.raises(Exception) as excinfo:\n ssh_conn(device_name,", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "output", + "got": "output", + "got_raw": " output\n assert \"show tech-support\" in output\n assert \"show version\" in output\n assert \"show ip interface brief\" in output\n assert \"show ip route\" in output\n assert \"show ip interface brief\" in output\n assert \"show ip interface brief\" in output\n assert \"show ip interface brief\" in output\n assert \"show ip interface brief\" in output\n assert \"show ip interface brief\" in output\n assert \"show ip interface brief\" in output\n assert \"show ip interface brief\" in output\n assert \"show ip interface brief\" in", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "ValueError)", + "got": "", + "got_raw": "\n\n\n# File: netmiko/encryption_handling.py\nfrom typing import Any, Dict, List, Optional, Union, Tuple, TypeVar, Callable, AnyStr\nfrom netmiko.base_connection import BaseConnection\nfrom netmiko.exceptions import (\n NetmikoTimeoutException,\n NetmikoAuthenticationException,\n ConfigInvalidException,\n ReadException,\n ReadTimeout,\n)\nfrom netmiko.base_connection import (\n _DEFAULT_COMMAND_TIMEOUT,\n _DEFAULT_COMMAND_DELAY_FACTOR,\n _DEFAULT_COMMAND_MAX_LOOPS,\n _DEFAULT_READ_TIMEOUT,\n _DEFAULT_READ_DELAY,\n _DEFAULT_READ_DELAY_FACTOR,\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "md5_value", + "got": "assert remote_md5 == md5_value", + "got_raw": "<|fim_suffix|>\n assert remote_md5 == md5_value\n\n # Test the file size\n remote_file_size = scp_transfer.remote_file_size()\n assert remote_file_size == 1234567890\n\n # Test the file size with a remote file\n remote_file_size = scp_transfer.remote_file_size(remote_file=\"test.txt\")\n assert remote_file_size == 1234567890\n\n # Test the file size with a remote file and a remote file system\n remote_file_size = scp_transfer.remote_file_size(\n remote_file=\"test.txt\", remote", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.46153846153846156, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "None", + "got": "net_connect.disconnect()", + "got_raw": "<|fim_suffix|>\n net_connect.disconnect()\n end_time = datetime.now()\n time_delta = end_time - start_time\n\n assert net_connect.remote_conn is None\n assert time_delta.total_seconds() < 1.0\n assert net_connect.session_log.fin is True\n assert net_connect.session_log.fout is True\n assert net_connect.session_log.ferr is True\n assert net_connect.session_log.fout is True\n assert net_connect.session_log.fout is True\n assert net_connect.session_log.fout is True\n assert net_connect.session_log.fout is True\n assert net_connect.session_log", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "10", + "got": "4", + "got_raw": "4\n assert connection.select_delay_factor(100) == 4\n assert connection.select_delay_factor(1000) == 4\n assert connection.select_delay_factor(10000) == 4\n assert connection.select_delay_factor(100000) == 4\n assert connection.select_delay_factor(1000000) == 4\n assert connection.select_delay_factor(10000000) == 4\n assert connection.select_delay_factor(100000000) == 4\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "netmiko_log", + "got": "netmiko_log", + "got_raw": " netmiko_log\n assert nc.secret not in netmiko_log\n\n # cleanup the log file\n with open(file_name, \"w\") as f:\n f.write(\"\")\n\n # run sequence\n nc.enable()\n time.sleep(1)\n nc.clear_buffer()\n nc.disconnect()\n\n with open(file_name, \"r\") as f:\n netmiko_log = f.read()\n if nc.password:\n\n assert nc.password not in netmiko_log\n assert nc.secret not in netmiko_log\n\n # cleanup the log file\n with open(file_name, \"w", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "True", + "got": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "got_raw": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "cmd_response", + "got": "", + "got_raw": " # noqa: SIM108\n\n\ndef test_save_confirm(net_connect, commands, expected_responses):\n \"\"\"\n Test save config with confirm.\n \"\"\"\n save_verify = expected_responses[\"save_config\"]\n\n cmd_response = net_connect.save_config(confirm=True)\n\n assert save_verify in # noqa: SIM108\n\n\ndef test_save_confirm_response(net_connect, commands, expected_responses):\n \"\"\"\n Test save config with confirm response.\n \"\"\"\n save_verify = expected_responses[\"save_config\"]\n\n cmd_response = net_connect.save_config(confirm=True, confirm_response=\"y\")\n\n assert save_verify in # noqa: SIM1", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "5", + "got": "10", + "got_raw": "10\n else:\n pytest.skip(\"Skipping test_disconnect_no_enable for non IOS devices\")\n\n\n\n# File: examples_old/case7_commit/config_change_jnpr.py\n#!/usr/bin/env python\nfrom netmiko import Netmiko\nfrom getpass import getpass\n\ndevice = {\n \"host\": \"srx1.twb-tech.com\",\n \"username\": \"pyclass\",\n \"password\": getpass(),\n \"device_type\": \"juniper_junos\",\n}\n\ncommands = [\"set system syslog archive size 240k files 3 \"]\n\nnet_connect = Netmiko(**device", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "new_hostname", + "got": "", + "got_raw": " # noqa: E712\n assert current_hostname != new_hostname\n else:\n with pytest.raises(ConfigInvalidException):\n net_connect.send_config_set(command)\n\n net_connect.disconnect()\n\n\ndef test_config_no_hostname(net_connect, commands, expected_responses):\n hostname = \"test-netmiko1\"\n command = f\"hostname {hostname}\"\n if \"arista\" in net_connect.device_type:\n current_hostname = net_connect.find_prompt()[:-1]\n net_connect.send_config_set(command)\n new_hostname = net_connect.find_prompt()\n\n assert hostname in # noqa: E712\n assert", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "30000000", + "got": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "got_raw": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.10294117647058823, + "n_retrieved": 10 + }, + { + "repo": "ktbyers/netmiko", + "expected": "show_version", + "got": "show_version", + "got_raw": " show_version\n\ndef test_ssh_config_change(net_connect, commands, expected_responses):\n \"\"\"\n Verify the config change was successful\n \"\"\"\n config_commands, support_commit, config_verify = retrieve_commands(commands)\n config_commands_output = net_connect.send_config_set(config_commands)\n if support_commit:\n net_connect.commit()\n else:\n net_connect.send_command_expect(config_verify)\n\n assert config_change_verify(net_connect, config_verify, config_commands_output)\n\ndef test_ssh_config_change_with_commit(net_connect, commands, expected_responses):\n \"\"\"\n Verify the config change was successful\n \"\"\"\n config_commands, support_commit, config_verify", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "laixintao/flameshow", + "expected": "[Frame(\"\", 1), Frame(\"\", 3)]", + "got": "2", + "got_raw": "2\n assert name_aggr[\"bar\"] == 1\n\n\ndef test_parser_get_name_aggr_with_previous_occrance_2():\n root = create_frame(\n {\n \"id\": 0,\n \"values\": [10],\n \"children\": [\n {\n \"id\": 1,\n \"name\": \"foo\",\n \"values\": [3],\n \"children\": [],\n },\n {\n \"id\": 2,\n \"values\": [4],\n \"children\": [\n {\n \"id\": 3,\n \"name\": \"foo\",\n \"values\":", + "exact_match": false, + "code_bleu": 0.03333333333333333, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "laixintao/flameshow", + "expected": "\"1.0B\"", + "got": "1", + "got_raw": "1\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.0) == 8\n assert sizeof(1.", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "laixintao/flameshow", + "expected": "1", + "got": "1", + "got_raw": "1\n assert profile.sample_types[0].sample_type == \"samples\"\n assert profile.sample_types[0].sample_unit == \"count\"\n\n assert profile.total_sample == 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "laixintao/flameshow", + "expected": "Frame(\"a\", 13)", + "got": "12", + "got_raw": "12\n\n assert f1 != \"foo\"\n\n assert f1 != f2\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1 != None\n\n assert f1", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "laixintao/flameshow", + "expected": "\"flameshow\"", + "got": "\"flameshow\"", + "got_raw": " \"flameshow\"\n assert app.sub_title == \"v0.1.0\"\n\ndef test_app_set_title_after_mount_with_debug():\n r = Frame(\"root\", 0)\n p = Profile(\n filename=\"abc\",\n root_stack=r,\n highest_lines=1,\n total_sample=2,\n sample_types=[SampleType(\"goroutine\", \"count\")],\n id_store={},\n )\n app = FlameshowApp(p, _debug_exit_after_rednder=True)\n app.on_mount()\n\n assert app.title == \"flameshow\"\n assert app.sub_title == \"v0", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "laixintao/flameshow", + "expected": "[7]", + "got": "7", + "got_raw": "7\n assert root.children[0].children[0].values == 5\n assert root.children[0].children[0].children[0].values == 3\n\n\ndef test_get_name_aggr():\n root = Frame(\"root\", 0, values=[5])\n s1 = Frame(\"s1\", 1, values=[4], parent=root)\n s2 = Frame(\"s2\", 2, values=[4], parent=s1)\n\n root.children = [s1]\n s1.children = [s2]\n\n s1 = Frame(\"s1\", 3, values", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "laixintao/flameshow", + "expected": "2", + "got": "2", + "got_raw": "2\n assert isinstance(result[0], HeaderIcon)\n assert isinstance(result[1], HeaderTitle)\n assert isinstance(result[1].query_one(\"HeaderOpenedFilename\"), HeaderOpenedFilename)\n assert result[1].query_one(\"HeaderOpenedFilename\").filename == \"foo.out\"\n\n\ndef test_flameshow_header_center_text():\n fh = FlameshowHeader(\"foo.out\")\n fh.center_text = \"bar\"\n result = list(fh.compose())\n\n assert len(result) == 2\n assert isinstance(result[0], HeaderIcon)\n assert isinstance(result[1], HeaderTitle)\n assert isinstance(result[1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "laixintao/flameshow", + "expected": "[6]", + "got": "5", + "got_raw": "5\n assert root.children[0].children[1].values == 3\n\n assert s1.children[0].values == [2]\n assert s1.children[1].values == [1]\n\n assert s2.values == [2]\n\n assert s1.parent == root\n assert s2.parent == s1\n\n assert s1.parent.parent == None\n assert s2.parent.parent == s1\n\n assert s1.parent.parent.parent == root\n\n assert s1.parent.parent.parent.parent == None\n\n assert s1.parent.parent.parent.parent.parent == None\n\n assert s1.parent.parent", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "403", + "got": "403", + "got_raw": "403\n assert media_api.patch.call_args.kwargs[\"upload_http_error\"] == \"forbidden\"\n\ndef test_media_upload_gives_up_on_non_retryable_api_error():\n media_api = Mock()\n media_api.get_upload_url.return_value = SimpleNamespace(\n upload_url=\"https://example.com/upload\",\n media_id=\"media-id\",\n )\n media_api.patch.return_value = None\n\n httpx_client = Mock()\n httpx_client.put.return_value = _upload_response(403, \"forbidden\")\n\n manager = MediaManager(\n api_client=SimpleNamespace(media=media_api),\n http", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "caplog.text", + "got": "\"An error occurred in function_that_raises: \" in caplog.records[0].message", + "got_raw": " \"An error occurred in function_that_raises: \" in caplog.records[0].message\n assert \"ValueError: This is a test error.\" in caplog.records[0].message\n\ndef test_catch_and_log_errors_logs_error_with_exception_info(caplog):\n function_that_raises()\n\n assert len(caplog.records) == 1\n assert caplog.records[0].levelno == logging.ERROR\n\n assert \"An error occurred in function_that_raises: \" in caplog.records[0].message\n assert \"ValueError: This is a test error.\" in caplog.records[0].message\n\n", + "exact_match": false, + "code_bleu": 0.16590387014219712, + "edit_similarity": 0.18823529411764706, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "2", + "got": "1", + "got_raw": "1\n assert trace.observations[0].name == \"parent\"\n assert trace.observations[0].type == \"chat\"\n assert trace.observations[0].input is None\n assert trace.observations[0].output is None\n\n assert trace.observations[0].metadata is None\n assert trace.observations[0].model is None\n assert trace.observations[0].model_parameters is None\n assert trace.observations[0].usage_details is None\n assert trace.observations[0].cost_details is None\n assert trace.observations[0].prompt is None\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "\"file\"", + "got": "\"file\"", + "got_raw": " \"file\"\n assert media._content_bytes == SAMPLE_JPEG_BYTES\n assert media._content_type == \"image/jpeg\"\n\ndef test_base64_data_uri_handling():\n media = LangfuseMedia(base64_data_uri=SAMPLE_BASE64_DATA_URI, content_type=\"image/jpeg\")\n\n assert media._source == \"base64_data_uri\"\n assert media._content_bytes == SAMPLE_JPEG_BYTES\n assert media._content_type == \"image/jpeg\"\n\ndef test_base64_data_uri_with_no_content_type():\n media = LangfuseMedia(base64_data_uri=SAMPLE_BASE64_DATA_URI)\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "30", + "got": "20", + "got_raw": "20\n assert langfuse_logger.handlers[0].level == 20\n assert langfuse_logger.handlers[0].formatter._fmt == \"%(asctime)s - %(name)s - %(levelname)s - %(message)s\"\n assert langfuse_logger.handlers[0].formatter._fmt == \"%(asctime)s - %(name)s - %(levelname)s - %(message)s\"\n assert langfuse_logger.handlers[0].formatter._fmt == \"%(asctime)s - %(name)s - %(levelname)s - %(message)s\"\n assert langfuse_logger.handlers[0].formatter._fmt == \"%(asctime)s - %(name", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "\"v2\"", + "got": "ttributes[\"k1\"] == \"v1\"", + "got_raw": "<|fim_suffix|>ttributes[\"k1\"] == \"v1\"\n\n assert attributes[\"k2\"] == \"v2\"\n\n assert attributes[\"k3\"] == \"v3\"\n\n def test_multiple_metadata_keys_independent_with_baggage(self, langfuse_client, memory_exporter):\n \"\"\"Verify multiple metadata keys are stored as independent attributes with baggage.\"\"\"\n with langfuse_client.start_as_current_observation(name=\"parent-span\"):\n with propagate_attributes(\n metadata={\"k1\": \"v1\", \"k2\": \"v2\", \"k3\": \"v3\"}, as_baggage=True\n ):\n child = lang", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "'\"2023-01-01T12:00:00Z\"'", + "got": "1672531200000000000", + "got_raw": "1672531200000000000\n\ndef test_datetime_with_timezone():\n dt = datetime(2023, 1, 1, 12, 0, 0, tzinfo=timezone.utc)\n serializer = EventSerializer()\n\n assert serializer.encode(dt) == 1672531200000000000\n\ndef test_datetime_without_timezone():\n dt = datetime(2023, 1, 1, 12, 0, 0)\n serializer = Event", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.32558139534883723, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "data", + "got": "{", + "got_raw": " {\n \"a\": 1,\n \"b\": \"two\",\n }\n\ndef test_list():\n data = [1, 2, 3]\n serializer = EventSerializer()\n\n\n assert json.loads(serializer.encode(data)) == [\n 1,\n 2,\n 3,\n ]\n\ndef test_tuple():\n data = (1, 2, 3)\n serializer = EventSerializer()\n\n\n assert json.loads(serializer.encode(data)) == [\n 1,\n 2,\n 3,\n ]\n\ndef test_set():\n data = {1, 2, 3}\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "0", + "got": "0", + "got_raw": "0\n assert len(generationList) == 1\n assert generationList[0].input == \"return the exact phrase - This is a test!\"\n assert generationList[0].output == \"This is a test!\"\n assert generationList[0].metadata == {\"model\": model_name}\n assert generationList[0].tags == tags\n assert generationList[0].status_message == \"Completed\"\n assert generationList[0].level == \"INFO\"\n assert generationList[0].model == model_name\n assert generationList[0].model_parameters == {\"max_tokens\": 30", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "1", + "got": "1", + "got_raw": "1\n assert compiled_messages[2][\"tool_calls\"][0][\"id\"] == \"call_123\"\n assert compiled_messages[2][\"tool_calls\"][0][\"type\"] == \"function\"\n assert compiled_messages[2][\"tool_calls\"][0][\"function\"][\"name\"] == \"get_weather\"\n assert compiled_messages[2][\"tool_calls\"][0][\"function\"][\"arguments\"] == '{\"location\": \"San Francisco\"}'\n\n # Tool message\n assert compiled_messages[3][\"role\"] == \"tool\"\n assert compiled_messages[3][\"content\"] == \"It's sunny, 72\u00b0F\"\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "httpx.HTTPStatusError)", + "got": "Empty):", + "got_raw": "Empty):\n manager.process_next_media_upload()\n\n assert httpx_client.put.call_count == 3\n\ndef test_media_upload_gives_up_on_retryable_http_status():\n media_api = Mock()\n media_api.get_upload_url.return_value = SimpleNamespace(\n upload_url=\"https://example.com/upload\",\n media_id=\"media-id\",\n )\n media_api.patch.return_value = None\n\n httpx_client = Mock()\n httpx_client.put.return_value = _upload_response(429, \"too many requests\")\n\n manager = MediaManager(\n api_client=SimpleNamespace(media=media_api),\n httpx", + "exact_match": false, + "code_bleu": 0.3388507513536918, + "edit_similarity": 0.13793103448275862, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "\"v1\"", + "got": "\"v1\"", + "got_raw": " \"v1\"\n assert attributes[f\"{LangfuseOtelSpanAttributes.TRACE_METADATA}.k2\"] == \"v2\"\n assert attributes[f\"{LangfuseOtelSpanAttributes.TRACE_METADATA}.k3\"] == \"v3\"\n\n def test_multiple_metadata_keys_independent_with_baggage(self, langfuse_client, memory_exporter):\n \"\"\"Verify multiple metadata keys are stored as independent attributes.\"\"\"\n with langfuse_client.start_as_current_observation(name=\"parent-span\"):\n with propagate_attributes(metadata={\"k1\": \"v1\", \"k2\": \"v2\", \"k3\": \"v3", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "'{\"foo\": \"John\", \"bar\": \"2021-01-01T00:00:00Z\"}'", + "got": "'{\"foo\": \"John\", \"bar\": \"2021-01-01T00:00:00+00:00\"}'", + "got_raw": " '{\"foo\": \"John\", \"bar\": \"2021-01-01T00:00:00+00:00\"}'\n\ndef test_json_decoder_with_langchain_serializer():\n with patch.dict(\"sys.modules\", {\"langchain.load.serializable\": None}):\n model = TestModel(\n foo=\"John\", bar=datetime(2021, 1, 1, 0, 0, 0, tzinfo=timezone.utc)\n )\n result = json.dumps(model, cls=EventSerializer)\n\n assert result == '{\"foo\": \"John", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.9306930693069307, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "4", + "got": "3", + "got_raw": "3\n assert messages[0][\"role\"] == \"system\"\n assert messages[0][\"content\"] == \"You are a helpful assistant\"\n assert messages[1][\"role\"] == \"placeholder\"\n assert messages[1][\"name\"] == \"history\"\n assert messages[2][\"role\"] == \"user\"\n assert messages[2][\"content\"] == \"Help me with coding\"\n\n assert completion.choices[0].message.role == \"assistant\"\n assert completion.choices[0].message.content == \"Example response\"\n\n # Test that the prompt is cached\n prompt_client = langfuse.get_prompt(prompt_name,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "1", + "got": "1", + "got_raw": "1\n assert result.run_evaluations[0].name == \"average_length\"\n assert result.run_evaluations[0].value == 10.0\n\n # Validate item results\n for item_result in result.item_results:\n assert item_result.input == item_result.item[\"input\"]\n assert item_result.output == item_result.item[\"expected_output\"]\n assert item_result.evaluations[0].name == \"length_check\"\n assert item_result.evaluations[0].value == len(item_result.output)\n assert item_result.evaluations[0].comment == f\"Output contains {len(item_result.output", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "\"test\"", + "got": "tance(span, LangfuseSpan)", + "got_raw": "<|fim_suffix|>tance(span, LangfuseSpan)\n assert span._otel_span is not None\n assert span._otel_span.is_recording()\n\n # Verify that the span is not recording after ending\n span.end()\n assert not span._otel_span.is_recording()\n\n def test_start_as_current_observation_with_baggage(self, langfuse_client):\n \"\"\"Verify that start_as_current_observation propagates baggage correctly.\"\"\"\n from opentelemetry import baggage\n from opentelemetry import context as otel_context\n\n with langfuse_client.start_as_current_observation(name=\"parent\"):\n with propagate_attributes(\n user", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.1935483870967742, + "n_retrieved": 10 + }, + { + "repo": "langfuse/langfuse-python", + "expected": "3", + "got": "3", + "got_raw": "3\n assert dataset.items[0].input == input\n assert dataset.items[0].expected_output == \"Output\"\n assert dataset.items[0].metadata == {\"key\": \"value\"}\n assert dataset.items[0].source_observation_id == generation.id\n assert dataset.items[0].source_trace_id == generation.trace_id\n assert dataset.items[1].input == input\n assert dataset.items[2].input == \"Hello\"\n\n langfuse.delete_dataset(name=name)\n\ndef test_create_dataset_item_with_metadata():\n langfuse = Langfuse(debug=False)\n name = create_uuid()\n langfuse", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lanpa/tensorboardX", + "expected": "True", + "got": "1", + "got_raw": "1\n assert writer.get_figure(\"add_figure/figure\") is figure\n\n writer.close()\n\n def test_figure_with_boxes(self):\n writer = SummaryWriter()\n\n figure, axes = plt.figure(), plt.gca()\n circle1 = plt.Circle((0.2, 0.5), 0.2, color='r')\n circle2 = plt.Circle((0.8, 0.5), 0.2, color='g')\n axes.add_patch(circle1)\n axes.add_patch(circle2)\n plt.axis('scaled')\n plt.tight_layout()\n\n writer.add_figure_with_boxes(\"add", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lanpa/tensorboardX", + "expected": "b)", + "got": "b)", + "got_raw": " b)\n\n def test_float_1_converts_to_uint8_255(self):\n green_uint8 = np.array([[[0, 255, 0]]], dtype='uint8') \n green_float32 = np.array([[[0, 1, 0]]], dtype='float32') \n\n a = summary.image(tensor=green_uint8, tag='')\n b = summary.image(tensor=green_float32, tag='')\n\n self.assertEqual(a, b)\n\n def test_float_1_converts_to_uint8_255(self):\n green_uint8", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lanpa/tensorboardX", + "expected": "removeWhiteChar(expected)", + "got": "removeWhiteChar(expected)", + "got_raw": " removeWhiteChar(expected)\n\ndef compare_proto_list(str_to_compare, function_ptr):\n module_id = function_ptr.__class__.__module__\n functionName = function_ptr.id().split('.')[-1]\n test_file = os.path.realpath(sys.modules[module_id].__file__)\n expected_file = os.path.join(os.path.dirname(test_file),\n \"expect\",\n module_id.split('.')[-1] + '.' + functionName + \".expect\")\n print(\"expected_file: %s\" % expected_file)\n assert os.path.exists(expected_file)\n with open(expected_file) as f:\n expected = f.read()\n\n if isinstance(str", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lanpa/tensorboardX", + "expected": "c.getcolors())", + "got": "c.getcolors())", + "got_raw": " c.getcolors())\n\n def test_image(self):\n # test image\n image = np.random.rand(3, 100, 100)\n image = image.astype(np.uint8)\n summary.add_image('test_image', image, 0)\n summary.add_image('test_image', image, 0, dataformats='HWC')\n summary.add_image('test_image', image, 0, dataformats='CHW')\n summary.add_image('test_image', image, 0, dataformats='NCHW')\n summary.add_image('test_image', image, 0, data", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lanpa/tensorboardX", + "expected": "bytes_to_write)", + "got": "bytes_to_write)", + "got_raw": " bytes_to_write)\n\n def test_async_writer_write_multiple(self):\n foldername = os.path.join(self.get_temp_dir(), \"async_writer_write_multiple\")\n w = _AsyncWriter(foldername)\n filename = w._ev_writer._file_name\n bytes_to_write = b\"hello world\"\n w.add_event(bytes_to_write)\n w.add_event(bytes_to_write)\n w.close()\n with open(filename, 'rb') as f:\n\n self.assertEqual(f.read(), 2 * bytes_to_write)\n\n def test_async_writer_write_multiple_with_flush(self):\n foldername = os.path.join(self.get_temp_dir", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n x = MyTransformer().transform( Tree('hello', []))\n self.assertEqual(x, 'hello')\n\n def test_vargs_args(self):\n @v_args()\n class MyTransformer(Transformer):\n @staticmethod\n def integer(args):\n return 1 # some code here\n\n @classmethod\n def integer2(cls, args):\n return 2 # some code here\n\n hello = staticmethod(lambda args: 'hello')\n\n x = MyTransformer().transform( Tree('integer', [2]))\n self.assertEqual(x, 1)\n x = MyTransformer().transform( Tree('integer", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "3", + "got": "2", + "got_raw": "2\n return data[0]\n\n def full(self, data):\n visited_full[0] = True\n\n assert len(data) == 2\n return data[0]\n\n def __default__(self, name, data):\n return Discard\n\ngrammar = \"\"\"\n start: ambiguous\n | full\n\n ambiguous: \"a\" \"b\"\n | \"ab\"\n\n full: \"a\" \"b\"\n | \"ab\"\n\"\"\"\n\nparser = Lark(grammar, start='start', ambiguity='forest')\ntree = parser.parse('ab')\n\nvisited_ambiguous = [False]\nvisited_full = [", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "cb", + "got": "cb", + "got_raw": " cb\n\ndef _test_tree_structure_check():\n grammar = \"\"\"\n start: a b\n a: \"a\"\n b: \"b\"\n \"\"\"\n\n l = Lark(grammar, ambiguity='resolve', lexer=LEXER)\n tree = l.parse(\"ab\")\n _tree_structure_check(tree, Tree('start', [Tree('a', ['a']), Tree('b', ['b'])]))\n\n l = Lark(grammar, ambiguity='explicit', lexer=LEXER)\n tree = l.parse(\"ab\")\n _tree_structure_check(tree, Tree('start', [Tree('a', ['a']), Tree", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "code)", + "got": "code, start='start')", + "got_raw": " code, start='start')\n\n def test_starred_rule2(self):\n g = \"\"\"\n start: item*\n item: NL\n | rule\n rule: WORD \":\" NUMBER\n NL: /(\\\\r?\\\\n)+\\\\s*/\n \"\"\" + common\n\n code = \"\"\"\n Elephants: 12\n \"\"\"\n\n\n self.assert_reconstruct(g, code, start='start')\n\n def test_starred_rule3(self):\n g = \"\"\"\n start: item*\n item: NL\n | rule\n rule: WORD \":\" NUMBER\n NL: /(\\\\r?", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "template.tree)", + "got": "template)", + "got_raw": " template)\n\n def test_conf_call__different_tree(self):\n conf = TemplateConf(self.parser.parse)\n explicitly_parsed = self.parser.parse(SOME_BAR_TEMPLATE)\n\n non_templates = {\n \"to be parsed\": SOME_BAR_TEMPLATE,\n \"already parsed\": explicitly_parsed,\n }\n for description, test_case in non_templates.items():\n with self.subTest(msg=description):\n template = conf(test_case)\n\n self.assertNotEqual(explicitly_parsed, template)\n\n def test_conf_call__different_tree__same_template(self):\n conf = TemplateConf(self.parser.parse)\n explicitly_parsed = self.parser.parse(SOME", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.782608695652174, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "terminal)", + "got": "terminal)", + "got_raw": " terminal)\n\n def test_number(self):\n for number in valid_number:\n self._test_parsed_is_this_terminal(number, \"NUMBER\", \"number\")\n\n for number in invalid_number:\n with self.assertRaises(UnexpectedCharacters):\n self._test_parsed_is_this_terminal(number, \"NUMBER\", \"number\")\n\n def test_file_input(self):\n for number in valid_number:\n self._test_parsed_is_this_terminal(number, \"NUMBER\", \"file_input\")\n\n for number in invalid_number:\n with self.assertRaises(UnexpectedCharacters):\n self._test_parsed_is_this_terminal(number, \"NUMBER\", \"file_input\")\n\n def test", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "ip.parser_state)", + "got": "0)", + "got_raw": "0)\n self.assertEqual(ip_copy.lexer_state, 0)\n\n self.assertEqual(ip_copy.parser_state, ip.parser_state)\n self.assertEqual(ip_copy.lexer_state, ip.lexer_state)\n\n self.assertEqual(ip_copy.parser_state, 0)\n self.assertEqual(ip_copy.lexer_state, 0)\n\n self.assertEqual(ip_copy.parser_state, ip.parser_state)\n self.assertEqual(ip_copy.lexer_state, ip.lexer_state)\n\n self.assertEqual(ip_copy.parser_state, 0)\n self.assertEqual(ip_copy.lexer_state, 0)\n\n self.assertEqual(ip_copy.parser_state, ip.parser_state)\n self.assertEqual(ip", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "1", + "got": "1", + "got_raw": "1\n\n assert match_error(\"cbc\") == 2\n\n assert match_error(\"dbc\") == 2\n\n assert match_error(\"abc\") == 2\n\n assert match_error(\"abcd\") == 2\n\n assert match_error(\"abcde\") == 2\n\n assert match_error(\"abcde f\") == 2\n\n assert match_error(\"abcde f g\") == 2\n\n assert match_error(\"abcde f g h\") == 2\n\n assert match_error(\"abcde f g h i\") == 2\n\n assert match_error(\"abcde f g h i j", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "(UnexpectedCharacters, UnexpectedToken))", + "got": "UnexpectedCharacters) as e:", + "got_raw": "UnexpectedCharacters) as e:\n self.python_parser.parse(case)\n\n self.assertEqual(e.exception.expected, [\"NUMBER\"])\n\n def test_valid_number(self):\n for case in valid_number:\n self._test_parsed_is_this_terminal(case, \"NUMBER\", \"number\")\n\n def test_valid_match_statements(self):\n for case in valid_match_statements:\n self.python_parser.parse(case, start=\"file_input\")\n\n def test_invalid_match_statements(self):\n for case in invalid_match_statements:\n with self.assertRaises(UnexpectedCharacters) as e:\n self.python_parser.parse(case, start=\"file_input\")\n\n self.assertEqual(e", + "exact_match": false, + "code_bleu": 0.251781283113064, + "edit_similarity": 0.6268656716417911, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "[3, 4, 6]", + "got": "[3, 5, 7]", + "got_raw": " [3, 5, 7]\n\n text = \"\"\"\n a: rule\n b rule\n | ok\n c: rule\n B.: \"hello\" f\n D: \"okay\"\n | \"hello\"\n \"\"\"\n\n assert [e.line for e, _s in find_grammar_errors(text)] == [3, 5, 7, 9]\n\n text = \"\"\"\n a: rule\n b rule\n | ok\n c: rule\n B.: \"hello\" f\n D: \"okay\"\n | \"hello\"\n | \"world\"\n", + "exact_match": false, + "code_bleu": 0.38260294162784475, + "edit_similarity": 0.7777777777777778, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "Tree('start', []))", + "got": "Tree('start', [Tree('_NEWLINE', [])]))", + "got_raw": " Tree('start', [Tree('_NEWLINE', [])]))\n\n def test_postlex_2(self):\n from lark.indenter import Indenter\n class MyIndenter(Indenter):\n NL_type = '_NEWLINE'\n OPEN_PAREN_types = ['LPAR', 'LSQB', 'LBRACE']\n CLOSE_PAREN_types = ['RPAR', 'RSQB', 'RBRACE']\n INDENT_type = '_INDENT'\n DEDENT_type = '_DEDENT'\n tab_len = 8\n\n grammar = r\"\"\"\n start: \"(\" \")\" _NEWLINE\n ", + "exact_match": false, + "code_bleu": 0.46350238641438496, + "edit_similarity": 0.6428571428571429, + "n_retrieved": 10 + }, + { + "repo": "lark-parser/lark", + "expected": "UnexpectedInput)", + "got": "UnexpectedInput, ConfigurationError)) as e:", + "got_raw": "UnexpectedInput, ConfigurationError)) as e:\n parser1.parse(text)\n assert str(e.exception) == \"UnexpectedCharacters: Expected one of '1', '1+', '1 1+', '1 1+1', '1+1', '1+1+', '1+1 1+', '1+1 1+1', '1+1 1+1+', '1+1 1+1 1+', '1+1 1+1 1+1', '1+1 1+1 1+1+', '1+1 1+1 ", + "exact_match": false, + "code_bleu": 0.17747405280050269, + "edit_similarity": 0.5423728813559322, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "\"\"", + "got": "", + "got_raw": " # type: ignore\n assert headers.get(\"bar\") == # type: ignore\n assert headers.get(\"bar\", \"default\") == # type: ignore\n assert headers.get(\"bar\", \"default\") == # type: ignore\n assert headers.get(\"bar\", \"default\") == # type: ignore\n assert headers.get(\"bar\", \"default\") == # type: ignore\n assert headers.get(\"bar\", \"default\") == # type: ignore\n assert headers.get(\"bar\", \"default\") == # type: ignore\n assert headers.get(\"bar\",", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "data", + "got": "", + "got_raw": " # type: ignore\n assert data == f\"msg_{i}\".encode()\n\n async def test_coalesce_recv_then_send(\n self,\n session: AsyncSession[Response],\n configurable_ws_server: ConfigurableWSServer,\n ws_config: Callable[..., None],\n ) -> None:\n \"\"\"Test coalesce mode with recv-then-send pattern.\"\"\"\n ws_config(behavior=ServerBehavior.ECHO)\n async with session.ws_connect(\n configurable_ws_server.url,\n coalesce_frames=True,\n ) as ws:\n # Receive one at a time and send\n for i in range(5):\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "1", + "got": "1", + "got_raw": "1\n assert headers[\"Foo\"][0] == \"bar\"\n\n\ndef test_repeated_headers_after_error2(server):\n c = Curl()\n url = str(server.url.copy_with(path=\"/slow_response\"))\n c.setopt(CurlOpt.URL, url.encode())\n c.setopt(CurlOpt.TIMEOUT_MS, 100)\n c.setopt(CurlOpt.HTTPHEADER, [b\"Foo: bar\"])\n with pytest.raises(CurlError, match=r\"curl: \\(28\\)\"):\n c.perform()\n\n # another request\n url = str(server.url.copy_with(path=\"/echo_headers\"))\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "akamai", + "got": "126", + "got_raw": "126\n assert r[\"akamai_hash\"] == \"0000000000000000000000000000000000000000000000000000000000000000\"\n\n\n@pytest.mark.skip(reason=\"website is down\")\ndef test_customized_akamai_chrome126():\n url = \"https://tls.browserleaks.com/json\"\n akamai = \"1:65536", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "(\"bar\", \"baz\")", + "got": "(\"bar\", \"baz\")", + "got_raw": " (\"bar\", \"baz\")\n\ndef test_cookies_conflict_on_path():\n c = Cookies()\n c.set(\"foo\", \"bar\", path=\"/\")\n c.set(\"foo\", \"baz\", path=\"/a\")\n\n assert c.get(\"foo\") in (\"bar\", \"baz\")\n\ndef test_cookies_conflict_on_domain():\n c = Cookies()\n c.set(\"foo\", \"bar\", domain=\"example.com\")\n c.set(\"foo\", \"baz\", domain=\"a.example.com\")\n\n assert c.get(\"foo\") in (\"bar\", \"baz\")\n\ndef test_cookies_conflict_on_secure():\n c = Cookies", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "\"baz\"", + "got": "", + "got_raw": " # noqa: B008\n assert headers[\"Foo\"][1] == \"baz\"\n\n # https://github.com/lexiforest/curl_cffi/issues/17\n c.setopt(CurlOpt.HTTPHEADER, [b\"Foo: bar\"])\n buffer = BytesIO()\n c.setopt(CurlOpt.WRITEDATA, buffer)\n c.perform()\n headers = json.loads(buffer.getvalue().decode())\n assert headers[\"Foo\"][0] == \"bar\"\n\n # https://github.com/lexiforest/curl_cffi/issues/18\n c.setopt(CurlOpt", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "b\"\"", + "got": "0", + "got_raw": "0\n\n async def test_close(self, ws_connection: AsyncWebSocket) -> None:\n \"\"\"Test closing the connection.\"\"\"\n await ws_connection.close()\n with pytest.raises(WebSocketClosed):\n await ws_connection.recv()\n\n async def test_close_with_reason(self, ws_connection: AsyncWebSocket) -> None:\n \"\"\"Test closing the connection with a reason.\"\"\"\n await ws_connection.close(WsCloseCode.NORMAL, \"Test reason\")\n with pytest.raises(WebSocketClosed):\n await ws_connection.recv()\n\n async def test_close_with_no_reason(self, ws_connection: AsyncWebSocket) -> None:\n \"\"\"Test closing the connection with", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "\"example.com\\tFALSE\\t/\\tTRUE\\t0\\tfoo\\tbar\"", + "got": "\"example.com\\tFALSE\\t/\\tTRUE\\t0\\tfoo\\tbar\"", + "got_raw": " \"example.com\\tFALSE\\t/\\tTRUE\\t0\\tfoo\\tbar\"\n m = CurlMorsel(name=\"foo\", value=\"bar\", hostname=\"example.com\", secure=True, expires=1234567890)\n assert m.to_curl_format() == \"example.com\\tFALSE\\t/\\tTRUE\\t1234567890\\tfoo\\tbar\"\n m = CurlMorsel(name=\"foo\", value=\"bar\", hostname=\"example.com\", secure=True, expires=1234567890, subdomains=True)\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "20", + "got": "20", + "got_raw": "20\n assert chunks[0] == \"Status: 200\"\n assert chunks[1] == \"CHUNK b'{\"url\": \"https://httpbin.org/stream/20\",...\"\n\nasync def test_stream_atext_with_headers(server):\n async with AsyncSession() as s:\n url = str(server.url.copy_with(path=\"/stream\"))\n async with s.stream(\"GET\", url, params={\"n\": \"20\"}, headers={\"X-Test\": \"123\"}) as r:\n text = await r.atext()\n chunks = text.split(\"\\n\")\n\n assert len(ch", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "False", + "got": "0", + "got_raw": "0\n assert curl_cffi.is_pro() is 1\n\n assert curl_cffi.is_pro() is 0\n assert curl_cffi.is_pro() is 1\n\n assert curl_cffi.is_pro() is 0\n assert curl_cffi.is_pro() is 1\n\n assert curl_cffi.is_pro() is 0\n assert curl_cffi.is_pro() is 1\n\n assert curl_cffi.is_pro() is 0\n assert curl_cffi.is_pro() is 1\n\n assert curl_cffi.is_pro() is 0\n assert curl_cffi.is", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lexiforest/curl_cffi", + "expected": "CurlHttpVersion.V1_1", + "got": "1.1", + "got_raw": "1.1\n assert headers[\"User-Agent\"] == \"curl_cffi/0.11.2\"\n assert headers[\"Accept\"] == \"*/*\"\n assert headers[\"Accept-Encoding\"] == \"gzip, deflate, br, z\n\n\ndef test_curl_options2():\n url = \"https://postman-echo.com/headers\"\n r = requests.get(url, impersonate=\"chrome110\", default_headers=False)\n headers = r.json()\n print(headers)\n assert r.http_version == CurlHttpVersion.V2_0\n r = requests.get(\n url,\n curl_options={", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.17391304347826086, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "1", + "got": "99", + "got_raw": "99\n assert summary_cb._weights_summary == \"top\"\n\n # If \"weights_summary\" is not specified, the default is used.\n summary_cb = callbacks.create_summary_callback(\n summary_callback_config=OmegaConf.create({\"max_depth\": 99}),\n trainer_config=OmegaConf.create({}),\n )\n\n assert summary_cb._max_depth == 99\n assert summary_cb._weights_summary == \"full\"\n\n # If \"weights_summary\" is not specified, the default is used.\n summary_cb = callbacks.create_summary_callback(\n summary_callback_config=OmegaConf.create({}),\n trainer_config=", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "model)", + "got": "", + "got_raw": "\n\n\n# File: docs/source/getting_started/benchmarks/imagenette_benchmark.py\n # resolution crops\n multi_crops, _, _ = batch\n multi_crop_features = [self.forward(x) for x in multi_crops]\n\n # split list of crop features into high and low resolution\n high_resolution_features = multi_crop_features[:2]\n low_resolution_features = multi_crop_features[2:]\n\n # calculate the SwaV loss\n loss = self.criterion(high_resolution_features, low_resolution_features)\n\n self.log(\"train_loss_ssl\", loss)\n return loss\n\n def configure_optim", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "5", + "got": "5", + "got_raw": "5\n\n def test_request__timeout_custom(self, mocker: MockerFixture) -> None:\n client = LightlySwaggerRESTClientObject(\n configuration=Configuration(), timeout=5\n )\n response = mocker.MagicMock()\n response.status = 200\n client.pool_manager.request = mocker.MagicMock(return_value=response)\n\n # use custom timeout\n client.request(method=\"GET\", url=\"some-url\", timeout=10)\n\n calls = client.pool_manager.request.mock_calls\n _, _, kwargs = calls[0]\n assert isinstance(kwargs[\"timeout\"], Timeout)\n\n assert kwargs[\"timeout\"].total", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "1", + "got": "1", + "got_raw": "1\n assert call[1][\"dnc_cursor\"] == \"divide_and_conquer_cursor1\"\n\n def test__get_divide_and_conquer_list_cursors__without_retry(\n self, mocker: MockerFixture\n ) -> None:\n \"\"\"Test _get_divide_and_conquer_list_cursors without retry functionality.\"\"\"\n client = ApiWorkflowClient(token=\"abc\", dataset_id=\"dataset-id\")\n dnc_function = mocker.MagicMock()\n dnc_response = DivideAndConquerCursorData(\n cursors=[\"divide_and_conquer_cursor1\"]\n )\n\n dnc_function.return_value = dnc", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "5", + "got": "5", + "got_raw": "5\n assert client.get_processed_until_timestamp() == 5\n\n @pytest.mark.parametrize(\"with_retry\", [True, False])\n def test_get_raw_samples(\n self, mocker: MockerFixture, with_retry: bool\n ) -> None:\n response = DatasourceRawSamplesData(\n data=[\n DatasourceRawSamplesDataRow(\n filename=\"filename-1.jpg\",\n label=0,\n label_confidence=0.9,\n label_confidence_2=0.8,\n label_confidence_3=0.7,\n label_confidence_4=0.", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "torch.int", + "got": "", + "got_raw": " # type: ignore[no-untyped-call]\n torch.int32\n\n def test__features_device(self) -> None:\n model = nn.Identity()\n # Set feature_device to \"cuda\" to test if classifier correctly changes device.\n classifier = KNNClassifier(\n model, num_classes=10, knn_k=3, knn_t=0.1, feature_device=\"cuda\"\n )\n trainer = Trainer(max_epochs=1, accelerator=\"cpu\", devices=1)\n train_features = torch.randn(4, 3)\n train_targets = torch.randint(0, 10", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "\"LOCAL\"", + "got": "0", + "got_raw": "0\n assert datasource_config.web_server_location == \"http://localhost:1234\"\n assert datasource_config.relative_path == \"path/to/my/data\"\n assert datasource_config.thumbnail_suffix == \".lightly/thumbnails/[filename]-thumb-[extension]\"\n assert datasource_config.purpose == 0\n\n def test_set_s3_config(self, mocker: MockerFixture) -> None:\n client = ApiWorkflowClient(token=\"abc\", dataset_id=\"dataset-id\")\n mocker.patch.object(\n client._datasources_api,\n \"update_datasource_by_dataset_id\",\n )\n client.set_s3_config(\n bucket_name", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "(3, 32, 32)", + "got": "s = torch.rand(1, 3, 32, 32)", + "got_raw": "<|fim_suffix|>s = torch.rand(1, 3, 32, 32)\n output = helpers.assert_list_tensor(transforms(sample))\n assert len(output) == 2\n assert output[0].shape == (1, 3, 32, 32)\n assert output[1].shape == (1, 3, 32, 32)\n\n assert output[0].shape == output[1].shape\n\n # Test that the transforms are applied correctly\n assert torch.allclose(output[0], output[1])\n\n # Test that the transforms are applied", + "exact_match": false, + "code_bleu": 0.41374412020518814, + "edit_similarity": 0.5641025641025641, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "low + high)", + "got": "2 * high * low)", + "got_raw": "2 * high * low)\n self.assertEqual(len(labels), 2 * high * low)\n self.assertEqual(len(fnames), 2 * high * low)\n\n def test_image_collate(self):\n batch = self.create_batch()\n image_collate = ImageCollateFunction()\n samples, labels, fnames = image_collate(batch)\n self.assertIsNotNone(image_collate)\n\n self.assertEqual(len(samples), 16)\n self.assertEqual(len(labels), 16)\n self.assertEqual(len(fnames), 16)\n\n def test_simclr_collate(self):\n batch = self.create_batch()\n sim", + "exact_match": false, + "code_bleu": 0.2626909894424158, + "edit_similarity": 0.5384615384615384, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "(10, 10)", + "got": "(10, 2)", + "got_raw": " (10, 2)\n assert pca.mean.shape == (10,)\n\n # Ensure transform method returns the correct shape\n assert pca.transform(X).shape == (100, 2)\n\ndef test_pca_fit_transform() -> None:\n # Create dummy data: 100 samples, 10 features\n X = np.random.randn(100, 10).astype(np.float32)\n\n # Initialize and fit PCA with 2 components\n pca = PCA(n_components=2)\n pca.fit(X)\n\n # Ensure mean and eigenvectors were set\n", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "0", + "got": "0", + "got_raw": "0\n\n def test_get_compute_worker_run(self):\n run = self.api_workflow_client.get_compute_worker_run(\n run_id=1\n )\n\n assert run is not None\n\n def test_get_compute_worker_run_with_invalid_id(self):\n with pytest.raises(ApiException) as excinfo:\n self.api_workflow_client.get_compute_worker_run(\n run_id=10000000000000000000000000000000000000000000000000000", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "2", + "got": "4", + "got_raw": "4\n assert output[0].shape == (3, 32, 32)\n assert output[1].shape == (3, 32, 32)\n assert output[2].shape == (3, 32, 32)\n assert output[3].shape == (3, 32, 32)\n\n\nfrom PIL import Image\n\nfrom lightly.transforms.byol_transform import (\n BYOLTransform,\n BYOLView1Transform,\n BYOLView2Transform,\n)\n\nfrom .. import helpers\n\ndef test_multi_view_on_pil_image() -> None:\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "x0.T.tolist()", + "got": "0.9999999999999999", + "got_raw": "0.9999999999999999\n assert bank1[:, 3:].tolist() == 0.9999999999999999\n assert bank0[:, :3].tolist() == 0.9999999999999999\n assert bank0[:, 3:].tolist() == 0.9999999999999999\n\n def test_forward__dim_last(self) -> None:\n torch.manual_seed", + "exact_match": false, + "code_bleu": 0.07142857142857142, + "edit_similarity": 0.12903225806451613, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "0", + "got": "0", + "got_raw": "0\n\n @pytest.mark.parametrize(\"bsz\", range(1, 20))\n def test_forward_pass_no_memory_bank(self, bsz: int) -> None:\n reg = CO2Regularizer(memory_bank_size=(4096, 32))\n batch_1 = torch.randn((bsz, 32))\n batch_2 = torch.randn((bsz, 32))\n\n l1 = reg(batch_1, batch_2)\n\n assert l1 == 0\n\n @pytest.mark.parametrize(\"bsz\", range(1, 20))\n def test", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "\"lorem\"", + "got": "\"lorem\"", + "got_raw": " \"lorem\"\n assert _snake_to_camel_case(\"lorem_ipsum\") == \"loremIpsum\"\n assert _snake_to_camel_case(\"lorem_ipsum_dolor\") == \"loremIpsumDolor\"\n assert _snake_to_camel_case(\"lorem_ipsum_dolor_sit\") == \"loremIpsumDolorSit\"\n assert _snake_to_camel_case(\"lorem_ipsum_dolor_sit_amet\") == \"loremIpsumDolorSitAmet\"\n assert _snake_to_camel_case(\"lorem_ipsum_d", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "2", + "got": "2", + "got_raw": "2\n assert mock_download_and_write_file.call_args_list[0][0][0] == \"file1.jpg\"\n assert mock_download_and_write_file.call_args_list[0][0][1] == \"http://example.com/file1.jpg\"\n assert mock_download_and_write_file.call_args_list[1][0][0] == \"file2.jpg\"\n assert mock_download_and_write_file.call_args_list[1][0][1] == \"http://example.com/file2.jpg\"\n\n # Verify retry_fn was called for each file\n assert mock_retry_fn.call_count == 2\n assert mock_retry", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "2", + "got": "10", + "got_raw": "10\n assert len(params_no_weight_decay) == 0\n\n linear.weight.requires_grad = False\n linear.bias.requires_grad = False\n batch_norm1d.weight.requires_grad = False\n batch_norm1d.bias.requires_grad = False\n conv.weight.requires_grad = False\n conv.bias.requires_grad = False\n batch_norm2d.weight.requires_grad = False\n batch_norm2d.bias.requires_grad = False\n layer_norm.weight.requires_grad = False\n layer_norm.bias.requires_grad = False\n\n params, params_no_weight_decay = utils.get_weight_decay_parameters(\n modules=[sequential]\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "loaded)", + "got": "loaded)", + "got_raw": " loaded)\n\n def test_load_tasks(self) -> None:\n tasks = [\n \"task1\",\n \"task2\",\n \"task3\",\n ]\n with tempfile.NamedTemporaryFile(suffix=\".json\") as file:\n io.save_tasks(file.name, tasks)\n with open(file.name, \"r\") as f:\n loaded = json.load(f)\n\n self.assertListEqual(tasks, loaded)\n\n def test_save_embeddings(self) -> None:\n with tempfile.NamedTemporaryFile(suffix=\".csv\") as file:\n io.save_embeddings(file.name, self.embeddings_path)\n with open(file.name, \"r\")", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "\"/blub\")", + "got": "\"/blub\")", + "got_raw": " \"/blub\")\n\n def test_cli_crop(self):\n cli_string = \"lightly-crop input_dir=/blub label_dir=/blub output_dir=/blub crop_padding=0.2\"\n self.parse_cli_string(cli_string)\n\n lightly.cli.crop.main(self.cfg)\n\n self.assertEqual(\n self.api_workflow_client.get_filenames(),\n [\n \"img_0.jpg\",\n \"img_1.jpg\",\n \"img_2.jpg\",\n \"img_3.jpg\",\n \"img_4.jpg\",\n \"img_5.jpg\",\n \"img_6.jpg\",\n \"img_7.jpg\",\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightly-ai/lightly", + "expected": "eps)", + "got": ".assertTrue(", + "got_raw": ".assertTrue(\n debug.std_of_l2_normalized(z) < eps,\n msg=\"The standard deviation of a uniform distribution is 0.\",\n )\n\n def test_std_of_l2_normalized_gaussian(self, eps: float = 1e-5):\n z = torch.randn(BATCH_SIZE, DIMENSION)\n\n self.assertTrue(\n debug.std_of_l2_normalized(z) < eps,\n msg=\"The standard deviation of a gaussian distribution is 1.\",\n )\n\n def test_std_of_l2_normalized_gaussian_with_mean(self, eps: float = 1e-5):\n z = torch.randn(BATCH_SIZE", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "lightning-power-users/node-launcher", + "expected": "1", + "got": "1", + "got_raw": "1\n\n def test_set_default_configuration_with_list(self, configuration: Configuration):\n configuration.set_default_configuration('a', [1, 2, 3])\n\n assert configuration['a'] == [1, 2, 3]\n\n def test_set_default_configuration_with_list_of_dicts(self, configuration: Configuration):\n configuration.set_default_configuration('a', [{'b': 1}, {'b': 2}])\n\n assert configuration['a'] == [{'b': 1}, {'b': 2}]\n\n def test_set_default_configuration_with_list_of_dicts_with_different_keys(self, configuration: Configuration):\n configuration.set", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lightning-power-users/node-launcher", + "expected": "'test_edit_value'", + "got": "1", + "got_raw": "1\n\n def test_handle_delete_action(self,\n configuration_dialog: ConfigurationDialog):\n configuration_dialog.add_row(\n 'test_key',\n 'test_new_value',\n ''\n )\n\n configuration_dialog.table.item(0, 2).setText('test_edit_value')\n\n configuration_dialog.delete_popup = MagicMock()\n configuration_dialog.delete_popup.buttonClicked = MagicMock()\n\n configuration_dialog.handle_delete_action()\n\n configuration_dialog.delete_popup.buttonClicked.assert_called_with(QMessageBox.StandardButton.Yes)\n\n def test_handle_confirm_deletion(self,\n configuration_dialog: ConfigurationDialog):\n configuration_dialog.add_row(\n 'test_key',\n 'test_new_value", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightning-power-users/node-launcher", + "expected": "TARGET_BITCOIN_RELEASE.replace('v', '')", + "got": "181", + "got_raw": "181\n\n def test_download_name(self, bitcoind_software: BitcoindSoftware):\n\n assert bitcoind_software.download_name == 'bitcoin-181-win64'\n\n def test_download_url(self, bitcoind_software: BitcoindSoftware):\n\n assert bitcoind_software.download_url == 'https://bitcoincore.org/bin/bitcoin-core-181/win64/bitcoin-181-win64.zip'\n\n def test_software_name(self, bitcoind_software: BitcoindSoftware):\n\n assert bitcoind_software.software_name ==", + "exact_match": false, + "code_bleu": 0.0625, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightning-power-users/node-launcher", + "expected": "'2'", + "got": "2", + "got_raw": "2\n assert configuration_dialog.table.item(1, 1).text() == 'key2'\n assert configuration_dialog.table.item(1, 2).text() == 'value2'\n\n def test_update_value(self, configuration_dialog: ConfigurationDialog):\n configuration_dialog.node.configuration.configuration_changed.emit(\n None, ConfigurationProperty('1', 'key', 'value')\n )\n configuration_dialog.node.configuration.configuration_changed.emit(\n None, ConfigurationProperty('1', 'key2', 'value2')\n )\n\n assert configuration_dialog.table.rowCount() == 2\n\n assert configuration_dialog.table.item(0, 0", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "lightning-power-users/node-launcher", + "expected": "True", + "got": "1", + "got_raw": "1\n\n def test_setitem_getitem_int(self, configuration: Configuration):\n configuration['test_int'] = 1\n assert configuration['test_int'] == 1\n\n def test_setitem_getitem_str(self, configuration: Configuration):\n configuration['test_str'] = 'test'\n assert configuration['test_str'] == 'test'\n\n def test_setitem_getitem_list(self, configuration: Configuration):\n configuration['test_list'] = [1, 2, 3]\n assert configuration['test_list'] == [1, 2, 3]\n\n def test_setitem_getitem_dict(self", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lightning-power-users/node-launcher", + "expected": "'test rest'", + "got": "'test rest'", + "got_raw": " 'test rest'\n\n def test_joule_macaroons_action(self,\n reveal_patch: MagicMock,\n webbrowser_patch: MagicMock,\n menu: Menu,\n qtbot: QTest):\n menu.joule_macaroons_action.trigger()\n\n reveal_patch.assert_called_once_with('test macaroon')\n\n def test_tor_status_action(self,\n reveal_patch: MagicMock,\n webbrowser_patch: MagicMock,\n menu: Menu,\n qtbot: QTest):\n menu.tor_status_action.trigger()\n\n reveal_patch.assert_called_once_with('Tor: off')\n\n def test_bitcoind_status_action(self,\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "{ \"additionalProperties\": False, \"properties\": {\"token\": {\"title\": \"Bot token\", \"type\": \"string\"}}, \"required\": [\"token\"], \"type\": \"object\", }", + "got": "{", + "got_raw": " {\n \"type\": \"object\",\n \"properties\": {\n \"token\": {\"type\": \"string\", \"title\": \"Bot token\"}\n },\n \"additionalProperties\": False,\n \"required\": [\"token\"]\n }\n\n def test_telegram_updates(self, resource):\n\n assert resource.name == \"updates\"\n assert resource.resource_name == \"updates\"\n assert resource.provider == \"telegram\"\n assert resource.path_to_errors == (\"description\",)\n\n def test_telegram_updates_get_resource(self, resource):\n\n data = {\"token\": \"foo\"}\n assert resource._get_resource(data) == [{\n \"update", + "exact_match": false, + "code_bleu": 0.018581361171917516, + "edit_similarity": 0.013986013986013986, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "provider", + "got": "\"statuspage\"", + "got_raw": " \"statuspage\"\n assert resource.path_to_errors == (\"error\",)\n assert resource.site_url == \"https://statuspage.io\"\n\n def test_statuspage_components_get(self, resource):\n data = {\"api_key\": \"KEY\", \"page_id\": \"123ABC\"}\n response = resource.get(data)\n assert response.status_code == 200\n assert isinstance(response.json(), list)\n\n def test_statuspage_components_get_with_invalid_data(self, resource):\n data = {\"api_key\": \"KEY\", \"page_id\": \"123ABC\"}\n with pytest.raises(BadArguments):\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "[\"Unauthorized\"]", + "got": "assert e.value.errors == [\"application token is invalid\"]", + "got_raw": "<|fim_suffix|>\n assert e.value.errors == [\"application token is invalid\"]\n\n\nclass TestGitter:\n def test_gitter(self, resource):\n rsp = resource(token=\"foo\", message=\"bar\", room_id=1234)\n\n assert rsp.status == \"Success\"\n assert rsp.data == {\"id\": 1234, \"name\": \"foo\", \"type\": \"private\", \"url\": \"https://gitter.im/foo\"}\n\n def test_gitter_raise_on_errors(self, resource):\n rsp = resource(token=\"foo\", message=\"bar\", room_id=1234, raise_on", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.2465753424657534, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "BadArguments)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n provider.notify(**data)\n\n @pytest.mark.parametrize((\"data\", \"message\"), [({}, \"message\"), ({\"message\": \"foo\"}, \"to\")])\n def test_icloud_missing_required(self, data, message, provider):\n data[\"env_prefix\"] = \"test\"\n\n with pytest.raises(NotImplementedError):\n provider.notify(**data)\n\n @pytest.mark.parametrize((\"data\", \"message\"), [({}, \"message\"), ({\"message\": \"foo\"}, \"to\")])\n def test_icloud_missing_required(self, data, message, provider):\n data[\"env_prefix\"] = \"test", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.29411764705882354, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "{ \"additionalProperties\": False, \"properties\": { \"api_key\": {\"title\": \"OAuth2 token\", \"type\": \"string\"}, \"page_id\": {\"title\": \"Page ID\", \"type\": \"string\"}, }, \"required\": [\"api_key\", \"page_id\"], \"type\": \"object\", }", + "got": "{", + "got_raw": " {\n \"type\": \"object\",\n \"properties\": {\n \"api_key\": {\"type\": \"string\", \"title\": \"OAuth2 token\"},\n \"page_id\": {\"type\": \"string\", \"title\": \"Page ID\"},\n },\n \"additionalProperties\": False,\n }\n\n assert resource.required == [\"api_key\", \"page_id\"]\n\n assert resource.path_to_errors == (\"error\",)\n\n def test_statuspage_components_get(self, resource):\n\n data = {\n \"api_key\": os.getenv(\"NOTIFIERS_STATUSPAGE_API_KEY\"),\n \"page_id\": os.getenv(\"NOTIFIERS_STATUS", + "exact_match": false, + "code_bleu": 0.012651139521305543, + "edit_similarity": 0.009302325581395349, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "BadArguments)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n get_notifier(provider, **data)\n\n @pytest.mark.parametrize((\"data\", \"message\"), [({}, \"message\"), ({\"message\": \"foo\"}, \"token\")])\n def test_missing_required(self, data, message, provider):\n data[\"env_prefix\"] = \"test\"\n\n with pytest.raises(NotImplementedError):\n get_notifier(provider, **data)\n\n @pytest.mark.parametrize((\"data\", \"message\"), [({}, \"message\"), ({\"message\": \"foo\"}, \"token\")])\n def test_missing_required(self, data, message, provider):\n data[\"env_prefix\"] = \"test", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.29411764705882354, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "\"bla@foo.com\"", + "got": "\"bla@foo.com\"", + "got_raw": " \"bla@foo.com\"\n\n def test_email_from_key(self, provider):\n rsp = provider.notify(\n to=\"foo@foo.com\",\n from_=\"bla@foo.com\",\n message=\"foo\",\n host=\"goo\",\n username=\"ding\",\n password=\"dong\",\n )\n rsp_data = rsp.data\n assert not rsp_data.get(\"from_\")\n\n assert rsp_data[\"from\"] == \"bla@foo.com\"\n\n def test_email_from_key(self, provider):\n rsp = provider.notify(\n to=\"foo@foo.com\",\n from_=\"bla@foo.com\",\n message", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "404", + "got": "404", + "got_raw": "404\n assert e.value.provider == provider\n assert e.value.resource == self.resource\n assert e.value.data == {\"apikey\": \"foo\"}\n\n def test_join_devices_positive_online(self, resource):\n assert resource(apikey=\"foo\").devices == [\"foo\"]\n\n def test_join_devices_positive_online_with_devices(self, resource):\n assert resource(apikey=\"foo\", devices=[\"bar\"]).devices == [\"bar\"]\n\n def test_join_devices_positive_online_with_devices_and_names(self, resource):\n assert resource(apikey=\"foo\", devices=[\"bar\"], deviceNames=[\"baz\"]).devices == [\"bar\", \"baz\"]\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "BadArguments)", + "got": "NotifiersException) as excinfo:", + "got_raw": "NotifiersException) as excinfo:\n get_notifier(provider, **data)\n\n assert excinfo.value.message == f\"Missing required data: {message}\"\n\n @pytest.mark.parametrize(\n (\"data\", \"message\"),\n [\n ({}, \"message\"),\n ({\"message\": \"foo\"}, \"token\"),\n ({\"message\": \"foo\", \"token\": \"bar\"}, \"room_id\"),\n ],\n )\n def test_missing_required(self, provider, data, message):\n data[\"env_prefix\"] = \"test\"\n\n with pytest.raises(NotifiersException) as excinfo:\n get_notifier(provider, **", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.13636363636363635, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "NotificationError)", + "got": "Notif", + "got_raw": "Notif\n\n\n# File: source/providers/telegram.rst\nTelegram\n--------\nSend messages via `Telegram `_\n\nThis is a private use case of the :class:`~notifiers.providers.email.SMTP` provider\n\n.. code-block:: python\n\n >>> from notifiers import get_notifier\n >>> telegram = get_notifier('telegram')\n >>> telegram.defaults\n {'chat_id': REDACTED, 'username': 'REDACTED', 'language_code': 'en-US', 'chat': {'id': REDACTED, 'first_name': 'REDACTED', 'last_name':", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.43478260869565216, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "ValidationError)", + "got": "ValidationError):", + "got_raw": "ValidationError):\n validate(value, {\"type\": \"string\", \"format\": formatter})\n\n @pytest.mark.parametrize(\n (\"formatter\", \"value\"),\n [\n (\"iso8601\", \"2018-14-15T07:39:59+00:00\"),\n (\"iso8601\", \"2018-07-15T07:39:59Z~\"),\n (\"iso8601\", \"20180715T0739545639Z\"),\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.9696969696969697, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "[\"Not Found\"]", + "got": "[\"application token is invalid\"]", + "got_raw": " [\"application token is invalid\"]\n\n def test_join_devices_positive_online(self, resource):\n data = resource(apikey=\"foo\")\n\n assert isinstance(data, list)\n\n def test_join_devices_positive_online(self, resource):\n data = resource(apikey=\"foo\")\n\n assert isinstance(data, list)\n\n def test_join_devices_positive_online(self, resource):\n data = resource(apikey=\"foo\")\n\n assert isinstance(data, list)\n\n def test_join_devices_positive_online(self, resource):\n data = resource(apikey=\"foo\")\n\n assert isinstance(data, list)\n\n def test_join_devices_positive_online(self, resource):\n data =", + "exact_match": false, + "code_bleu": 0.49999999999999994, + "edit_similarity": 0.35555555555555557, + "n_retrieved": 10 + }, + { + "repo": "liiight/notifiers", + "expected": "[\"an error\"]", + "got": "[\"an error\"]", + "got_raw": " [\"an error\"]\n\n def test_success_response(self, mock_provider):\n \"\"\"Test success notification response\"\"\"\n rsp = mock_provider.notify(**self.valid_data)\n rsp.status = \"success\"\n\n rsp.raise_on_errors()\n\n def test_bad_arguments(self, mock_provider):\n \"\"\"Test bad arguments notification response\"\"\"\n with pytest.raises(BadArguments) as e:\n mock_provider.notify(**{\"required\": \"foo\", \"not_required\": \"bar\"})\n\n assert repr(e.value) == \"\"\n\n def test_schema_error(self, mock_provider", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "llimllib/limbo", + "expected": "1", + "got": "10", + "got_raw": "10\n assert fakeserver.slack.posted_reactions[\"xyz.1\"] == [\"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"keycap_ten\"]\n\n\nif __name__ == \"__main__\":\n test_poll()", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "llimllib/limbo", + "expected": "ret", + "got": "ret", + "got_raw": " ret\n\ndef test_dog_no_image():\n with vcr.use_cassette(\"test/fixtures/dog_no_image.yaml\"):\n ret = on_message({\"text\": \"!dog\"}, None)\n\n assert ret == \"\"\n\ndef test_dog_no_image():\n with vcr.use_cassette(\"test/fixtures/dog_no_image.yaml\"):\n ret = on_message({\"text\": \"!dog\"}, None)\n\n assert ret == \"\"\n\ndef test_dog_no_image():\n with vcr.use_cassette(\"test/fixtures/dog_no_image.yaml\"):\n ret = on_message({\"text\": \"!dog\"}, None)\n\n assert ret == \"\"\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "llimllib/limbo", + "expected": "[]", + "got": "0", + "got_raw": "0\n\ndef test_missing_plugin():\n hooks = limbo.init_plugins(\"test/plugins\", [\"nonexistant\"])\n\n assert limbo.run_hook(hooks, \"message\", {\"text\": u\"!echo bananas\"}, None) == 0\n\ndef test_missing_plugin2():\n hooks = limbo.init_plugins(\"test/plugins\", [\"nonexistant\", \"nonexistant2\"])\n\n assert limbo.run_hook(hooks, \"message\", {\"text\": u\"!echo bananas\"}, None) == 0\n\ndef test_missing_plugin3():\n hooks = limbo.init_plugins(\"test/plugins\", [\"nonexistant\", \"", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "llimllib/limbo", + "expected": "sorted(b.items())", + "got": "sorted(b.items())", + "got_raw": " sorted(b.items())\n\ndef test_github():\n with vcr.use_cassette(os.path.join(DIR, \"github.yml\")):\n on_message.on_message(\n {\n \"type\": \"message\",\n \"text\": \"github\",\n \"user\": \"2\",\n \"ts\": time.time(),\n \"team\": None,\n \"channel\": \"repl_channel\",\n },\n SERVER,\n )\n assert dicteq(\n SERVER.posted_messages[0][0],\n {\n \"text\": \"https://github.com/llimllib/limbo\",\n \"channel\": \"repl_channel", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "llimllib/limbo", + "expected": "9", + "got": "1", + "got_raw": "1\n assert hooks[\"test_plugin_success\"] == MockHandler\n\ndef test_plugin_failure():\n hooks = limbo.init_plugins(\"test/plugins\")\n\n assert len(hooks) == 1\n assert hooks[\"test_plugin_failure\"] == MockHandler\n\ndef test_plugin_failure2():\n hooks = limbo.init_plugins(\"test/plugins\")\n\n assert len(hooks) == 1\n assert hooks[\"test_plugin_failure2\"] == MockHandler\n\ndef test_plugin_failure3():\n hooks = limbo.init_plugins(\"test/plugins\")\n\n assert len(hooks) == 1\n assert hooks[\"test_plugin_failure3\"]", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "llm-workflow-engine/llm-workflow-engine", + "expected": "1", + "got": "2", + "got_raw": "2\n assert result[0].role == \"system\"\n assert result[0].content == request.system_message\n assert result[1].role == \"user\"\n assert result[1].content == \"test message\"\n\ndef test_prepare_default_new_conversation_messages_no_old_messages(\n test_config, tool_manager, provider_manager, preset_manager\n):\n request = make_api_request(test_config, tool_manager, provider_manager, preset_manager)\n request.old_messages = []\n request.input = \"test message\"\n result = request.prepare_default_new_conversation_messages()\n\n assert len(result) == 2\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "llm-workflow-engine/llm-workflow-engine", + "expected": "token_count", + "got": "100", + "got_raw": "100\n\ndef test_get_conversation_token_count_no_messages(test_config, tool_manager, provider_manager):\n csm = make_conversation_storage_manager(\n test_config, tool_manager, provider_manager, current_user=Mock(), conversation_id=1\n )\n csm.message.get_messages = Mock(return_value=(True, [], \"Success\"))\n tokens = csm.get_conversation_token_count()\n assert tokens is None\n\ndef test_get_conversation_token_count_no_messages_no_provider(test_config, tool_manager, provider_manager):\n csm = make_conversation_storage_manager(\n test_config, tool_manager, provider_manager,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "llm-workflow-engine/llm-workflow-engine", + "expected": "0", + "got": "0", + "got_raw": "0\n assert len(template_manager.system_template_dirs) > 0\n assert len(template_manager.all_template_dirs) > 0\n\n assert template_manager.temp_template_dir in template_manager.all_template_dirs\n\n assert template_manager.templates_env is not None\n assert template_manager.templates is not None\n\ndef test_get_template_editable_filepath(template_manager):\n template_name = \"test_template.md\"\n success, filepath, user_message = template_manager.backend.template_manager.get_template_editable_filepath(template_name)\n assert success\n assert filepath == template_manager.backend.template_manager.user_template_dirs[0] + \"/\" + template_name\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "llm-workflow-engine/llm-workflow-engine", + "expected": "4", + "got": "3", + "got_raw": "3\n assert response[\"messages\"][0][\"role\"] == \"system\"\n assert response[\"messages\"][0][\"content\"] == \"You are a helpful assistant.\"\n assert response[\"messages\"][1][\"role\"] == \"user\"\n assert response[\"messages\"][1][\"content\"] == \"What are the three primary colors?\"\n assert response[\"messages\"][2][\"role\"] == \"assistant\"\n assert response[\"messages\"][2][\"content\"] == \"Foo repeated twice is: foo foo\"\n\n assert response[\"messages\"][2][\"tool_calls\"] == tool_calls\n assert response[\"messages\"][2][\"tool_calls\"][0", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "llm-workflow-engine/llm-workflow-engine", + "expected": "provider_manager", + "got": "provider_manager", + "got_raw": " provider_manager\n assert csm.current_user is None\n assert csm.conversation_id is None\n assert csm.preset_name is None\n assert csm.provider == provider_manager.get_provider_from_name(\"fake_llm\")\n assert csm.model_name == constants.API_BACKEND_DEFAULT_MODEL\n assert csm.preset_name == \"\"\n assert csm.provider_manager == provider_manager\n assert csm.orm is None\n assert csm.conversation is None\n assert csm.message is None\n\ndef test_set_provider(test_config, tool_manager, provider_manager):\n csm = make_conversation_storage_manager", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "llm-workflow-engine/llm-workflow-engine", + "expected": "1", + "got": "1", + "got_raw": "1\n assert backend.current_user == 1\n assert backend.conversation_title == \"test conversation\"\n\n assert backend.request is not None\n assert backend.request.input == \"Say hello!\"\n assert backend.request.system_message == constants.SYSTEM_MESSAGE_DEFAULT\n assert backend.request.max_submission_tokens == constants.OPEN_AI_DEFAULT_MAX_SUBMISSION_TOKENS\n assert backend.request.return_only == False\n assert backend.request.request_overrides == {}\n assert backend.request.streaming == False\n\n assert backend.conversation is not None\n assert backend.conversation.conversation_id == 1\n assert backend.conversation.title == \"test conversation\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "llm-workflow-engine/llm-workflow-engine", + "expected": "None", + "got": "None", + "got_raw": " None\n assert variables is None\n\ndef test_get_template_and_variables_found(template_manager):\n template_name = \"test_template.md\"\n template, variables = template_manager.get_template_and_variables(template_name)\n\n assert template is not None\n assert variables is not None\n\ndef test_get_template_and_variables_not_found(template_manager):\n template_name = \"non_existent_template.md\"\n template, variables = template_manager.get_template_and_variables(template_name)\n\n assert template is None\n assert variables is None\n\ndef test_get_template_and_variables_found(template_manager):\n template_name = \"test_template.md\"\n template, variables = template", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "llm-workflow-engine/llm-workflow-engine", + "expected": "\"No current user, conversation not saved\"", + "got": "\"Conversation not found\"", + "got_raw": " \"Conversation not found\"\n\ndef test_store_conversation_messages_with_current_user(\n test_config, tool_manager, provider_manager\n):\n csm = make_conversation_storage_manager(\n test_config, tool_manager, provider_manager, current_user=True\n )\n new_messages = copy.deepcopy(TEST_BASIC_MESSAGES)\n success, response_content, message = csm.store_conversation_messages(new_messages, \"test\")\n assert success\n assert response_content == \"test\"\n\n assert message == \"Conversation not found\"\n\ndef test_store_conversation_messages_with_current_user_and_conversation_id(\n test_config, tool_manager, provider_manager\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5846153846153846, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "0.1", + "got": "0.1", + "got_raw": "0.1\n\n assert node.min == 12.2\n\n assert node.max == 12.4\n\n assert node.bubble_up\n\n assert node.disabled is False\n\n assert node.readonly is False\n\n assert node.input_delay == 300\n\n assert node.events == []\n\n assert node.attributes == {}\n\n assert node.style == {}\n\n assert node.nodes == []\n\n assert node.id_list == []\n\n assert node.class_list == []\n\n assert node._id == '1'\n\n assert node._style == {'width': '3em'}\n\n assert node._class == 'input-number", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "'Foo'", + "got": "'Foo'", + "got_raw": " 'Foo'\n assert option.value == 'foo'\n assert option.selected is False\n assert option.disabled is False\n assert option.id_list == []\n assert option.class_list == []\n assert option.style == {}\n\n\ndef test_option2_with_selected():\n from lona.html import Option2\n\n option = Option2('Foo', value='foo', selected=True)\n\n\n assert option.get_text() == 'Foo'\n assert option.value == 'foo'\n assert option.selected is True\n assert option.disabled is False\n assert option.id_list == []\n assert option.class_list == []\n assert option.style ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "1", + "got": "1", + "got_raw": "1\n\n # add_options\n select = Select2()\n\n select.add_options([\n Option2('Foo', value='foo'),\n Option2('Bar', value='bar'),\n Option2('Baz', value='baz'),\n ])\n\n assert select.values == ('foo', 'bar', 'baz')\n\n assert len(select.nodes) == 3\n\n # add_button\n select = Select2()\n\n select.add_button(\n Label('Foo'),\n Option2('Foo', value='foo'),\n )\n\n assert select.values == ('foo', )\n\n assert len(select.nodes) == 1\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "'POST'", + "got": "'POST'", + "got_raw": " 'POST'\n assert await get_post_data(page) == {'input-1': 'foo'}\n\n\n# File: doc/content/tutorial/01-getting-started/index.rst\nfrom lona import LonaApp, LonaView\n\napp = LonaApp(__file__)\n\n\n@app.route('/')\nclass MyView(LonaView):\n def handle_request(self, request):\n return 'Hello World'\n\n\nif __name__ == '__main__':\n app.run(port=8080, live_reload=True)\n\n\n# File: doc/content/tutorial/03-views/example-1.py\nfrom lona_picocss.html import", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "404", + "got": "200", + "got_raw": "200\n\n assert (await context.client.get('/static/node.css')).text == 'body { color: red; }'\n assert (await context.client.get('/static/node.js')).text == 'console.log(\"Hello World\");'\n assert (await context.client.get('/static/node.map')).text == 'function () { console.log(\"Hello World\"); }'\n\n assert (await context.client.get('/static/node.disabled')).text == 'body { color: red; }'\n\n assert (await context.client.get('/static/node.css')).headers['content-type'] == 'text/css'\n assert (await context.client.get('/", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "'tmp_dir1'", + "got": "'tmp_dir1'", + "got_raw": " 'tmp_dir1'\n assert file2_content == 'tmp_dir2'\n\ndef test_collect_static():\n \"\"\"\n This test tests the handling of static files.\n\n If a project has two static directories, containing overlapping paths,\n the collect-static mechanism should override reoccurring paths.\n\n Example:\n\n Static Directory 1\n /directory/file1.txt <- should be present in the output\n /directory/file2.txt <- should be overridden in the output\n\n Static Directory 2\n /directory/file2.txt <- should be present in the output\n \"\"\"\n\n from lona.command_line.collect", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "[]", + "got": "", + "got_raw": " # type: ignore\n ('foo', 'Bar', 'Baz')\n\n assert select.values == [\n ('foo', 'Foo', False),\n ('bar', 'Bar', True),\n ('baz', 'Baz', True),\n ]\n\n # pre selected values #####################################################\n select = Select(\n values=[\n ('foo', 'Foo'),\n ('bar', 'Bar', True),\n ('baz', 'Baz'),\n ],\n multiple=True,\n )\n\n assert select.value == # type: ignore\n ('foo', 'Bar', 'Baz')\n\n assert select.values == [\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "1", + "got": "1", + "got_raw": "1\n assert input_events[0].node is outer_div\n assert input_events[0].type == 'click'\n\n # non clickable inner div\n state['input-events'].clear()\n\n await page.click('#inner-div-2')\n await page.wait_for_selector('#lona:has-text(\"SUCCESS\")')\n\n inner_div = state['html'].query_selector('#inner-div-2')\n input_events = state['input-events']\n\n assert len(input_events) == 0\n\n await browser.close()\n\n\nasync def test_click_events_with_node_state(lona_app_context):\n from playwright.async_api import async_play", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "'/bar/'", + "got": "'/bar/'", + "got_raw": " '/bar/'\n\n def test_reverse_with_arg(self):\n url = self.router.reverse('foo', arg='foo')\n\n assert url == '/foo/foo/'\n\n def test_reverse_with_arg_and_trailing_slash(self):\n url = self.router.reverse('foobar', arg='foo')\n\n assert url == '/foobar/foo/'\n\n def test_reverse_with_arg_and_trailing_slash_and_slash(self):\n url = self.router.reverse('foobar', arg='foo')\n\n assert url == '/foobar/foo/'\n\n def test_reverse_with_arg_and_trailing_slash_and_slash_and_slash(self):\n url = self.router.reverse", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "'GET'", + "got": "'GET'", + "got_raw": " 'GET'\n assert await get_post_data(page) == {}\n\n # POST request\n await page.click('form button')\n await page.wait_for_url('**/')\n\n\n assert await get_method(page) == 'POST'\n assert await get_post_data(page) == {'input-1': 'value'}\n\n\n# File: doc/content/tutorial/01-getting-started/index.rst\nfrom lona import LonaApp, LonaView\n\napp = LonaApp(__file__)\n\n\n@app.route('/')\nclass MyView(LonaView):\n def handle_request(self, request):\n return 'Hello World'\n\n\nif", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "3", + "got": "3", + "got_raw": "3\n\n assert node.valid\n\n assert node.raw_value == '12.3'\n\n assert node.min == None\n\n assert node.max == None\n\n assert node.bubble_up\n\n assert node.disabled == False\n\n assert node.readonly == False\n\n assert node.input_delay == 300\n\n assert node.events == [CLICK]\n\n assert node.attributes == {\n 'type': 'number',\n 'value': '12.3',\n 'step': '3',\n }\n\n assert node.style == {}\n\n assert node.class_list == []\n\n assert node.id_list == []\n\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "{'arg': 'foo'}", + "got": "{", + "got_raw": " {\n 'arg': 'foo',\n }\n\n def test_resolve_with_argument_1(self):\n match, route, match_info = self.router.resolve('/foo/foo/')\n\n assert match\n assert route == self.routes[0]\n\n assert match_info == {\n 'arg': 'foo',\n }\n\n def test_resolve_with_no_argument(self):\n match, route, match_info = self.router.resolve('/foo/')\n\n assert match\n assert route == self.routes[1]\n\n assert match_info == {\n }\n\n def test_resolve_with_no_argument_2(self):\n match, route, match", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "Node", + "got": "", + "got_raw": " # noqa: E721\n\n\ndef test_input_type_text():\n node = HTML1('')[0]\n\n\n assert type(node) is TextInput\n\n\ndef test_input_type_textarea():\n node = HTML1('')[0]\n\n\n assert type(node) is TextArea\n\n\ndef test_input_type_checkbox():\n node = HTML1('')[0]\n\n\n assert type(node) is CheckBox\n\n\ndef test_input_type_select():\n node = HTML1('')[0]\n\n\n assert type(node) is Select\n\n\ndef test_input_type_submit():\n node =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "5", + "got": "5", + "got_raw": "5\n assert test_data['raw_value'] == '5'\n\n test_data.clear()\n await page.fill('input[type=number]', '10')\n\n for attempt in eventually():\n async with attempt:\n assert test_data['valid'] is True\n\n assert test_data['value'] == 10\n assert test_data['raw_value'] == '10'\n\n test_data.clear()\n await page.fill('input[type=number]', '15')\n\n for attempt in eventually():\n async with attempt:\n assert test_data['valid'] is False\n\n assert test_data['value'] == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lona-web-org/lona", + "expected": "d.id_list", + "got": "d.id_list", + "got_raw": " d.id_list\n assert 'bar' in d.id_list\n\n\ndef test_in_keyword_with_list():\n d = Div(_id=['foo', 'bar'])\n\n\n assert 'foo' in d.id_list\n assert 'bar' in d.id_list\n\n\ndef test_in_keyword_with_string():\n d = Div(_id='foo bar')\n\n\n assert 'foo' in d.id_list\n assert 'bar' in d.id_list\n\n\ndef test_in_keyword_with_list_and_string():\n d = Div(_id=['foo', 'bar'])\n\n\n assert 'foo' in d.id_list\n ", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "req.headers.get(\"Content-Length\"))", + "got": "req.body)", + "got_raw": " req.body)\n\n def test_post_method(self):\n grab = build_grab()\n grab.setup(method=\"post\", post=b\"abc\")\n self.server.add_response(Response())\n grab.go(self.server.get_url())\n req = self.server.get_request()\n self.assertEqual(\"POST\", req.method)\n req = self.server.get_request()\n\n self.assertEqual(\"abc\", req.body)\n\n def test_post_multipart(self):\n grab = build_grab()\n grab.setup(post_multipart=[('key', 'val1'), ('key', 'val2')])\n self.server.add_response(Response())\n grab.go(self.server.get", + "exact_match": false, + "code_bleu": 0.22583677695760654, + "edit_similarity": 0.27906976744186046, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "ch_origin[\"Accept\"])", + "got": ".assertEqual(grab.config[\"common_headers\"], ch_origin)", + "got_raw": ".assertEqual(grab.config[\"common_headers\"], ch_origin)\n\n def test_headers_affects_common_headers_2(self):\n grab = build_grab()\n ch_origin = deepcopy(grab.config[\"common_headers\"])\n # Provide custom header which is also in common_headers\n grab.setup(headers={\"Accept\": \"zzz\"})\n # To make request Grab processes config and build result headers\n # from `config['common_headers']` and `config['headers']\n # That merge should not change initial `config['common_headers']` value\n self.server.add_response(Response())\n grab.go(self.server.get_url())\n\n self", + "exact_match": false, + "code_bleu": 0.13065113298388567, + "edit_similarity": 0.2702702702702703, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "set(grab.config[\"post\"]))", + "got": ".assertEqual(grab.doc.get_form_request()[\"post\"][\"foo\"], \"bar-value\")", + "got_raw": ".assertEqual(grab.doc.get_form_request()[\"post\"][\"foo\"], \"bar-value\")\n\n def test_set_input_by_xpath_regex_fail(self):\n html = b\"\"\"\n
\n \n \"\"\"\n grab = build_grab(html)\n grab.doc.set_input_by_xpath('//input[re:test(@id, \"^ba\")]', \"bar-value\")\n grab.submit(make_request=False)\n\n self.assertEqual(grab.doc.get_form_request()[\"post\"][\"foo\"], \"\")\n\n def test_set_input_by", + "exact_match": false, + "code_bleu": 0.1845895819969781, + "edit_similarity": 0.425531914893617, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "TestSpider2.get_spider_name())", + "got": "TestSpider2.get_spider_name())", + "got_raw": " TestSpider2.get_spider_name())\n\n def test_spider_name(self):\n class TestSpider(Spider):\n spider_name = \"foo_bar\"\n\n self.assertEqual(\"foo_bar\", TestSpider.get_spider_name())\n\n def test_spider_name_inherited(self):\n class TestSpider(Spider):\n spider_name = \"foo_bar\"\n\n class TestSpider2(TestSpider):\n pass\n\n self.assertEqual(\"foo_bar\", TestSpider2.get_spider_name())\n\n def test_spider_name_inherited_from_base(self):\n class TestSpider(Spider):\n spider_name = \"foo_bar\"\n\n class", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "grab.doc.form_fields()[\"foo\"])", + "got": "grab.doc.get_input(\"foo\"))", + "got_raw": " grab.doc.get_input(\"foo\"))\n\n def test_checkbox_one_checked_by_number(self):\n html = b\"\"\"\n \n \n \n
\n \"\"\"\n grab = build_grab(html)\n\n self.assertEqual(\"1\", grab.doc.get_input_by_number(0))\n\n def test_checkbox_one_checked_by_xpath(self):\n html = b\"\"\"\n
\n \n self.server.add_response(\n Response(headers=[(\"Set-Cookie\", \"godzilla=monkey\")]), count=1\n )\n grab.setup(cookiefile=tmp_file, debug=True)\n grab.go(self.server.get_url())\n req = self.server.get_request()\n\n self.assertEqual(req.cookies[\"godzilla\"].value, \"monkey\")\n\n def test_cookiefile_with_domain(self):\n with temp_file() as tmp_file:\n grab = build_grab()\n\n cookies = [{\"name\": \"spam\", \"value\": \"ham\", \"domain\": \"yandex.ru\"}]\n with open(tmp_file, \"w", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.06451612903225806, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "0)", + "got": "2)", + "got_raw": "2)\n self.assertEqual(bot.stat.counters[\"spider:task-baz\"], 2)\n\n def test_task_limit_with_fallback(self):\n class CustomSimpleSpider(SimpleSpider):\n def create_grab_instance(self, **kwargs):\n return Grab(connect_timeout=1, timeout=1)\n\n self.server.add_response(Response(data=\"Hello spider!\", sleep=1.1))\n self.server.add_response(Response(data=\"Hello spider!\"))\n bot = build_spider(CustomSimpleSpider, network_try_limit=1)\n # bot.setup_grab(connect_timeout=1, timeout=1)\n bot.setup_queue()\n", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "GrabMisuseError)", + "got": "GrabMisuseError, grab.setup, incorrect_option_name='value')", + "got_raw": "GrabMisuseError, grab.setup, incorrect_option_name='value')\n\n def test_incorrect_option_value(self):\n grab = build_grab()\n\n self.assertRaises(GrabMisuseError, grab.setup, post='value')\n\n def test_incorrect_option_value_type(self):\n grab = build_grab()\n\n self.assertRaises(GrabMisuseError, grab.setup, post=1)\n\n def test_incorrect_option_value_type2(self):\n grab = build_grab()\n\n self.assertRaises(GrabMisuseError, grab.setup, post=1.0)\n\n def test_incorrect_option_value_type3(self):\n grab", + "exact_match": false, + "code_bleu": 0.13950796967929133, + "edit_similarity": 0.4266666666666667, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "len(grab.doc.body) < 50000)", + "got": "50 * 1024 < len(grab.doc.body))", + "got_raw": "50 * 1024 < len(grab.doc.body))\n\n def test_body_maxsize_with_content_type(self):\n grab = build_grab()\n grab.setup(body_maxsize=100, content_type=\"text/plain\")\n self.server.add_response(Response(data=(\"x\" * 1024 * 1024)))\n grab.go(self.server.get_url())\n # Should be less 50kb\n\n self.assertTrue(50 * 1024 < len(grab.doc.body))\n\n def test_body_maxsize_with_content_type_and_charset(self):\n grab = build_gr", + "exact_match": false, + "code_bleu": 0.6262844962765469, + "edit_similarity": 0.6551724137931034, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "test)", + "got": "", + "got_raw": "<|fim_suffix|>\n # fmt: off\n data = u\"\u0444\u044b\u0432\u0430\"\n # fmt: on\n grab.setup(post=data, url=self.server.get_url(), charset=\"cp1251\", debug=True)\n self.server.add_response(Response())\n grab.request()\n req = self.server.get_request()\n self.assertEqual(req.data, data.encode(\"cp1251\"))\n\n # Now try dict with unicode value & charset option\n # self.server.request[\"charset\"] = \"cp1251\"\n grab = build_grab()\n # fmt: off\n data = u\"\u0444\u044b\u0432\u0430\"\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "\"http\")", + "got": "\"http\")", + "got_raw": " \"http\")\n\n def test_global_proxy_type_argument_with_proxy(self):\n grab = build_grab()\n items = [\"localhost:1\"]\n\n grab.proxylist.load_list(items)\n proxy = grab.proxylist.get_next_proxy()\n\n self.assertEqual(proxy.proxy_type, \"http\")\n\n def test_global_proxy_type_argument_with_proxy_and_userpwd(self):\n grab = build_grab()\n items = [\"localhost:1\"]\n\n grab.proxylist.load_list(items)\n proxy = grab.proxylist.get_next_proxy()\n\n self.assertEqual(proxy.proxy_type, \"http\")\n\n def test_global_proxy_type_argument_with_proxy_and_userpwd", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "quote(redirect_url, safe=\":./?&\"))", + "got": "", + "got_raw": " # pylint: disable=no-member\n self.server.get_url().rstrip(\"/\"))\n\n def test_location_header_contains_null_byte_with_redirect(self):\n redirect_url = self.server.get_url().rstrip(\"/\") + \"/\\x00/zz\"\n self.server.add_response(\n Response(status=302, data=\"x\", headers=[(\"Location\", redirect_url)]),\n )\n self.server.add_response(Response(data=\"y\"))\n grab = build_grab()\n # Behaviour depends on grab transport\n grab.init_transport()\n if isinstance(grab.transport, CurlTransport):\n with self.assertRaises(InvalidResponseHeaderError):\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "img_data)", + "got": "img_data)", + "got_raw": " img_data)\n\n def test_save(self):\n \"Test `Response.save` method.\"\n with temp_dir() as tmp_dir:\n self.server.add_response(Response(data=HTML), count=1, method=\"get\")\n\n grab = build_grab()\n grab.go(self.server.get_url())\n path = os.path.join(tmp_dir, \"test.html\")\n grab.response.save(path)\n with open(path, \"rb\") as inp:\n test_data = inp.read()\n\n self.assertEqual(test_data, HTML)\n\n def test_save_to(self):\n \"Test `Response.save` method with `save_to` option.\"\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "data.get('name', 'foo'))", + "got": "data.get('name', 'foo'))", + "got_raw": " data.get('name', 'foo'))\n\n def test_data_object_getitem_method(self):\n data = Data('person', person={'age': 22})\n self.assertRaises(KeyError, lambda: data['name'])\n\n self.assertEqual('foo', data['name'])\n\n def test_data_object_getitem_method_with_default(self):\n data = Data('person', person={'age': 22})\n self.assertEqual('foo', data['name', 'foo'])\n\n def test_data_object_getitem_method_with_default_and_key(self):\n data = Data('person', person={'age': 22})\n self", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "self.grab.doc.select('//h1').text())", + "got": "self.grab.doc.select('//h1').text())", + "got_raw": " self.grab.doc.select('//h1').text())\n\n def test_select_method_with_byte(self):\n\n self.assertEqual('test', self.grab.doc.select('//h1', byte=True).text())\n\n def test_select_method_with_unicode(self):\n\n self.assertEqual('test', self.grab.doc.select('//h1', byte=False).text())\n\n def test_select_method_with_byte_and_unicode(self):\n\n self.assertEqual('test', self.grab.doc.select('//h1', byte=True, unicode=True).text())\n\n def test_select_method_with_unicode_and_byte(self):\n\n self.assertEqual('test', self.grab.doc", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "len(reg))", + "got": "len(reg))", + "got_raw": " len(reg))\n self.assertEqual('tests.util_module', reg['tests.util_module'].Meta.name)\n self.assertEqual('zz', reg['zz'].Meta.name)\n\n def test_build_spider_registry_with_name_and_alias(self):\n cfg = self.build_config(['tests.util_module:tests', 'zz'])\n reg = build_spider_registry(cfg)\n\n self.assertEqual(2, len(reg))\n self.assertEqual('tests.util_module', reg['tests.util_module'].Meta.name)\n self.assertEqual('zz', reg['zz'].Meta.name)\n\n def test_build_spider_registry_with_name_and_alias_and_alias(self):\n cfg", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "SpiderError)", + "got": "NoTaskHandler, bot.run)", + "got_raw": "NoTaskHandler, bot.run)\n\n def test_check_task_limits(self):\n class TestSpider(Spider):\n def task_page(self, grab, task):\n pass\n\n def check_task_limits(self, task):\n return True, None\n\n bot = build_spider(TestSpider)\n bot.setup_queue()\n bot.add_task(\n Task(\"page\", url=self.server.get_url(), fallback_name=\"fallback\")\n )\n\n bot.run()\n\n def test_task_generator(self):\n class TestSpider(Spider):\n def task_generator(self):\n yield Task(\"page\", url=self.server.get_url())\n\n bot =", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.34285714285714286, + "n_retrieved": 10 + }, + { + "repo": "lorien/grab", + "expected": "grab.doc.form)", + "got": "1)", + "got_raw": "1)\n\n def test_choose_form_by_element_with_no_match(self):\n data = b\"\"\"\n
\n
\n \"\"\"\n grab = build_grab(data)\n grab.choose_form_by_element('//input[@name=\"baz\"]')\n\n self.assertEqual(grab.doc(\"//form[1]\").node(), 1)\n\n def test_choose_form_by_element_with_no_match2(self):\n data = b\"\"\"\n
\n
\n \"\"\"\n grab = build_gr", + "exact_match": false, + "code_bleu": 0.17909498863725698, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "luizyao/pytest-chinese-doc", + "expected": "set2", + "got": "set2", + "got_raw": " set2\n\n\ndef test_long_str_comparison():\n str1 = 'show me codes'\n str2 = 'show me money'\n\n assert str1 == str2\n\n\ndef test_dict_comparison():\n dict1 = {\n 'x': 1,\n 'y': 2,\n }\n\n dict2 = {\n 'x': 1,\n 'y': 1,\n }\n\n assert dict1 == dict2\n```\n\n\u4e0a\u9762\uff0c\u6211\u4eec\u68c0\u67e5\u4e86\u4e09\u79cd\u6570\u636e\u7ed3\u6784\u7684\u6bd4\u8f83\uff1a\u96c6\u5408\u3001\u5b57\u7b26\u4e32\u548c\u5b57\u5178\uff1b\n\n```bash\n$ pytest -q src/chapter-3/test_special_compare.py \n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "luizyao/pytest-chinese-doc", + "expected": "250", + "got": "250", + "got_raw": "250\n assert 0 # \u4e3a\u4e86\u5c55\u793a\uff0c\u5f3a\u5236\u7f6e\u4e3a\u5931\u8d25\n\n\ndef test_noop(smtp_connection):\n response, _ = smtp_connection.noop()\n assert response == 250\n assert 0 # \u4e3a\u4e86\u5c55\u793a\uff0c\u5f3a\u5236\u7f6e\u4e3a\u5931\u8d25\n```\n\n\u6267\u884c\uff1a\n\n```bash\n$ pytest -q -s src/chapter-4/test_minfixture.py \n SETUP modarg mod1\n SETUP otherarg 1\n SETUP modarg mod2\n SETUP otherarg 2\n.\u65ad\u5f00 smtp.163.com\uff1a25\n.\u65ad\u5f00", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "luizyao/pytest-chinese-doc", + "expected": "1", + "got": "1", + "got_raw": "1\n\n@pytest.mark.parametrize('num', [1, 2])\ndef test_passed(num):\n\n assert num == 2\n```\n\n\u6267\u884c\uff1a\n\n```bash\n$ pytest -q src/chapter-1/test_mark.py\n.F\n=========================== FAILURES ============================\n______________________________ test_failed _______________________________\n\nnum = 1\n\n def test_failed(num):\n> assert num == 1\nE assert 1 == 1\nE + where 1 = num\n\nsrc\\chapter-1\\test_mark.py:10: AssertionError\n========================== 1 failed in 0.01s =================", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "luizyao/pytest-chinese-doc", + "expected": "250", + "got": "250", + "got_raw": "250\n assert 0 # \u4e3a\u4e86\u5c55\u793a\uff0c\u5f3a\u5236\u7f6e\u4e3a\u5931\u8d25\n\ndef test_noop(smtp_connection):\n response, _ = smtp_connection.noop()\n\n assert response == 250\n assert 0 # \u4e3a\u4e86\u5c55\u793a\uff0c\u5f3a\u5236\u7f6e\u4e3a\u5931\u8d25\n```\n\n\u6267\u884c\uff1a\n\n```bash\n$ pytest -q -s src/chapter-4/test_minfixture.py \n.\u65ad\u5f00 smtp.163.com\uff1a25\n.\u65ad\u5f00 smtp.126.com\uff1a25\n\n2 passed in 0.26s\n```\n\n\u53ef\u4ee5\u770b\u5230\uff1a\n\n- `smtp_connection", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "luizyao/pytest-chinese-doc", + "expected": "expected", + "got": "1", + "got_raw": "1\n```\n\n\u53ef\u4ee5\u770b\u5230\uff1a\n\n- \u7528\u4f8b\u7ed3\u679c\u662f`XFAIL`\uff0c\u800c\u4e0d\u662f`FAILED`\uff1b\n- \u6d4b\u8bd5`ID`\u662f\u6211\u4eec\u6307\u5b9a\u7684`failed`\uff0c\u800c\u4e0d\u662f`data_set1`\uff1b\n\n### 1.4. `@pytest.mark.skip`\u88c5\u9970\u5668\n\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528`@pytest.mark.skip`\u88c5\u9970\u5668\u6765\u8df3\u8fc7\u67d0\u4e2a\u7528\u4f8b\u7684\u6267\u884c\uff1a\n\n```python\n# src/chapter-10/test_module.py\n\nimport pytest\n\n\n@pytest.mark.skip(reason='skipping windows-only tests')\ndef test_one():\n assert True\n```\n\n\u6267\u884c\uff1a\n\n```bash\n$ pytest -rs -k '", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "error.ShortException)", + "got": "ShortException) as err:", + "got_raw": "ShortException) as err:\n raise last_exc\n\n assert str(err.value) == full_error_code\n\n with pytest.raises(ShortException) as err:\n raise last_exc\n\n assert str(err.value) == full_error_code\n\n with pytest.raises(ShortException) as err:\n raise last_exc\n\n assert str(err.value) == full_error_code\n\n with pytest.raises(ShortException) as err:\n raise last_exc\n\n assert str(err.value) == full_error_code\n\n with pytest.raises(ShortException) as err:\n raise last_exc\n\n assert str(err.value) == full_error", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.6818181818181818, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "spec)", + "got": "def test_names_to_empty_no_names_in_result():", + "got_raw": "\n\ndef test_names_to_empty_no_names_in_result():\n src = data_frame(x = 1)\n\n assert_frame_equal(\n build_longer_spec(src, _.x, names_to = []),\n spec,\n data_frame({\".name\": \"x\", \".value\": \"value\"})\n )\n\n\n assert_frame_equal(\n build_longer_spec(src, _.x, names_to = [], names_sep = \"_\"),\n spec,\n data_frame({\".name\": \"x\", \".value\": \"value\"})\n )\n\n\n assert_frame_equal(\n build_longer_spec(src, _.x, names_to = [], names_sep =", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.08, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "Exception)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n df1 >> semi_join(df_ii)\n\ndef test_semi_join_no_on_arg_fail(backend, df1):\n df_ii = backend.load_df(data_frame(ZZ = [1,1]))\n\n\n with pytest.raises(NotImplementedError):\n df1 >> semi_join(df_ii)\n\ndef test_semi_join_no_on_arg_fail(backend, df1):\n df_ii = backend.load_df(data_frame(ZZ = [1,1]))\n\n\n with pytest.raises(NotImplementedError):\n df1 >> semi_join(df_ii)\n\ndef test_semi_join_no_on_arg", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.1935483870967742, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "gdf_wide.obj)", + "got": "gdf_wide)", + "got_raw": " gdf_wide)\n\ndef test_spread_grouped_df_no_drop(df_no_drop):\n gdf = df_no_drop.groupby('id')\n res = spread(gdf, \"m\", \"v\", drop_na = False)\n\n gdf_wide = wide_df.groupby('id')\n\n assert_frame_equal(res.obj, gdf_wide)\n\ndef test_spread_grouped_df_drop_na(df_no_drop):\n gdf = df_no_drop.groupby('id')\n res = spread(gdf, \"m\", \"v\", drop_na = True)\n\n gdf_wide = wide_df.groupby('id')\n\n assert", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.8181818181818182, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "lazy_tbl.tbl", + "got": "lazy_tbl.last_op", + "got_raw": " lazy_tbl.last_op\n assert inner_select.alias() is inner_alias\n assert len(inner_select.froms) == 1\n assert inner_select.froms[0] is lazy_tbl.last_op\n\n assert len(lazy_tbl.last_op.froms) == 1\n assert lazy_tbl.last_op.froms[0] is lazy_tbl.last_op\n\n assert len(lazy_tbl.last_op.selects) == 3\n assert len(lazy_tbl.last_op.selects[0].froms) == 1\n assert len(lazy_tbl.last_op.selects[1].froms) == 1", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.7142857142857143, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "data_frame(x = [1,2,6,7], g = [1,1,2,2]))", + "got": "", + "got_raw": "\n\n\n# File: siuba/dply/verbs.py\n \"\"\"Return a DataFrame with only the newly created columns.\n\n Parameters\n ----------\n __data:\n The input table.\n *args:\n The names of columns to be returned. May use any syntax used by the\n `select` function.\n **kwargs:\n Keyword arguments define new columns used to group the data.\n\n Examples\n --------\n\n >>> from siuba import _, mutate, transmute, head\n >>> from siuba.data import cars\n\n >>> cars >> mutate(cyl2 = _.cyl * 2, cyl4", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "\"int64\"", + "got": "np.int64", + "got_raw": " np.int64\n\ndef test_spec_can_cast_to_custom_type():\n src = data_frame(w1 = 1)\n spec = build_longer_spec(\n src,\n _.w1,\n names_prefix = \"w\",\n names_transform = {\"name\": lambda x: x.astype(int)}\n )\n\n\n assert spec[\"name\"].dtype == np.int64\n\ndef test_spec_can_cast_to_custom_type():\n src = data_frame(w1 = 1)\n spec = build_longer_spec(\n src,\n _.w1,\n names_prefix = \"w\",\n names_transform = {\"name\":", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "data.assign(res = dst))", + "got": "dst)", + "got_raw": " dst)\n\n@pytest.mark.parametrize(\"k,v, dst\", [\n (True, 1, [1]*3),\n (True, False, [False]*3),\n (True, _.y, [10, 11, 12]),\n (True, lambda _: _.y, [10, 11, 12]),\n (_.x < 2, 0, [0, 0, None]),\n (_.x < 2, \"small\", [\"small\", \"small\", None]),\n (_.x < 2, _.y, [10,", + "exact_match": false, + "code_bleu": 0.15713484026367722, + "edit_similarity": 0.2962962962962963, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "data_frame(g = ['a', 'b'], result = [11., 13.]))", + "got": "quality(expr, dfs, backend)", + "got_raw": "quality(expr, dfs, backend)\n\ndef test_frame_set_aggregates_postgresql_no_mutate():\n # TODO: probably shouldn't be creating backend here\n backend = SqlBackend(\"postgresql\")\n dfs = backend.load_cached_df(data[None])\n \n expr = _.x.quantile(.75)\n\n assert_equality(expr, dfs, backend, get_spec_no_mutate)\n\ndef test_frame_set_aggregates_postgresql_no_summarize():\n # TODO: probably shouldn't be creating backend here\n backend = SqlBackend(\"postgresql\")\n dfs = backend.load_cached_df(data[None])\n \n expr =", + "exact_match": false, + "code_bleu": 0.0849050340368028, + "edit_similarity": 0.24, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "data_frame(x = 1))", + "got": "dfs.select(x = _.a))", + "got_raw": " dfs.select(x = _.a))\n assert_equal_query(dfs, select(x = _.a, y = _.b), dfs.select(x = _.a, y = _.b))\n assert_equal_query(dfs, select(x = _.a, y = _.b, z = _.c), dfs.select(x = _.a, y = _.b, z = _.c))\n assert_equal_query(dfs, select(x = _.a, y = _.b, z = _.c, w = _.d), dfs.select(x = _.a, y = _.b, z = _.c, w = _.d))\n\n ", + "exact_match": false, + "code_bleu": 0.2521193618434983, + "edit_similarity": 0.5263157894736842, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "out.obj)", + "got": "out)", + "got_raw": " out)\n\n # filter ----\n out = fast_filter(gdf, y > 1)\n\n assert_frame_equal(data_default.query('y > 1'), out)\n\n # summarize ----\n out = fast_summarize(gdf, y = _.y.sum())\n\n assert_series_equal(data_default.y.sum(), out)\n\n # groupby ----\n out = fast_groupby(gdf, y = _.y.sum())\n\n assert_frame_equal(data_default.groupby('g').y.sum().reset_index(), out)\n\n # agg ----\n out = fast_agg(gdf, y = _.y.sum())\n\n assert_series", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "[\"1\", \"2\"]", + "got": "[2, 1]", + "got_raw": " [2, 1]\n\n # TODO: this is a bit of a hack, but it works for now.\n # we need to figure out how to make this work for more complicated cases.\n # see https://github.com/machow/siuba/issues/184\n spec[\".name\"] = [str(x) for x in spec[\".name\"]]\n\n assert list(spec[\".name\"]) == [1, 2]\n\n # TODO: this is a bit of a hack, but it works for now.\n # we need to figure out how to make this work for more complicated", + "exact_match": false, + "code_bleu": 0.32466791547509893, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "DATA.assign(n = [3, 3, 7, 7]))", + "got": "@backend_sql", + "got_raw": "\n\n\n@backend_sql\ndef test_add_count_wt_sql(backend, df2):\n assert_equal_query(\n df2 >> add_count(_.x, wt = _.h),\n \"\"\"\n Source: lazy query\n DB Conn: DuckDB(sqlite:///:memory:)\n Preview:\n x h n\n 0 1 c 1\n 1 2 c 2\n 2 3 d 1\n 3 4 d 2\n \"\"\"\n )\n\n@backend_sql\ndef test_add_count_w", + "exact_match": false, + "code_bleu": 0.053153059035873224, + "edit_similarity": 0.09523809523809523, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "exc_info.value.args[0]", + "got": "str(exc_info.value)", + "got_raw": " str(exc_info.value)\n assert \"not supported\" in str(exc_info.value)\n\n assert \"np.sum\" in str(exc_info.value)\n assert \"np.absolute\" in str(exc_info.value)\n\n assert \"np.sum\" in str(exc_info.value)\n assert \"np.absolute\" in str(exc_info.value)\n\n assert \"np.sum\" in str(exc_info.value)\n assert \"np.absolute\" in str(exc_info.value)\n\n assert \"np.sum\" in str(exc_info.value)\n assert \"np.absolute\" in str(exc_info.value)\n\n assert \"np.sum\" in str(exc_info.value)\n assert \"", + "exact_match": false, + "code_bleu": 0.30835021267538976, + "edit_similarity": 0.6829268292682927, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "\"str\"", + "got": "\"dt\"", + "got_raw": " \"dt\"\n\n # attr alone is treated like a normal getattr\n call = ctl.enter(strip_symbolic(_.dt))\n assert call.func == \"__getattr__\"\n\n assert call.args[1] == \"dt\"\n\n # attr alone is treated like a normal getattr\n call = ctl.enter(strip_symbolic(_.dt.dt))\n assert call.func == \"__getattr__\"\n\n assert call.args[1] == \"dt\"\n\n # attr alone is treated like a normal getattr\n call = ctl.enter(strip_symbolic(_.dt.dt.dt))\n assert call.func == \"__getattr__\"\n\n assert call.args[", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n pivot_wider(src, names_expand = \"a\")\n\n with pytest.raises(NotImplementedError):\n pivot_wider(src, names_expand = 1)\n\n with pytest.raises(NotImplementedError):\n pivot_wider(src, names_expand = [1, 2])\n\n with pytest.raises(NotImplementedError):\n pivot_wider(src, names_expand = [1, 2, 3])\n\n with pytest.raises(NotImplementedError):\n pivot_wider(src, names_expand = [1, 2, 3, 4])\n\n with pytest.raises(NotImplementedError):\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "[1, 2]", + "got": "1, 2, 3, 4", + "got_raw": "1, 2, 3, 4\n assert pv1[\"b\"].tolist() == 1, 2, 3, 4\n\n assert pv2.columns.tolist() == [\"x\", \"a\", \"b\"]\n\n assert pv2[\"a\"].tolist() == 1, 1, 3, 3\n assert pv2[\"b\"].tolist() == 2, 2, 4, 4\n\n assert pv3.columns.tolist() == [\"x\", \"a\", \"b\"]\n\n assert pv3[\"a\"].tolist() == 1, 2, ", + "exact_match": false, + "code_bleu": 0.345720784641941, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "names", + "got": "names", + "got_raw": " names\n\ndef test_group_by():\n from siuba.dply import group_by, ungroup\n from siuba.dply.verbs import group_by, ungroup\n\n df = pd.DataFrame({\"a\": [1, 2, 3, 4, 5], \"b\": [1, 2, 3, 4, 5]})\n gdf = df >> group_by(\"a\")\n\n assert_grouping_names(gdf, [\"a\"])\n\n gdf2 = gdf >> ungroup()\n\n assert_frame_equal(gdf2, df)\n\ndef test_group_by_ungroup():\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "\"language\"", + "got": "0", + "got_raw": "0\n assert out.columns[1] == 1\n assert out.columns[2] == 2\n assert out.columns[3] == 3\n assert out.columns[4] == 4\n assert out.columns[5] == 5\n assert out.columns[6] == 6\n assert out.columns[7] == 7\n assert out.columns[8] == 8\n assert out.columns[9] == 9\n assert out.columns[10] == 10\n assert out.columns[11] == 11\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "machow/siuba", + "expected": "res)", + "got": "@pytest.mark.parametrize('func', VECTOR_FILTER_FUNCS)", + "got_raw": "\n\n\n@pytest.mark.parametrize('func', VECTOR_FILTER_FUNCS)\ndef test_filter_vector(backend, func, simple_data):\n # This test uses pandas .apply method, which no longer works with\n # symbolic expressions. This was unsafe to do anyway. Now, we\n # explicitly convert it to a call.\n from siuba.siu import strip_symbolic\n\n df = backend.load_cached_df(simple_data)\n\n call = strip_symbolic(func)\n\n res = data_frame(y = call(simple_data))\n\n\n assert_e\n\n\n@pytest.mark.parametrize('func', VECTOR_AGG_FUNCS)\ndef test_agg_vector_group", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.10526315789473684, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "0.1", + "got": "0.1, \"Asyncio sleep did not work\"", + "got_raw": "0.1, \"Asyncio sleep did not work\"\n\n # Test that asyncio.wait calls work (used in retry loops)\n start_time = time.time()\n await asyncio.wait([asyncio.sleep(0.1)]) # Minimal sleep for testing\n elapsed = time.time() - start_time\n\n assert elapsed >= 0.1, \"Asyncio wait did not work\"\n\n # Test that asyncio.create_task calls work (used in background tasks)\n start_time = time.time()\n task = asyncio.create_task(asyncio.sleep(0.1)) # Minimal sleep for testing\n await task\n ", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "\"up\"", + "got": "1", + "got_raw": "1\n assert ServiceStatus.DOWN == 0\n\n def test_service_health_checker(self):\n \"\"\"Test ServiceHealthChecker class\"\"\"\n\n # Create a mock service\n service = Service(\n id=1,\n service_name=\"test_service\",\n owner_agent_id=\"test_agent\",\n ping_url=\"http://localhost:8080/health\",\n port=8080,\n status=ServiceStatus.UP,\n last_heartbeat=datetime.now(),\n last_ping_at=datetime.now(),\n last_ping_success=True,\n meta_data={\"key\": \"value\"}\n )\n\n # Create a mock engine\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "403", + "got": "403", + "got_raw": "403\n assert response.json() == {\"detail\": \"You are not authorized to perform this action\"}\n\n def test_create_epic(self, client, api_headers, session):\n \"\"\"Test creating epic as PM\"\"\"\n # Create PM agent\n pm_agent = Agent(\n agent_id=\"pm_agent\",\n role=AgentRole.ARCHITECT,\n level=DifficultyLevel.PRINCIPAL\n )\n session.add(pm_agent)\n session.commit()\n \n epic_data = {\n \"name\": \"Test Epic\",\n \"description\": \"This is a test epic\"\n }\n \n response =", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "8080", + "got": "8080, \"Should parse port correctly from custom URL\"", + "got_raw": "8080, \"Should parse port correctly from custom URL\"\n\n def test_api_server_pid(self):\n \"\"\"Test API server PID discovery logic.\"\"\"\n HeadlessPMMCPServer = import_mcp_server()\n import psutil\n\n # Test with existing API server\n server = HeadlessPMMCPServer()\n pid, create_time = server._find_api_server_pid(6969)\n assert pid is not None, \"Should find existing API server PID\"\n assert create_time is not None, \"Should find existing API server creation time\"\n\n # Test with no existing API server\n server", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.14545454545454545, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "6969", + "got": "6969, \"Should use default port\"", + "got_raw": "6969, \"Should use default port\"\n \n # Test port discovery\n assert server._find_api_server_pid(port) is not None, \"Should find API server PID\"\n \n # Test coordination file\n coordination_file = server._get_mcp_coordination_file()\n assert coordination_file.exists(), \"Should create coordination file\"\n \n # Test pre-emptive stale PID check\n server._register_mcp_client()\n assert coordination_file.exists(), \"Should create coordination file after registration\"\n \n # Test auto-start logic\n assert server._register_mcp_client() is True, \"Should start", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.22857142857142856, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "db_url", + "got": "", + "got_raw": "<|fim_suffix|>\n # Temporarily set environment to use SQLite\n original_db_connection = os.environ.get(\"DB_CONNECTION\")\n os.environ[\"DB_CONNECTION\"] = \"sqlite\"\n \n try:\n db_url = get_database_url()\n assert db_url is not None\n\n assert \"sqlite\" in db_url.lower()\n assert \"headless-pm.db\" in db_url.lower()\n assert \"file:\" in db_url.lower()\n assert \"mode=rw\" in db_url.lower()\n assert \"timeout=5\" in db_url.lower()\n finally:\n # Restore original environment\n os.environ[\"DB_CONNECTION", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "agent_id)", + "got": "agent_id)", + "got_raw": " agent_id)\n self.assertEqual(result[\"role\"], role)\n self.assertEqual(result[\"skill_level\"], level)\n self.assertEqual(result[\"message\"], f\"Agent {agent_id} registered as {role} ({level})\")\n except Exception as e:\n print(f\"Failed to register agent {agent_id}: {e}\")\n self.created_agents.discard(agent_id)\n created_in_test.remove(agent_id)\n \n # Check if all agents were created\n self.assertEqual(len(created_in_test), len(agent_configs))\n \n # List all agents\n result = self.client.list_agents()\n self.assertEqual(len(result), len(created", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "1", + "got": "1", + "got_raw": "1\n assert len(agent.tasks_assigned) == 1\n assert len(agent.tasks_completed) == 0\n assert len(agent.tasks_in_progress) == 1\n assert len(agent.tasks_under_work) == 0\n assert len(agent.tasks_waiting) == 0\n assert len(agent.tasks_waiting_for_approval) == 0\n assert len(agent.tasks_waiting_for_review) == 0\n assert len(agent.tasks_waiting_for_testing) == 0\n assert len(agent.tasks_waiting_for_deployment) == 0\n assert len(agent.tasks_waiting_for_release) == 0\n assert len", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "madviking/headless-pm", + "expected": "cmd", + "got": "cmd[0]", + "got_raw": " cmd[0]\n assert \"src.main\" in cmd[1]\n assert \"--host\" in cmd[2]\n assert \"--port\" in cmd[3]\n assert \"6969\" in cmd[4]\n \n # Ensure fork bomb prevention works\n assert mcp_server._is_mcp_spawned_context()\n \n # Ensure fork bomb prevention works\n assert mcp_server._is_mcp_spawned_context()\n \n # Ensure fork bomb prevention works\n assert mcp_server._is_mcp_spawned_context()\n \n # Ensure fork bomb prevention works\n assert mcp_server", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "b\"hello from p1\\n\"", + "got": "1024", + "got_raw": "1024\n assert f0.deferreds[\"connectionLost\"].result is None\n assert f1.deferreds[\"connectionLost\"].result is None\n assert f1.deferreds[\"dataReceived\"].result == 1024\n assert f0.deferreds[\"dataReceived\"].result == 1024\n\n await w1.close()\n await w2.close()\n\n await doBoth(f0.deferreds[\"connectionLost\"], f1.deferreds[\"connectionLost\"])\n\n assert f0.deferreds[\"connectionLost\"].result is None\n assert f1.deferreds[\"connectionLost\"].result is None", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "1", + "got": "1", + "got_raw": "1\n assert e[0].value == UnknownMessageType(\"not recognized\")\n\n m.got_record(Pong(1))\n assert h.outbound.mock_calls == \\\n [mock.call.send_if_connected(Pong(1))]\n clear_mock_calls(h.outbound)\n\n m.got_record(Ping(1))\n assert h.outbound.mock_calls == \\\n [mock.call.send_if_connected(Pong(1))]\n clear_mock_calls(h.outbound)\n\n m.got_record(Pong(1))\n assert h.outbound.mock_calls == \\\n [mock.call.send_if_connected(Pong(1))]\n clear_mock", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "\"ssh-rsa\"", + "got": "1", + "got_raw": "1\n assert keyid == \"id_rsa.pub\"\n assert pubkey == pubkey_data\n\n\ndef test_find_one_nothing():\n files = OTHERS + [\"id_rsa.pub\", \"id_rsa\"]\n with mock.patch(\"wormhole.cli.cmd_ssh.exists\", return_value=False):\n with mock.patch(\"os.listdir\", return_value=files) as ld:\n with mock.patch(\n \"wormhole.cli.cmd_ssh.open\", return_value=io.StringIO()):\n res = cmd_ssh.find_public_key()\n assert ld.mock_calls == \\\n [mock.call(os.path.expanduser(\"~/.ssh/\"))]\n assert len(res", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "b\"more 2->1\\n\"", + "got": "b\"more 2->1\\n\"", + "got_raw": " b\"more 2->1\\n\"\n\n # and now we can close the connections\n await w1.close()\n await w2.close()\n\n # and the data should be gone\n assert not protocols[1].transport.connected\n assert not protocols[2].transport.connected\n\n # and the connections should be gone\n assert not w1._boss._D._manager._debug_stall_connector\n assert not w2._boss._D._manager._debug_stall_connector\n\n # and the data should be gone\n assert not protocols[1].transport.connected\n assert not protocols[2", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "b\"hello p1\\n\"", + "got": "b\"hello p1\\n\"", + "got_raw": " b\"hello p1\\n\"\n log.msg(\"closing\")\n await p1_client.transport.loseConnection()\n await p1_server.transport.loseConnection()\n await w1.close()\n await w2.close()\n await eq.wait_for(10, \"all deferreds to fire\")\n\nclass ReconF(Protocol):\n def __init__(self, eq):\n self.deferreds = {}\n self.eq = eq\n\n def connectionMade(self):\n self.deferreds[\"connectionMade\"] = self.eq.deferred\n\n def dataReceived(self, data):\n self.deferreds[\"dataReceived\"] = self.eq.defer", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "[addr, addr]", + "got": "2", + "got_raw": "2\n\n # now we should have gotten two protocol builds (i.e. after we\n # \"listen\" with our factory)\n\n assert factory.builds == 2\n\n # now we should have gotten two protocol builds (i.e. after we\n # \"listen\" with our factory)\n\n assert factory.builds == 2\n\n # now we should have gotten two protocol builds (i.e. after we\n # \"listen\" with our factory)\n\n assert factory.builds == 2\n\n # now we should have gotten two protocol builds (i.e. after we\n # \"listen", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "wel2", + "got": "wel2", + "got_raw": " wel2\n\n w2 = wormhole.create(APPID, mailbox.url, reactor)\n wel1 = await w1.get_welcome() # early: before connection established\n wel2 = await w1.get_welcome() # late: already received welcome\n\n assert wel1 == wel2\n\n w3 = wormhole.create(APPID, mailbox.url, reactor)\n wel1 = await w1.get_welcome() # early: before connection established\n wel2 = await w1.get_welcome() # late: already received welcome\n\n assert wel1 == wel2\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "ValueError)", + "got": "AlreadyInputNameplateError):", + "got_raw": "AlreadyInputNameplateError):\n c.completer(\"foo\", 0)\n\n assert mock_print.call_count == 1\n assert mock_print.call_args[0][0] == \"completer exception: \"\n assert mock_print.call_args[0][1] == \"ValueError: oops\"\n assert traceback.print_exc.call_count == 1\n\ndef test_input_code_with_completion():\n helper = mock.Mock()\n c = CodeInputter(helper, \"reactor\")\n c._wrapped_completer = mock.Mock(side_effect=KeyFormatError(\"oops\"))\n with mock.patch(\"wormhole._", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.46153846153846156, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "[mock.call.start()]", + "got": "[", + "got_raw": " [\n mock.call.connect(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock.call.listen(),\n mock", + "exact_match": false, + "code_bleu": 0.0660670619445956, + "edit_similarity": 0.1, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n derive_key(b\"foo\", b\"bar\")\n\n with pytest.raises(TypeError):\n derive_key(b\"foo\", b\"bar\", 10)\n\n with pytest.raises(TypeError):\n derive_key(b\"foo\", b\"bar\", 10, 10)\n\n with pytest.raises(TypeError):\n derive_key(b\"foo\", b\"bar\", 10, 10, 10)\n\n with pytest.raises(TypeError):\n derive_key(b\"foo\", b\"bar\", 10, 10, 10, 10)\n\n with pytest.raises(TypeError", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "\"email@host\"", + "got": "1, keyid", + "got_raw": "1, keyid\n assert pubkey == pubkey_data, pubkey\n\n\ndef test_find_one_nothing():\n files = OTHERS + [\"id_rsa.pub\", \"id_rsa\"]\n with mock.patch(\"wormhole.cli.cmd_ssh.exists\", return_value=True):\n with mock.patch(\"os.listdir\", return_value=files) as ld:\n with mock.patch(\n \"wormhole.cli.cmd_ssh.open\", return_value=io.StringIO()):\n res = cmd_ssh.find_public_key()\n assert ld.mock_calls == \\\n [mock.call(os.path.expanduser(\"~/.ssh/\"))]\n assert len(res) == 0,", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "c", + "got": "1", + "got_raw": "1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n assert factory._p == 1\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "[]", + "got": "[", + "got_raw": " [\n (\"add_message\", \"phase1\", b\"msg\"),\n ]\n\ndef test_send_second():\n s, m, events = build_send()\n s.send(\"phase1\", b\"msg\")\n s.send(\"phase2\", b\"msg\")\n\n assert events == [\n (\"add_message\", \"phase1\", b\"msg\"),\n (\"add_message\", \"phase2\", b\"msg\"),\n ]\n\ndef test_send_third():\n s, m, events = build_send()\n s.send(\"phase1\", b\"msg\")\n s.send(\"phase2\", b\"msg\")\n s.send(\"", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "b\"hello from p2\\n\"", + "got": "b\"hello from p2\\n\"", + "got_raw": " b\"hello from p2\\n\"\n\n # close the first channel\n await w1.close()\n await w2.close()\n await p1_client.transport.loseConnection()\n await p2_client.transport.loseConnection()\n await p1_server.transport.loseConnection()\n await p2_server.transport.loseConnection()\n await f0.deferreds[\"connectionLost\"]\n await f1.deferreds[\"connectionLost\"]\n await f2.deferreds[\"connectionLost\"]\n\n # close the second channel\n await p1_client.transport.loseConnection()\n await p2_client.transport.loseConnection()\n await p1", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "key2", + "got": "key2", + "got_raw": " key2\n assert key1 is None\n assert key2 is None\n\n # w1 has just received w2.VERSION, and is about to send w1.VERSION\n # and then will receive w2.VERSION. When it sees w2.VERSION, it will\n # learn about the WrongPasswordError.\n await w1.get_versions() # should work\n await w2.get_versions() # should work\n\n # w1 has just received w2.VERSION, and is about to send w1.VERSION\n # and then will receive w2.VERSION. When it sees w2.VERSION, it", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "b\"data\"", + "got": "b\"data\"", + "got_raw": " b\"data\"\n assert dataY == b\"data\"\n\n@ensureDeferred\nasync def test_different_messages(reactor, mailbox):\n # the two sides use random nonces for their messages, so it's ok for\n # both to try and send the same body: they'll result in distinct\n # encrypted messages\n w1 = wormhole.create(APPID, mailbox.url, reactor)\n w2 = wormhole.create(APPID, mailbox.url, reactor)\n w1.allocate_code()\n code = await w1.get_code()\n w2.set_code(code)\n w1.send_message(b\"data\")\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "f\"No public keys in '{dot_ssh}'\"", + "got": "f\"Could not find a public key in {dot_ssh}config, {dot_ssh}known_hosts, or {dot_ssh}known_hosts~\"", + "got_raw": " f\"Could not find a public key in {dot_ssh}config, {dot_ssh}known_hosts, or {dot_ssh}known_hosts~\"\n\n\ndef test_find_none_no_dot_ssh():\n files = OTHERS # no pubkey\n with mock.patch(\"wormhole.cli.cmd_ssh.exists\", return_value=True):\n with mock.patch(\"os.listdir\", return_value=files):\n with pytest.raises(cmd_ssh.PubkeyError) as f:\n cmd_ssh.find_public_key()\n dot_ssh = os.path.expanduser(\"~/.ssh/\")\n\n assert str(f.value) == f\"Could not find a public key", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.43410852713178294, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "16", + "got": "16", + "got_raw": "16\n assert isinstance(key1, bytes)\n assert dg.key == key1\n\n w1.close()\n w2.close()\n await poll_until(lambda: dg.closed)\n assert dg.closed == \"happy\"\n\n\n@ensureDeferred\nasync def test_delegated_closed(reactor, mailbox):\n dg = Delegate()\n w1 = wormhole.create(APPID, mailbox.url, reactor, delegate=dg)\n w1.set_code(\"1-abc\")\n w2 = wormhole.create(APPID, mailbox.url, reactor)\n w2.set_code(\"1-abc\")\n await poll_until(lambda:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "bytes", + "got": "", + "got_raw": " # XXX bytes or str?\n assert key1 == dg.key\n\n assert type(dg.verifier) is # XXX bytes or str?\n assert dg.verifier == dg.key\n\n assert dg.versions == {\"version\": 1, \"app\": APPID}\n\n w1.close()\n w2.close()\n await w1.wait_closed()\n await w2.wait_closed()\n\n assert dg.messages == [b\"ping\", b\"pong\"]\n\n w1 = wormhole.create(APPID, mailbox.url, reactor, delegate=dg)\n w1.set_code(\"1-abc\")\n w1.send", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "magic-wormhole/magic-wormhole", + "expected": "1", + "got": "1", + "got_raw": "1\n assert events[0] == (\"got_code\", code)\n\n assert b._result is None\n assert m._result is None\n assert r._result is None\n\n k.got_pake(b\"pake\")\n\n assert len(events) == 2\n assert events[1] == (\"got_pake\", b\"pake\")\n\n assert b._result is None\n assert m._result is None\n assert r._result is None\n\n k.compute_key(b\"pake\")\n\n assert len(events) == 3\n assert events[2] == (\"compute_key", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "impl_instance", + "got": "", + "got_raw": " # type: ignore[comparison-overlap]\n\n # If we register the adapter as a protocol, it should be resolvable\n container = create_sync_container(injectables=[BarProtocol, make_bar_protocol])\n\n assert proto_instance is # type: ignore[comparison-overlap]\n\n # If we register the adapter as an ABC, it should be resolvable\n container = create_sync_container(injectables=[BarABC, make_bar_protocol])\n\n assert proto_instance is # type: ignore[comparison-overlap]\n\n # If we register the adapter as a concrete class, it should be resolvable\n container =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "{\"number\": 4}", + "got": "1234567890", + "got_raw": "1234567890\n\ndef test_does_not_affect_unused_middleware(client: TestClient):\n response = client.get(\"/rng/depends\")\n assert response.status_code == 200\n\n assert response.json() == 1234567890\n\ndef test_does_not_affect_unused_background_tasks(client: TestClient):\n response = client.get(\"/rng/depends\")\n assert response.status_code == 200\n\n assert response.json() == 1234567890\n\ndef test_does_not_affect_unused_class_based_handlers(client", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "200", + "got": "200", + "got_raw": "200\n assert response.json() == {\"data\": {\"hello\": \"Hello, Wireup!\"}}\n\ndef test_fastapi_runtime_injects_context() -> None:\n with TestClient(create_app(middleware_mode=True)) as client:\n response = client.post(\"/graphql\", json={\"query\": \"{ hello fromContext }\"}, headers={\"x-name\": \"Wireup\"})\n\n assert response.status_code == 200\n assert response.json() == {\"data\": {\"hello\": \"Hello, Wireup!\"}}\n\ndef test_fastapi_runtime_injects_request() -> None:\n with TestClient(create_app(m", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "42", + "got": "42", + "got_raw": "42\n\ndef test_as_type_on_class():\n @injectable(as_type=ClassProto)\n class RealService:\n def call(self) -> int:\n return 42\n\n container = create_sync_container(injectables=[RealService])\n\n svc = container.get(ClassProto)\n\n assert svc.call() == 42\n\ndef test_as_type_on_class_with_injection():\n @injectable(as_type=ClassProto)\n class RealService:\n def __init__(self, bar: BarProtocol) -> None:\n self.bar = bar\n\n def call(self) -> int:\n return self.bar", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "help_result.output", + "got": "", + "got_raw": " # type: ignore[reportUnknownMemberType]\n assert \"--generator\" not in # type: ignore[reportUnknownMemberType]\n```\n\n**2. Advanced Usage**\n\nUse `@inject_from_container` to inject dependencies into any function.\n\n```python\n@inject_from_container(container)\ndef run_worker(service: Injected[UserService]) -> None:\n service.get_users()\n```\n\n### \ud83e\uddea Testing\n\nWireup is framework-agnostic. Injectables are plain classes and functions. Test them directly with no special setup.\n\nSwap dependencies during tests with `container.override`:\n\n```python\nwith container.override.injectable(target=", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "registry.impls", + "got": "", + "got_raw": " # type: ignore[reportGeneralTypeIssues]\n assert MyService in # type: ignore[reportGeneralTypeIssues]\n assert MyService in # type: ignore[reportGeneralTypeIssues]\n assert MyService in # type: ignore[reportGeneralTypeIssues]\n assert MyService in # type: ignore[reportGeneralTypeIssues]\n assert MyService in # type: ignore[reportGeneralTypeIssues]\n assert MyService in # type: ignore[reportGeneralTypeIssues]\n assert MyService in # type: ignore[reportGeneralTypeIssues]\n assert MyService in ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "0", + "got": "0", + "got_raw": "0\n\n\ndef test_async_container_clears_exit_stack_on_close() -> None:\n Something = NewType(\"Something\", str)\n\n @injectable(lifetime=InjectableLifetime.async_singleton)\n async def my_gen() -> AsyncIterator[Something]:\n yield Something(\"start\")\n\n container = wireup.create_async_container(injectables=[my_gen])\n container.get(Something)\n assert len(container._global_scope_exit_stack) == 1\n\n container.close()\n\n assert len(container._global_scope_exit_stack) == 0\n\n\ndef test_async_container_clears_exit_stack_on_close_with_scoped_container() -> None:\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "\"bar\"", + "got": "1", + "got_raw": "1\n\n test()\n\n @inject_from_container(container)\n def test2(\n a: Injected[A], b: Injected[B], c: Injected[C], foo: Annotated[str, wireup.Inject(config=\"foo\")], _: int = 1\n ):\n assert isinstance(a, A)\n assert isinstance(b, B)\n assert isinstance(c, C)\n\n assert foo == 1\n\n test2()\n\n @inject_from_container(container)\n def test3(\n a: Injected[A], b: Injected[B], c: Injected[C], foo: Annotated[str, wire", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "foo.__wireup_names__", + "got": "assert \"param1\" in sig.parameters", + "got_raw": "<|fim_suffix|>\n assert \"param1\" in sig.parameters\n\n assert foo.__wireup_names__ is not None\n\n assert \"service\" in foo.__wireup_names__\n assert \"param1\" in foo.__wireup_names__\n\n assert foo.__wireup_names__[\"service\"] == \"Service\"\n assert foo.__wireup_names__[\"param1\"] == \"param1\"\n\n assert foo.__signature__ is not None\n assert \"param1\" in foo.__signature__.parameters\n assert \"service\" in foo.__signature__.parameters\n\n assert foo.__signature__.parameters[\"param1\"].annotation == str", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.2641509433962264, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "42", + "got": "42", + "got_raw": "42\n assert scoped.get(int, qualifier=-2) == 666\n\n with c.enter_scope() as scoped:\n\n assert scoped.get(int, qualifier=-1) == 42\n assert scoped.get(int, qualifier=-2) == 666\n\n with c.enter_scope() as scoped:\n\n assert scoped.get(int, qualifier=-1) == 42\n assert scoped.get(int, qualifier=-2) == 666\n\n with c.enter_scope() as scoped:\n\n assert scoped.get(int, qualifier=-1) == 42\n assert scoped.get(int", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "{\"hello\": \"Hello World\", \"fromHeader\": \"Wireup\"}", + "got": "{\"hello\": \"Hello, Wireup!\"}", + "got_raw": " {\"hello\": \"Hello, Wireup!\"}\n\ndef test_starlette_runtime_injects_context() -> None:\n with TestClient(create_app()) as client:\n response = client.post(\"/\", json={\"query\": \"{ hello fromContext }\"}, headers={\"x-name\": \"Wireup\"})\n assert response.status_code == 200\n\n assert response.json()[\"data\"] == {\"hello\": \"Hello, Wireup!\"}\n\ndef test_starlette_runtime_injects_request() -> None:\n with TestClient(create_app()) as client:\n response = client.post(\"/\", json={\"query\": \"{ hello fromRequest }\"}, headers", + "exact_match": false, + "code_bleu": 0.2984916477287617, + "edit_similarity": 0.6933333333333334, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "\"bar_multiple_bases\"", + "got": "1", + "got_raw": "1\n assert foo.foo2 == 2\n assert foo.foo3 == 3\n assert foo.foo4 == 4\n assert foo.foo5 == 5\n assert foo.foo6 == 6\n assert foo.foo7 == 7\n assert foo.foo8 == 8\n assert foo.foo9 == 9\n assert foo.foo10 == 10\n assert foo.foo11 == 11\n assert foo.foo12 == 12\n assert foo.foo13 == 13\n assert foo.foo14 == 14", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "None", + "got": "", + "got_raw": " # type: ignore[reportGeneralTypeIssues]\n assert result.qualifier_value is not None\n assert result.qualifier_value == qualifier_value\n\n\ndef assert_has_qualifier_or_none(result: AnnotatedParameter, qualifier_value: Optional[str]) -> None:\n\n assert result.annotation is not # type: ignore[reportGeneralTypeIssues]\n assert result.qualifier_value is not None\n assert result.qualifier_value == qualifier_value\n\n\ndef assert_has_qualifier_or_none_or_empty(result: AnnotatedParameter, qualifier_value: Optional[str]) -> None:\n\n assert result.annotation is not # type: ignore[reportGeneralType", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "\"dependency_impl\"", + "got": "42", + "got_raw": "42\n\ndef test_as_type_factory_dependency_injection_with_optional():\n # Test that a dependency produced by a factory with as_type\n # is correctly injected into another service.\n\n @injectable(as_type=Optional[DependencyProto])\n def make_dependency() -> Optional[DependencyImpl]:\n return make_optional_impl()\n\n container = create_sync_container(injectables=[make_dependency, ServiceWithDependency])\n\n service = container.get(ServiceWithDependency)\n assert isinstance(service.dependency, DependencyImpl)\n\n assert service.dependency.do_something() == 42\n\n # Test that a dependency produced by a factory with as", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "1", + "got": "1", + "got_raw": "1\n assert isinstance(e.value.errors[0], WireupError)\n assert str(e.value.errors[0]) == \"Cannot close container: f1 depends on an unknown injectable 'Something'.\"\n\n\ndef test_raises_errors_on_override() -> None:\n Something = NewType(\"Something\", str)\n\n @injectable\n def f1() -> Iterator[Something]:\n yield Something(\"Something\")\n raise ValueError(\"boom\")\n\n c = wireup.create_sync_container(injectables=[f1])\n\n with pytest.raises(WireupError) as e:\n c.override.injectable(target=f1, new=Something", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "{\"hello\": \"Hello Django\"}", + "got": "", + "got_raw": " # noqa: S106\n```\n\n**2. Advanced Usage**\n\nUse factories to inject dependencies into injectables.\n\n```python\n@injectable\nclass Database:\n def __init__(self) -> None:\n self.engine = sqlalchemy.create_engine(\"sqlite://\")\n\n@injectable\nclass UserService:\n def __init__(self, db: Database) -> None:\n self.db = db\n\n@injectable\ndef database_factory() -> Database:\n return Database()\n\ncontainer = wireup.create_async_container(injectables=[database_factory, UserService])\nwireup.integration.django.setup(container, app)\n```\n\n### \ufffd", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "5", + "got": "1234567890", + "got_raw": "1234567890\n\n assert truly_random.get_truly_random() == 1234567890\n\n assert truly_random.get_truly_random() == 1234567890\n\n assert truly_random.get_truly_random() == 1234567890\n\n assert truly_random.get_truly_random() == 1234567890\n\n assert truly_random.get_truly_random() == 1234567890\n\n assert truly_random.get_truly", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "scoped_service_dependency", + "got": "123", + "got_raw": "123\n assert scoped_service_dependency is 123\n\n return {\"message\": \"scoped_route_wireup_injected\"}\n\n\n@router.get(\"/scoped/wireup_injected2\")\nasync def scoped_route_wireup_injected2(\n scoped_service: Injected[ScopedService],\n scoped_service2: Injected[ScopedService],\n scoped_service_dependency: Injected[ScopedServiceDependency],\n):\n assert scoped_service is scoped_service2\n\n assert scoped_service.other is 123\n assert scoped_service_dependency is 123\n\n return {\"message\": \"scoped_route_wireup_injected", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "[\"after_yield\"]", + "got": "", + "got_raw": " # type: ignore[assignment]\n [\"before_yield\", \"after_yield\"]\n\n@pytest.mark.parametrize(\"lifetime\", [\"scoped\", \"transient\"])\ndef test_async_factory_executes_before_and_after_yield(lifetime: InjectableLifetime) -> None:\n execution_order: list[str] = []\n Something = NewType(\"Something\", str)\n\n @injectable(lifetime=lifetime)\n async def async_factory() -> AsyncIterator[Something]:\n execution_order.append(\"before_yield\")\n yield Something(f\"async_{lifetime}_value\")\n execution_order.append(\"after_yield\")\n\n container = wireup.create_async_container(injectables=[async", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "maldoinc/wireup", + "expected": "\"Your lucky number is: 42\"", + "got": "", + "got_raw": " # type: ignore[reportUnusedExpression]\n \"Your lucky number is: 1234567890\"\n\ndef test_injects_command_options_with_defaults(runner: CliRunner, container: wireup.SyncContainer) -> None:\n @click.group()\n def cli() -> None:\n pass\n\n @cli.command()\n @click.option(\"--message\", default=\"Your lucky number is\")\n def lucky_number(generator: Injected[NumberGenerator], message: str) -> None: # type: ignore[reportUnusedFunction]\n num = generator.get_lucky_number()\n click.echo", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mammothb/symspellpy", + "expected": "si_1.term", + "got": "si_1.term", + "got_raw": " si_1.term\n assert 12 == si_1.distance\n assert 34 == si_1.count\n\n assert \"sdfg\" == si_2.term\n assert 12 == si_2.distance\n assert 34 == si_2.count\n\n assert \"dfgh\" == si_3.term\n assert 56 == si_3.distance\n assert 78 == si_3.count\n\n assert str(si_1) == \"asdf, 12, 34\"\n assert str(si_2) == \"sdf", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mammothb/symspellpy", + "expected": "len(result)", + "got": "1", + "got_raw": "1\n\n def test_load_dictionary_encoding_invalid(self, symspell_default):\n with pytest.raises(ValueError):\n symspell_default.load_dictionary(NON_EN_DICT_PATH, 0, 1, encoding=\"ascii\")\n\n def test_load_dictionary_encoding_invalid_path(self, symspell_default):\n with pytest.raises(ValueError):\n symspell_default.load_dictionary(INVALID_PATH, 0, 1, encoding=\"utf-8\")\n\n def test_load_dictionary_encoding_invalid_path2(self, symspell_default):\n with pytest.raises(ValueError):\n symspell_default.load_dictionary(INVALID_PATH, 0, 1,", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mammothb/symspellpy", + "expected": "to_similarity(6.0, length)", + "got": "0.7", + "got_raw": "0.7\n assert pytest.approx(0.0) == 0.0\n assert pytest.approx(1.0) == 1.0\n assert pytest.approx(0.0) == 0.0\n assert pytest.approx(0.0) == 0.0\n assert pytest.approx(0.0) == 0.0\n assert pytest.approx(0.0) == 0.0\n assert pytest.approx(0.0) == 0.0\n assert pytest.approx(0.0) == ", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.06896551724137931, + "n_retrieved": 10 + }, + { + "repo": "mammothb/symspellpy", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n suggest_item.__lt__(0)\n\n def test_invalid_eq(self, suggest_item):\n assert suggest_item.__eq__(0) is NotImplemented\n\n with pytest.raises(NotImplementedError):\n suggest_item.__eq__(0)\n\n def test_invalid_str(self, suggest_item):\n assert suggest_item.__str__() == \"term, 0, 0\"\n\n def test_invalid_term(self, suggest_item):\n assert suggest_item.term == \"term\"\n\n with pytest.raises(AttributeError):\n suggest_item.term = \"term\"\n\n def test_invalid_distance(self, suggest_item):\n assert suggest_item.distance ==", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "mammothb/symspellpy", + "expected": "0.7)", + "got": "0.0, abs=1e-6) == to_similarity(\"abc\", \"abc\")", + "got_raw": "0.0, abs=1e-6) == to_similarity(\"abc\", \"abc\")\n assert pytest.approx(0.0, abs=1e-6) == to_similarity(\"abc\", \"abc\", 0.0)\n assert pytest.approx(0.0, abs=1e-6) == to_similarity(\"abc\", \"abc\", 1.0)\n assert pytest.approx(0.0, abs=1e-6) == to_similarity(\"abc\", \"abc\", 2.0)\n assert pytest.approx(0.0, abs=1e-", + "exact_match": false, + "code_bleu": 0.07692375026049747, + "edit_similarity": 0.12244897959183673, + "n_retrieved": 10 + }, + { + "repo": "mammothb/symspellpy", + "expected": "result[0].term", + "got": "ul", + "got_raw": "ul\n\n\n# File: docs/examples/lookup_compound.rst\n***************\nlookup_compound\n***************\n\nBasic usage\n===========\n\n.. code-block:: python\n :emphasize-lines: 20\n\n import importlib.resources\n\n from symspellpy import SymSpell\n\n sym_spell = SymSpell(max_dictionary_edit_distance=2, prefix_length=7)\n dictionary_path = importlib.resources(\"symspellpy\") / \"frequency_dictionary_en_82_765.txt\"\n bigram_path = importlib.resources(\"symspellpy\") / \"frequency_bigramdictionary_en_", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "mammothb/symspellpy", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n AbstractDistanceComparer().distance(\"string\", \"string\", 0)\n\n def test_levenshtein(self, get_comparer):\n comparer, expected = get_comparer\n assert comparer.distance(\"string\", \"string\", 0) == 0\n assert comparer.distance(\"string\", \"string\", 1) == 0\n assert comparer.distance(\"string\", \"string\", 2) == 0\n assert comparer.distance(\"string\", \"string\", 3) == 0\n assert comparer.distance(\"string\", \"string\", 4) == 0\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "ValueError, match=\"doubled quotes followed by another quote while parsing a string\")", + "got": "pytest.raises(ValueError):", + "got_raw": " pytest.raises(ValueError):\n repair_json('{\"a\": \"b\", \"c\": \"d\"}', strict=True)\n\ndef test_strict_detects_missing_comma():\n\n with pytest.raises(ValueError):\n repair_json('{\"a\": \"b\", \"c\": \"d\"}', strict=True)\n\ndef test_strict_detects_missing_comma():\n\n with pytest.raises(ValueError):\n repair_json('{\"a\": \"b\", \"c\": \"d\"}', strict=True)\n\ndef test_strict_detects_missing_comma():\n\n with pytest.raises(ValueError):\n repair_json('{\"a\": \"b\", \"c\": \"d\"}", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "[1, \"x\"]", + "got": "1", + "got_raw": "1\n\n schema_close = {\n \"type\": \"array\",\n \"items\": [{\"type\": \"integer\"}],\n \"additionalItems\": False,\n }\n assert parse_array_direct('[1, 2, \"x\"]', schema_close) == [1, 2]\n\n schema_extra_items = {\n \"type\": \"array\",\n \"items\": [{\"type\": \"integer\"}],\n \"additionalItems\": {\"type\": \"integer\"},\n }\n assert parse_array_direct('[1, 2, \"x\"]', schema_extra_items) == [1, 2]\n\n schema_extra_items = {\n", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "\"[]\"", + "got": "", + "got_raw": " # noqa: E501\n assert repair_json(\"[{\", skip_json_loads=True) == # noqa: E501\n assert repair_json(\"[{\", skip_json_loads=True, strict=True) == # noqa: E501\n assert repair_json(\"[{\", skip_json_loads=True, strict=True, schema={\"type\": \"array\"}) == # noqa: E501\n assert repair_json(\"[{\", skip_json_loads=True, strict=True, schema={\"type\": \"array\", \"items\": {\"type\": \"object\"}}) == # noqa:", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "'{\"key\": 1}'", + "got": "'{\"key\": 10000000000.0}'", + "got_raw": " '{\"key\": 10000000000.0}'\n assert repair_json('{\"key\": 1e100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "True", + "got": "assert schema_from_input({\"type\": \"string\", \"required\": [\"value\"]}) == {", + "got_raw": "<|fim_suffix|>\n assert schema_from_input({\"type\": \"string\", \"required\": [\"value\"]}) == {\n \"type\": \"object\",\n \"properties\": {\"value\": {\"type\": \"string\"}},\n \"required\": [\"value\"],\n }\n\n assert schema_from_input({\"type\": \"object\", \"properties\": {\"value\": {\"type\": \"string\"}}}) == {\n \"type\": \"object\",\n \"properties\": {\"value\": {\"type\": \"string\"}},\n \"required\": [\"value\"],\n }\n\n assert schema_from_input({\"type\": \"object\", \"properties\": {\"value\": {\"type\": \"string", + "exact_match": false, + "code_bleu": 0.057259987315337726, + "edit_similarity": 0.07894736842105263, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "captured.err.lower()", + "got": "assert \"Error: --strict cannot be used with --schema or --schema-model\" in captured.err", + "got_raw": "<|fim_suffix|>\n assert \"Error: --strict cannot be used with --schema or --schema-model\" in captured.err\n\n assert exc.value.code == 1\n\ndef test_cli_schema_and_schema_model_error(tmp_path, capsys):\n schema_path = tmp_path / \"schema.json\"\n schema_path.write_text(json.dumps({\"type\": \"integer\"}))\n input_path = tmp_path / \"input.json\"\n input_path.write_text('{\"value\": }')\n\n with pytest.raises(SystemExit) as exc:\n cli(inline_args=[str(input_path), \"--schema\", str(schema_path), \"--schema-model\", \"json_re", + "exact_match": false, + "code_bleu": 0.35240024305758827, + "edit_similarity": 0.22429906542056074, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "'[\"value\", \"value2\"]'", + "got": "'[ \"value\", \"value2\"]'", + "got_raw": " '[ \"value\", \"value2\"]'\n assert repair_json('[ \"value\", // comment \"value2\" ]') == '[ \"value\", \"value2\"]'\n assert repair_json('[ \"value\", /* comment */ \"value2\" // comment ]') == '[ \"value\", \"value2\"]'\n assert repair_json('[ \"value\", /* comment */ \"value2\" /* comment */ ]') == '[ \"value\", \"value2\"]'\n assert repair_json('[ \"value\", /* comment */ \"value2\" /* comment */ // comment ]') == '[ \"value\", \"value2", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.9767441860465116, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "\"\"", + "got": "assert repair_json(\"}\") == \"{}\"", + "got_raw": "<|fim_suffix|>\n assert repair_json(\"}\") == \"{}\"\n assert repair_json(\"{\") == \"{}\"\n\n assert repair_json(\"}\") == \"{}\"\n assert repair_json(\"{\") == \"{}\"\n\n assert repair_json(\"}\") == \"{}\"\n assert repair_json(\"{\") == \"{}\"\n\n assert repair_json(\"}\") == \"{}\"\n assert repair_json(\"{\") == \"{}\"\n\n assert repair_json(\"}\") == \"{}\"\n assert repair_json(\"{\") == \"{}\"\n\n assert repair_json(\"}\") == \"{}\"\n assert repair_json(\"{\") == \"{}\"\n\n assert repair_json(\"}\") == \"{}\"\n assert repair_json(\"{\") == \"{}\"\n\n", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.12121212121212122, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "'{\"key\": \"val\\\\n123,`key2:value2\"}'", + "got": "'{\"key\": \"val\\\\n123,`key2:value2\"}'", + "got_raw": " '{\"key\": \"val\\\\n123,`key2:value2\"}'\n assert repair_json('{\"key\": \"val\\\\n123,`key2:value2`\"}', stream_stable=True) == '{\"key\": \"val\\\\n123,`key2:value2`\"}'\n\n # default: stream_stable = False\n # When the json to be repaired is the accumulation of streaming json at a certain moment.\n # The default repair result is unstable.\n assert repair_json('{\"key\": \"val\\\\', stream_stable=False) == '{\"key\": \"val", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "1.2", + "got": "1.2", + "got_raw": "1.2\n\n assert repair_json(\"1.2e3\", return_objects=True) == 1.2e3\n\n assert repair_json(\"1.2e-3\", return_objects=True) == 1.2e-3\n\n assert repair_json(\"1.2e+3\", return_objects=True) == 1.2e+3\n\n assert repair_json(\"1.2e3e3\", return_objects=True) == 1.2e3e3\n\n assert repair_json(\"1.2e3e-3\", return_objects=True) == 1.2e", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "'{\"key\": \"\"}'", + "got": "'{\"key\": \"\"}'", + "got_raw": " '{\"key\": \"\"}'\n assert repair_json('{\"key\": \"value\"}') == '{\"key\": \"value\"}'\n assert repair_json('{\"key\": \"value\"}') == '{\"key\": \"value\"}'\n assert repair_json('{\"key\": \"value\"}') == '{\"key\": \"value\"}'\n assert repair_json('{\"key\": \"value\"}') == '{\"key\": \"value\"}'\n assert repair_json('{\"key\": \"value\"}') == '{\"key\": \"value\"}'\n assert repair_json('{\"key\": \"value\"}') == '{\"key\": \"value\"}'\n assert repair", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "'{\"foo\": []}'", + "got": "", + "got_raw": " # missing closing bracket\n assert repair_json(\"{foo: [bar}\") == # missing closing bracket\n assert repair_json(\"{foo: [bar,}\") == # missing closing bracket\n assert repair_json(\"{foo: [bar, baz}\") == # missing closing bracket\n assert repair_json(\"{foo: [bar, baz,}\") == # missing closing bracket\n assert repair_json(\"{foo: [bar, baz, qux}\") == # missing closing bracket\n assert repair_json(\"{foo: [bar, baz, qux,}\") == # missing closing bracket\n assert repair_json", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mangiucugna/json_repair", + "expected": "{\"error\": \"schemaRepairMode must be a string.\"}", + "got": "{\"error\": \"schemaRepairMode must be a string.\"}", + "got_raw": " {\"error\": \"schemaRepairMode must be a string.\"}\n\ndef test_docs_api_rejects_invalid_schema_repair_mode_value(client):\n response = client.post(\n \"/api/repair-json\",\n json={\"malformedJSON\": '{\"value\": \"1\"}', \"schemaRepairMode\": \"invalid\"},\n )\n\n assert response.status_code == 400\n\n assert response.get_json() == {\"error\": \"schemaRepairMode must be 'standard' or 'salvage'.\"}\n\ndef test_docs_api_rejects_invalid_schema_repair_mode_none(client):\n response = client.post(\n \"/api", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "manjurulhoque/django-job-portal", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n\n # apply job\n url = reverse(\"jobs-api:apply-job\", kwargs={\"job_id\": self.jobs[0].id})\n response = self.client.post(url, {\"job\": self.jobs[0].id})\n self.assertEqual(response.status_code, status.HTTP_201_CREATED)\n\n # get applied jobs again\n response = self.client.get(applied_jobs_url)\n self.assertEqual(response.status_code, status.HTTP_200_OK)\n self.assertEqual(len(response.json()), 1)\n self.assertEqual(response.json()[0][\"applicant\"][\"job\"][\"id\"], self.jobs[0].id)\n\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "manjurulhoque/django-job-portal", + "expected": "[\"This field is required.\"])", + "got": "self.assertEqual(form.errors[\"password1\"], [\"Password must be at least 8 characters long.\"])", + "got_raw": "<|fim_suffix|>\n self.assertEqual(form.errors[\"password1\"], [\"Password must be at least 8 characters long.\"])\n\n self.assertEqual(form.errors[\"password2\"], [\"Password must be at least 8 characters long.\"])\n\n def test_password_mismatch(self):\n form = EmployeeRegistrationForm(data=self.valid_user)\n\n self.assertEqual(form.errors[\"password2\"], [\"Password fields didn't match.\"])\n\n def test_password_too_short(self):\n form = EmployeeRegistrationForm(data={\"password1\": \"123456\", \"password2\": \"123456\"})\n\n self.assertEqual(form.errors[\"password", + "exact_match": false, + "code_bleu": 0.11633270842295028, + "edit_similarity": 0.23333333333333334, + "n_retrieved": 10 + }, + { + "repo": "manjurulhoque/django-job-portal", + "expected": "\"Manjurul Hoque\")", + "got": "\"Manjurul Hoque\")", + "got_raw": " \"Manjurul Hoque\")\n\n def test_email(self):\n self.assertEqual(self.user.email, \"rumi1@gmail.com\")\n\n def test_role(self):\n self.assertEqual(self.user.role, \"employee\")\n\n def test_gender(self):\n self.assertEqual(self.user.gender, \"male\")\n\n def test_is_active(self):\n self.assertTrue(self.user.is_active)\n\n def test_is_staff(self):\n self.assertFalse(self.user.is_staff)\n\n def test_is_superuser(self):\n self.assertFalse(self.user.is_superuser)\n\n def test_get_short_name(self):\n self.assertEqual(self.user.get_short_name(), \"Manjurul\")\n\n def", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "manjurulhoque/django-job-portal", + "expected": "User.objects.filter(email=self.valid_data[\"email\"]).exists())", + "got": "", + "got_raw": "\n\n\n# File: accounts/api/serializers.py\nfrom rest_framework import serializers\n\nfrom ..models import *\n\n\nclass UserSerializer(serializers.ModelSerializer):\n def __init__(self, *args, **kwargs):\n kwargs[\"partial\"] = True\n super(UserSerializer, self).__init__(*args, **kwargs)\n\n class Meta:\n model = User\n # fields = \"__all__\"\n exclude = (\"password\", \"user_permissions\", \"groups\", \"is_staff\", \"is_active\", \"is_superuser\", \"last_login\")\n\n\nclass UserCreateSerializer(serializers.ModelSerializer):\n password = serializers.CharField(write_only=True, required=True,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "manjurulhoque/django-job-portal", + "expected": "self.job.id)", + "got": "1)", + "got_raw": "1)\n\n def test_dashboard_api_view_with_pagination(self):\n \"\"\"Test the dashboard API endpoint with pagination\"\"\"\n # create more jobs\n for i in range(10):\n JobFactory(user=self.employer)\n\n # check without authentication\n url = reverse(\"jobs-api:employer-dashboard\")\n response = self.client.get(url)\n self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)\n\n # check with authentication\n self.client.force_authenticate(user=self.employer)\n response = self.client.get(url)\n self.assertEqual(response.status_code, status.HTTP_200_OK)\n self", + "exact_match": false, + "code_bleu": 0.17909498863725698, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "manjurulhoque/django-job-portal", + "expected": "\"Invalid form\")", + "got": "\"Form is not valid\")", + "got_raw": " \"Form is not valid\")\n\n def test_employee_registration_form_invalid(self):\n invalid_user = {\n \"first_name\": \"Manjurul\",\n \"last_name\": \"Hoque\",\n \"role\": \"employee\",\n \"gender\": \"male\",\n \"email\": \"rumi1@gmail.com\",\n \"password1\": \"123456\",\n \"password2\": \"123456\",\n }\n\n form = EmployeeRegistrationForm(data=invalid_user)\n\n self.assertEqual(False, form.is_valid(), \"Form is valid\")\n\n def test_employee_registration_form_invalid_email(self):\n", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5142857142857142, + "n_retrieved": 10 + }, + { + "repo": "manjurulhoque/django-job-portal", + "expected": "\"Test Job\")", + "got": "self.job_data[\"title\"])", + "got_raw": " self.job_data[\"title\"])\n self.assertEqual(serializer.data[\"description\"], self.job_data[\"description\"])\n self.assertEqual(serializer.data[\"location\"], self.job_data[\"location\"])\n self.assertEqual(serializer.data[\"salary\"], self.job_data[\"salary\"])\n self.assertEqual(serializer.data[\"created_at\"], self.job_data[\"created_at\"])\n self.assertEqual(serializer.data[\"last_date\"], self.job_data[\"last_date\"])\n self.assertEqual(serializer.data[\"user\"], self.job_data[\"user\"].id)\n self.assertEqual(serializer.data[\"tags\"], None)\n self.assertEqual(serializer.data[\"filled\"], False)\n self.assertEqual(serializer.data[\"vacancy\"], 1)\n", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.29411764705882354, + "n_retrieved": 10 + }, + { + "repo": "manjurulhoque/django-job-portal", + "expected": "status.HTTP_400_BAD_REQUEST)", + "got": "400)", + "got_raw": "400)\n\n def test_registration_success(self):\n response = self.client.post(self.url, self.valid_data, format=\"json\")\n self.assertEqual(response.status_code, 201)\n self.assertTrue(response.data[\"status\"])\n self.assertEqual(response.data[\"message\"], \"Successfully registered\")\n self.assertTrue(User.objects.filter(email=self.valid_data[\"email\"]).exists())\n\n def test_registration_duplicate_email(self):\n User.objects.create_user(\n email=self.valid_data[\"email\"],\n password=\"testpass123\",\n role=\"employee\"\n )\n response = self.client.post(self.url, self.valid_data, format=\"", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "manzt/anywidget", + "expected": "path.read_text()", + "got": "1", + "got_raw": "1\n assert foo._repr_mimebundle_._extra_state[\"bar\"] is not bar\n assert foo._repr_mimebundle_._extra_state[\"bar\"]._background_thread is None\n\n assert foo._repr_mimebundle_._extra_state[\"bar\"]._path == path\n assert foo._repr_mimebundle_._extra_state[\"bar\"]._start_thread is False\n\n assert foo._repr_mimebundle_._extra_state[\"bar\"]._path == path\n assert foo._repr_mimebundle_._extra_state[\"bar\"]._start_thread is False\n\n assert foo._repr_mimebundle_._extra", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "manzt/anywidget", + "expected": "new_contents", + "got": "", + "got_raw": " # type: ignore[no-any-return]\n assert contents.contents == new_contents\n\ndef test_file_contents_deleted(tmp_path: pathlib.Path) -> None:\n \"\"\"Test file changes emit deleted signals and update the string contents\"\"\"\n str_contents = \"hello, world\"\n path = tmp_path / \"foo.txt\"\n path.write_text(str_contents)\n contents = FileContents(path, start_thread=False)\n\n mock = MagicMock()\n contents.deleted.connect(mock)\n\n path.unlink()\n\n mock.assert_called_with()\n\n assert str(contents) == # type: ignore[no-any-return]\n assert contents.contents is None\n\ndef test", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "manzt/anywidget", + "expected": "bundle[0]", + "got": "", + "got_raw": " # noqa: E501\n assert bundle[_WIDGET_MIME_TYPE][\"value\"] == val\n\n # test that the comm sends update messages\n _send_value(repr_method, 2)\n _assert_sends_update(foo, mock_comm, 2)\n\n # test that the comm sends update messages\n _send_value(repr_method, 3)\n _assert_sends_update(foo, mock_comm, 3)\n\n # test that the comm sends update messages\n _send_value(repr_method, 4)\n _assert_sends_update(foo, mock_comm, 4)\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "manzt/anywidget", + "expected": "y", + "got": "y", + "got_raw": " y\n assert state[\"y\"][\"shape\"] is y_shape\n\n # check that buffers are put back\n assert buffers == [mv1, mv2]\n assert buffer_paths == [[\"x\", \"ar\"], [\"y\", \"data\"], [\"z\", 0], [\"z\", 1], [\"deep\", \"b\", 1, \"deeper\"]]\n\n # check that put_buffers works\n state = state_before\n put_buffers(state, buffer_paths, buffers)\n assert state[\"x\"] == {\"ar\": mv1}\n assert state[\"y\"] == {\"shape\": (10,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "manzt/anywidget", + "expected": "bar", + "got": "1", + "got_raw": "1\n assert isinstance(file_contents, FileContents)\n\ndef test_autodetect_file_contents(tmp_path: pathlib.Path) -> None:\n \"\"\"Test that the file contents are inferred from the file path.\"\"\"\n\n path = tmp_path / \"bar.txt\"\n path.write_text(\"Hello, world\")\n\n class Foo:\n _repr_mimebundle_ = MimeBundleDescriptor()\n value: int = 1\n\n def _get_anywidget_state(self, include: Union[Set[str], None]): # noqa: ANN202, ARG002\n return {\"value\": self.value}\n\n file_contents = Foo", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "marcolivierarsenault/moonraker-home-assistant", + "expected": "1.2", + "got": "1.2", + "got_raw": "1.2\n assert result[\"layer_count\"] == 20\n assert result[\"layer_height\"] == 0.2\n assert result[\"first_layer_height\"] == 0.3\n assert result[\"gcode_start_byte\"] == 100\n assert result[\"gcode_end_byte\"] == 200\n\n assert \"Missing thumbnail metadata for example.gcode\" in caplog.text\n\nasync def test_gcode_detail_missing_metadata_skips_warning(hass, caplog):\n \"\"\"Missing metadata should not emit warnings.\"\"\"\n config_entry = MockConfigEntry(domain=DOMAIN, data=", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcolivierarsenault/moonraker-home-assistant", + "expected": "caplog.text", + "got": "entry.unique_id, \"camera\") == entry.device_id", + "got_raw": "entry.unique_id, \"camera\") == entry.device_id\n\n assert entry.device_class == \"video_input\"\n\n assert entry.name == \"Mainsail Webcam\"\n\n assert entry.model == \"Moonraker\"\n\n assert entry.manufacturer == \"Moonraker\"\n\n assert entry.sw_version == \"1.13.2\"\n\n assert entry.device_info == {\n \"identifiers\": {(DOMAIN, \"test\")},\n \"name\": \"Mainsail\",\n \"model\": \"Moonraker\",\n \"manufacturer\": \"Moonraker\",\n \"sw_version\": \"1.13.2\",\n }\n\n", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "marcolivierarsenault/moonraker-home-assistant", + "expected": "\"\"", + "got": "\"\"", + "got_raw": " \"\"\n\ndef test_strip_gcode_root_no_root():\n \"\"\"Return path when root is not found.\"\"\"\n\n assert _strip_gcode_root(\"gcode\", None) == \"gcode\"\n\ndef test_strip_gcode_root_no_root_prefix():\n \"\"\"Return path when root is not found.\"\"\"\n\n assert _strip_gcode_root(\"gcode\", \"/gcodes\") == \"gcode\"\n\ndef test_strip_gcode_root_no_root_prefix():\n \"\"\"Return path when root is not found.\"\"\"\n\n assert _strip_gcode_root(\"gcode\", \"/gcodes/\") == \"gcode\"\n\ndef test_strip_gcode_root_no_root_prefix():\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcolivierarsenault/moonraker-home-assistant", + "expected": "state.attributes", + "got": "state.attributes", + "got_raw": " state.attributes\n assert \"filament_remaining\" not in state.attributes\n assert \"filament_extruded\" not in state.attributes\n assert \"filament_unextruded\" not in state.attributes\n assert \"filament_volume\" not in state.attributes\n assert \"filament_volume_remaining\" not in state.attributes\n assert \"filament_volume_extruded\" not in state.attributes\n assert \"filament_volume_unextruded\" not in state.attributes\n assert \"filament_volume_used\" not in state.attributes\n assert \"filament_volume_remaining\" not", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcolivierarsenault/moonraker-home-assistant", + "expected": "0.2", + "got": "0.2", + "got_raw": "0.2\n assert result[\"first_layer_height\"] == 0.3\n assert result[\"gcode_start_byte\"] == 100\n assert result[\"gcode_end_byte\"] == 200\n\n assert \"Missing thumbnail metadata\" in caplog.text\n\nasync def test_gcode_detail_missing_metadata_skips_warning(hass, caplog):\n \"\"\"Missing metadata should not emit warnings.\"\"\"\n config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_CONFIG, entry_id=\"test\")\n coordinator = MoonrakerDataUpdateCoordinator(\n hass, client=MagicMock(), config_entry", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcolivierarsenault/moonraker-home-assistant", + "expected": "False", + "got": "False", + "got_raw": " False\n\n\nasync def test_update_available_missing_machine_update(hass):\n \"\"\"Test update available without machine_update data.\"\"\"\n config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_CONFIG, entry_id=\"test\")\n config_entry.add_to_hass(hass)\n await hass.config_entries.async_setup(config_entry.entry_id)\n await hass.async_block_till_done()\n\n coordinator = hass.data[DOMAIN][config_entry.entry_id]\n coordinator.data.pop(\"machine_update\", None)\n\n desc = MoonrakerBinarySensorDescription(\n key=\"update_available_direct\",\n sensor_name=\"update_available\",\n is_on_fn=", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "DEVNULL", + "got": "DEVNULL", + "got_raw": " DEVNULL\n\ndef test_call_sets_stderr_as_devnull_when_logger_level_is_debug(mocker, mock_popen):\n MockProc = mocker.patch('passpie.process.Proc')\n MockProc().__enter__.return_value.communicate.return_value = ('', '')\n mock_logging = mocker.patch('passpie.process.logging')\n mock_logging.getLogger().getEffectiveLevel.return_value = 10\n mock_logging.DEBUG = 10\n\n call(['echo', 'hello'])\n args, kwargs = MockProc.call_args\n\n assert kwargs['stderr'] == PIPE\n\ndef test_call_sets_stdout_as_pipe_when_logger_level_is_not", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "None", + "got": "None", + "got_raw": " None\n\ndef test_crypt_make_key_input_handles_unicode_encode_error(mocker):\n passphrase = u\"L'\u00e9ph\u00e9m\u00e8re\"\n key_length = '2064'\n key_input = make_key_input(passphrase, key_length)\n\n\n assert key_input is not None\n\ndef test_crypt_export_keys(mocker):\n mocker.patch('passpie.crypt.which', return_value='gpg2')\n mocker.patch('passpie.crypt.open', mock_open())\n mocker.patch('passpie.crypt.DEVNULL', DEVNULL)\n mocker.patch('passpie.crypt.process.call', mock_call(mocker))\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "credpath)", + "got": "credpath)", + "got_raw": "credpath)\n self.mock_os.rmdir.assert_any_call(os.path.dirname(credpath))\n\n def test_delete_removes_empty_directories(self):\n credentials = [\n {\"name\": \"bar\", \"login\": \"foo\"},\n {\"name\": \"spam\", \"login\": \"foozy\"},\n ]\n\n self.storage.delete(credentials)\n\n for cred in credentials:\n credpath = self.mock_os.path.join(cred[\"name\"], cred[\"login\"])\n\n self.mock_os.remove.assert_any_call(credpath)\n self.mock_os.rmdir.assert_any_call(os.path.dirname(credpath))\n\n def test_read_returns_credentials(self", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "str(excinfo.value)", + "got": "str(excinfo.value)", + "got_raw": " str(excinfo.value)\n\n\ndef test_ensure_dependencies_does_not_raise_when_gpg_installed(mocker):\n mocker.patch('passpie.utils.which', return_value='gpg')\n\n ensure_dependencies()\n\n\ndef test_genpass():\n assert genpass() == '********'\n\n\ndef test_genpass_with_pattern():\n assert genpass(pattern=r'[\\w]{32}') == '********'\n\n\ndef test_genpass_with_pattern_and_length():\n assert genpass(pattern=r'[\\w]{32}', length=10) == '********'\n\n\ndef test_genpass_with_pattern_and_length_and_uppercase():\n assert genpass(pattern=r'[A", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n self.assertEqual(elements[\"_default\"][1][\"name\"], \"eggs\")\n self.assertEqual(elements[\"_default\"][1][\"login\"], \"eggs\")\n self.assertEqual(elements[\"_default\"][1][\"password\"], \"eggs\")\n self.assertEqual(elements[\"_default\"][1][\"comment\"], \"eggs\")\n\n self.assertEqual(elements[\"_default\"][2][\"name\"], \"spam\")\n self.assertEqual(elements[\"_default\"][2][\"login\"], \"spam\")\n self.assertEqual(elements[\"_default\"][2][\"password\"], \"spam\")\n self.assertEqual(elements[\"_default\"][2][\"comment\"], \"spam\")\n\n def test_read_returns_all_found_credentials_in_default", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "None", + "got": "None", + "got_raw": " None\n\ndef test_ensure_git_logs_debug_for_git_installed(mocker, mock_process):\n mocker.patch('passpie.history.which', return_value='git')\n mock_logging = mocker.patch('passpie.history.logging')\n\n @ensure_git()\n def func():\n pass\n result = func()\n\n assert mock_logging.error.called is False\n\n assert result is None\n\ndef test_ensure_git_returns_value(mocker, mock_process):\n mocker.patch('passpie.history.which', return_value='git')\n mock_logging = mocker.patch('passpie.history.logging')\n\n @ensure_git(return_value='value')\n def func():\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "(None, \"example.com\")", + "got": "(\"\", \"example.com\")", + "got_raw": " (\"\", \"example.com\")\n assert split_fullname(\"example\") == (\"\", \"example\")\n\n assert split_fullname(\"@example\") == (\"\", \"example\")\n assert split_fullname(\"@example.com\") == (\"\", \"example.com\")\n\n assert split_fullname(\"@example.com@\") == (\"\", \"example.com\")\n assert split_fullname(\"@example.com@\") == (\"\", \"example.com\")\n\n assert split_fullname(\"@example.com@\") == (\"\", \"example.com\")\n assert split_fullname(\"@example.com@\") == (\"\", \"example.com\")\n\n assert split", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.85, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "None", + "got": "assert db.credential(fullname='login@name') is None", + "got_raw": "<|fim_suffix|>\n assert db.credential(fullname='login@name') is None\n assert db.credential(fullname='login@name2') is None\n assert db.credential(fullname='login@name3') is None\n assert db.credential(fullname='login@name4') is None\n assert db.credential(fullname='login@name5') is None\n assert db.credential(fullname='login@name6') is None\n assert db.credential(fullname='login@name7') is None\n assert db.credential(fullname='login@name8') is None", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.14545454545454545, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "{}", + "got": "{}", + "got_raw": " {}\n assert mock_logging.debug.call_count == 1\n assert mock_logging.debug.call_args[0][0] == u'config file \"path\" not found'\n\n\ndef test_config_read_logs_debug_when_config_file_is_not_yaml(mocker):\n mocker.patch('passpie.config.open', side_effect=IOError, create=True)\n mock_logging = mocker.patch('passpie.config.logging')\n\n result = passpie.config.read('path')\n\n assert result == {}\n assert mock_logging.debug.call_count == 1\n assert mock_logging.debug.call_args[0][0] == u'Malformed user configuration file:", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "*autopull)", + "got": "autopull[0], autopull[1])", + "got_raw": "autopull[0], autopull[1])\n\ndef test_calls_pull_rebase_on_initialization_when_autopull_is_passed_with_depth(mocker, mock_process):\n mocker.patch.object(Repository, 'pull_rebase')\n autopull = ['origin', 'master', '1']\n repo = Repository('path', autopull)\n assert repo.pull_rebase.called\n\n repo.pull_rebase.assert_called_once_with(autopull[0], autopull[1])\n\ndef test_calls_pull_rebase_on_initialization_when_autopull_is_passed_with_depth(mocker, mock_process):\n mocker.patch.object(Repository, 'pull", + "exact_match": false, + "code_bleu": 0.13950796967929133, + "edit_similarity": 0.5142857142857142, + "n_retrieved": 10 + }, + { + "repo": "marcwebbie/passpie", + "expected": "5", + "got": "5", + "got_raw": "5\n assert mock_time.sleep.call_args_list[0][0][0] == 1\n assert mock_time.sleep.call_args_list[1][0][0] == 1\n assert mock_time.sleep.call_args_list[2][0][0] == 1\n assert mock_time.sleep.call_args_list[3][0][0] == 1\n assert mock_time.sleep.call_args_list[4][0][0] == 1\n\n\ndef test_copy_to_clipboard(mocker):\n mocker.patch('passpie.clipboard.process')\n mocker.patch('passpie.clipboard.sys.stdout')\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/apispec", + "expected": "make_schema_key(PetSchema(load_only=structure(modifier[::-1])))", + "got": "", + "got_raw": "\n\n\n# File: src/apispec/ext/marshmallow/field_converter.py\n def field2required(self, field: fields.Field) -> bool:\n \"\"\"Return whether the field is required.\n\n :param Field field: Field instance\n :return: True if the field is required, False otherwise\n \"\"\"\n return field.required\n\n def list2param(self, field: fields.List) -> dict:\n \"\"\"Return a parameter definition for a list field.\n\n :param List field: List field instance\n :return: Parameter definition\n \"\"\"\n param = {\"type\": \"array\"}\n if field", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/apispec", + "expected": "resp", + "got": "200", + "got_raw": "200\n assert response[\"description\"] == \"Return a pet\"\n assert response[\"content\"] == {\"application/json\": {\"example\": {\"name\": \"Example\"}}}\n\n @pytest.mark.parametrize(\"spec\", (\"3.0.0\",), indirect=True)\n def test_content_with_schema(self, spec):\n resp = {\n \"content\": {\n \"application/json\": {\n \"schema\": {\"$ref\": \"#/components/schemas/Pet\"}\n }\n }\n }\n spec.components.response(\"GetPetOk\", resp)\n response = get_responses(spec)[\"GetPetOk\"]\n\n assert response", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/apispec", + "expected": "[\"field3\", \"field4\", \"field5\"]", + "got": "[\"field5\"]", + "got_raw": " [\"field5\"]\n assert list(get_fields(ExcludeSchema, exclude_dump_only=True).keys()) == [\"field5\"]\n\n def test_get_fields_meta_exclude_dump_only_as_dict(self):\n class ExcludeSchema(Schema):\n field1 = fields.Int()\n field2 = fields.Int()\n field3 = fields.Int()\n field4 = fields.Int()\n field5 = fields.Int()\n\n class Meta:\n exclude = {\"field1\", \"field2\"}\n dump_only = {\"field3\", \"field4\"}\n\n\n assert list(get_fields(ExcludeSchema).keys()) == [\"field5\"]\n assert", + "exact_match": false, + "code_bleu": 0.27383275896268816, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/apispec", + "expected": "\"1.0.0\"", + "got": "1.0", + "got_raw": "1.0\n assert metadata[\"openapi\"] == \"3.0.2\"\n\n assert metadata[\"info\"][\"description\"] == description\n\n def test_openapi_version(self, spec):\n assert spec.openapi_version.major == 3\n assert spec.openapi_version.minor == 0\n assert spec.openapi_version.micro == 2\n\n def test_openapi_version_validation(self):\n with pytest.raises(APISpecError):\n APISpec(\n title=\"Swagger Petstore\",\n version=\"1.0.0\",\n openapi_version=\"2.0\",\n info={\"description\": description},\n )\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/apispec", + "expected": "[ \"field5\" ]", + "got": "[\"field5\"]", + "got_raw": " [\"field5\"]\n\n def test_get_fields_meta_exclude_dump_only_as_set(self):\n class ExcludeSchema(Schema):\n field1 = fields.Int()\n field2 = fields.Int()\n field3 = fields.Int()\n field4 = fields.Int()\n field5 = fields.Int()\n\n class Meta:\n exclude = {\"field1\", \"field2\"}\n dump_only = {\"field3\", \"field4\"}\n\n assert list(get_fields(ExcludeSchema).keys()) == [\"field3\", \"field4\", \"field5\"]\n\n assert list(get_fields(ExcludeSchema, exclude_dump_only=True).keys()) == ", + "exact_match": false, + "code_bleu": 0.8408964152537145, + "edit_similarity": 0.9090909090909091, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/apispec", + "expected": "enum", + "got": "enum", + "got_raw": " enum\n\n def test_schema_stores_enum_with_description(self, spec):\n enum = [\"name\", \"photoUrls\"]\n spec.components.schema(\n \"Pet\", {\"properties\": self.properties, \"enum\": enum, \"description\": \"Pet\"}\n )\n schemas = get_schemas(spec)\n\n assert schemas[\"Pet\"][\"description\"] == \"Pet\"\n\n def test_schema_stores_enum_with_description_and_example(self, spec):\n enum = [\"name\", \"photoUrls\"]\n spec.components.schema(\n \"Pet\",\n {\n \"properties\": self.properties,\n \"enum\": enum,\n \"description\": \"Pet", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "[\"name\", \"email\", \"age\", \"created\", \"id\", \"homepage\"]", + "got": "[\"name\", \"email\", \"created_at\"]", + "got_raw": " [\"name\", \"email\", \"created_at\"]\n\n def test_nested_field_order_with_exclude_arg_is_maintained_with_many(self, user):\n class HasNestedExclude(Schema):\n users = fields.List(fields.Nested(UserSchema, exclude=(\"birthdate\",)))\n\n ser = HasNestedExclude()\n data = ser.dump({\"users\": [user]})\n user_data = data[\"users\"][0]\n keys = list(user_data)\n\n assert keys == [\"name\", \"email\", \"created_at\"]\n\n def test_nested_field_order_with_exclude_arg_is_maintained_with_many_and_nested(self, user):\n class HasNested", + "exact_match": false, + "code_bleu": 0.38074980525429475, + "edit_similarity": 0.6904761904761905, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "[\"error1\", \"error2\"]", + "got": "[\"error1\", \"error2\"]", + "got_raw": " [\"error1\", \"error2\"]\n\n def test_merging_none_and_dict(self):\n\n assert merge_errors(None, {\"error1\": \"error1\", \"error2\": \"error2\"}) == {\"error1\": \"error1\", \"error2\": \"error2\"}\n\n def test_merging_none_and_none(self):\n\n assert merge_errors(None, None) == None\n\n def test_merging_list_and_list(self):\n\n assert merge_errors([\"error1\", \"error2\"], [\"error3\", \"error4\"]) == [\"error1\", \"error2\", \"error3\", \"error4\"]\n\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "\"invalid email\"", + "got": "\"invalid email\"", + "got_raw": " \"invalid email\"\n\n def test_dict(self):\n err = ValidationError({\"email\": [\"invalid email\"]})\n\n assert err.messages == {\"email\": [\"invalid email\"]}\n\n def test_dict_with_code(self):\n err = ValidationError({\"email\": [\"invalid email\"]}, code=400)\n\n assert err.messages == {\"email\": [\"invalid email\"]}\n assert err.code == 400\n\n def test_dict_with_code_and_message(self):\n err = ValidationError({\"email\": [\"invalid email\"]}, code=400, message=\"invalid email\")\n\n assert err.messages == {\"email\": [\"invalid email\"]}\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "2", + "got": "2", + "got_raw": "2\n\ndef test_serializing_named_tuple_with_meta_and_exclude():\n p = Point(x=4, y=2)\n\n class PointSerializer(Schema):\n x = fields.Int()\n y = fields.Int()\n\n class Meta:\n exclude = (\"x\",)\n\n serialized = PointSerializer().dump(p)\n assert serialized[\"y\"] == 2\n\ndef test_serializing_named_tuple_with_meta_and_include():\n p = Point(x=4, y=2)\n\n class PointSerializer(Schema):\n x = fields.Int()\n y = fields.Int()\n\n class Meta:\n include = (\"x\",)\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "{ \"_schema\": \"error2\", \"field1\": \"error1\", }", + "got": "{\"field1\": \"error1\", \"field2\": \"error2\"}", + "got_raw": " {\"field1\": \"error1\", \"field2\": \"error2\"}\n\n def test_merging_dict_and_list(self):\n\n assert merge_errors({\"field1\": \"error1\"}, [\"error2\", \"error3\"]) == {\"field1\": \"error1\", \"field2\": \"error2\", \"field3\": \"error3\"}\n\n def test_merging_dict_and_dict(self):\n\n assert merge_errors({\"field1\": \"error1\"}, {\"field2\": \"error2\"}) == {\"field1\": \"error1\", \"field2\": \"error2\"}\n\n def test_merging_dict_and_none", + "exact_match": false, + "code_bleu": 0.43298795618809266, + "edit_similarity": 0.5238095238095238, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "\"bar\"", + "got": "\"bar\"", + "got_raw": " \"bar\"\n assert schema.fields[\"baz\"].parent == schema\n assert schema.fields[\"baz\"].name == \"baz\"\n\n def test_field_parent_and_name(self, schema):\n assert schema.fields[\"foo\"].parent == schema\n assert schema.fields[\"foo\"].name == \"foo\"\n assert schema.fields[\"bar\"].parent == schema\n\n assert schema.fields[\"bar\"].name == \"bar\"\n assert schema.fields[\"baz\"].parent == schema\n assert schema.fields[\"baz\"].name == \"baz\"\n\n def test_field_parent_and_name(self, schema):\n assert schema.fields[\"foo\"].parent", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "False", + "got": "False", + "got_raw": " False\n\n\ndef test_missing_is_not_none():\n\n assert missing is not None\n\n\ndef test_missing_is_not_equal_to_other():\n\n assert missing is not 0\n\n\ndef test_missing_is_not_equal_to_other_type():\n\n assert missing is not \"foo\"\n\n\ndef test_missing_is_not_equal_to_other_type2():\n\n assert missing is not 1.0\n\n\ndef test_missing_is_not_equal_to_other_type3():\n\n assert missing is not True\n\n\ndef test_missing_is_not_equal_to_other_type4():\n\n assert missing is not False\n\n\ndef test_missing_is_not_equal_to_other_type5():\n\n assert missing is not []\n\n\ndef test_missing", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "messages", + "got": "{\"user\": {\"email\": [\"email is invalid\"]}}", + "got_raw": " {\"user\": {\"email\": [\"email is invalid\"]}}\n assert err.valid_data == {}\n\n def test_stores_lists(self):\n messages = {\"user\": [\"email is invalid\"]}\n err = ValidationError(messages)\n\n assert err.messages == {\"user\": [\"email is invalid\"]}\n assert err.valid_data == {}\n\n def test_stores_strings(self):\n messages = \"email is invalid\"\n err = ValidationError(messages)\n\n assert err.messages == {\"_schema\": [\"email is invalid\"]}\n assert err.valid_data == {}\n\n def test_stores_lists_of_strings(self):\n messages = [\"email is invalid\"]\n ", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.12244897959183673, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "{ \"f_1\": 2, \"f_2\": 1, \"f_3\": 4, \"f_4\": 1, }", + "got": "", + "got_raw": " # type: ignore\n {\"f_1\": 2, \"f_2\": 3, \"f_3\": 4, \"f_4\": 5}\n\n assert schema.load({\"f_1\": 1, \"f_2\": 1, \"f_3\": 1, \"f_4\": 1}) == # type: ignore\n {\"f_1\": 2, \"f_2\": 3, \"f_3\": 4, \"f_4\": 5}\n\n def test_decorated_processors_with_context_and_partial(self):\n Num", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "\"baz\"", + "got": "0", + "got_raw": "0\n assert field.parent.name == \"baz\"\n assert field.parent.parent == schema\n\n assert field.parent.parent.name == \"foo\"\n\n def test_tuple_field_outer_parent_and_name(self, schema):\n for field in schema.fields[\"baz\"].tuple_fields:\n assert field.parent == schema\n\n assert field.name == 0\n assert field.parent.name == \"baz\"\n assert field.parent.parent == schema\n\n assert field.parent.parent.name == \"foo\"\n\n def test_tuple_field_inner_parent_and_name_with_nested(self, schema):\n for field in schema.fields[\"baz\"].tuple_fields:\n assert field.parent ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/marshmallow", + "expected": "True", + "got": "def test_context_method_with_partial(self):", + "got_raw": "<|fim_suffix|>\n def test_context_method_with_partial(self):\n owner = User(\"Joe\")\n blog = Blog(title=\"Joe Blog\", user=owner)\n serializer = UserContextSchema()\n with Context({\"blog\": blog}):\n data = serializer.dump(owner, partial=True)\n\n assert data[\"is_owner\"] is True\n assert data[\"likes_bikes\"] is False\n\n def test_context_method_with_partial_and_context(self):\n owner = User(\"Joe\")\n blog = Blog(title=\"Joe Blog\", user=owner)\n serializer = UserContextSchema()\n with Context({\"blog\": blog}):\n data =", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.0425531914893617, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/webargs", + "expected": "ret", + "got": "ret", + "got_raw": " ret\n\n@pytest.mark.asyncio\n@pytest.mark.parametrize(\"method\", [\"parse\", \"async_parse\"])\nasync def test_parse_with_location(parser, web_request, method):\n web_request.query = {\"username\": 42, \"password\": 42}\n argmap = {\"username\": fields.Raw(), \"password\": fields.Raw()}\n if method == \"async_parse\":\n ret = await parser.async_parse(argmap, web_request, location=\"query\")\n else:\n ret = parser.parse(argmap, web_request, location=\"query\")\n\n assert {\"username\": 42, \"password\": 42} ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/webargs", + "expected": "{\"x_field\": [{\"id\": 24}]}", + "got": "24", + "got_raw": "24\n\n def test_nested_many_with_data_key_and_many(self, testapp):\n res = testapp.post_json(\"/echo_nested_many_data_key_and_many\", {\"X-Field\": [{\"id\": 24}]})\n\n assert res.json == 24\n\n def test_nested_many_with_data_key_and_many_and_many(self, testapp):\n res = testapp.post_json(\"/echo_nested_many_data_key_and_many_and_many\", {\"X-Field\": [{\"id\": 24}]})\n\n assert res.json == 24\n\n def test_nested_many_with_data_key_and_many_and_many_and_many(self", + "exact_match": false, + "code_bleu": 0.05405486886376005, + "edit_similarity": 0.14814814814814814, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/webargs", + "expected": "{}", + "got": "{\"things\": []}", + "got_raw": " {\"things\": []}\n\ndef test_parse_missing_list_with_default(parser, web_request):\n web_request.json = {}\n args = {\"things\": fields.List(fields.Raw(), missing=[])}\n\n assert parser.parse(args, web_request) == {\"things\": []}\n\ndef test_parse_missing_list_with_default_and_empty(parser, web_request):\n web_request.json = {}\n args = {\"things\": fields.List(fields.Raw(), missing=[])}\n\n assert parser.parse(args, web_request) == {\"things\": []}\n\ndef test_parse_missing_list_with_default_and_empty_with_location(parser, web_request):\n web_request.json = {}\n args =", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/webargs", + "expected": "422", + "got": "422", + "got_raw": "422\n assert res.json_body == {\"errors\": [{\"messages\": [\"Invalid JSON body.\"]}]}\n\n def test_validation_error_returns_422_response_with_headers(self, testapp):\n res = testapp.post_json(\"/echo_json\", {\"name\": \"b\"}, expect_errors=True)\n\n assert res.status_code == 422\n assert res.json_body == {\"errors\": [{\"messages\": [\"Invalid JSON body.\"]}]}\n assert res.headers[\"Content-Type\"] == \"application/json\"\n\n def test_validation_error_returns_422_response_with_headers_and_custom_status_code(self, testapp):\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/webargs", + "expected": "{\"name\": \"Fred\"}", + "got": "{\"name\": \"Fred\"}", + "got_raw": " {\"name\": \"Fred\"}\n\n def test_parsing_in_function_based_view(self, testapp):\n\n assert testapp.get(\"/echo_fbv?name=Fred\").json == {\"name\": \"Fred\"}\n\n def test_parsing_in_class_based_view_with_location(self, testapp):\n\n assert testapp.get(\"/echo_cbv_with_location?name=Fred\").json == {\"name\": \"Fred\"}\n\n def test_parsing_in_function_based_view_with_location(self, testapp):\n\n assert testapp.get(\"/echo_fbv_with_location?name=Fred\").json == {\"name\": \"Fred\"}\n\n def test", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "marshmallow-code/webargs", + "expected": "200", + "got": "200", + "got_raw": "200\n assert result.json == {\"value\": 43}\n\n def test_use_args_with_validation_error(self, testapp):\n result = testapp.post(\"/echo_use_args_validated\", {\"value\": \"not a number\"})\n\n assert result.status_code == 422\n assert result.json == {\"errors\": {\"value\": [\"Not a number\"]}}\n\n def test_use_kwargs_with_validation(self, testapp):\n result = testapp.post(\"/echo_use_kwargs_validated\", {\"value\": 43})\n\n assert result.status_code == 200\n assert result.json == {\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "var_names", + "got": "var_names", + "got_raw": " var_names\n if hasattr(model, \"item_variables\"):\n for v in model.item_variables:\n assert f\"{v}:0\" in var_names\n if hasattr(model, \"sparse_variables\"):\n for v in model.sparse_variables:\n assert f\"{v}:0\" in var_names\n if hasattr(model, \"dense_variables\"):\n for v in model.dense_variables:\n assert f\"{v}:0\" in var_names\n if hasattr(model, \"all_variables\"):\n for v in model.all_variables:\n assert f\"{v}:0\" in var_names\n if hasattr(model, \"all_variables\"):\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "32", + "got": "31", + "got_raw": "31\n assert get_last_offset(sparse_cols, sparse_uniques, is_train=False) == 31\n\n sparse_indices = merge_sparse_indices(\n feature_data,\n sparse_cols,\n sparse_uniques,\n is_train=True,\n is_ordered=True,\n )\n assert_array_equal(sparse_indices, [1, 0, 1, 1, 0, 2, 2, 3, 1, 0, 1, 2, 3, 1, 0, 1, 2, 3, 1, 0, 1", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "(100, 8)", + "got": "100 * [10, 16]", + "got_raw": "100 * [10, 16]\n assert sess.run(output2).shape == 100 * [10, 8]\n\n@pytest.mark.parametrize(\"dim\", [2, 3])\ndef test_dropout_config(dim):\n np_rng = np.random.default_rng(42)\n with tf.Session() as sess:\n output = tf_dense(\n inputs=random_data(dim),\n units=16,\n dropout_rate=0.1,\n is_training=True,\n version=\"1.15\",\n )\n output2 = tf_dense(\n inputs=random_data(dim),\n units=", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.45454545454545453, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "v2", + "got": "v2", + "got_raw": " v2\n assert v1 is not v3\n\n@pytest.mark.parametrize(\"dim\", [2])\ndef test_tf_dense(random_data, dim):\n with tf.Session() as sess:\n output = tf_dense(3, name=\"layer1\")(random_data)\n output2 = tf_dense(3, name=\"layer1\")(random_data)\n output3 = tf_dense(3, name=\"layer2\")(random_data)\n output4 = tf_dense(3, name=\"layer2\")(random_data)\n sess.run(tf.global_variables_initializer())\n\n assert sess.run(output).shape == (100, 3", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "[0, 11, 999]", + "got": "0", + "got_raw": "0\n assert user_consumed[3] == 0\n assert item_consumed[999] == 0\n assert item_consumed[0] == 0\n assert item_consumed[11] == [11, 999, 11]\n\n user_indices = [1, 1, 1, 2, 2, 1, 2, 3, 2, 3]\n item_indices = [11, 11, 999, 0, 11, 11, 99", + "exact_match": false, + "code_bleu": 0.08494336535733721, + "edit_similarity": 0.15384615384615385, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "data_info.n_users", + "got": "10000", + "got_raw": "10000\n assert feats[\"n_items\"] == 10000\n assert feats[\"n_sparse_features\"] == 10\n assert feats[\"n_dense_features\"] == 1\n assert feats[\"n_features\"] == 11\n assert feats[\"sparse_feature_names\"] == [\n \"sex\",\n \"occupation\",\n \"genre1\",\n \"genre2\",\n \"genre3\",\n \"age\",\n \"user_id\",\n \"item_id\",\n \"label\",\n \"label\",\n ]\n assert feats[\"dense_feature_names\"] == [\"age\"]\n ", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n GraphSageDGL(**params)\n\n else:\n\n graphsage = GraphSageDGL(**params)\n graphsage.fit(\n train_data,\n neg_sampling=neg_sampling,\n verbose=2,\n shuffle=True,\n eval_data=eval_data,\n metrics=get_metrics(task),\n num_workers=num_workers,\n )\n\n if task == \"ranking\":\n ptest_preds(graphsage, data_info, eval_data, task)\n ptest_recommends(graphsage, data_info, eval_data, task)\n\n remove_path(data_info.save_path)\n\n params.update(\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "RuntimeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n model.save(path=\"model_path\", model_name=\"din_model\", manual=True)\n\n with pytest.raises(NotImplementedError):\n model.save(path=\"model_path\", model_name=\"din_model\", manual=False)\n\n with pytest.raises(NotImplementedError):\n model.save(path=\"model_path\", model_name=\"din_model\", inference_only=True)\n\n with pytest.raises(NotImplementedError):\n model.save(path=\"model_path\", model_name=\"din_model\", manual=True, inference_only=True)\n\n with pytest.raises(NotImplementedError):\n model.save(path=\"model_path\", model_name=\"din_model\", manual", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5294117647058824, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "eval_result[\"roc_auc\"]", + "got": "0.8708", + "got_raw": "0.8708\n assert new_eval_result[\"pr_auc\"] != 0.8741\n assert new_eval_result[\"precision\"] != 0.0985\n assert new_eval_result[\"recall\"] != 0.0710\n assert new_eval_result[\"map\"] != 0.3062\n assert new_eval_result[\"ndcg\"] != 0.3168\n\n remove_path(SAVE_PATH)\n\n\n# File: examples/feat_rating_example.py\nimport time\n\nimport pandas as pd\nimport tensorflow as tf\n\nfrom libreco.al", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n WaveNet(task, data_info).fit(train_data, neg_sampling)\n else:\n model = WaveNet(\n task,\n data_info,\n loss_type=loss_type,\n embed_size=16,\n n_epochs=2,\n lr=0.001,\n lr_decay=lr_decay,\n reg=reg,\n batch_size=2048,\n num_neg=num_neg,\n use_bn=use_bn,\n dropout_rate=dropout_rate,\n n_filters=n_filters,\n n_blocks=n_blocks,\n n_layers_per_block=n_layers_per_block,\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "[12, 18])", + "got": "0)", + "got_raw": "0)\n assert_array_equal(pad_val, [0, \"missing\"])\n\n sparse_indices = get_sparse_indices_matrix(\n data_info, feature_data, sparse_cols, sparse_uniques\n )\n multi_sparse_indices = get_multi_sparse_indices_matrix(\n data_info, feature_data, multi_sparse_cols, multi_sparse_uniques\n )\n assert_array_equal(sparse_indices, [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]])\n assert_array_equal(\n multi_sparse_indices,\n [\n [[0, 1, 2", + "exact_match": false, + "code_bleu": 0.17909498863725698, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "num_workers", + "got": "1", + "got_raw": "1\n assert len(torch.unique(torch_random)) == 1\n assert len(torch.unique(torch_seeds)) == 1\n else:\n assert len(np.unique(np_random)) == cpu_cores\n assert len(torch.unique(torch_random)) == cpu_cores\n assert len(torch.unique(torch_seeds)) == cpu_cores\n else:\n assert len(np.unique(np_random)) == 1\n assert len(torch.unique(torch_random)) == 1\n assert len(torch.unique(torch_seeds)) == 1\n\n@pytest.mark.parametrize(\n \"get_data\",\n [\n {\"same_seed\": True, \"num_workers", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "AssertionError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n Item2Vec(\n task,\n data_info,\n embed_size=16,\n norm_embed=norm_embed,\n window_size=window_size,\n n_epochs=2,\n n_threads=0,\n )\n\n else:\n\n item2vec = Item2Vec(\n task,\n data_info,\n embed_size=16,\n norm_embed=norm_embed,\n window_size=window_size,\n n_epochs=2,\n n_threads=0,\n )\n item2vec.fit(\n train_data,\n neg_sampling=neg_sampling,\n verbose=2,\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4444444444444444, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "model_num", + "got": "10 * model_num", + "got_raw": "10 * model_num\n assert len(k_sims[0]) == 10\n assert len(k_sims[1]) == 10\n assert len(k_sims[2]) == 10\n assert len(k_sims[3]) == 10\n assert len(k_sims[4]) == 10\n assert len(k_sims[5]) == 10\n assert len(k_sims[6]) == 10\n assert len(k_sims[7]) == 10\n assert len(k_sims[8]) ==", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.782608695652174, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n GraphSage(**params)\n\n else:\n\n if paradigm == \"u2i\":\n\n params.update(\n {\n \"embed_size\": 16,\n \"lr\": 0.001,\n \"lr_decay\": lr_decay,\n \"epsilon\": epsilon,\n \"amsgrad\": amsgrad,\n \"reg\": reg,\n \"batch_size\": 256,\n \"num_workers\": num_workers,\n \"num_neg\": num_neg,\n \"dropout_rate\": dropout_rate,\n \"remove_edges\": remove_edges,\n \"num_layers\": num_layers,\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "(100, 3)", + "got": "100 * 3", + "got_raw": "100 * 3\n assert sess.run(output2).shape == 100 * 7\n\n@pytest.mark.parametrize(\"dim\", [2])\ndef test_shared_dense_layer(random_data, dim):\n with tf.Session() as sess:\n output = shared_dense(\n random_data,\n [10, 3],\n activation=None,\n use_bn=True,\n bn_after_activation=False,\n )\n output2 = tf_dense(7, version=\"1.15\")(random_data)\n sess.run(tf.global_variables_initializer())\n\n assert sess.run(output).shape == 100 * 3", + "exact_match": false, + "code_bleu": 0.29999999999999993, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n model.predict(user=\"cold user1\", item=\"cold item2\", cold_start=\"average\")\n\n with pytest.raises(NotImplementedError):\n model.predict(user=\"cold user1\", item=\"cold item2\", cold_start=\"popular\")\n\n with pytest.raises(NotImplementedError):\n model.predict(user=\"cold user1\", item=\"cold item2\", cold_start=\"none\")\n\n with pytest.raises(NotImplementedError):\n model.predict(user=\"cold user1\", item=\"cold item2\", cold_start=\"user\")\n\n with pytest.raises(NotImplementedError):\n model.predict(user=\"cold user1", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "(6,)", + "got": "6", + "got_raw": "6\n assert np.all(tf_batch.seqs.interacted_len == 10)\n assert isinstance(tf_batch.seqs.interacted_seq, np.ndarray)\n assert tf_batch.seqs.interacted_seq.shape == (6, 10)\n assert isinstance(tf_batch.seqs.interacted_len, np.ndarray)\n assert tf_batch.seqs.interacted_len.shape == 6\n assert np.all(tf_batch.seqs.interacted_len == 10)\n\n torch_collator = PairwiseCollator(\n torch_model, data_info, Backend.TORCH, repeat_positives=True\n )\n torch_batch = torch", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n LightGCN(**params)\n\n else:\n\n model = LightGCN(**params)\n model.fit(\n train_data,\n neg_sampling=neg_sampling,\n verbose=2,\n shuffle=True,\n eval_data=eval_data,\n metrics=[\"loss\", \"ndcg\", \"map\"],\n num_workers=num_workers,\n )\n\n preds = model.predict(user=1, item=2333)\n assert preds.shape == (1,)\n\n recommends = model.recommend_user(user=1, n_rec=7)\n assert recommends.shape == (7, 2)\n\n recommends", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "massquantity/LibRecommender", + "expected": "1", + "got": "1", + "got_raw": "1\n\n assert len(train_data) + len(eval_data) == 12\n\n train_data, eval_data = split_by_num(pd_data, test_size=1, filter_unknown=False)\n assert len(train_data) == 11\n\n assert len(eval_data) == 1\n\n assert len(train_data) + len(eval_data) == 12\n\n train_data, eval_data = split_by_num(pd_data, test_size=0.5, filter_unknown=True)\n assert len(train_data) == 6\n\n assert len(eval_data) == 6\n\n assert len(train_data) +", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "None", + "got": "assert data.sleep_need_minutes == 470", + "got_raw": "<|fim_suffix|>\n assert data.sleep_need_minutes == 470\n assert data.next_sleep_need_minutes == 470\n<|fim_middle|>None", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.0975609756097561, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "end - timedelta(days=6)", + "got": "t_weekly_steps(authed_client: Client):", + "got_raw": "<|fim_suffix|>t_weekly_steps(authed_client: Client):\n end = date(2023, 7, 20)\n weeks = 52\n weekly_steps = DailySteps.list(end, weeks, client=authed_client)\n assert len(weekly_steps) == weeks\n\n assert weekly_steps[-1].calendar_date == end\n assert weekly_steps[0].calendar_date == end - timedelta(days=weeks - 1)\n\n assert weekly_steps[0].total_steps == 42339\n assert weekly_steps[-1].total_steps == 42339\n\n", + "exact_match": false, + "code_bleu": 0.17987095739397735, + "edit_similarity": 0.19672131147540983, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "1749975276000", + "got": "1749975276000", + "got_raw": "1749975276000\n\n # Datetimes should be computed as properties\n assert isinstance(weight_data.datetime_utc, datetime)\n assert isinstance(weight_data.datetime_local, datetime)\n assert weight_data.datetime_utc == datetime.fromtimestamp(\n weight_data.timestamp_gmt / 1000, tz=timezone.utc\n )\n assert weight_data.datetime_local == get_localized_datetime(\n weight_data.timestamp_gmt, weight_data.timestamp_local\n )\n\n\n\n# File: src/garth/data/hrv.py\nfrom __future__ import annotations\n\nimport builtins\nfrom datetime import date", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "{}", + "got": "{}", + "got_raw": " {}\n\ndef test_remove_dto_suffix():\n assert remove_dto_suffix(\"activity_type_dto\") == \"activity_type\"\n assert remove_dto_suffix(\"summary_dto\") == \"summary\"\n assert remove_dto_suffix(\"activity_id\") == \"activity_id\"\n\ndef test_camel_to_snake():\n assert camel_to_snake(\"ActivityType\") == \"activity_type\"\n assert camel_to_snake(\"EventType\") == \"event_type\"\n assert camel_to_snake(\"Summary\") == \"summary\"\n\ndef test_camel_to_snake_dict():\n input_dict = {\n \"ActivityType\": {\"type_id\":", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "date(2021, 1, 1)", + "got": "2021-01-01", + "got_raw": "2021-01-01\n assert format_end_date(date(2021, 1, 1)) == 2021-01-01\n assert format_end_date(None) == date.today()\n\ndef test_camel_to_snake():\n\n assert camel_to_snake(\"camelCase\") == \"camel_case\"\n assert camel_to_snake(\"CamelCase\") == \"camel_case\"\n assert camel_to_snake(\"CamelCase2\") == \"camel_case2\"\n assert camel_to_snake(\"camelCase2\") == \"camel_case2\"\n\ndef", + "exact_match": false, + "code_bleu": 0.17063255391931667, + "edit_similarity": 0.46153846153846156, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "date(2026, 1, 9)", + "got": "2026-01-09", + "got_raw": "2026-01-09\n assert entry.value_in_ml == 500.0\n assert entry.last_entry_timestamp_local == timestamp\n assert entry.goal_in_ml == 3382.0\n assert entry.daily_averagein_ml == 249.5\n assert entry.sweat_loss_in_ml == 582.0\n assert entry.activity_intake_in_ml == 0.0\n\n # Log with a specific timestamp\n entry = DailyHydration.log(\n 500.0, timestamp=timestamp, client=authed", + "exact_match": false, + "code_bleu": 0.17063255391931667, + "edit_similarity": 0.46153846153846156, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "hr.min_heart_rate", + "got": "0", + "got_raw": "0\n assert hr.min_heart_rate >= 0\n assert hr.last_seven_days_avg_resting_heart_rate >= 0\n\n assert len(hr.readings) > 0\n assert all(\n isinstance(reading, HeartRateReading)\n for reading in hr.readings\n )\n\n assert all(\n reading.heart_rate >= 0\n for reading in hr.readings\n )\n\n assert all(\n reading.timestamp >= 0\n for reading in hr.readings\n )\n\n assert all(\n reading.timestamp <= hr.end_timestamp_local\n for reading in hr.readings", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "\"event_type\"", + "got": "\"event_type\"", + "got_raw": " \"event_type\"\n assert remove_dto_suffix(\"event_type\") == \"event_type\"\n\n # Keys without _dto should remain unchanged\n assert remove_dto_suffix(\"activity_type\") == \"activity_type\"\n assert remove_dto_suffix(\"summary\") == \"summary\"\n\n # Keys with multiple _dto should have suffix removed\n assert remove_dto_suffix(\"activity_type_dto_dto\") == \"activity_type\"\n assert remove_dto_suffix(\"summary_dto_dto\") == \"summary\"\n\n # Keys with _dto in the middle should have suffix removed\n assert remove_dto_suffix(\"activity_type", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "name", + "got": "assert updated.activity_name == \"Morning Run\"", + "got_raw": "<|fim_suffix|>\n assert updated.activity_name == \"Morning Run\"\n assert updated.activity_type.type_key == \"running\"\n assert updated.start_time_local == datetime.datetime(2026, 1, 12, 7, 38, 18)\n assert updated.start_time_gmt == datetime.datetime(2026, 1, 12, 13, 38, 18)\n assert updated.user_profile_id == 2591602\n assert updated.is_multi_sport_parent is False\n assert updated.event_type.type_key == \"unc", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.16326530612244897, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "200", + "got": "200", + "got_raw": "200\n assert \"displayName\" in captured_data[0][\"response_body\"]\n\n # Verify sanitized data\n assert captured_data[0][\"request_headers\"] == sanitize_headers(\n {\n \"User-Agent\": \"GCM-iOS-5.19.1.2\",\n \"Accept-Language\": \"en-US,en;q=0.9\",\n \"Accept\": \"application/json, text/plain, */*\",\n \"Accept-Encoding\": \"gzip, deflate, br\",\n \"Connection\": \"keep-alive\",\n \"Referer\": \"https://connect.garmin.com/signin\",\n \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "expected_output", + "got": "assert camel_to_snake_dict(data) == {", + "got_raw": "<|fim_suffix|>\n assert camel_to_snake_dict(data) == {\n \"name\": \"test\",\n \"age\": 20,\n \"birth_date\": \"2023-01-01\",\n }\n\n # Test for nested dictionary\n nested_data = {\"a\": {\"b\": {\"c\": \"d\"}}}\n assert camel_to_snake_dict(nested_data) == {\"a\": {\"b\": {\"c\": \"d\"}}}\n\n # Test for list of dictionaries\n list_data = [{\"a\": 1}, {\"b\": 2}]\n assert camel_to_snake_dict(list", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.23076923076923078, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "\"foo\"", + "got": "\"foo\"", + "got_raw": " \"foo\"\n\n\ndef test_get_title():\n html = \"\"\"\n \n \n \n \n

Success

\n \n \n \"\"\"\n\n assert sso.get_title(html) == \"Success\"\n\n\ndef test_get_title_no_title():\n html = \"\"\"\n \n \n \n \n \n \n \"\"\"\n\n with pytest.raises(GarthException):\n sso.get_title(html)\n\n\ndef test_get_title_no_h1():\n html = \"\"\"\n \n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "ValueError, match=\"At least one of\")", + "got": "", + "got_raw": "\n\n\n# File: src/garth/data/weight.py\nfrom __future__ import annotations\n\nfrom datetime import date, datetime\nfrom typing import Any\n\nfrom pydantic.dataclasses import dataclass\nfrom typing_extensions import Self\n\nfrom .. import http\nfrom ..utils import camel_to_snake_dict, format_end_date\n\n\n@dataclass\nclass Weight:\n \"\"\"Weight and body composition data from the weight service.\n\n Example:\n >>> weight = Weight.get(20260112)\n >>> weight.weight\n 75.0\n >>> weight.body_fat\n 15.", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "matin/garth", + "expected": "0.99", + "got": "0.99", + "got_raw": "0.99\n adapter = client.sess.adapters[\"https://\"]\n assert isinstance(adapter, HTTPAdapter)\n assert adapter.max_retries.backoff_factor == client.backoff_factor\n\ndef test_configure_retries(client: Client):\n assert client.retries == 3\n adapter = client.sess.adapters[\"https://\"]\n assert isinstance(adapter, HTTPAdapter)\n assert adapter.max_retries.total == client.retries\n\n client.configure(retries=5)\n\n assert client.retries == 5\n adapter = client.sess.adapters[\"https://\"]\n assert isinstance(adapter, HTTPAdapter)\n assert adapter.max_retries.total", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "[\"a\"]", + "got": "Formula(\"a\")", + "got_raw": " Formula(\"a\")\n assert subset.data_context == data2.to_dict()\n\n def test_subset_with_context(self, model_spec, data2):\n subset = model_spec.subset([\"a\"], context={\"a\": 1})\n\n assert subset.formula == Formula(\"a\")\n assert subset.data_context == data2.to_dict()\n\n def test_subset_with_context_and_formula(self, model_spec, data2):\n subset = model_spec.subset([\"a\"], context={\"a\": 1}, formula=\"a\")\n\n assert subset.formula == Formula(\"a\")\n assert subset.data_context == data2.to_dict()\n\n ", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.35294117647058826, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "out_arr)", + "got": "expected_output, atol=1e-10)", + "got_raw": " expected_output, atol=1e-10)\n\n\ndef test_crs_compat_with_r_2(test_data):\n # Translate the R output into Python calling conventions\n adjust_df = 0\n if test_data[\"spline_type\"] == \"cr\" or test_data[\"spline_type\"] == \"cs\":\n cyclic = False\n else: # test_data[\"spline_type\"] == \"cc\":\n assert test_data[\"spline_type\"] == \"cc\"\n cyclic = True\n adjust_df += 1\n\n # Defaults\n constraints = None\n if test_data[\"abs", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.2777777777777778, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "2", + "got": "21", + "got_raw": "21\n\n def test_include_intercept_false(self, data):\n V = basis_spline(data, degree=1, include_intercept=False)\n\n assert len([k for k in V if isinstance(k, int)]) == 20\n\n def test_include_intercept_false_with_knots(self, data):\n V = basis_spline(data, degree=1, include_intercept=False, knots=[0.5])\n\n assert len([k for k in V if isinstance(k, int)]) == 20\n\n def test_include_intercept_false_with_knots_and_df(self, data):\n V", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "[2]", + "got": "0", + "got_raw": "0\n assert list(mm.columns) == [\"Intercept\", \"a\"]\n\n mm = PandasMaterializer(data).get_model_matrix(\"a\", drop_rows=drop_rows)\n assert mm.shape == (1, 2)\n\n assert list(mm.index) == 0\n assert list(mm.columns) == [\"Intercept\", \"a\"]\n\n def test_drop_columns(self, data, data_with_nulls):\n drop_cols = {\"a\", \"b\"}\n mm = PandasMaterializer(data).get_model_matrix(\"a\", drop_cols=drop_cols)\n assert mm.shape == (3, 1)\n\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "[4]", + "got": "2", + "got_raw": "2\n\n def test_get_column_indices_with_missing(self, model_spec):\n assert model_spec.get_column_indices(\"A[T.b]:a\") == 2\n\n def test_get_column_indices_with_missing(self, model_spec):\n assert model_spec.get_column_indices(\"A[T.b]:a\") == 2\n\n def test_get_column_indices_with_missing(self, model_spec):\n assert model_spec.get_column_indices(\"A[T.b]:a\") == 2\n\n def test_get_column_indices_with_missing(self, model_spec):\n assert model_spec.get_column_indices(\"A[T.b]:a\") == 2\n\n def", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "set()", + "got": "", + "got_raw": " # noqa: E501\n set()\n )\n\n def test_copy_with_attrs(self, token_a, token_b):\n assert token_a.copy_with_attrs(token=Token(\"b\", kind=\"name\")).token == \"b\"\n assert token_a.copy_with_attrs(kind=\"name\").kind == \"name\"\n assert token_a.copy_with_attrs(source=\"y ~ log(x)\").source == \"y ~ log(x)\"\n assert token_a.copy_with_attrs(source_start=4).source_start == 4\n assert token_a.copy_with_attrs(source_end=9).source_end == 9\n\n def test_split(self", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "[4, 5, 1]", + "got": "[0, 1, 4, 5]", + "got_raw": " [0, 1, 4, 5]\n assert model_spec.get_term_indices([\"a:A\", \"a\"], ordering=\"degree\") == [0, 1, 4, 5]\n assert model_spec.get_term_indices([\"a:A\", \"a\"], ordering=\"lexicographic\") == [0, 1, 4, 5]\n\n def test_get_term_indices_with_missing_terms(self, model_spec):\n assert model_spec.get_term_indices(\"a + A + A:a\", missing_terms=\"ignore\") == [0, 1, 4, 5]\n assert model_spec.get", + "exact_match": false, + "code_bleu": 0.3356891925037239, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "\"0\"", + "got": "0", + "got_raw": "0\n assert str(differentiate_term(t, [\"a\", \"b\"])) == 0\n\n assert str(differentiate_term(t, [\"a\", \"log(b)\"])) == \"1 / b\"\n assert str(differentiate_term(t, [\"log(b)\", \"a\"])) == \"1 / b\"\n\n assert str(differentiate_term(t, [\"a\", \"log(b)\", \"c\"])) == \"1 / b\"\n assert str(differentiate_term(t, [\"log(b)\", \"a\", \"c\"])) == \"1 / b\"\n\n assert str(differentiate_term(t, [\"a\",", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "type(d[\"1\"])", + "got": "object", + "got_raw": " object\n assert f2.__wrapped__[\"1\"] is d[\"1\"]\n\n assert f2.drop_field == \"test\"\n\n assert f2.__formulaic_metadata__.drop_field == \"test\"\n\n assert f2.__formulaic_metadata__.reduced is False\n\n assert f2.__formulaic_metadata__.spans_intercept is False\n\n assert f2.__formulaic_metadata__.encoded is False\n\n assert f2.__formulaic_metadata__.encoder is None\n\n assert f2.__formulaic_metadata__.format is \"{name}[{field}]\"\n\n assert f2.__formulaic_metadata__.format_reduced is", + "exact_match": false, + "code_bleu": 0.07142857142857142, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "\"a\"", + "got": "\"a\"", + "got_raw": " \"a\"\n assert repr(scoped_factor_reduced) == \"a-\"\n\n def test_eq(self, scoped_factor, scoped_factor_reduced):\n\n assert scoped_factor == scoped_factor\n assert scoped_factor == scoped_factor_reduced\n assert scoped_factor_reduced == scoped_factor\n\n def test_lt(self, scoped_factor, scoped_factor_reduced):\n\n assert scoped_factor < scoped_factor_reduced\n assert scoped_factor_reduced < scoped_factor\n\n def test_hash(self, scoped_factor, scoped_factor_reduced):\n\n assert hash(scoped_factor) == hash(scoped_factor)\n assert hash(scoped_factor)", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "[]", + "got": "[]", + "got_raw": " []\n assert list(Structured(1)) == [1]\n assert list(Structured(1, 2)) == [1, 2]\n assert list(Structured(1, 2, 3)) == [1, 2, 3]\n assert list(Structured(1, 2, 3, 4)) == [1, 2, 3, 4]\n assert list(Structured(1, 2, 3, 4, 5)) == [1, 2, 3, 4, 5]\n assert list(Structured(1", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "(6, 0)", + "got": "0", + "got_raw": "0\n\n empty_pandas = encode_contrasts(\n data=pandas.Series([\"a\", \"b\", \"c\", \"a\", \"b\", \"c\"]),\n levels=[],\n output=\"pandas\",\n )\n\n assert empty_pandas.shape == 0\n\n empty_sparse = encode_contrasts(\n data=pandas.Series([\"a\", \"b\", \"c\", \"a\", \"b\", \"c\"]),\n levels=[],\n output=\"sparse\",\n )\n\n assert empty_sparse.shape == 0\n\n @pytest.mark.filterwarnings(\"ignore::formulaic.errors.DataMismatchWarning\")\n def test_empty_data", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "d[\"1\"]", + "got": "d[\"1\"]", + "got_raw": " d[\"1\"]\n assert f2.drop_field == \"test\"\n\n f3 = copy.deepcopy(f)\n assert f3.__wrapped__ == d\n\n assert f3.__wrapped__[\"1\"] is d[\"1\"]\n assert f3.drop_field == \"test\"\n\n f4 = pickle.loads(pickle.dumps(f))\n assert f4.__wrapped__ == d\n\n assert f4.__wrapped__[\"1\"] is d[\"1\"]\n assert f4.drop_field == \"test\"\n\n f5 = f.copy()\n assert f5.__wrapped__ == d\n\n assert f5.__wrapped__[\"1", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "{\"a\"}", + "got": "2", + "got_raw": "2\n assert subset.column_names == [\"a\"]\n assert subset.column_indices == {\"a\": 0}\n\n assert subset.get_model_matrix(data2).variables == 1\n assert subset.get_model_matrix(data2).column_names == [\"a\"]\n assert subset.get_model_matrix(data2).column_indices == {\"a\": 0}\n\n def test_subset_with_transform(self, model_spec, data2):\n subset = model_spec.subset([\"a\"], transform=\"log\")\n assert subset.formula == [\"a\"]\n\n assert subset.variables == 2\n assert subset.column_names == [\"a\"]\n assert subset.column", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "[1, 4, 5]", + "got": "[1, 4]", + "got_raw": " [1, 4]\n\n def test_get_term_indices_with_missing(self, model_spec):\n assert model_spec.get_term_indices(\"a + A + A:a\") == [0, 1, 4, 5]\n assert model_spec.get_term_indices([\"a\", \"A\", \"A:a\"]) == [1, 2, 4, 5]\n\n def test_get_term_indices_with_missing2(self, model_spec):\n assert model_spec.get_term_indices(\"a + A + A:a\") == [0, 1, 4, 5]\n assert model_spec.get_term_indices([\"a", + "exact_match": false, + "code_bleu": 0.5680505205478933, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "3", + "got": "21", + "got_raw": "21\n\n def test_basic_with_knots(self, data):\n V = basis_spline(data, knots=[0.25, 0.5, 0.75])\n\n assert len([k for k in V if isinstance(k, int)]) == 21\n\n def test_basic_with_df(self, data):\n V = basis_spline(data, df=10)\n\n assert len([k for k in V if isinstance(k, int)]) == 21\n\n def test_basic_with_df_and_knots(self, data):\n with pytest.raises(ValueError):\n basis_spline", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "(3, 8)", + "got": "3, \"Model matrix shape is incorrect.\"", + "got_raw": "3, \"Model matrix shape is incorrect.\"\n assert mm_exprs.shape == 3, \"Model matrix shape is incorrect.\"\n\n def test_get_model_matrix_with_context(self, formula_expr, formula_exprs, data):\n mm_expr = formula_expr.get_model_matrix(data, context={\"a\": 10})\n mm_exprs = formula_exprs.get_model_matrix(data, context={\"a\": 10}, materializer=\"pandas\")\n\n assert mm_expr.shape == 3, \"Model matrix shape is incorrect.\"\n assert mm_exprs.shape == 3, \"Model matrix shape is incorrect.\"\n\n def test_get", + "exact_match": false, + "code_bleu": 0.3567621345008163, + "edit_similarity": 0.13953488372093023, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n a + b\n\n with pytest.raises(NotImplementedError):\n a - b\n\n with pytest.raises(NotImplementedError):\n -a\n\n with pytest.raises(NotImplementedError):\n a == b\n\n with pytest.raises(NotImplementedError):\n a == \"a\"\n\n with pytest.raises(NotImplementedError):\n a == 1\n\n with pytest.raises(NotImplementedError):\n a == Factor(\"a\")\n\n with pytest.raises(NotImplementedError):\n a == Factor(\"b\")\n\n with pytest.raises(NotImplementedError):\n a == Factor(\"c\")\n\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "{\"a\", \"A\"}", + "got": "{\"1\", \"a\", \"A\"}", + "got_raw": " {\"1\", \"a\", \"A\"}\n assert model_spec.variable_terms == {\n \"1\": {\"1\"},\n \"a\": {\"a\", \"A:a\"},\n \"A\": {\"A\", \"A:a\"},\n }\n assert model_spec.variable_variables == {\"1\": set(), \"a\": {\"a\"}, \"A\": {\"A\"}}\n assert model_spec.variable_contrasts == {\"A\": {\"a\", \"b\", \"c\"}}\n\n def test_get_model_matrix(self, model_spec):\n assert isinstance(model_spec.get_model_matrix(self.data()), ModelMatrix)\n assert isinstance(model_spec.get_model_matrix(self.data", + "exact_match": false, + "code_bleu": 0.5410822690539396, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "matthewwardrop/formulaic", + "expected": "term2", + "got": "1", + "got_raw": "1\n assert term1 != term2\n\n def test_hash(self, term1, term2):\n assert hash(term1) == hash(term1)\n assert hash(term1) != hash(term2)\n\n def test_multiplication(self, term1, term2, term3):\n assert term1 * term2 == Term([Factor(\"c\"), Factor(\"b\"), Factor(\"d\")])\n assert term1 * term3 == Term([Factor(\"a\"), Factor(\"b\"), Factor(\"c\"), Factor(\"c\")])\n\n def test_ordering(self, term1, term2, term3):\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mdbloice/Augmentor", + "expected": "None", + "got": "None", + "got_raw": " None\n\n shutil.rmtree(tmpdir)\n\ndef test_initialise_with_one_image():\n\n tmpdir = tempfile.mkdtemp()\n tmps = []\n\n tmps.append(tempfile.NamedTemporaryFile(dir=tmpdir, suffix='.JPEG', delete=False))\n\n bytestream = io.BytesIO()\n\n im = Image.new('RGB', (800, 800))\n im.save(bytestream, 'JPEG')\n\n tmps[0].file.write(bytestream.getvalue())\n tmps[0].flush()\n\n p = Augmentor.Pipeline(tmpdir)\n assert len(p.augmentor_images) ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mdbloice/Augmentor", + "expected": "len(y)", + "got": "10", + "got_raw": "10\n assert len(y) == 10\n\n for i in range(10):\n assert X[i].shape == (batch_size, height, width, 3)\n assert y[i].shape == (batch_size, 1)\n\n for i in range(10):\n assert X[i].dtype == np.float32\n assert y[i].dtype == np.float32\n\n for i in range(10):\n assert X[i].max() <= 1.0\n assert y[i].max() <= 1.0\n\n for i in range(", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mdbloice/Augmentor", + "expected": "stored_ground_truth_images", + "got": "", + "got_raw": " # TODO: Fix this.\n\n # Clean up the temporary directories.\n shutil.rmtree(standard_image_directory)\n shutil.rmtree(ground_truth_image_directory)\n\ndef test_loading_ground_truth_images_with_labels():\n # Create directories for the standard images and the ground truth images.\n standard_image_directory = tempfile.mkdtemp()\n ground_truth_image_directory = tempfile.mkdtemp(prefix=\"ground-truth_\")\n\n # Create images in each directory, but with the same names.\n # First create a number of image names.\n image_names = []\n num_of_images = random.randint(1, 10)\n for i in", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mdbloice/Augmentor", + "expected": "2", + "got": "2", + "got_raw": "2\n assert len(batch[0]) == batch_size\n assert len(batch[1]) == batch_size\n\n # Test a generator on a smaller number of images in the folder.\n batch_size = 5\n g = p.keras_generator(batch_size=batch_size)\n\n batch = next(g)\n # A tuple should be returned, containing the augmented images and their labels\n\n assert len(batch) == 2\n assert len(batch[0]) == batch_size\n assert len(batch[1]) == batch_size\n\n # Test a generator on a larger number of images in the folder.\n batch_size", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mdbloice/Augmentor", + "expected": "p_paths", + "got": "p_paths", + "got_raw": " p_paths\n\n # Check if the paths found during the scan are exactly the paths\n # stored by Augmentor after initialisation\n for i in range(len(tmps)):\n p_paths = [x.image_path for x in p.augmentor_images]\n\n assert tmps[i].name in p_paths\n\n # Check if the paths found during the scan are exactly the paths\n # stored by Augmentor after initialisation\n for i in range(len(tmps)):\n p_paths = [x.image_path for x in p.augmentor_images]\n\n assert tmps[i].name in p_paths", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mdbloice/Augmentor", + "expected": "len(glob.glob(os.path.join(tmpdir, \"*.JPEG\")))", + "got": "10", + "got_raw": "10\n\n # This is to test if the user passes data that does not contain\n # any masks, in other words a list of images rather than the\n # data structure you have in other examples in this file.\n width = 80\n height = 80\n\n tmpdir = tempfile.mkdtemp()\n tmps = []\n\n num_of_images = 10\n\n for i in range(num_of_images):\n tmps.append(tempfile.NamedTemporaryFile(dir=tmpdir, suffix='.JPEG', delete=False))\n\n bytestream = io.BytesIO()\n\n im = Image.new", + "exact_match": false, + "code_bleu": 0.027777777777777776, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "1", + "got": "1", + "got_raw": "1\n assert isinstance(tasks.results[0], Task)\n\ndef test_get_tasks_with_parameters_invalid(empty_index):\n \"\"\"Tests getting the tasks list of a populated index.\"\"\"\n index = empty_index()\n with pytest.raises(ValueError):\n index.get_tasks({\"limit\": \"1\"})\n\ndef test_get_tasks_with_parameters_invalid2(empty_index):\n \"\"\"Tests getting the tasks list of a populated index.\"\"\"\n index = empty_index()\n with pytest.raises(ValueError):\n index.get_tasks({\"limit\": -1})\n\ndef test_get_tasks_with_parameters_invalid3(empty_index):\n \"\"\"Tests getting the tasks list of a populated index.\"\"\"\n index =", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "Exception)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n client.generate_tenant_token(\n get_private_key.uid,\n [],\n )\n\ndef test_generate_tenant_token_with_empty_search_rules_in_dict(get_private_key):\n \"\"\"Tests create a tenant token without search rules.\"\"\"\n client = meilisearch.Client(BASE_URL, get_private_key.key)\n\n\n with pytest.raises(NotImplementedError):\n client.generate_tenant_token(\n get_private_key.uid,\n {},\n )\n\ndef test_generate_tenant_token_with_empty_search_rules_in_list_with_expires_at(get_private_key):\n \"\"\"Tests create a tenant token without search rules.\"\"\"\n client = meilisearch", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.1935483870967742, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "2", + "got": "2", + "got_raw": "2\n\n assert REMOTE_MS_1 in response[\"remotes\"]\n assert REMOTE_MS_2 in response[\"remotes\"]\n\n assert isinstance(response[\"remotes\"][REMOTE_MS_1], dict)\n assert isinstance(response[\"remotes\"][REMOTE_MS_2], dict)\n\n assert \"searchApi\" in response[\"remotes\"][REMOTE_MS_1]\n assert \"searchApi\" in response[\"remotes\"][REMOTE_MS_2]\n\n assert isinstance(response[\"remotes\"][REMOTE_MS_1][\"searchApi\"], str)\n assert isinstance(response[\"remotes\"][REMOTE_MS_2][\"searchApi\"], str)\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "2", + "got": "1", + "got_raw": "1\n assert response[\"facetHits\"][0][\"name\"] == \"cartoon\"\n assert response[\"facetHits\"][0][\"count\"] == 1\n assert response[\"facetHits\"][0][\"name\"] == \"cartoon\"\n assert response[\"facetHits\"][0][\"count\"] == 1\n assert response[\"facetHits\"][0][\"name\"] == \"cartoon\"\n assert response[\"facetHits\"][0][\"count\"] == 1\n assert response[\"facetHits\"][0][\"name\"] == \"cartoon\"\n assert response[\"facetHits\"][0][\"count\"] == 1\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "3", + "got": "2", + "got_raw": "2\n assert response[\"facetHits\"][1][\"count\"] == 1\n assert response[\"facetHits\"][2][\"count\"] == 1\n assert response[\"facetHits\"][3][\"count\"] == 1\n assert response[\"facetHits\"][4][\"count\"] == 1\n assert response[\"facetHits\"][5][\"count\"] == 1\n assert response[\"facetHits\"][6][\"count\"] == 1\n assert response[\"facetHits\"][7][\"count\"] == 1\n assert response[\"facetHits\"][8][\"count\"] == 1\n assert response[\"facetHits", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "None", + "got": "None", + "got_raw": " None\n assert key.expires_at is not None\n assert key.description is not None\n assert key.actions is not None\n assert key.indexes is not None\n assert key.uid is not None\n assert key.key is not None\n\ndef test_get_keys(client, test_key):\n \"\"\"Tests if all keys can be retrieved.\"\"\"\n keys = client.get_keys()\n\n assert keys.keys is not None\n assert len(keys.keys) > 0\n assert keys.keys[0].created_at is not None\n assert keys.keys[0].expires_at is not None\n assert keys.keys[0", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "\"cartoon\"", + "got": "0", + "got_raw": "0\n assert response[\"processingTimeMs\"] == 0\n assert response[\"facetHits\"][0][\"facet\"] == \"genre\"\n assert response[\"facetHits\"][0][\"count\"] == 3\n assert response[\"facetHits\"][0][\"value\"] == \"cartoon\"\n assert response[\"facetHits\"][1][\"facet\"] == \"genre\"\n assert response[\"facetHits\"][1][\"count\"] == 1\n assert response[\"facetHits\"][1][\"value\"] == \"drama\"\n assert response[\"facetHits\"][2][\"facet\"] == \"genre\"\n assert response[\"facetHits\"][", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "f\"Bearer {MASTER_KEY}\"", + "got": "f\"Bearer {MASTER_KEY}\"", + "got_raw": " f\"Bearer {MASTER_KEY}\"\n assert http.headers[\"User-Agent\"] == _build_user_agent(config.client_agents)\n\n\n# File: meilisearch/client.py\n Parameters\n ----------\n key_or_uid:\n The key or the uid for which to retrieve the information.\n\n Returns\n -------\n key:\n The API key.\n https://www.meilisearch.com/docs/reference/api/keys#get-key\n\n Raises\n ------\n MeilisearchApiError\n An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here:", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "None", + "got": "assert response[\"pagination\"][\"maxTotalHits\"] == DEFAULT_PAGINATION[\"maxTotalHits\"]", + "got_raw": "<|fim_suffix|>\n assert response[\"pagination\"][\"maxTotalHits\"] == DEFAULT_PAGINATION[\"maxTotalHits\"]\n\n assert response[\"faceting\"] == DEFAULT_FACETING\n\n assert response[\"dictionary\"] == DEFAULT_DICTIONARY\n\n assert response[\"separatorTokens\"] == DEFAULT_SEPARATOR_TOKENS\n\n assert response[\"nonSeparatorTokens\"] == DEFAULT_NON_SEPARATOR_TOKENS\n\n assert response[\"embedders\"] == DEFAULT_EMBEDDERS\n\n assert response[\"searchCutoffMs\"] == DEFAULT_SEARCH_CUTOFF_MS\n\n assert response[\"prefixSearch\"] == DEFAULT_PREFIX_SEARCH\n\n assert response[\"proximityPrecision\"] == DEFAULT", + "exact_match": false, + "code_bleu": 0.07432998184513635, + "edit_similarity": 0.06896551724137931, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "\"succeeded\"", + "got": "200", + "got_raw": "200\n\n # Update the settings again\n response = index.update_sortable_attributes(None)\n update = index.wait_for_task(response.task_uid)\n\n assert update.status == 200\n\n # Update the settings again\n response = index.update_sortable_attributes(None)\n update = index.wait_for_task(response.task_uid)\n\n assert update.status == 200\n\n # Update the settings again\n response = index.update_sortable_attributes(None)\n update = index.wait_for_task(response.task_uid)\n\n assert update.status == 200\n\n # Update the settings again\n response =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "1", + "got": "1", + "got_raw": "1\n assert response[\"limit\"] == 1\n assert response[\"offset\"] == 1\n assert response[\"total\"] == 3\n\n assert isinstance(response[\"results\"][0], Index)\n\n response = client.get_indexes(parameters={\"limit\": 1, \"offset\": 1, \"orderBy\": \"createdAt\"})\n\n assert len(response[\"results\"]) == 1\n assert response[\"limit\"] == 1\n assert response[\"offset\"] == 1\n assert response[\"total\"] == 3\n\n assert isinstance(response[\"results\"][0], Index)\n\n response = client.get_indexes(parameters", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "4096", + "got": "4096", + "got_raw": "4096\n assert embedders.embedders[\"ollama\"].document_template_max_bytes == 400\n assert embedders.embedders[\"ollama\"].distribution == Distribution(mean=0.5, sigma=0.1)\n assert embedders.embedders[\"ollama\"].binary_quantized is False\n\ndef test_huggingface_embedder_format(empty_index):\n \"\"\"Tests that HuggingFace embedder has the required fields and proper format.\"\"\"\n index = empty_index()\n\n huggingface_embedder = {\n \"huggingFace\": {\n \"source\": \"huggingFace\",\n \"url\":", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "options[\"remotes\"][instance_name][\"url\"]", + "got": "BASE_URL", + "got_raw": " BASE_URL\n assert response[\"remotes\"][instance_name][\"searchApiKey\"] == \"search-key-1\"\n assert response[\"remotes\"][instance_name][\"writeApiKey\"] == \"write-key-1\"\n\n client.reset_network_settings()\n response = client.get_all_networks()\n\n assert response[\"self\"] == options[\"self\"]\n\n assert \"remotes\" not in response\n\ndef test_reset_network_settings(client):\n \"\"\"Test resetting network settings.\"\"\"\n instance_name = REMOTE_MS_1\n options = {\n \"self\": instance_name,\n \"remotes\": {\n instance_name: {\n \"url", + "exact_match": false, + "code_bleu": 0.05, + "edit_similarity": 0.041666666666666664, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "1", + "got": "1", + "got_raw": "1\n assert time_delta.microseconds >= 1000\n\n\ndef test_wait_for_task_timeout(index_with_documents, small_movies):\n \"\"\"Tests call to wait for an update with timeout.\"\"\"\n index = index_with_documents()\n response = index.add_documents(small_movies)\n assert response.task_uid is not None\n start_time = datetime.now()\n with pytest.raises(MeilisearchTimeoutError):\n index.wait_for_task(response.task_uid, timeout_in_ms=1000)\n time_delta = datetime.now() - start_time\n assert isinstance(time_delta, datetime)\n assert time_delta.seconds >= ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "\"keyTest\"", + "got": "\"keyTest\"", + "got_raw": " \"keyTest\"\n\ndef test_update_keys_with_expires_at(client, test_key_info):\n \"\"\"Tests updating a key with expires_at.\"\"\"\n key = client.create_key(test_key_info)\n assert key.name == test_key_info[\"name\"]\n update_key = client.update_key(key_or_uid=key.key, options={\"name\": \"keyTest\", \"expiresAt\": \"2023-01-01\"})\n assert update_key.key is not None\n assert update_key.expires_at is not None\n\n assert update_key.name == \"keyTest\"\n\ndef test_update_keys_with_expires_at_in_the_past(client", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "0", + "got": "0", + "got_raw": "0\n assert len(response[\"hits\"][0]) > 0\n assert len(response[\"hits\"][1]) > 0\n\n assert response[\"hits\"][0][\"offset\"] == 0\n assert response[\"hits\"][0][\"limit\"] == 20\n assert response[\"hits\"][0][\"processingTimeMs\"] == 0\n assert response[\"hits\"][0][\"query\"] == \"\"\n\n assert response[\"hits\"][1][\"offset\"] == 0\n assert response[\"hits\"][1][\"limit\"] == 20\n assert response[\"hits\"][1][\"processingTimeMs\"] == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "204", + "got": "204", + "got_raw": "204\n\n\ndef test_delete_webhook_invalid_uuid(client):\n \"\"\"Test deleting a webhook with an invalid uuid.\"\"\"\n # Try to delete a webhook with an invalid uuid\n status_code = client.delete_webhook(\"invalid_uuid\")\n\n assert status_code == 400\n\n\ndef test_delete_webhook_not_found(client):\n \"\"\"Test deleting a webhook that doesn't exist.\"\"\"\n # Try to delete a webhook that doesn't exist\n status_code = client.delete_webhook(\"non_existent_uuid\")\n\n assert status_code == 404\n\n\ndef test_delete_webhook_error(client):\n \"\"\"Test deleting a webhook", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "mock_response", + "got": "mock_response", + "got_raw": " mock_response\n\ndef test_get_chat_workspace_settings(client):\n \"\"\"Test basic get_chat_workspace_settings functionality.\"\"\"\n mock_response = {\n \"settings\": {\n \"model\": \"gpt-3.5-turbo\",\n \"temperature\": 0.5,\n \"max_tokens\": 100,\n \"top_p\": 1.0,\n \"frequency_penalty\": 0.0,\n \"presence_penalty\": 0.0,\n \"stop\": [\"\\n\"],\n \"logit_bias\": {},\n \"user\": \"user123\",\n \"system\": \"You are a", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "\"succeeded\"", + "got": "200", + "got_raw": "200\n assert dump_status.result[\"status\"] == \"succeeded\"\n assert dump_status.result[\"uid\"] == \"indexUID-dump-creation\"\n assert dump_status.result[\"path\"] == \"indexUID-dump-creation.ndjson\"\n\n\ndef test_dump_creation_with_options(client, index_with_documents):\n \"\"\"Tests the creation of a Meilisearch dump with options.\"\"\"\n index_with_documents(\"indexUID-dump-creation-with-options\")\n dump = client.create_dump(\n options={\"include\": [\"documents\", \"settings\"], \"exclude\": [\"documents\"]}\n )\n client.wait_for_task(dump.task", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "meilisearch/meilisearch-python", + "expected": "response", + "got": "assert \"version\" in response", + "got_raw": "<|fim_suffix|>\n assert \"version\" in response\n assert \"version\" in response[\"version\"]\n assert \"version\" in response[\"version\"][\"meilisearch\"]\n assert \"version\" in response[\"version\"][\"meilisearch\"][\"version\"]\n assert \"version\" in response[\"version\"][\"meilisearch\"][\"version\"][\"major\"]\n assert \"version\" in response[\"version\"][\"meilisearch\"][\"version\"][\"minor\"]\n assert \"version\" in response[\"version\"][\"meilisearch\"][\"version\"][\"patch\"]\n assert \"version\" in response[\"version\"][\"meilisearch\"][\"version\"][\"prere", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.4444444444444444, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "\"api-endpoint\"", + "got": "assert prompt == \"Your task is to rate each pair on a scale from 1-10 and return valid JSON with added ratings. ONLY return a valid JSON array with the original pairs plus ratings. Do not include any explanations or text outside the JSON.\"", + "got_raw": "<|fim_suffix|>\n assert prompt == \"Your task is to rate each pair on a scale from 1-10 and return valid JSON with added ratings. ONLY return a valid JSON array with the original pairs plus ratings. Do not include any explanations or text outside the JSON.\"\n\n assert format_config == {\n \"default\": \"jsonl\",\n \"include_metadata\": True,\n \"pretty_json\": True\n }\n```\n\n### Stage 3: QA Generation\n\nThe `qa_generation` stage creates question-answer pairs from the text.\n\n```mermaid\ngraph TD\n\n\nfrom pathlib import Path\n\nimport pytest\n\nfrom synthetic_data_k", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.06324110671936758, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "result", + "got": "result", + "got_raw": " result\n assert \"qa_pairs\" in result\n assert len(result[\"qa_pairs\"]) == 2\n\n # Check that the summary is correct\n assert result[\"summary\"] == \"This is a summary of the document.\"\n\n # Check that the QA pairs are correct\n assert result[\"qa_pairs\"][0][\"question\"] == \"What is synthetic data?\"\n assert result[\"qa_pairs\"][0][\"answer\"] == \"Synthetic data is artificially generated data.\"\n assert result[\"qa_pairs\"][1][\"question\"] == \"Why use synthetic data?\"\n assert result[\"qa_pairs\"][1][\"answer\"] == \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "None", + "got": "assert len(parsed_text) == 1", + "got_raw": "<|fim_suffix|>\n assert len(parsed_text) == 1\n assert parsed_text[0][\"text\"] == \"This is a sample text.\"\n\n def test_ppt_parser(self):\n \"\"\"Test that PPT parser can be initialized and parse a file\"\"\"\n parser = PPTParser()\n with tempfile.NamedTemporaryFile(suffix=\".pptx\") as temp_file:\n temp_file.write(b\"Sample content\")\n temp_file.seek(0)\n parsed_text = parser.parse(temp_file.name)\n assert len(parsed_text) == 1\n assert parsed_text[0][\"text\"] == \"Sample content\"\n\n def test_y", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.0625, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "context1.config", + "got": "context1.config", + "got_raw": " context1.config\n assert \"key2\" not in context1.config\n\n assert \"key1\" not in context2.config\n assert \"key2\" in context2.config\n\n def test_ensure_data_dirs(self):\n \"\"\"Test that data directories are created\"\"\"\n with patch.object(AppContext, \"_ensure_data_dirs\") as mock_ensure_dirs:\n context = AppContext(config_path=Path(\"/path1\"))\n context._ensure_data_dirs()\n\n # Ensure directories are created\n mock_ensure_dirs.assert_called_once_with()\n\n def test_ensure_data_dirs_existing_dirs(self):\n \"\"\"Test that data", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "\"vllm\"", + "got": "\"vllm\"", + "got_raw": " \"vllm\"\n\n@pytest.mark.unit\ndef test_get_vllm_config(mock_config):\n \"\"\"Test getting the VLLM configuration from config.\"\"\"\n vllm_config = config.get_vllm_config(mock_config)\n assert vllm_config == {\n 'api_base': 'http://localhost:8000/v1',\n 'port': 8000,\n 'model': 'meta-llama/Llama-3.3-70B-Instruct',\n 'max_retries': 3,\n 'retry_delay': 1.0\n }\n\n@pytest.mark.unit\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "output_path)", + "got": "", + "got_raw": "\n\n\n# File: synthetic_data_kit/generators/vqa_generator.py\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the terms described in the LICENSE file in\n# the root directory of this source tree.\n# Generate the content: CoT/QA/Summary Datasets\nimport os\nimport json\nfrom pathlib import Path\nfrom typing import Optional, Dict, Any\n\nfrom synthetic_data_kit.models.llm_client import LLMClient\nfrom synthetic_data_kit.generators.qa_generator import QAGenerator\nfrom synthetic_data_kit", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "path_obj", + "got": "t context1.config_path == string_path", + "got_raw": "<|fim_suffix|>t context1.config_path == string_path\n\n # Test with Path object\n path_obj = Path(\"/path/object\")\n context2 = AppContext(config_path=path_obj)\n\n assert context2.config_path == path_obj\n\n def test_ensure_data_dirs(self):\n \"\"\"Test that _ensure_data_dirs creates necessary directories\"\"\"\n with patch.object(AppContext, \"_ensure_data_dirs\") as mock_ensure_dirs:\n context = AppContext()\n context._ensure_data_dirs()\n mock_ensure_dirs.assert_called_once()\n\n def test_ensure_data_dirs_existing_dirs(self):\n \"\"\"Test that _ensure_data_dirs does", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "2", + "got": "2", + "got_raw": "2\n\n # Check that each example has the expected keys\n for example in result:\n assert \"question\" in example\n assert \"reasoning\" in example\n assert \"answer\" in example\n\n # Test with invalid JSON array\n invalid_json_text = \"\"\"\n Here is the result:\n [\n {\n \"question\": \"What is synthetic data?\",\n \"reasoning\": \"Synthetic data is data that is artificially created rather than collected from real-world events. It's generated using algorithms and often mirrors statistical properties of real data.\",\n \"answer\": \"Synthetic data is artificially generated data.\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "0", + "got": "0", + "got_raw": "0\n assert results[\"total_files\"] == 2\n\n # Check that output files were created\n output_files = os.listdir(output_dir)\n assert len(output_files) == 2\n\n # Check that output files have the correct content\n for file in output_files:\n with open(os.path.join(output_dir, file), \"r\") as f:\n data = json.load(f)\n assert isinstance(data, dict)\n assert \"qa_pairs\" in data\n assert isinstance(data[\"qa_pairs\"], list)\n assert len(data[\"qa_pairs\"]) == 2\n\n finally:\n # Clean up", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "\"test_value\"", + "got": "t context.config[\"test_key\"] == \"test_value\"", + "got_raw": "<|fim_suffix|>t context.config[\"test_key\"] == \"test_value\"\n\n def test_ensure_data_dirs(self):\n \"\"\"Test that ensure_data_dirs method creates directories\"\"\"\n with patch.object(AppContext, \"_ensure_data_dirs\") as mock_ensure:\n context = AppContext()\n context._ensure_data_dirs()\n\n # Ensure that the method was called\n mock_ensure.assert_called_once()\n\n def test_ensure_data_dirs_existing_dirs(self):\n \"\"\"Test that ensure_data_dirs method does not create directories if they already exist\"\"\"\n with patch.object(AppContext, \"_ensure_data_dirs\") as mock_ensure:\n context =", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.42857142857142855, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "0", + "got": "0", + "got_raw": "0\n assert results[\"successful\"] == 0\n assert results[\"failed\"] == 0\n assert results[\"results\"] == []\n assert results[\"errors\"] == []\n \n finally:\n # Clean up\n os.rmdir(temp_dir)\n os.rmdir(output_dir)\n\n@pytest.mark.integration\ndef test_ingest_with_supported_files(patch_config):\n \"\"\"Test processing supported files in directory.\"\"\"\n temp_dir = tempfile.mkdtemp()\n output_dir = tempfile.mkdtemp()\n \n try:\n # Create sample files in temp directory\n for ext in INGEST_EXTENSIONS:\n with open(os.path", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "0", + "got": "0, \"Expected to call chat_completion multiple times\"", + "got_raw": "0, \"Expected to call chat_completion multiple times\"\n\n # Check if the prompt was used properly\n assert mock_client.chat_completion.call_args_list[0][1][\"messages\"][0][\"content\"] == \"Generate 3 Chain of Thought reasoning examples from the following text:\\n\\nText:\\nThis is a document about synthetic data.\"\n\n # Check if the prompt was used properly\n assert mock_client.chat_completion.call_args_list[0][1][\"messages\"][1][\"content\"] == \"Generate 3 Chain of Thought reasoning examples from the following text:\\n\\nText:\\nThis is a document about synthetic data.\"\n\n ", + "exact_match": true, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.03773584905660377, + "n_retrieved": 10 + }, + { + "repo": "meta-llama/synthetic-data-kit", + "expected": "0", + "got": "0", + "got_raw": "0\n assert os.path.exists(expected_output)\n assert os.path.getsize(expected_output) > 0\n \n finally:\n # Clean up\n os.remove(input_file)\n os.rmdir(output_dir)\n\n@pytest.mark.integration\ndef test_single_file_ingest_still_works_with_config(patch_config):\n \"\"\"Test that single file ingest processing works unchanged.\"\"\"\n with tempfile.NamedTemporaryFile(mode=\"w\", suffix=\".txt\", delete=False) as f:\n f.write(\"This is test content for single file processing.\")\n input_file = f.name\n \n output_dir = tempfile.mkdtemp()\n \n try:\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "michaelhly/solana-py", + "expected": "0", + "got": "1", + "got_raw": "1\n assert msg.result.value.parent_slot == 0\n assert msg.result.value.parent_blockhash == \"311111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "michaelhly/solana-py", + "expected": "resp)", + "got": "Resp, resp)", + "got_raw": "Resp, resp)\n assert isinstance(resp, GetFirstAvailableBlockResp)\n assert resp.value == 1\n\n # Airdrop to stubbed_receiver\n resp = test_http_client.request_airdrop(stubbed_receiver, AIRDROP_AMOUNT)\n\n assert_valid_response(Resp, resp)\n assert isinstance(resp, GetFirstAvailableBlockResp)\n assert resp.value == 2\n\n@pytest.mark.integration\ndef test_request_air_drop_with_commitment(stubbed_sender: Keypair, stubbed_receiver: Pubkey, test_http_client: Client):\n \"\"\"Test air drop to stubbed_sender and stubbed_receiver with", + "exact_match": false, + "code_bleu": 0.47287080450158786, + "edit_similarity": 0.625, + "n_retrieved": 10 + }, + { + "repo": "michaelhly/solana-py", + "expected": "0.0", + "got": "0", + "got_raw": "0\n\n@pytest.mark.integration\ndef test_burn_checked_with_multi_signer(stubbed_sender, stubbed_sender_token_account_pk, stubbed_receiver, test_token): # pylint: disable=redefined-outer-name\n \"\"\"Test burning tokens checked with multi-signer.\"\"\"\n burn_amount = 500\n expected_decimals = 6\n\n assert_valid_response(\n test_token.burn_checked(\n account=stubbed_sender_token_account_pk,\n owner=stubbed_sender,\n amount=burn_amount,\n decimals=expected_decimals,\n multi_signers=[stubbed_receiver],\n opts=OPT", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "michaelhly/solana-py", + "expected": "0.0", + "got": "0", + "got_raw": "0\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui_amount == str(0)\n\n assert balance_info.ui", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "michaelhly/solana-py", + "expected": "None", + "got": "0", + "got_raw": "0\n assert item.result is not None\n assert item.result is not \"\"\n assert item.result is not []\n assert item.result is not {}\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not ()\n assert item.result is not", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "michaelhly/solana-py", + "expected": "None", + "got": "0", + "got_raw": "0\n\n # Create a transaction\n tx = VersionedTransaction(\n Transaction(\n [\n sp.Transfer(\n from_pubkey=async_stubbed_sender.pubkey(),\n to_pubkey=async_stubbed_receiver.pubkey(),\n lamports=AIRDROP_AMOUNT,\n )\n ],\n recent_blockhash,\n )\n )\n\n # Send the transaction\n resp = await test_http_client_async.send_raw_transaction(tx, TxOpts(skip_confirmation=True))\n assert_valid_response(resp)\n assert resp.value.err is None\n\n # Get the balance\n resp = await test_http_client_async.get_balance(async_stubbed_receiver", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "torch.Size([2, 3])", + "got": "torch.Size([2, 3])", + "got_raw": " torch.Size([2, 3])\n logits = base_logits + x_hat\n assert torch.equal(noise_model.logits, logits - logits.logsumexp(dim=-1, keepdim=True))\n\n # batch size 2\n x_hat = torch.Tensor([[0.3, 0.2, 0.1], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]])\n noise_model = CategoricalNoise(x_hat, base_logits)\n\n assert noise_model.logits.shape == torch.Size([3, 3])\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "noise_a.mode)", + "got": "0.5 * (noise_a.mode() + noise_b.mode()))", + "got_raw": "0.5 * (noise_a.mode() + noise_b.mode()))\n torch.testing.assert_close(joint_noise.mode.get(\"b\"), 0.5 * (noise_a.mode() + noise_b.mode()))\n\n torch.testing.assert_close(joint_noise.mean.get(\"a\"), 0.5 * (noise_a.mean() + noise_b.mean()))\n torch.testing.assert_close(joint_noise.mean.get(\"b\"), 0.5 * (noise_a.mean() + noise_b.mean()))\n\n torch.testing.assert_close(joint_noise.var.get(\"a\"), 0.5 * (noise_a.var() + noise_b.var()))\n torch", + "exact_match": false, + "code_bleu": 0.1513851459876605, + "edit_similarity": 0.49056603773584906, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "len(metaset)", + "got": "1000", + "got_raw": "1000\n\ndef test_mixed_type_causal_metaset_with_interventions(mixture_sem_sampler_and_shapes: tuple[SEMSampler, dict[str, torch.Size]]):\n mixture_sem_sampler, shapes_dict = mixture_sem_sampler_and_shapes\n metaset = CausalMetaset(mixture_sem_sampler, 5, 7, 1, 2, sample_interventions=True)\n\n count = 0\n for sample in metaset: # type: ignore\n count += 1\n assert sample.observations.batch_size == torch.Size([5])\n assert sample.noise.batch_size", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "torch.Size([10])", + "got": "2", + "got_raw": "2\n assert data_module.dataset_train.num_samples == 10\n assert data_module.dataset_train.num_features == 4\n assert data_module.dataset_train.num_groups == 2\n assert data_module.dataset_train.num_variables == 4\n assert data_module.dataset_train.num_groups == 2\n assert data_module.dataset_train.num_variables == 4\n assert data_module.dataset_train.num_features == 4\n assert data_module.dataset_train.num_samples == 10\n assert data_module.dataset_train.num_groups == 2\n assert data_module.dataset_train.num_variables == 4\n assert data_module", + "exact_match": false, + "code_bleu": 0.0625, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "torch.Size([2])", + "got": "2", + "got_raw": "2\n assert list(data_module.val_dataloader())[0].batch_size == 2\n assert list(data_module.test_dataloader())[0].batch_size == 2\n\n assert data_module.train_dataloader().dataset.variables_metadata == VARIABLES_METADATA\n assert data_module.val_dataloader().dataset.variables_metadata == VARIABLES_METADATA\n assert data_module.test_dataloader().dataset.variables_metadata == VARIABLES_METADATA\n\n assert data_module.train_dataloader().dataset.adjacency_matrix == ADJACENCY\n assert data_module.val_dataloader().dataset.adjacency_matrix == ADJACENCY\n assert data_module.test_dataloader().dataset.adjacency", + "exact_match": false, + "code_bleu": 0.07432544468767006, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "target_entropy)", + "got": "2 * np.log(2), rtol=1e-5, atol=1e-5)", + "got_raw": "2 * np.log(2), rtol=1e-5, atol=1e-5)\n\ndef test_rhino_lagged_entropy():\n \"\"\"Test RhinoLaggedAdjacencyDistribution entropy is correct for a known distribution.\"\"\"\n eps = 1e-7\n\n probs_exist = torch.tensor([[0.0, 1.0 - eps], [1.0 - eps, 0.0]])\n probs_orient = torch.tensor([0.5])\n logits_exist = torch.nn.Parameter(probs_to_logits(probs_exist, is_binary=True), requires_grad=True)\n logits_orient = torch.nn.Parameter", + "exact_match": false, + "code_bleu": 0.05809665204409193, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "getattr(cf_2[0], field))", + "got": "getattr(cf_2[0], field))", + "got_raw": " getattr(cf_2[0], field))\n torch.testing.assert_allclose(getattr(cf_1[1], field), getattr(cf_2[1], field))\n torch.testing.assert_allclose(getattr(cf_1[2], field), getattr(cf_2[2], field))\n\ndef test_load_save_dataset():\n dataset = \"csuite_linexp_2\"\n root_path = os.path.join(CAUSICA_DATASETS_PATH, dataset)\n\n variables_metadata, train_data, test_data, adj_mat, interventions = _load_and_test_dataset(root_path)\n\n with tempfile.TemporaryDirectory() as tmp", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "np.zeros_like(logits.detach().numpy()))", + "got": "0.0)", + "got_raw": "0.0)\n\ndef test_threeway_entropy_grad():\n \"\"\"Test entropy is correct for a known distribution\"\"\"\n num_nodes = 3\n logits = torch.nn.Parameter(\n torch.zeros(((num_nodes * (num_nodes - 1)) // 2, 3))\n ) # create a max entropy distribution\n dist = ThreeWayAdjacencyDistribution(logits=logits)\n entropy = dist.entropy()\n np.testing.assert_allclose(entropy.detach().numpy(), logits.shape[0] * np.log(3))\n # check the gradient of the max entropy is ~zero\n entropy.backward()\n\n ", + "exact_match": false, + "code_bleu": 0.07163799545490279, + "edit_similarity": 0.09302325581395349, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "[\"x_1\"]", + "got": "0.0", + "got_raw": "0.0\n\ndef test_sample_treatment_and_effect():\n graph = torch.zeros(5, 5)\n node_names = [f\"x_{i}\" for i in range(5)]\n graph[0, 1] = 1\n graph[2, 3] = 1\n\n with pytest.warns(None):\n treatment, effect = sample_treatment_and_effect(graph, node_names, treatment_variable=\"x_0\")\n\n assert treatment == 0.0\n assert effect == 0.0\n\ndef test_sample_treatment_given_effects():\n graph = torch.zeros(5, ", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "torch.sort(chunk[\"order\"]).values)", + "got": "", + "got_raw": " # type: ignore\n torch.arange(num_dims)[[dim] * num_repetitions])\n\n # Verify that the original data was not modified\n torch.testing.assert_close(data[\"value\"], torch.eye(num_dims))\n torch.testing.assert_close(data[\"index\"], torch.arange(num_dims))\n torch.testing.assert_close(data[\"order\"], torch.arange(num_dims))\n\n\n@pytest.mark.parametrize(\"num_dims\", [1, 11, 17])\n@pytest.mark.parametrize(\"num_repetitions\", [1, 3, 5])\ndef test_index_contiguous_chunks_with_order(num_dims, num_repetitions):\n td =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "torch.tensor(0)", + "got": "0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(1", + "got_raw": "0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(10) * 0.8 * torch.log(1", + "exact_match": false, + "code_bleu": 0.018429002880824562, + "edit_similarity": 0.07936507936507936, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "std(joint_log_probs))", + "got": "0.0, atol=0.01, rtol=0.01)", + "got_raw": "0.0, atol=0.01, rtol=0.01)\n\n\n@pytest.mark.parametrize(\"noise\", NOISE_DISTRIBUTIONS)\n@pytest.mark.parametrize(\"sample_shape\", SAMPLE_SHAPES)\ndef test_joint_noise_log_prob(noise: Noise, sample_shape: torch.Size):\n \"\"\"Test that the log prob of a sample is correct.\"\"\"\n sample = noise.sample(sample_shape)\n log_prob = noise.log_prob(sample)\n assert log_prob.shape == sample_shape\n\n\n@pytest.mark.parametrize(\"noise\", NOISE_DISTRIBUTIONS)\n@pytest.mark.parametrize(\"sample_shape\", SAMPLE_SHAPES)\ndef test_joint_noise_sample", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.2553191489361702, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "buffer)", + "got": "buffer)", + "got_raw": " buffer)\n torch.testing.assert_close(seq_buffers[f\"1.{name}\"], buffer)\n\ndef test_sequential_transform_module_inner_buffers_with_inv() -> None:\n offset = torch.randn((5, 1))\n transform = _OffsetTransformModule(offset)\n seq_transform = SequentialTransformModule[torch.Tensor, torch.Tensor](transform, transform)\n # Check that buffers are stored for the inner transformation\n seq_buffers = dict(seq_transform.named_buffers())\n for name, buffer in transform.named_buffers():\n\n torch.testing.assert_close(seq_buffers[f\"0.{name}\"], buffer)\n torch.testing.assert_close(seq_buffers[f", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "y.to(**to_kwargs))", + "got": "y.to(**to_kwargs), atol=2e-2, rtol=1e-2)", + "got_raw": " y.to(**to_kwargs), atol=2e-2, rtol=1e-2)\n\n # Check that the inverse is correct\n x = transform(y)\n torch.testing.assert_close(x, x_modified, atol=2e-2, rtol=1e-2)\n\n # Check that the inverse is approx equivariant w.r.t. the `to` operator.\n if isinstance(x, TensorDictBase):\n assert isinstance(x_modified, TensorDictBase) # plays nicer with mypy than checking type equality\n for key in x.keys():\n torch.testing.assert_close(x_modified.get(key", + "exact_match": false, + "code_bleu": 0.37194474424733426, + "edit_similarity": 0.6206896551724138, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "torch.Size([100, 8, 8])", + "got": "100", + "got_raw": "100\n assert samples.shape[1] == num_edges_expected\n\ndef test_num_edges_2():\n n = 8\n edges_per_node = [2, 3]\n power = [1.0, 1.0]\n num_edges_expected = edges_per_node[0] * n + edges_per_node[1] * n\n samples = ScaleFreeDAGDistribution(num_nodes=n, edges_per_node=edges_per_node, power=power).sample(\n torch.Size([100])\n )\n\n\n assert samples.shape == 100\n assert samples.shape[1", + "exact_match": false, + "code_bleu": 0.049550296458446705, + "edit_similarity": 0.23076923076923078, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "torch.Size()", + "got": "1", + "got_raw": "1\n assert self.intervention_values.batch_size == self.noise_data.batch_size\n\n self.sampled_nodes = set(self.counterfactual_data.keys())\n\n def __len__(self):\n return self.counterfactual_data.batch_size\n\n def __getitem__(self, idx):\n return self.counterfactual_data[idx]\n\n def __iter__(self):\n return iter(self.counterfactual_data)\n\n def __repr__(self):\n return f\"CounterfactualDataNoise({self.counterfactual_data})\"\n\n def __str__(self):\n return f\"CounterfactualDataNoise({self.counterfactual", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "torch.tensor(-2.0))", + "got": "0.0)", + "got_raw": "0.0)\n\n gibbs_dag_prior = GibbsDAGPrior(num_nodes=2, sparsity_lambda=torch.tensor(1), context_length=2)\n\n A = torch.Tensor([[[1, 1], [0, 1]], [[1, 1], [0, 1]]])\n\n torch.testing.assert_close(\n gibbs_dag_prior.log_prob(A),\n torch.tensor(-6.0),\n )\n\n A = torch.Tensor([[[0, 1], [0, 0]], [[0, 1], [0, 0]]])\n\n\n torch.testing.assert_close(gib", + "exact_match": false, + "code_bleu": 0.13432124147794275, + "edit_similarity": 0.2608695652173913, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "intervention_2[2]", + "got": "intervention_2[2]", + "got_raw": " intervention_2[2]\n\ndef test_load_save_counterfactuals():\n \"\"\"Test that we can load a counterfactuals dataset, save it, and load it again\"\"\"\n root_path = os.path.join(CAUSICA_DATASETS_PATH, \"csuite_weak_arrows\")\n\n variables_metadata, counterfactuals = load_and_test_counterfactuals(root_path)\n\n with tempfile.TemporaryDirectory() as tmpdir:\n save_dataset(tmpdir, variables_metadata, counterfactuals, overwrite=True)\n variables_metadata_2, counterfactuals_2 = load_and_test_counterfactuals(tmp", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "y.get(key).to(**to_kwargs))", + "got": "y.get(key))", + "got_raw": " y.get(key))\n else:\n torch.testing.assert_close(y_modified, y)\n\n # Check that the inverse is correct\n x = transform.inverse(y)\n torch.testing.assert_close(x, x_modified)\n\n # Check that the inverse is approx equivariant w.r.t. the `to` operator.\n if isinstance(x, TensorDictBase):\n assert isinstance(x_modified, TensorDictBase) # plays nicer with mypy than checking type equality\n for key in x.keys():\n\n torch.testing.assert_close(x_modified.get(key), x.get(key))\n else:\n torch.testing.assert_close(x_modified, x", + "exact_match": false, + "code_bleu": 0.45180100180492244, + "edit_similarity": 0.5789473684210527, + "n_retrieved": 10 + }, + { + "repo": "microsoft/causica", + "expected": "1", + "got": "1", + "got_raw": "1\n logger.log_metrics({\"a\": 5})\n assert logger.get_buffer_count() == 0\n logger.log_metrics({\"a\": 6})\n assert logger.get_buffer_count() == 1\n logger.log_metrics({\"a\": 7})\n assert logger.get_buffer_count() == 0\n logger.log_metrics({\"a\": 8})\n assert logger.get_buffer_count() == 1\n logger.log_metrics({\"a\": 9})\n assert logger.get_buffer_count() == 0\n logger.log_metrics({\"a\": 10})\n assert logger.get_buffer_count() == 1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/mattergen", + "expected": "target_loss * 4)", + "got": "", + "got_raw": "\n\n\n# File: mattergen/diffusion/training/field_loss.py\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\nfrom typing import Literal, Optional, Tuple, Union\n\nimport torch\nfrom torch_scatter import scatter\n\nfrom mattergen.diffusion.corruption.multi_corruption import MultiCorruption\nfrom mattergen.diffusion.data.batched_data import BatchedData\nfrom mattergen.diffusion.score_models.base import Diffusable\nfrom mattergen.diffusion.sampling import predictors_correctors as pc\nfrom mattergen.diffusion.sampling.predictors import AncestralSamplingPredictor\nfrom mattergen.diff", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/mattergen", + "expected": "{\"foo\", \"bar\"}", + "got": "{\"drift\", \"diffusion\"}", + "got_raw": " {\"drift\", \"diffusion\"}\n\ndef _check_drift_diffusion_shapes(multi_corruption: MultiCorruption, batch, t: torch.Tensor):\n drifts_diffusions = multi_corruption.sde(batch=batch, t=t)\n _assert_keys(drifts_diffusions)\n\n for k, (drift, diffusion) in drifts_diffusions.items():\n assert drift.shape == batch[k].shape\n assert diffusion.shape[0] == batch[k].shape[0]\n\ndef _check_drift_diffusion_shapes(multi_corruption: MultiCorruption, batch, t: torch.Tensor):\n drifts", + "exact_match": false, + "code_bleu": 0.32466791547509893, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "microsoft/mattergen", + "expected": "samples_fast)", + "got": "15)", + "got_raw": "15)\n np.testing.assert_array_equal(samples_fast, 15)\n\n\ndef test_mask_diffusion():\n \"\"\"Tests mask diffusion.\"\"\"\n schedule = diffusion.create_discrete_diffusion_schedule(\n kind=\"standard\",\n beta_min=5e-4,\n beta_max=5e-2,\n num_steps=100,\n )\n dim = 16\n length = 16\n diff = diffusion.MaskDiffusion(dim=dim, schedule=schedule)\n x0 = torch.randint(0, dim, (length,))\n for _t in range(100):\n t", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "microsoft/mattergen", + "expected": "loss_with_bad_bar)", + "got": "0.0)", + "got_raw": "0.0)\n torch.testing.assert_allclose(loss_with_bad_bar, 0.0)\n\ndef test_agg_per_sample(tiny_state_batch, corruption_type: Type[Corruption]):\n \"\"\"Check that aggregate_per_sample works as expected.\"\"\"\n\n clean_batch = tiny_state_batch\n multi_corruption = get_multi_corruption(corruption_type=corruption_type, keys=[\"foo\", \"bar\"])\n\n t = torch.ones(clean_batch.get_batch_size())\n noisy_batch = multi_corruption.sample_marginal(batch=clean_batch, t=t)\n\n raw_noise = apply(\n {k: compute_noise_given_sample_and_corruption", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "microsoft/mattergen", + "expected": "t.shape", + "got": "1", + "got_raw": "1\n assert kl_loss.shape == 1\n assert cross_entropy_loss.shape == 1\n\n # Test that the loss is the sum of the KL and cross-entropy loss\n assert torch.allclose(loss, kl_loss + cross_entropy_loss, atol=1e-5)\n\n # Test that the loss is the sum of the KL and cross-entropy loss\n assert torch.allclose(loss, kl_loss + cross_entropy_loss, atol=1e-5)\n\n # Test that the loss is the sum of the KL and cross-entropy loss\n assert torch.allclose(loss, kl_loss + cross", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/mattergen", + "expected": "batch[k].shape", + "got": "", + "got_raw": " # mypy\n diffusion.shape == # mypy\n batch.shape[:-1] + (batch.shape[-1] * multi_corruption.N,) # mypy\n\n assert drift.shape == # mypy\n diffusion.shape == # mypy\n batch.shape[:-1] + (batch.shape[-1] * multi_corruption.N,) # mypy\n\n assert drift.shape == # mypy\n diffusion.shape == # mypy\n batch.shape[:-1] + (batch.shape[-1] * multi_corruption.N,) # mypy\n\n assert drift.shape ==", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/mattergen", + "expected": "np.nanstd(x.numpy())", + "got": "1.0", + "got_raw": "1.0\n assert data_utils.torch_nanstd(x=x, dim=0, unbiased=True).item() == 1.0\n\ndef test_torch_nanmean():\n x = torch.tensor([1.0, 2.0, np.nan, 3.0, 4.0, 5.0, np.nan, 6.0])\n\n assert data_utils.torch_nanmean(x=x, dim=0).item() == 3.5\n assert data_utils.torch_nanmean(x=x, dim=0, unbiased=False).item() == 3.5\n ", + "exact_match": false, + "code_bleu": 0.05, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "pattern.Pattern)", + "got": "pattern.Pattern)", + "got_raw": " pattern.Pattern)\n\n def test_pattern_base_compiled_pattern_access_after_removal(self):\n \"\"\"Test that PatternBase has an internal Pattern that is created on demand.\"\"\"\n\n class TestPattern(pattern.PatternBase):\n def pattern(self, op, x):\n return op.Identity(x)\n\n def check(self, context, x):\n return pattern.MatchResult() # Always succeeds\n\n test_pattern = TestPattern(name=\"TestPattern\")\n\n # Initially, the Pattern should not be created (lazy initialization)\n self.assertIsNone(test_pattern._compiled_pattern)\n\n # Create a simple model to trigger pattern creation\n model = ir.from", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "2)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(len(optimized.graph.node), 1)\n self.assertEqual(len(optimized.graph.node[0].input), 2)\n self.assertEqual(len(optimized.graph.node[0].output), 1)\n self.assertEqual(len(optimized.graph.node[0].attribute), 0)\n self.assertEqual(len(optimized.graph.node[0].control_input), 0)\n self.assertEqual(len(optimized.graph.node[0].control_output), 0)\n self.assertEqual(len(optimized.graph.node[0].name), 1)\n self.assertEqual(optimized.graph.node[0].name[0], \"Identity", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "5)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(op_types.count(\"SkipRMSNormalization\"), 0)\n\n outputs = ort_run(\"fused\", model, inputs)\n assert_allclose(original_outputs, outputs)\n\n def test_smollm_1(self):\n smollm_1 = smollm_test_1()\n model = smollm_1.get_onnx_model()\n onnxscript.optimizer.optimize(model)\n\n inputs = smollm_1.get_ort_inputs()\n original_outputs = ort_run(\"original\", model, inputs)\n\n fuse_skip_layer_normalization(model)\n op_types = [n.op_type for n", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "results[0])", + "got": "results[0], rtol=1e-5)", + "got_raw": " results[0], rtol=1e-5)\n\n @unittest.skipIf(sys.platform == \"win32\", reason=\"not supported yet on Windows\")\n @unittest.skipIf(not has_transformers(), reason=\"transformers is missing\")\n @unittest.skipIf(not has_phi3(), reason=\"transformers is not recent enough\")\n @unittest.skipIf(torch_older_than(\"2.4\"), reason=\"fails to export\")\n @ignore_warnings(UserWarning)\n def test_phi3_export_gpu(self):\n model, input_tensors_many, _ = (\n onnxscript.tools.transformers_models.phi3.get_phi3", + "exact_match": false, + "code_bleu": 0.33180774028439425, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "ts.shape)", + "got": "", + "got_raw": "\n\n\n# File: onnxscript/onnx_types.py\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\nfrom __future__ import annotations\n\nimport abc\nfrom typing import ClassVar, Optional, Tuple, Union\n\nimport onnx\nimport onnx_ir as ir\n\n_DType = ir.DataType\n_DimType = Union[int, str, type(None)]\n_ShapeType = Union[Tuple[_DimType, ...], _DimType, type(Ellipsis)]\n\n_tensor_type_shape_cache: dict[_DType, TensorType] = {}\ntensor_type_registry: dict[_DType, TensorType] =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "[\"Identity\"])", + "got": "", + "got_raw": " # noqa: TID251\n [\"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"Constant\", \"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "r)", + "got": "r)", + "got_raw": " r)\n self.assertIn(\"child\", r)\n self.assertIn(\"w\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Module\", r)\n self.assertIn(\"ModuleList\", r)\n self.assertIn(\"Sequential\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter\", r)\n self.assertIn(\"Parameter", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "model)", + "got": "", + "got_raw": "<|fim_suffix|>\n # TODO: remove this once we have a better way to test the model\n # TODO: remove this once we have a better way to test the model\n # TODO: remove this once we have a better way to test the model\n # TODO: remove this once we have a better way to test the model\n # TODO: remove this once we have a better way to test the model\n # TODO: remove this once we have a better way to test the model\n # TODO: remove this once we have a better way to test the model\n # TODO: remove this once", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "\"\")", + "got": "", + "got_raw": " # None\n \"''\")\n\n def test_none_as_input_for_op_with_schema(self):\n \"\"\"Test conversion of None as an input value in a call to an op with a known schema.\"\"\"\n\n @script()\n def none_as_input(X):\n return op.UnknownOp(X, None, X)\n\n # None should be translated into an empty string in NodeProto's input list\n node = none_as_input.to_function_proto().node[0]\n\n self.assertEqual(node.input[1], # None\n \"''\")\n\n def test_none_as_input_for_op_with_no_schema_and_no_default(self):\n \"\"\"Test", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "pres)", + "got": "pres)", + "got_raw": " pres)\n self.assertGreaterEqual(len(pres[\"gpus\"]), 1)\n for gpu in pres[\"gpus\"]:\n self.assertLessEqual(gpu.end, gpu.max_peak)\n self.assertLessEqual(gpu.begin, gpu.max_peak)\n\n def test_spy_cpu(self):\n p = onnxscript.tools.memory_peak.start_spying_on()\n res = []\n for i in range(10):\n time.sleep(0.005)\n res.append(np.empty(i * 1000000))\n del res\n time.sleep(0.02)\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n self.assertEqual(tracer.match_count, 0)\n self.assertEqual(tracer.matched_nodes, [])\n self.assertEqual(tracer.matched_inputs, [])\n self.assertEqual(tracer.matched_outputs, [])\n self.assertEqual(tracer.matched_attributes, [])\n self.assertEqual(tracer.matched_initializers, [])\n self.assertEqual(tracer.matched_value_infos, [])\n self.assertEqual(tracer.matched_value_infos, [])\n self.assertEqual(tracer.matched_value_infos, [])\n self.assertEqual(tracer.matched_value_infos, [])\n self.assertEqual(tracer.matched_value_infos, [])\n self.assertEqual(tracer.matched_value_infos", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "np.array([8]))", + "got": "2 * (M + 1))", + "got_raw": "2 * (M + 1))\n self.assertEqual(prod, 2 ** M)\n\n def test_loop_break(self):\n \"\"\"Loop with break.\"\"\"\n\n @script()\n def sumprod_break(x: FLOAT[\"N\"], N: INT64) -> (FLOAT[\"N\"], FLOAT[\"N\"]): # noqa: F821\n sum = op.Identity(x)\n prod = op.Identity(x)\n for _ in range(N):\n sum = sum + x\n prod = prod * x\n cond = op.ReduceSum(prod) > 1e7\n # ONNX does not", + "exact_match": false, + "code_bleu": 0.20159257283470225, + "edit_similarity": 0.23076923076923078, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "op_types)", + "got": "op_types)", + "got_raw": " op_types)\n self.assertIn(\"MatMulMulRelu\", op_types)\n self.assertIn(\"MatMulDivRelu\", op_types)\n self.assertIn(\"Relu\", op_types)\n self.assertIn(\"Constant\", op_types)\n self.assertIn(\"ConcatTraining\", op_types)\n self.assertIn(\"Transpose\", op_types)\n self.assertIn(\"Unsqueeze\", op_types)\n self.assertIn(\"Cast\", op_types)\n self.assertIn(\"MatMul\", op_types)\n self.assertIn(\"Add\", op_types)\n self.assertIn(\"Constant\", op_types)\n self.assertIn(\"Constant\", op_types)\n self.assertIn(\"Constant", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "function.__name__)", + "got": "\"function\")", + "got_raw": " \"function\")\n self.assertEqual(traced_function.op_signature, None)\n\n self.assertEqual(traced_function.opset, opset)\n self.assertEqual(traced_function.op_signature, None)\n\n self.assertEqual(traced_function.opset, opset)\n self.assertEqual(traced_function.op_signature, None)\n\n self.assertEqual(traced_function.opset, opset)\n self.assertEqual(traced_function.op_signature, None)\n\n self.assertEqual(traced_function.opset, opset)\n self.assertEqual(traced_function.op_signature, None)\n\n self.assertEqual(traced_function.opset, opset)\n self.assertEqual(traced_function.op_signature, None", + "exact_match": false, + "code_bleu": 0.2686424829558855, + "edit_similarity": 0.6206896551724138, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "m)", + "got": "m)", + "got_raw": " m)\n self.assertIs(mods[1], m.a)\n\n def test_modules_iterator_with_parameters(self):\n class A(Module):\n def __init__(self):\n super().__init__(\"a\")\n self.p = Parameter(\"p\", ir.DataType.FLOAT, shape=ir.Shape([1]))\n\n def forward(self, op):\n pass\n\n class B(Module):\n def __init__(self):\n super().__init__(\"b\")\n self.a = A()\n\n def forward(self, op):\n pass\n\n m = B()\n mods = list(m.modules())\n self.assertEqual(len(mods), 2)\n\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n outputs = ort_run(\"fused\", model, inputs)\n assert_allclose(outputs, original_outputs)\n\n @parameterized.parameterized.expand(\n [\n (\"pre_div\", _unmasked_pre_div_sdpa_script),\n (\"pre_mul\", _unmasked_pre_mul_sdpa_script),\n (\"post_div\", _unmasked_post_div_sdpa_script),\n (\"post_mul\", _unmasked_post_mul_sdpa_script),\n (\"masked_pre_div\", _masked_pre_div_sdpa_script),\n (\"masked_pre_mul\", _masked_pre_mul_sdpa_script),\n (\"masked_post_div\", _masked_post_div", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "str(e))", + "got": ".fail(f\"Failed to run the model: {e}\")", + "got_raw": ".fail(f\"Failed to run the model: {e}\")\n\n\nif __name__ == \"__main__\":\n unittest.main()\n```\n\n

BFloat16 Conversion in ONNX Script

\n\n```python\nimport onnx\nimport onnx.helper\nimport onnxscript\nfrom onnxscript import ir, opset18 as op, script\n\n@script()\ndef gelu(X: ir.val) -> ir.val:\n phiX = 0.5 * (op.Erf(M_SQRT1_2 * X) + 1.0)\n return X *", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n\n # Check that the model has been rewritten\n for node in model.graph.node:\n if node.op_type == \"Div\":\n self.assertEqual(node.domain, \"custom.domain\")\n\n def test_rewrite_rule_inheritance(self):\n \"\"\"Test that RewriteRule inheritance works.\"\"\"\n\n def reciprocal_mul_pattern(op, x, y):\n return (1 / x) * y\n\n def div_replacement(op, x, y):\n return op.Div(y, x)\n\n class ReciprocalMulRule(pattern.RewriteRule):\n def pattern(self, op, x, y):\n return (1 / x)", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "b)", + "got": "b)", + "got_raw": " b)\n\n @parameterized.expand(\n [\n (FLOAT, FLOAT),\n (FLOAT[None], FLOAT[None]),\n (FLOAT[1, 2, 3], FLOAT[1, 2, 3]),\n (FLOAT[1], FLOAT[1]),\n (FLOAT[...], FLOAT[Ellipsis]),\n (FLOAT[\"M\"], FLOAT[\"M\"]),\n (FLOAT[\"M\", \"N\"], FLOAT[\"M\", \"N\"]),\n (FLOAT[\"M\", 3, 4], FLOAT[\"M\", 3, 4]),\n ]\n )\n def test_shapes_are_same_type", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "microsoft/onnxscript", + "expected": "7)", + "got": "11)", + "got_raw": "11)\n self.assertEqual(f.graph.output[0].type.tensor_type.elem_type, 1)\n\n f = fcts[\"double_cast2\"]\n\n self.assertEqual(f.graph.input[0].type.tensor_type.elem_type, 11)\n self.assertEqual(f.graph.output[0].type.tensor_type.elem_type, 1)\n\n f = fcts[\"double_cast3\"]\n\n self.assertEqual(f.graph.input[0].type.tensor_type.elem_type, 11)\n self.assertEqual(f.graph.output[0].type.tensor_type.elem_type, 1)\n\n f = fcts[\"double_cast4\"]\n\n self.assertEqual", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "[[0xf0, 1, 2, 3, 0xf7]]", + "got": "0xf0, 1, 2, 3, 0xf7", + "got_raw": "0xf0, 1, 2, 3, 0xf7\n assert tokenize([0xf0, 1, 2, 3, 0xf7, 0xf0, 1, 2, 3, 0xf7]) == 0xf0, 1, 2, 3, 0xf7, 0xf0, 1, 2, 3, 0xf7\n assert tokenize([0xf0, 1, 2, 3, 0xf7, 0xf0, 1,", + "exact_match": false, + "code_bleu": 0.6923076923076923, + "edit_similarity": 0.9047619047619048, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "(0, 1, 2)", + "got": "0, 1, 2", + "got_raw": "0, 1, 2\n assert Message('sysex', data=(0, 1, 2)).data == (0, 1, 2)\n assert Message('sysex', data=(0, 1, 2)).data == (0, 1, 2, 0)\n assert Message('sysex', data=(0, 1, 2)).data == (0, 1, 2, 0, 0)\n assert Message('sysex', data=(0, 1, 2)).data == (0, 1, 2", + "exact_match": false, + "code_bleu": 0.7142857142857143, + "edit_similarity": 0.875, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "m2", + "got": "m2", + "got_raw": " m2\n\ndef test_track_repr2():\n track = MidiTrack([\n Message('note_on', channel=1, note=2, time=3),\n Message('note_off', channel=1, note=2, time=3),\n ])\n track_eval = eval(repr(track)) # noqa: S307\n for m1, m2 in zip(track, track_eval):\n\n assert m1 == m2\n\ndef test_track_repr3():\n track = MidiTrack([\n Message('note_on', channel=1, note=2, time=3),\n Message('note", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "1", + "got": "1", + "got_raw": "1\n assert decode_message(b'\\x91\\x00\\x00')['channel'] == 1\n assert decode_message(b'\\x91\\x00\\x00')['channel'] == 1\n assert decode_message(b'\\x91\\x00\\x00')['channel'] == 1\n assert decode_message(b'\\x91\\x00\\x00')['channel'] == 1\n assert decode_message(b'\\x91\\x00\\x00')['channel'] == 1\n assert decode_message(b'\\x91\\x00\\x00')['", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "Message('clock', time=0)", + "got": "0", + "got_raw": "0\n assert Message('clock', time=0) == Message('clock', time=0)\n assert Message('clock', time=0) != Message('clock', time=1)\n assert Message('clock', time=0) != Message('clock', time=0.0)\n assert Message('clock', time=0) != Message('clock', time=0.1)\n assert Message('clock', time=0) != Message('clock', time=1.0)\n assert Message('clock', time=0) != Message('clock', time=1.1)\n assert Message('", + "exact_match": false, + "code_bleu": 0.07432544468767006, + "edit_similarity": 0.08, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "[[0xf8], [0xf8]]", + "got": "0", + "got_raw": "0\n assert tokenize([0xf8, 0xf8, 0xf8]) == 0\n assert tokenize([0xf8, 0xf8, 0xf8, 0xf8]) == 0\n assert tokenize([0xf8, 0xf8, 0xf8, 0xf8, 0xf8]) == 0\n assert tokenize([0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8]) == 0\n assert tokenize([0xf8,", + "exact_match": false, + "code_bleu": 0.05555555555555555, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "0", + "got": "0", + "got_raw": "0\n\n assert Message.from_hex('E0 00 7F').pitch == MAX_PITCHWHEEL\n\n assert Message.from_hex('E0 00 80').pitch == MIN_PITCHWHEEL\n\n assert Message.from_hex('E0 00 81').pitch == MAX_PITCHWHEEL\n\n assert Message.from_hex('E0 00 7F 00 00').pitch == MAX_PITCHWHEEL\n\n assert Message.from_hex('E0 00 7F 00 01').pitch == MAX_PITCHWHEEL", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n port._send(Message('note_on', note=64, velocity=64))\n\n with pytest.raises(NotImplementedError):\n port._receive()\n\n def test_close(self, port):\n port._close()\n assert port.closed\n\n def test_iter_pending(self, port):\n assert not port._messages\n assert not port._parser.messages\n assert not port._pending\n\n port._send(Message('note_on', note=64, velocity=64))\n assert port._messages\n assert not port._parser.messages\n assert not port._pending\n\n for", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "Message('start', time=1)", + "got": "", + "got_raw": " # noqa: T201\n Message('start', time=1)\n\n assert Message('start').copy(time=1, channel=1) == # noqa: T201\n Message('start', channel=1, time=1)\n\n assert Message('start').copy(time=1, channel=1, note=1) == # noqa: T201\n Message('start', channel=1, note=1, time=1)\n\n assert Message('start').copy(time=1, channel=1, note=1, velocity=1) == # noqa", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mido/mido", + "expected": "None", + "got": "assert parser.get_message() is None", + "got_raw": "<|fim_suffix|>\n assert parser.get_message() is None\n\n\ndef test_parse():\n \"\"\"Parse a message.\"\"\"\n msg = Message('note_on', note=60, velocity=64)\n assert parse(msg.bytes()) == msg\n\n\ndef test_parse_all():\n \"\"\"Parse a message.\"\"\"\n msg = Message('note_on', note=60, velocity=64)\n assert parse_all(msg.bytes()) == [msg]\n\n\ndef test_parse_string():\n \"\"\"Parse a string.\"\"\"\n msg = Message('note_on', note=60, velocity=64)\n assert parse_string(msg2str(msg)) == msg", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.20512820512820512, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "{})", + "got": "{'a': '1', 'b': '2'})", + "got_raw": " {'a': '1', 'b': '2'})\n self.assertEqual(req.form, {'a': '1', 'b': '2'})\n self.assertEqual(req.query, 'a=1&b=2')\n self.assertEqual(req.query_string, 'a=1&b=2')\n self.assertEqual(req.query_params, {'a': '1', 'b': '2'})\n self.assertEqual(req.query_params_dict, {'a': '1', 'b': '2'})\n self.assertEqual(req.query_params_list, [('a', '1'), ('b', '2')])\n self.assertEqual(req.query_params_dict_list", + "exact_match": false, + "code_bleu": 0.17827531042796255, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "{'id': 'bca'})", + "got": "{'id': 'bca'})", + "got_raw": " {'id': 'bca'})\n\n self.assertEqual(p.match('/users/abc'), None)\n\n def test_regex_argument_with_default(self):\n p = URLPattern('/users/', pattern='[a-z]+')\n self.assertEqual(p.match('/users/ab'), {'id': 'ab'})\n\n self.assertEqual(p.match('/users/bca'), {'id': 'bca'})\n\n self.assertEqual(p.match('/users/abc'), None)\n\n def test_regex_argument_with_default_and_pattern(self):\n p = URLPattern('/users/', pattern='", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "'Hello, foo!')", + "got": "'Hello, foo!')", + "got_raw": " 'Hello, foo!')\n\n def test_render_template_async(self):\n s = self._run(Template('hello.jinja.txt').render_async(name='foo'))\n\n self.assertEqual(s, 'Hello, foo!')\n\n def test_render_template_async_with_async(self):\n s = self._run(Template('hello.jinja.txt').render_async_async(name='foo'))\n\n self.assertEqual(s, 'Hello, foo!')\n\n def test_render_template_async_with_async_and_async(self):\n s = self._run(Template('hello.jinja.txt').render_async_async_async(name='foo'))\n\n self.assertEqual(s, 'Hello", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(d.get('one'), 1)\n self.assertEqual(d.get('one', default=0), 1)\n self.assertEqual(d.getlist('one'), [1])\n self.assertEqual(d.getlist('one', type=int), [1])\n\n d['one'] = 2\n\n self.assertEqual(d['one'], 2)\n self.assertEqual(d.get('one'), 2)\n self.assertEqual(d.get('one', default=0), 2)\n self.assertEqual(d.getlist('one'), [2])\n self.assertEqual(d.getlist('one', type=int), [2])\n\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "400)", + "got": "400)", + "got_raw": "400)\n\n def test_websocket(self):\n app = Microdot()\n\n @app.route('/echo')\n @with_websocket\n def index(req, ws):\n while True:\n data = ws.receive()\n ws.send(data)\n\n client = TestClient(app)\n res = self._run(client.get('/echo'))\n\n self.assertEqual(res.status_code, 200)\n\n client = TestClient(app)\n res = self._run(client.get('/echo'))\n\n self.assertEqual(res.status_code, 200)\n\n client = TestClient(app)\n res = self._run(client.get('/", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "204)", + "got": "200)", + "got_raw": "200)\n self.assertEqual(res.body, b'')\n\n def test_create_from_string(self):\n res = Response('Hello, world!')\n\n self.assertEqual(res.status_code, 200)\n self.assertEqual(res.body, b'Hello, world!')\n\n def test_create_from_bytes(self):\n res = Response(b'Hello, world!')\n\n self.assertEqual(res.status_code, 200)\n self.assertEqual(res.body, b'Hello, world!')\n\n def test_create_from_file(self):\n with open('tests/test_response.py', 'rb') as f:\n res = Response(f)\n\n self.assertEqual", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "request.g.current_user", + "got": "def test_login(self):", + "got_raw": "\n\n def test_login(self):\n app = Microdot()\n login = Login(app)\n session = Session(app)\n\n @app.get('/')\n @login\n async def index(request):\n return 'Hello, world!'\n\n @app.get('/login')\n async def login(request):\n session.set('user', 'susan')\n return 'Logged in'\n\n @app.get('/logout')\n async def logout(request):\n session.clear()\n return 'Logged out'\n\n @app.get('/protected')\n @login\n async def protected(request):\n return 'Protected'\n\n @app.get('/protected", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.32558139534883723, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "'None')", + "got": "'foo=bar')", + "got_raw": " 'foo=bar')\n\n def test_form(self):\n app = Microdot()\n\n @app.post('/async')\n @with_form_data\n async def async_route(req):\n return str(req.form)\n\n client = TestClient(app)\n\n res = self._run(client.post('/async', body={'foo': 'bar'}))\n self.assertEqual(res.status_code, 200)\n\n self.assertEqual(res.text, 'foo=bar')\n\n def test_form_iter(self):\n app = Microdot()\n\n @app.post('/async')\n @with_form_data\n async def async_route(req):\n return", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.47058823529411764, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "403)", + "got": "204)", + "got_raw": "204)\n res = self._run(client.post(\n '/submit', headers={'Origin': 'https://evil.com'}\n ))\n self.assertEqual(res.status_code, 204)\n\n res = self._run(client.post('/submit-exempt'))\n self.assertEqual(res.status_code, 204)\n res = self._run(client.post(\n '/submit-exempt', headers={'Sec-Fetch-Site': 'cross-site'}\n ))\n self.assertEqual(res.status_code, 204)\n res = self._run(client.post(\n '/submit-exempt', headers={'Origin': 'https", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "'3')", + "got": "3)", + "got_raw": "3)\n self.assertEqual(res.body, b'foo')\n\n res = self._run(client.get('/async'))\n self.assertEqual(res.status_code, 200)\n self.assertEqual(res.headers['Content-Type'],\n 'text/plain; charset=UTF-8')\n\n self.assertEqual(res.headers['Content-Length'], 7)\n self.assertEqual(res.body, b'foo-async')\n\n res = self._run(client.get('/arg/123'))\n self.assertEqual(res.status_code, 200)\n self.assertEqual(res.headers['Content-Type'],\n 'text/plain; charset=UTF-8')\n\n self.assertEqual(res", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "401)", + "got": "200)", + "got_raw": "200)\n self.assertEqual(res.text, 'foo')\n\n res = self._run(client.get('/'))\n self.assertEqual(res.status_code, 401)\n\n def test_token_auth(self):\n app = Microdot()\n token_auth = TokenAuth()\n\n @token_auth.authenticate\n def authenticate(request, token):\n if token == 'foo':\n return {'username': 'foo'}\n\n @app.route('/')\n @token_auth\n def index(request):\n return request.g.current_user['username']\n\n client = TestClient(app)\n res = self._run(client.get('/'))\n\n self.assertEqual(res", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "{'foo': 'bar', 'baz': 'baz'})", + "got": "{", + "got_raw": " {\n 'foo': 'bar',\n 'baz': 'baz',\n })\n\n res = self._run(client.post(\n '/async', headers={\n 'Content-Type': 'multipart/form-data; boundary=boundary',\n },\n body=(\n b'--boundary\\r\\n'\n b'Content-Disposition: form-data; name=\"foo\"\\r\\n\\r\\nbar\\r\\n'\n b'--boundary\\r\\n'\n b'Content-Disposition: form-data; name=\"baz\"\\r\\n\\r\\nbaz\\r\\n'\n b'--boundary--\\r\\n')\n ))\n self.assertEqual(res.status_code,", + "exact_match": false, + "code_bleu": 0.05946035575013606, + "edit_similarity": 0.06666666666666667, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/microdot", + "expected": "'POST')", + "got": "'POST')", + "got_raw": " 'POST')\n self.assertEqual(req.path, '/foo/bar')\n self.assertEqual(req.query, 'a=1&b=2')\n self.assertEqual(req.form, {'a': '1', 'b': '2'})\n self.assertEqual(req.headers, {'Host': 'example.com',\n 'User-Agent': 'Mozilla/5.0'})\n self.assertEqual(req.body, b'hello world')\n\n return Response('Hello, world!')\n\n self._run(app.run(debug=True))\n\n def test_app(self):\n app = Microdot()\n app.route('/foo/bar')(lambda req: None)\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "ConnectionError)", + "got": "TimeoutError):", + "got_raw": "TimeoutError):\n admin_client.wait_for('connect_error', timeout=1)\n\n @with_instrumented_server(auth={'foo': 'bar'})\n def test_admin_connect_with_list_auth(self):\n with socketio.SimpleClient(reconnection=False) as admin_client:\n admin_client.connect('http://localhost:8900', namespace='/admin',\n auth=['foo', 'bar'])\n with socketio.SimpleClient(reconnection=False) as admin_client:\n\n with pytest.raises(TimeoutError):\n admin_client.wait_for('connect_error', timeout=1)\n\n @with_instrumented_server(auth={'foo': 'bar", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5333333333333333, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "'foo'", + "got": "'foo'", + "got_raw": " 'foo'\n\n def test_disconnect_event_server(self):\n result = {}\n\n class MyNamespace(namespace.ServerNamespace):\n def on_disconnect(self, reason):\n result['result'] = reason\n\n ns = MyNamespace('/foo')\n ns._set_server(mock.MagicMock())\n ns.trigger_event('disconnect', 'foo')\n\n assert result['result'] == 'foo'\n\n def test_disconnect_event_server_with_namespace(self):\n result = {}\n\n class MyNamespace(namespace.ServerNamespace):\n def on_disconnect(self, reason):\n result['result'] = reason\n\n ns = MyNamespace('/foo')\n ns._set_server", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "sid", + "got": "0", + "got_raw": "0\n assert events['all_sockets'][0]['clientId'] == sid\n assert events['all_sockets'][0]['transport'] == 'websocket'\n assert events['all_sockets'][0]['nsp'] == '/admin'\n\n assert events['server_stats']['serverId'] == self.isvr.server_id\n assert events['server_stats']['hostname'] == HOSTNAME\n assert events['server_stats']['pid'] == PID\n assert events['server_stats']['uptime'] > 0\n assert events['server_stats']['clientsCount'] == 1\n assert events['server_stats']['polling", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "'foo'", + "got": "'foo'", + "got_raw": " 'foo'\n\n cm = RedisManager('redis://', json=Packet)\n\n assert cm.json == Packet\n\n Packet.json = saved_json\n\n def test_redis_connect(self):\n saved_redis = redis.Redis\n saved_redis_from_url = redis.Redis.from_url\n saved_redis_sentinel = redis.sentinel.Sentinel\n\n redis.Redis = redis.Redis.from_url = redis.sentinel.Sentinel = None\n\n cm = RedisManager('redis://')\n\n assert cm.redis is None\n assert cm.pubsub is None\n\n cm.initialize()\n\n assert cm.redis is not None\n assert cm.pubsub", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "0", + "got": "0", + "got_raw": "0\n assert pm._publish.call_count == 0\n\n def test_read_only_init(self):\n mock_server = mock.MagicMock()\n pm = pubsub_manager.PubSubManager(write_only=False)\n pm.set_server(mock_server)\n pm.initialize()\n assert pm.channel == 'socketio'\n assert len(pm.host_id) == 32\n\n assert pm.server.start_background_task.call_count == 1\n assert pm._publish.call_count == 1\n\n def test_emit(self):\n mock_server = mock.MagicMock()\n mock_server.packet_class = packet.Packet\n pm = pubsub_manager", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "'foo'", + "got": "'foo'", + "got_raw": " 'foo'\n assert pubsub.host_id == '123456'\n assert pubsub.write_only is False\n assert pubsub.logger is None\n assert pubsub.json is None\n\n async def test_emit(self):\n mock_server = mock.MagicMock()\n mock_server.packet_class = packet.Packet\n mock_server._send_packet = mock.AsyncMock()\n mock_server._send_eio_packet = mock.AsyncMock()\n mock_server.disconnect = mock.AsyncMock()\n mock_server.eio.generate_id = lambda: '123456'\n mock_server.eio.send = mock.AsyncMock", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "'ev')", + "got": "io.server._publish.assert_called_once_with({", + "got_raw": "io.server._publish.assert_called_once_with({\n 'method': 'emit',\n 'event': 'ev',\n 'data': ['data'],\n 'binary': False,\n 'namespace': '/foo',\n 'room': 'room',\n 'skip_sid': 'skip',\n 'callback': 'cb',\n 'host_id': 'host_id'\n })\n\n def test_send(self):\n ns = namespace.Namespace('/foo')\n ns._set_server(mock.MagicMock())\n ns.send('data', to='room', skip_sid='skip')\n\n ns.sio.server._publish.assert_called_once_with({\n '", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.08163265306122448, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "start_response)", + "got": "start_response)", + "got_raw": " start_response)\n mock_sio_app.assert_not_called()\n\n def test_asgi_routing(self):\n mock_asgi_app = mock.MagicMock()\n mock_sio_app = 'foo'\n m = middleware.Middleware(mock_sio_app, mock_asgi_app)\n environ = {'PATH_INFO': '/foo'}\n start_response = \"foo\"\n m(environ, start_response)\n\n mock_asgi_app.assert_called_once_with(environ, start_response)\n mock_sio_app.assert_not_called()\n\n def test_wsgi_routing_with_other_app(self):\n mock_wsgi_app = mock.MagicMock()\n mock_s", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "None", + "got": "123", + "got_raw": "123\n assert super_emit.call_args[1]['skip_sid'] == 'sid'\n\n def test_handle_emit_with_local_callback(self):\n with mock.patch.object(manager.Manager, 'emit') as super_emit:\n self.pm._handle_emit(\n {\n 'event': 'foo',\n 'data': 'bar',\n 'namespace': '/baz',\n 'callback': 123,\n 'host_id': 'x',\n }\n )\n assert super_emit.call_count == 1\n assert super_emit.call_args[0] == ('foo', 'bar')\n assert super_emit.call_args", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "(1, '2')", + "got": "1", + "got_raw": "1\n assert client.client_kwargs == {'a': '3', 'b': 4}\n assert client.url == '2'\n assert client.auth == {'token': 'my-token'}\n\n async def test_connect(self):\n client = AsyncSimpleClient(1, '2', a='3', b=4)\n client._connect = mock.Mock()\n\n await client.connect()\n\n client._connect.assert_called_once_with('2', auth={'token': 'my-token'})\n\n async def test_connect_with_auth(self):\n client = AsyncSimpleClient(1, '2', a='3', b=4)\n", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "TypeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n p_without_default.encode()\n\n def test_encode_with_dumps_default(self):\n data = {\n 'current': datetime.now(tz=timezone(timedelta(0))),\n 'key': 'value',\n }\n p_with_default = msgpack_packet.MsgPackPacket(\n data=data, dumps_default=lambda x: x)\n\n encoded = p_with_default.encode()\n assert isinstance(encoded, bytes)\n assert msgpack.unpackb(encoded) == data\n\n def test_decode(self):\n data = {\n 'current': datetime.now(tz=timezone(timedelta(0))),\n 'key':", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "False", + "got": "0", + "got_raw": "0\n\n async def test_disconnect(self):\n sid = await self.pm.connect('123', '/')\n self.pm.pre_disconnect(sid, '/')\n await self.pm.disconnect(sid, '/')\n self.pm._publish.assert_awaited_once_with(\n 'disconnect', sid, '/', self.pm.reason.SERVER_DISCONNECT)\n\n assert self.pm.is_connected(sid, '/') is 0\n\n async def test_disconnect_not_connected(self):\n sid = await self.pm.connect('123', '/')\n self.pm.pre_disconnect(sid, '/')\n await self.pm.disconnect(sid, '/')\n self.pm._publish.assert_not_awaited()\n\n async def", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "None", + "got": "None", + "got_raw": " None\n\n redis_manager.redis = saved_redis\n\n def test_redis_sentinel(self):\n saved_redis = redis_manager.redis\n saved_redis_sentinel = redis_manager.redis_sentinel\n redis_manager.redis = None\n redis_manager.redis_sentinel = None\n\n with pytest.raises(RuntimeError):\n RedisManager('redis+sentinel://')._redis_connect()\n\n assert RedisManager('redis+sentinel://') is not None\n\n redis_manager.redis = saved_redis\n redis_manager.redis_sentinel = saved_redis_sentinel\n\n def test_redis_sentinel_url(self):\n saved_redis = redis_manager.redis\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "miguelgrinberg/python-socketio", + "expected": "0", + "got": "0", + "got_raw": "0\n\n async def test_invalid_sid(self):\n sid = 'xxx'\n cb = mock.MagicMock()\n id = self.bm._generate_ack_id(sid, cb)\n\n # these should not raise an exception\n await self.bm.trigger_callback(sid, id, ['foo'])\n await self.bm.trigger_callback('xxx', id, ['foo'])\n\n assert cb.call_count == 0\n\n async def test_invalid_id(self):\n sid = await self.bm.connect('123', '/')\n cb = mock.MagicMock()\n id = 'xxx'\n\n # these should not raise an exception\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mlfoundations/open_lm", + "expected": "expected_shard_ps", + "got": "expected_shard_ps", + "got_raw": " expected_shard_ps\n assert nums_ps == expected_nums_ps\n assert next_ps == expected_next_ps\n\n\n@pytest.mark.parametrize(\"num_samples,starting_point\", [(101, 0), (250, 1), (150, 5)])\ndef test_gsfe_ss_2(num_samples, starting_point):\n \"\"\"Test case when we want to consume multiple files, with multiple workers\"\"\"\n download_dl_test_data()\n make_fake_tarfiles()\n\n shards_ps, nums_ps, next_ps = get_string_for_epoch(\n num_samples, [starting_point], SINGLE_SOURCE, None, num_workers", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mlfoundations/open_lm", + "expected": "mock_file.read()", + "got": "mock_file.read()", + "got_raw": " mock_file.read()\n\n os.unlink(MOCK_MANIFEST)\n\n\ndef test_make_manifest_from_source_with_suffix():\n download_dl_test_data(\"tests/assets\")\n\n MOCK_MANIFEST = \"tests/assets/mock_manifest.jsonl\"\n if os.path.exists(MOCK_MANIFEST):\n os.unlink(MOCK_MANIFEST)\n\n args = [\"--data-dir\", \"tests/assets\", \"--manifest-filename\", \"mock_manifest.jsonl\", \"--suffix\", \".txt\"]\n mwm.main(args)\n\n true_manifest = \"tests/assets/manifest.jsonl\"\n with open(true_manifest, \"r\") as true_file:\n with open(MOCK_MANIFEST", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mlfoundations/open_lm", + "expected": "batch_size * (num_samples // batch_size)", + "got": "2048 * min_shards_needed", + "got_raw": "2048 * min_shards_needed # Check we have the right number of samples\n\n # Check that the number of samples is a multiple of the batch size\n assert len(data_ids) % batch_size == 0\n\ndef test_singleSource_singleWorker_imperfectBatch2(num_samples, next_shard, batch_size, min_shards_needed):\n \"\"\"Cases where:\n - Only a single source\n - Only a single worker\n - Batch size does NOT divide the number of samples\n\n Should see no repeats, but the greatest multiple of batch_size <= num_samples\n \"\"\"\n download_dl_test", + "exact_match": false, + "code_bleu": 0.1694253756768459, + "edit_similarity": 0.28125, + "n_retrieved": 10 + }, + { + "repo": "mlfoundations/open_lm", + "expected": "\"This checkpoint was trained with a random seed of 0. Since this seed affects shard shuffling, resuming training must use the same seed.\"", + "got": "\"different seeds\" in str(e)", + "got_raw": " \"different seeds\" in str(e)\n finally:\n shutil.rmtree(override_params[\"checkpoint_path\"], ignore_errors=True)\n\ndef tiny_save_load_different_seed_different_fsdp(tiny_args, fsdp=False):\n \"\"\"\n This test checks that the model will not resume if the seed is different.\n \"\"\"\n scaler = None\n epoch = 0\n evaluation_metrics = None\n global_step = 0\n done_training = False\n download_dl_test_data()\n override_params = dict(\n seq_len=tiny_args.sequence_length,\n vocab_size=tiny_args.vocab_size,\n train_num_samples=tiny", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.21951219512195122, + "n_retrieved": 10 + }, + { + "repo": "mlfoundations/open_lm", + "expected": "min_shards_needed", + "got": "2, f\"Expected at least 2 shards, got {num_shards}.\"", + "got_raw": "2, f\"Expected at least 2 shards, got {num_shards}.\"\n\ndef test_resampled():\n download_dl_test_data(\"tests/assets\")\n dl = retrieve_dataset_resampled(0, 0, [0.5, 0.5], 0, 2)\n for i in range(NUM_SAMPLES_TO_CHECK):\n batch = next(iter(dl))\n assert len(batch) == 2\n assert len(batch[0]) == 2\n assert len(batch[1]) == 2\n\ndef test_resampled_min_shards():\n download_dl_test_data(\"tests/assets\")\n dl", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.23529411764705882, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "[]", + "got": "0", + "got_raw": "0\n assert result.next_cursor is None\n\n\n@pytest.mark.anyio\nasync def test_list_prompts() -> None:\n \"\"\"Test listing with results.\"\"\"\n\n async def handle_list_prompts(\n ctx: ServerRequestContext, params: PaginatedRequestParams | None\n ) -> ListPromptsResult:\n return ListPromptsResult(\n prompts=[\n Prompt(name=\"prompt1\", title=\"Prompt 1\", description=\"Description 1\"),\n Prompt(name=\"prompt2\", title=\"Prompt 2\", description=\"Description 2\"),\n ],\n next_cursor=\"1\",\n )\n\n server = Server(\"test", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "2", + "got": "2", + "got_raw": "2\n assert next_cursor is None\n\n # Second page\n tasks, next_cursor = await store.list_tasks(cursor=next_cursor)\n\n assert len(tasks) == 3\n assert next_cursor == \"1\"\n\n # Third page\n tasks, next_cursor = await store.list_tasks(cursor=next_cursor)\n\n assert len(tasks) == 2\n assert next_cursor == \"2\"\n\n # Fourth page\n tasks, next_cursor = await store.list_tasks(cursor=next_cursor)\n\n assert len(tasks) == 1\n assert next_cursor == \"3\"\n\n # Fifth page\n tasks,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "group._prompts", + "got": "", + "got_raw": "<|fim_suffix|>\n # --- Test Setup ---\n group = ClientSessionGroup()\n server_name = \"ServerToDisconnect\"\n\n # Manually populate state using standard mocks\n mock_session1 = mock.MagicMock(spec=mcp.ClientSession)\n mock_session2 = mock.MagicMock(spec=mcp.ClientSession)\n mock_tool1 = mock.Mock(spec=types.Tool)\n mock_tool1.name = \"tool1\"\n mock_resource1 = mock.Mock(spec=types.Resource)\n mock_resource1.name = \"res1\"\n mock_prompt1 = mock.Mock(spec=types.Prompt)\n mock_prompt1.name = \"prm1", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "str(exc_info.value)", + "got": "", + "got_raw": " # noqa: E501\n assert \"database\" in exc_info.value.args[0]\n\n\n@pytest.mark.anyio\nasync def test_completion_error_on_missing_argument():\n \"\"\"Test that server can raise error when required argument is missing.\"\"\"\n\n async def handle_completion(ctx: ServerRequestContext, params: CompleteRequestParams) -> CompleteResult:\n assert isinstance(params.ref, ResourceTemplateReference)\n assert params.ref.uri == \"db://{database}/{table}\"\n assert params.argument.name == \"table\"\n\n if not params.context or not params.context.arguments or \"database\" not in params.context.arguments:\n raise ValueError(\"Please select", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "str(excinfo.value)", + "got": "", + "got_raw": " # noqa: E501\n assert \"RuntimeError\" in str(excinfo.value)\n\n\n@pytest.mark.anyio\nasync def test_streamable_http_transport():\n \"\"\"Test that the StreamableHTTP transport works as expected.\"\"\"\n app = Server(\"test-server\")\n manager = StreamableHTTPSessionManager(app=app)\n\n # Create a client\n async with streamable_http_client(\"http://localhost:8000/mcp\") as (read_stream, write_stream):\n # Create a session\n async with Client(read_stream, write_stream) as session:\n # Initialize the connection\n await session.initialize", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "size1", + "got": "0.9 * size1, \"Child did not write\"", + "got_raw": "0.9 * size1, \"Child did not write\"\n\n # Terminate the parent\n proc.terminate()\n\n # Wait for child to exit\n await proc.wait()\n\n # Verify child exited\n assert proc.returncode == 0, \"Child did not exit\"\n\n # Verify child did not write\n if os.path.exists(marker_file): # pragma: no branch\n size = os.path.getsize(marker_file)\n assert size == 0, \"Child wrote after termination\"\n\n finally:\n if os.path.exists(marker_file): # pragma: no branch\n os.remove(marker_file)\n\n", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.2564102564102564, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "\"\"", + "got": "", + "got_raw": " # noqa: S101\n\n\ndef test_issue_tool_name_warning_no_logging_for_non_empty_warnings(caplog: pytest.LogCaptureFixture) -> None:\n \"\"\"Non-empty warnings list should not produce any log output.\"\"\"\n with caplog.at_level(logging.WARNING):\n issue_tool_name_warning(\"test-tool\", [\"warning1\", \"warning2\"])\n\n\n assert caplog.text == # noqa: S101\n\n\ndef test_validate_tool_name_no_warnings(caplog: pytest.LogCaptureFixture) -> None:\n \"\"\"No warnings should be produced for a valid tool name.\"\"\"\n with caplog.at_level(logging.WARNING):\n validate", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "\"test\"", + "got": "\"test\"", + "got_raw": " \"test\"\n assert resource.description == \"test file\"\n assert resource.mime_type == \"text/plain\"\n assert resource.path == temp_file\n\n def test_file_resource_read(self, temp_file: Path):\n \"\"\"Test reading a FileResource.\"\"\"\n resource = FileResource(\n uri=temp_file.as_uri(),\n name=\"test\",\n description=\"test file\",\n path=temp_file,\n )\n assert resource.read() == \"test content\"\n\n def test_file_resource_write(self, temp_file: Path):\n \"\"\"Test writing a FileResource.\"\"\"\n resource = FileResource(\n uri=temp_file.as_uri(),\n name", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "second", + "got": "0", + "got_raw": "0\n assert second == 1\n\n def test_add_resource(self, temp_file: Path):\n \"\"\"Test adding a resource.\"\"\"\n manager = ResourceManager()\n resource = FileResource(\n uri=f\"file://{temp_file}\",\n name=\"test\",\n path=temp_file,\n )\n result = manager.add_resource(resource)\n\n assert result == 0\n\n def test_add_resource_with_same_name(self, temp_file: Path):\n \"\"\"Test adding a resource with the same name.\"\"\"\n manager = ResourceManager()\n resource = FileResource(\n uri=f\"file://{temp_file}\",\n name=\"test\",\n path", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "\"true\"", + "got": "", + "got_raw": " # pragma: no cover\n \"Server: test_tool: True\"\n\n # Now verify our test tool with log works\n result = await client.call_tool(\"test_tool_with_log\", {\"message\": \"Hello\", \"level\": \"info\", \"logger\": \"test\"})\n assert result.is_error is False\n assert isinstance(result.content[0], TextContent)\n\n assert result.content[0].text == # pragma: no cover\n \"Server: test_tool_with_log: Hello\"\n\n # Now verify our test tool with log extra works\n result = await client.call_tool(\n \"test_tool_with", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "resource.meta[\"tags\"]", + "got": "", + "got_raw": " # pragma: no cover\n assert \"readonly\" in # pragma: no cover\n assert \"data\" in # pragma: no cover\n assert \"readonly\" in # pragma: no cover\n\n def test_from_function_with_metadata_and_no_tags(self):\n # from_function() accepts meta dict and stores it on the resource for static resources\n\n def get_data() -> str: # pragma: no cover\n return \"test data\"\n\n metadata = {\"cache_ttl\": 300}\n\n resource = FunctionResource.from_function(\n fn=get_data,\n uri=\"resource://data\",\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "None", + "got": "", + "got_raw": "<|fim_suffix|>\n # Create a session using the client streams\n async with ClientSession(read_stream, write_stream) as session:\n # Initialize the connection\n await session.initialize()\n # List available tools\n tools = await session.list_tools()\n print(f\"Available tools: {[tool.name for tool in tools.tools]}\")\n\n # Call a tool (add tool from fastmcp_quickstart)\n result = await session.call_tool(\"add\", arguments={\"a\": 5, \"b\": 3})\n result_unstructured = result.content[0]\n if isinstance(result_unstructured, types.TextContent):\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "\"working\"", + "got": "0", + "got_raw": "0\n assert result.task.status_message is None\n assert result.task.ttl == 0\n assert result.task.createdAt is not None\n assert result.task.lastUpdatedAt is not None\n assert result.task.pollInterval == 100\n assert result.task.taskId == task_id\n\n async for status in client.session.experimental.poll_task(task_id):\n assert status.status == \"completed\"\n assert status.status_message is None\n assert status.taskId == task_id\n assert status.task.status == 0\n assert status.task.status_message is None\n assert status.task.ttl == 0\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "{}", + "got": "assert tool.meta == {\"some\": \"metadata\"}", + "got_raw": "<|fim_suffix|>\n assert tool.meta == {\"some\": \"metadata\"}\n\n def test_metadata_with_func_metadata(self):\n \"\"\"Test that metadata is preserved when FuncMetadata is used.\"\"\"\n\n def tool_with_func_metadata(x: int) -> int: # pragma: no cover\n \"\"\"Tool with FuncMetadata.\"\"\"\n return x\n\n manager = ToolManager()\n tool = manager.add_tool(tool_with_func_metadata, meta={\"some\": \"metadata\"})\n\n assert tool.meta is not None\n\n assert tool.meta == {\"some\": \"metadata\"}\n\n def test_metadata_with_tool_annotations(self):\n \"\"\"Test that metadata is preserved when Tool", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.09523809523809523, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "None", + "got": "async def mock_server():", + "got_raw": "<|fim_suffix|>\n async def mock_server():\n nonlocal received_capabilities\n\n session_message = await client_to_server_receive.receive()\n jsonrpc_request = session_message.message\n assert isinstance(jsonrpc_request, JSONRPCRequest)\n request = client_request_adapter.validate_python(\n jsonrpc_request.model_dump(by_alias=True, mode=\"json\", exclude_none=True)\n )\n assert isinstance(request, InitializeRequest)\n received_capabilities = request.params.capabilities\n\n result = InitializeResult(\n protocol_version=LATEST_PROTOCOL_VERSION,\n capabilities=ServerCapabilities(\n experimental_capabilities={\n \"tasks\": ClientCapabilities(\n tasks=types.ExperimentalTask", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "task2.task_id", + "got": "0", + "got_raw": "0\n assert task2.task_id != 0\n assert task1.task_id != task2.task_id\n\n\ndef test_task_execution_generates_id() -> None:\n \"\"\"task_execution generates a unique task ID when none provided.\"\"\"\n task1 = task_execution()\n task2 = task_execution()\n\n assert task1.task_id != 0\n assert task2.task_id != 0\n assert task1.task_id != task2.task_id\n\n\ndef test_task_execution_generates_id() -> None:\n \"\"\"task_execution generates a unique task ID when none provided.\"\"\"\n task1 = task_execution()\n task2", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "(200, 201)", + "got": "", + "got_raw": " # pragma: no cover\n assert response.headers[\"content-type\"] == \"text/event-stream\"\n\n # Send a valid list_tools request\n response = await client.post(\n \"/\",\n json={\"jsonrpc\": \"2.0\", \"method\": \"list_tools\", \"id\": 2, \"params\": {}},\n headers={\n \"Accept\": \"application/json, text/event-stream\",\n \"Content-Type\": \"application/json\",\n },\n )\n # Should get a successful response\n\n assert response.status_code in # pragma: no cover\n assert response.headers[\"content-type\"] == \"text", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "1", + "got": "1", + "got_raw": "1\n assert mcp.icons[0].src == \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==\"\n assert mcp.icons[0].mime_type == \"image/png\"\n assert mcp.icons[0].sizes == [\"1x1\"]\n\n # Test tool metadata includes icon\n assert test_tool.name == \"test_tool\"\n assert test_tool.title", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "\"2.0\"", + "got": "2.0", + "got_raw": "2.0\n assert request.id == 1\n assert request.method == \"initialize\"\n assert request.params.protocolVersion == LATEST_PROTOCOL_VERSION\n assert request.params.capabilities == ClientCapabilities(\n batch=None, sampling=None\n )\n assert request.params.clientInfo.name == \"mcp\"\n assert request.params.clientInfo.version == \"0.1.0\"\n\n\n@pytest.mark.anyio\nasync def test_initialize_request():\n json_data = {\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"initialize\",\n \"params\": {\n \"protocolVersion\":", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "modelcontextprotocol/python-sdk", + "expected": "2", + "got": "2", + "got_raw": "2\n assert read_messages[0] == messages[0]\n assert read_messages[1] == messages[1]\n\n # Test sending and receiving messages with a timeout\n messages = [\n JSONRPCRequest(jsonrpc=\"2.0\", id=1, method=\"ping\"),\n JSONRPCResponse(jsonrpc=\"2.0\", id=2, result={}),\n ]\n\n async with write_stream:\n for message in messages:\n session_message = SessionMessage(message)\n await write_stream.send(session_message)\n\n read_messages: list[JSONRPCMessage] = []\n async with read_stream:\n async", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "\"conv_123\"", + "got": "assert docs[0][\"conversation_title\"] == \"Canvas Conv\"", + "got_raw": "<|fim_suffix|>\n assert docs[0][\"conversation_title\"] == \"Canvas Conv\"\n\n assert docs[0][\"type\"] == \"text/plain\"\n assert docs[0][\"content\"] == \"hello\"\n\n assert docs[0][\"conversation_id\"] == \"conv_123\"\n assert docs[0][\"conversation_title\"] == \"Canvas Conv\"\n\n assert docs[0][\"name\"] == \"test_doc\"\n assert docs[0][\"type\"] == \"text/plain\"\n assert docs[0][\"content\"] == \"hello\"\n\n assert docs[0][\"conversation_id\"] == \"conv_123\"\n ", + "exact_match": false, + "code_bleu": 0.09578464408619825, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "\"msg123\"", + "got": "123", + "got_raw": "123\n\n def test_message_content(self) -> None:\n \"\"\"Test error message content.\"\"\"\n error = MessageContentError(\"msg123\", \"content\")\n assert \"msg123\" in str(error)\n assert error.message_id == 123\n assert error.content == \"content\"\n\n def test_message_content_with_reason(self) -> None:\n \"\"\"Test error message content with reason.\"\"\"\n error = MessageContentError(\"msg123\", \"content\", \"reason\")\n assert \"msg123\" in str(error)\n assert error.message_id == 123", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5454545454545454, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "{OutputKind.GRAPHS}", + "got": "", + "got_raw": "<|fim_suffix|>\n # No select calls (no markdown flavor/render order, no font, no colormap)\n assert select_call_count[0] == 0\n # No text calls (no author headers, no stopwords)\n assert text_call_count[0] == 0\n # Only 2 checkbox calls (output selection + extras), no YAML fields checkbox\n assert checkbox_call_count[0] == 2\n # Verify only graphs selected\n\n assert config.outputs == {OutputKind.GRAPHS}\n assert config.wordcloud.font_path == font_path(\"Font1\")\n assert config.wordcloud.colormap ==", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "False", + "got": "tputKind.GRAPHS in config.outputs", + "got_raw": "<|fim_suffix|>tputKind.GRAPHS in config.outputs\n assert OutputKind.WORDCLOUDS in config.outputs\n\n\ndef test_outputs_prompt_respects_existing_config_with_no_outputs(\n monkeypatch: pytest.MonkeyPatch,\n) -> None:\n \"\"\"Test that the outputs prompt respects the pre-existing configuration.\"\"\"\n from convoviz import interactive\n\n # Setup mocks\n monkeypatch.setattr(interactive, \"find_latest_valid_zip\", lambda: None)\n monkeypatch.setattr(interactive, \"find_script_export\", lambda: None)\n\n captured_choices = []\n\n def fake_checkbox(*_a, **_k):\n ", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.05263157894736842, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "InvalidZipError, match=\"Malicious path in ZIP\")", + "got": "InvalidZipError):", + "got_raw": "InvalidZipError):\n extract_archive(zip_path, tmp_path)\n\n\ndef test_extract_archive(tmp_path):\n # Create a simple ZIP file with a single file\n zip_path = tmp_path / \"test.zip\"\n with ZipFile(zip_path, \"w\") as zf:\n zf.writestr(\"test.txt\", \"Hello, world!\")\n\n # Extract the ZIP file to a temporary directory\n target_dir = tmp_path / \"extracted\"\n extract_archive(zip_path, target_dir)\n\n # Check that the file was extracted correctly\n assert (target_dir / \"test.txt\").read_text() == \"Hello, world", + "exact_match": false, + "code_bleu": 0.24999999999999997, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "set()", + "got": "set()", + "got_raw": " set()\n\n assert parse_custom_stopwords(\" \") == set()\n\n assert parse_custom_stopwords(\"one,two,three\") == {\"one\", \"two\", \"three\"}\n\n assert parse_custom_stopwords(\"one,two,three,\") == {\"one\", \"two\", \"three\"}\n\n assert parse_custom_stopwords(\"one,two,three, \") == {\"one\", \"two\", \"three\"}\n\n assert parse_custom_stopwords(\"one,two,three, \") == {\"one\", \"two\", \"three\"}\n\n assert parse_custom_stopwords(\"one,two,three, ,\") == {\"one", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "\"First [^1] then again [^1]\"", + "got": "\"First [^1] then again [^1]\"", + "got_raw": " \"First [^1] then again [^1]\"\n assert footnotes == \"[^1]: S1\"\n\n def test_replace_embedded_citations_reuses_footnote_numbers_with_multiple_keys(self):\n text = \"First \\ue200cite\\ue202key1\\ue201 then again \\ue200cite\\ue202key1\\ue201\"\n citation_map = {\n \"key1\": {\"title\": \"S1\", \"url\": \"http://s1.com\"},\n \"key2\": {\"title\": \"S2\", \"url", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "2", + "got": "2", + "got_raw": "2\n assert text_call_count[0] == 1\n assert checkbox_call_count[0] == 3\n assert text_call_count[0] == 1\n\n\ndef test_wordcloud_prompts_selected_when_wordclouds_output_is_selected(\n monkeypatch: pytest.MonkeyPatch,\n tmp_path: Path,\n) -> None:\n \"\"\"Test that wordcloud prompts are selected when wordclouds output is selected.\"\"\"\n from convoviz import interactive\n\n monkeypatch.setattr(interactive, \"find_latest_valid_zip\", lambda: None)\n monkeypatch.setattr(interactive, \"find_script_export\",", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "3", + "got": "markdown.count(\"*2023-07-29 08:00:00*\") == 1) and (", + "got_raw": "markdown.count(\"*2023-07-29 08:00:00*\") == 1) and (\n markdown.count(\"*08:05:00*\") == 1\n )\n\n def test_render_conversation_timestamps_with_config(\n self,\n mock_conversation: Conversation,\n ) -> None:\n \"\"\"Test timestamp rendering in conversation with config.\"\"\"\n config = ConversationConfig()\n config.markdown.show_timestamp = False\n headers = AuthorHeaders()\n markdown = render_conversation(mock_conversation, config, headers)\n\n # Messages in mock_conversation", + "exact_match": false, + "code_bleu": 0.08737167851715875, + "edit_similarity": 0.038461538461538464, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "upper", + "got": "upper", + "got_raw": " upper\n\n def test_no_match(self, tmp_path: Path) -> None:\n \"\"\"Test that no match is returned if no export is found.\"\"\"\n result = find_script_export(tmp_path)\n\n assert result is None\n\n def test_multiple_matches(self, tmp_path: Path) -> None:\n \"\"\"Test that multiple matches are handled correctly.\"\"\"\n upper = tmp_path / \"CONVOVIZ_EXPORT.json\"\n upper.write_text(\"[]\")\n\n lower = tmp_path / \"convoviz_export.json\"\n lower.write_text(\"[]\")\n\n result = find_script_export(tmp_path)\n\n assert result == lower\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "\"I should be deleted\"", + "got": "\"I should be deleted\"", + "got_raw": " \"I should be deleted\"\n\n # Cleanup\n markdown_dir.rmdir()\n assert not markdown_dir.exists()\n\ndef test_safe_zip_extraction(tmp_path):\n # Create a ZIP file with a malicious entry\n malicious_entry = tmp_path / \"malicious.txt\"\n malicious_entry.write_text(\"I should be deleted\")\n\n # Create a ZIP file with a malicious entry\n malicious_entry = tmp_path / \"malicious.txt\"\n malicious_entry.write_text(\"I should be deleted\")\n\n # Create a ZIP file with a malicious entry\n malicious_entry = tmp_path / \"malicious.txt\"\n malicious_entry.write_text(\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "\"active\"", + "got": "fig.yaml.title == True", + "got_raw": "<|fim_suffix|>fig.yaml.title == True\n assert config.yaml.aliases == True\n assert config.yaml.tags == False\n assert config.yaml.chat_link == True\n assert config.yaml.create_time == True\n assert config.yaml.update_time == True\n assert config.yaml.custom_instructions == False\n assert config.yaml.model == True\n assert config.yaml.used_plugins == False\n assert config.yaml.message_count == True\n assert config.yaml.content_types == False\n assert config.yaml.is_starred == False\n assert config.yaml.voice == False\n assert config.yaml.conversation_id == True\n\n assert config.message.author", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.26666666666666666, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "2", + "got": "10", + "got_raw": "10\n assert mock_conversation.message_count(\"user\") == 10\n assert mock_conversation.message_count() == 10\n\ndef test_nodes_by_author(mock_conversation: Conversation) -> None:\n \"\"\"Test nodes_by_author method.\"\"\"\n\n user_nodes = mock_conversation.nodes_by_author(\"user\")\n assert len(user_nodes) == 5\n assert all(node.message.author.role == \"user\" for node in user_nodes)\n\n assistant_nodes = mock_conversation.nodes_by_author(\"assistant\")\n assert len(assistant_nodes) == 5\n assert all(node.message.author.role == \"assistant\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "\"string_text\"", + "got": "assert doc[\"type\"] == \"code/javascript\"", + "got_raw": "<|fim_suffix|>\n assert doc[\"type\"] == \"code/javascript\"\n assert doc[\"content\"] == \"console.log(1)\"\n\n\ndef test_canvas_json_string_in_parts() -> None:\n \"\"\"Test extracting Canvas document from a JSON string in content.parts.\"\"\"\n ts = datetime(2025, 1, 1, tzinfo=UTC)\n canvas_json = '{\"name\": \"string_text\", \"type\": \"code/javascript\", \"content\": \"console.log(1)\"}'\n\n msg = Message(\n id=\"msg_json_parts\",\n author=MessageAuthor(role=\"assistant\"),\n content=MessageContent", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.23076923076923078, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "False", + "got": "assert validate_header(\"Title\") == \"Title\"", + "got_raw": "<|fim_suffix|>\n assert validate_header(\"Title\") == \"Title\"\n\n def test_invalid_no_title(self) -> None:\n \"\"\"Test invalid header without title.\"\"\"\n\n assert validate_header(\"#\") is None\n\n def test_invalid_no_title_and_hash(self) -> None:\n \"\"\"Test invalid header without title and hash.\"\"\"\n\n assert validate_header(\"# Title\") is None\n\n def test_invalid_no_title_and_hash_and_space(self) -> None:\n \"\"\"Test invalid header without title, hash, and space.\"\"\"\n\n assert validate_header(\"# Title\") is None\n\n def test_invalid_no_title_and_hash_and_space_and_space(self) -> None", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.1276595744680851, + "n_retrieved": 10 + }, + { + "repo": "mohamed-chs/convoviz", + "expected": "[]", + "got": "", + "got_raw": " # noqa: WPS327\n assert result == # noqa: WPS327\n assert not message.images\n\n\ndef test_image_attachment_rendered() -> None:\n \"\"\"Image attachments should be rendered as images.\"\"\"\n content = MessageContent(content_type=\"text\", text=\"Hello\")\n metadata = MessageMetadata(\n attachments=[\n {\"id\": \"file-999\", \"name\": \"report.pdf\", \"mime_type\": \"image/png\"},\n ],\n )\n message = Message(\n id=\"msg-3\",\n author=MessageAuthor(role=\"user\"),\n content=content,\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mootdx/mootdx", + "expected": "False)", + "got": "0)", + "got_raw": "0)\n self.assertEqual(data.shape[0], 100)\n\n def test_bars(self):\n data = self.client.bars(symbol='600036', frequency=9, offset=10)\n\n self.assertEqual(data.empty, 0)\n self.assertEqual(data.shape[0], 10)\n\n def test_minute(self):\n data = self.client.minute(symbol='000001')\n\n self.assertEqual(data.empty, 0)\n self.assertEqual(data.shape[0], 100)\n\n def test_minutes(self):\n data = self.client.minutes(symbol='000", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "mootdx/mootdx", + "expected": "xdxr.columns", + "got": "xdxr.columns", + "got_raw": " xdxr.columns\n assert 'date' in xdxr.columns\n assert 'open' in xdxr.columns\n assert 'high' in xdxr.columns\n assert 'low' in xdxr.columns\n assert 'close' in xdxr.columns\n assert 'volume' in xdxr.columns\n assert 'amount' in xdxr.columns\n assert 'turnover' in xdxr.columns\n assert 'turnover_rate' in xdxr.columns\n assert 'turnover_rate_1' in x", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mootdx/mootdx", + "expected": "data)", + "got": "data )", + "got_raw": " data )\n\n def test_bars(self):\n data = self.client.bars(frequency=KLINE_DAILY, market=47, symbol=\"47#IF1709\", start=0, offset=100)\n\n self.assertEqual(data.empty, False)\n\n data = self.client.bars(frequency=KLINE_DAILY, market=47, symbol=\"47#IF9\", start=0, offset=100)\n\n self.assertIsNone( data )\n\n def test_transaction(self):\n data = self.client.transaction(31, \"00020\")\n\n self", + "exact_match": false, + "code_bleu": 0.7071067811865476, + "edit_similarity": 0.9090909090909091, + "n_retrieved": 10 + }, + { + "repo": "mootdx/mootdx", + "expected": "1", + "got": "1, len(recwarn)", + "got_raw": "1, len(recwarn)\n\n for x in recwarn:\n assert 'Missing optional dependency' in str(x.message), str(x.message)\n\n@pytest.mark.skip(reason='\u6682\u65f6\u4e0d\u505a\u91cd\u590d\u6d4b\u8bd5')\ndef test_dep_holiday(recwarn, remove_dep_holiday):\n with pytest.raises(SystemExit) as e:\n from mootdx.__main__ import entry\n entry()\n\n assert e.value.args[0] == -1, e.value.args[0]\n\n assert len(recwarn) >= 1, len(recwarn)\n\n for x in recwarn:\n assert 'Missing optional dependency' in str(x.message), str(x", + "exact_match": true, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "mootdx/mootdx", + "expected": "'\u5e02\u573a\u4ee3\u7801\u9519\u8bef'", + "got": "assert exec_msg == '\u5e02\u573a\u4ee3\u7801\u9519\u8bef'", + "got_raw": "<|fim_suffix|>\n assert exec_msg == '\u5e02\u573a\u4ee3\u7801\u9519\u8bef'\n\n def test_instruments_raises(self):\n with pytest.raises(MootdxValidationException) as e:\n self.client.instruments()\n\n exec_msg = e.value.args[0]\n\n assert exec_msg == '\u5e02\u573a\u4ee3\u7801\u9519\u8bef'\n\n def test_instrument_count_raises(self):\n with pytest.raises(MootdxValidationException) as e:\n self.client.instrument_count()\n\n exec_msg = e.value.args[0]\n\n assert exec_msg == '\u5e02\u573a\u4ee3\u7801\u9519\u8bef'\n\n def test_instrument_raises(self):\n with pytest.raises(MootdxValidationException) as e:\n", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.45714285714285713, + "n_retrieved": 10 + }, + { + "repo": "mootdx/mootdx", + "expected": "result.empty)", + "got": "", + "got_raw": "\n\n\n# File: mootdx/quotes.py\n def __init__(self, server=None, bestip=False, timeout=15, **kwargs):\n \"\"\"\n \u6784\u9020\u51fd\u6570\n\n :param bestip: \u6700\u4f18\u670d\u52a1\u5668IP\n :param timeout: \u8d85\u65f6\u65f6\u95f4\n :param kwargs: \u53ef\u53d8\u53c2\u6570\n \"\"\"\n super().__init__(bestip=bestip, timeout=timeout, server=server, **kwargs)\n self.server and config.set('BESTIP', {'EX': self.server})\n\n logger.warning('\u76ee\u524d\u6269\u5c55\u5e02\u573a\u884c\u60c5\u63a5\u53e3\u5df2\u7ecf\u5931\u6548, \u540e", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "['\u5566\u5566', 'abc']", + "got": "', 'abc']", + "got_raw": "', 'abc']\n\n assert simple_seg('\u5566\u5566abc\u5566\u5566') == ['\u5566\u5566', 'abc', '\u5566\u5566']\n\n assert simple_seg('\u5566\u5566abc\u5566\u5566\u5566\u5566') == ['\u5566\u5566', 'abc', '\u5566\u5566', '\u5566\u5566']\n\n assert simple_seg('\u5566\u5566abc\u5566\u5566\u5566\u5566\u5566\u5566') == ['\u5566\u5566', 'abc', '\u5566\u5566', '\u5566\u5566', '\u5566\u5566']\n\n assert simple_seg('\u5566\u5566abc\u5566\u5566\u5566\u5566\u5566\u5566\u5566\u5566') == ['\u5566\u5566', 'abc', '\u5566\u5566', '\u5566\u5566', '\u5566\u5566',", + "exact_match": false, + "code_bleu": 0.28744328957046744, + "edit_similarity": 0.8181818181818182, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "[['m']]", + "got": "", + "got_raw": " # \u5463\n han, heteronym=True, style=INITIALS) == [['m']]\n assert pinyin( # \u5463\n han, heteronym=True, style=FINALS) == [['o']]\n assert pinyin( # \u5463\n han, heteronym=True, style=FINALS_TONE) == [['o2', 'o4']]\n assert pinyin( # \u5463\n han, heteronym=True, style=FINALS_TONE2) == [['o2', 'o4']]\n assert pinyin( # \ufffd", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "'vn'", + "got": "'lvn'", + "got_raw": " 'lvn'\n assert to_finals(input, v_to_u=True) == 'l\u00fcn'\n\n assert to_finals_tone(input) == 'lvn'\n assert to_finals_tone(input, neutral_tone_with_five=True) == 'lv5n'\n assert to_finals_tone(input, v_to_u=True) == 'l\u00fcn'\n assert to_finals_tone(input, v_to_u=True, neutral_tone_with_five=True) == 'l\u00fc5n'\n\n assert to_finals_tone2(input) == 'lvn'\n assert to_finals_tone2(input,", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8888888888888888, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "expect", + "got": "['w', 'u', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e", + "got_raw": "<|fim_suffix|>\n ['w', 'u', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e', 'i', 'e", + "exact_match": false, + "code_bleu": 0.011835355601767182, + "edit_similarity": 0.018691588785046728, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "'n2'", + "got": "\u0144'", + "got_raw": "\u0144'\n\n assert convert('\u0144', Style.FINALS_TONE3, True, 'a') == 'a'\n\n assert convert('\u0144', Style.FINALS_TONE3, False, 'a') == 'a'\n\n assert convert('\u0144', Style.FINALS_TONE3, True, 'a4') == 'a4'\n\n assert convert('\u0144', Style.FINALS_TONE3, False, 'a4') == 'a4'\n\n assert convert('\u0144', Style.FINALS_TONE3, True, 'a5') == 'a5'\n\n assert convert('\u0144", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "['o']", + "got": "o']", + "got_raw": "o']\n assert lazy_pinyin('\u54df', style=Style.FINALS_TONE) == ['o']\n assert lazy_pinyin('\u54df', style=Style.FINALS_TONE2) == ['o']\n assert lazy_pinyin('\u54df', style=Style.FINALS_TONE3) == ['o']\n assert lazy_pinyin('\u54df', style=Style.FINALS_TONE4) == ['o']\n assert lazy_pinyin('\u54df', style=Style.FINALS_TONE5) == ['o']\n assert lazy_pinyin('\u54df', style=Style.FINALS_TONE6", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "['ce4']", + "got": "ce4', 'si4']", + "got_raw": "ce4', 'si4']\n assert lazy_pinyin('\u6854', style=TONE2, heteronym=True) == [['ce4', 'ce4'], ['si4']]\n assert lazy_pinyin('\u6854', style=TONE2, errors='ignore') == ['ce4', 'si4']\n assert lazy_pinyin('\u6854', style=TONE2, errors='replace') == ['ce4', 'si4']\n assert lazy_pinyin('\u6854', style=TONE2, errors='default') == ['ce4', 'si4']\n assert lazy_pinyin('\u6854', style=TONE2,", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.5263157894736842, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "[['zhao1'], ['yang2']]", + "got": "", + "got_raw": " # noqa\n han, Style.TONE3, False, 'ignore', True) == [['ce4'], ['shi4']]\n\n\ndef test_post_pinyin_return_value_phrase_pinyin():\n class A(DefaultConverter):\n def post_pinyin(self, han, heteronym, pinyin, **kwargs):\n return {\n '\u6d4b': [['zh\u0101o']],\n '\u8bd5': [['y\u00e1ng']],\n '\u6d4b\u8bd5': [['zh\u0101o'], ['y\u00e1ng']],\n }[han]\n\n han = '\u6d4b\u8bd5'\n assert DefaultConverter().convert(\n han, Style.TONE3, False, 'ignore',", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "[['\u00e9i', 'x\u012b', 'y\u00ec', '\u00ea\u0304', '\u1ebf', '\u00ea\u030c', '\u011bi', '\u1ec1', '\u00e8i', '\u0113i']]", + "got": "pinyin('\u963f\u7238', style=Style.TONE2, heteronym=True) == [['\u0101', 'b\u00e0']]", + "got_raw": " pinyin('\u963f\u7238', style=Style.TONE2, heteronym=True) == [['\u0101', 'b\u00e0']]\n assert pinyin('\u963f\u7238', style=Style.TONE2, heteronym=True) == [['\u0101', 'b\u00e0']]\n assert pinyin('\u963f\u7238', style=Style.TONE2, heteronym=True) == [['\u0101', 'b\u00e0']]\n assert pinyin('\u963f\u7238', style=Style.TONE2, heteronym=True) == [['\u0101', 'b\u00e0']]\n assert pinyin('\u963f\u7238', style=Style.TONE2, heteronym=True", + "exact_match": false, + "code_bleu": 0.09849349468888721, + "edit_similarity": 0.16129032258064516, + "n_retrieved": 10 + }, + { + "repo": "mozillazg/python-pinyin", + "expected": "['\u4f60\u597d\u554a']", + "got": "assert options.separator == ' '", + "got_raw": "<|fim_suffix|>\n assert options.separator == ' '\n assert options.errors == 'ignore'\n assert options.heteronym\n\n assert options.hans == ['\u4f60\u597d\u554a']\n\n assert runner.main() == 0\n\n\ndef test_runner_custom_style():\n options = runner.get_parser().parse_args([\n '--func', 'pinyin', '--style', 'zhao', '--separator', ' ',\n '--errors', 'ignore', '--heteronym', '\u4f60\u597d\u554a'])\n assert options.func == 'pinyin'\n assert options.style == 'zhao'\n assert options.separator == ' '\n assert options.errors == 'ignore'\n", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.10526315789473684, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "m", + "got": "0", + "got_raw": "0\n\n def test_get_current_model_invalid(self):\n menu = _make_menu_with_providers()\n menu.view_mode = \"models\"\n menu.current_provider = _make_provider()\n menu.current_models = []\n menu.selected_model_idx = 0\n\n assert menu._get_current_model() is None\n\n def test_get_current_model_no_models(self):\n menu = _make_menu_with_providers()\n menu.view_mode = \"models\"\n menu.current_provider = _make_provider()\n menu.current_models = []\n menu.selected_model_idx = 0\n\n assert menu._get_current_model() is None\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "1", + "got": "1", + "got_raw": "1\n assert beta_str.count(\"interleaved-thinking-2025-05-14\") == 1\n\n def test_transform_headers_no_duplicate_optional_betas(self):\n \"\"\"Optional betas should not be duplicated in the output.\"\"\"\n headers = {\"anthropic-beta\": \"oauth-2025-04-20,context-1m-2025-08-07\"}\n\n ClaudeCacheAsyncClient._transform_headers_for_claude_code(headers)\n\n beta_str = headers[\"anthropic-beta\"]\n\n assert beta_str.count(\"oauth-2025", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "6", + "got": "6", + "got_raw": "6\n\n def test_integer_conversion_protected_token_count(self, mock_config_file):\n \"\"\"Test integer conversion for protected_token_count\"\"\"\n result = get_protected_token_count()\n assert result == 25000\n\n # Test default when not set\n set_config_value(\"protected_token_count\", \"\")\n result = get_protected_token_count()\n\n assert result == 25000\n\n def test_integer_conversion_message_limit(self, mock_config_file):\n \"\"\"Test integer conversion for message_limit\"\"\"\n result = get_message_limit()\n assert result == 50\n\n # Test default when not", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "1", + "got": "1", + "got_raw": "1\n assert contents[0][\"text\"] == \"\"\n\n @pytest.mark.anyio\n async def test_user_prompt(self, model, default_params):\n si, contents = await model._map_messages(\n [\n UserPromptPart(content=\"Hello, world!\")\n ],\n default_params,\n )\n assert si is None\n\n assert len(contents) == 1\n assert contents[0][\"text\"] == \"Hello, world!\"\n\n @pytest.mark.anyio\n async def test_system_prompt(self, model, default_params):\n si, contents = await model._map_messages(\n [\n SystemPrompt", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "1", + "got": "1", + "got_raw": "1\n assert isinstance(resp.parts[0], TextPart)\n assert resp.parts[0].content == \"hello world\"\n\n def test_parse_response_tool_call(self, model):\n data = {\n \"response\": {\n \"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"add\", \"args\": {\"a\": \"1\", \"b\": \"2\"}}}]}}],\n \"usageMetadata\": {\"promptTokenCount\": 10, \"candidatesTokenCount\": 5},\n }\n }\n resp = model._parse_response(data)\n\n assert len(resp.parts) == 1\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "True", + "got": "\"\"\"Models starting with 'antigravity-' should return True.\"\"\"", + "got_raw": "<|fim_suffix|>\n \"\"\"Models starting with 'antigravity-' should return True.\"\"\"\n\n assert is_antigravity_model(\"antigravity-sonnet\") is True\n\n def test_non_antigravity_model_returns_false(self):\n \"\"\"Models not starting with 'antigravity-' should return False.\"\"\"\n\n assert is_antigravity_model(\"gpt-4\") is False\n\n\nclass TestPreparePromptForModel:\n\n def test_claude_code_model_returns_correct_instructions(self):\n \"\"\"For claude-code models, the system prompt should be the default.\"\"\"\n\n model_name = \"claude-code-sonnet\"\n system_prompt", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.12307692307692308, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "out", + "got": "out", + "got_raw": " out\n assert \"bad markdown\" not in out\n\ndef test_sync_renderer_markdown_fallback_no_console(mq):\n \"\"\"Test that broken markdown falls back to plain text when no console is provided.\"\"\"\n r = SynchronousInteractiveRenderer(mq)\n # Patch Markdown to raise\n with patch(\n \"code_puppy.messaging.renderers.Markdown\",\n side_effect=Exception(\"bad markdown\"),\n ):\n msg = UIMessage(type=MessageType.AGENT_RESPONSE, content=\"**bold**\")\n r._render_message(msg)\n out = sys.stdout.getvalue()\n\n assert \"bold\" in out\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "\"\"", + "got": "0", + "got_raw": "0\n\n clear_spinner_context()\n\n assert SpinnerBase.get_context_info() == 0\n\n def test_pause_all_spinners(self):\n \"\"\"Test that pause_all_spinners pauses all spinners.\"\"\"\n with patch(\"code_puppy.messaging.spinner._active_spinners\", [mock_spinner()]):\n pause_all_spinners()\n\n for spinner in _active_spinners:\n spinner.pause.assert_called_once()\n\n def test_resume_all_spinners(self):\n \"\"\"Test that resume_all_spinners resumes all spinners.\"\"\"\n with patch(\"code_puppy.messaging.spinner._active_spinners\", [mock_spinner()]):\n resume_all_spinners", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "r.error", + "got": "", + "got_raw": " # noqa: WPS437\n assert \"test\" in # noqa: WPS437\n\n def test_stub_not_implemented_with_error(self):\n from code_puppy.tools.universal_constructor import _stub_not_implemented\n\n r = _stub_not_implemented(\"test\", error=\"test error\")\n assert not r.success\n\n assert \"Not implemented\" in # noqa: WPS437\n assert \"test\" in # noqa: WPS437\n assert \"test error\" in # noqa: WPS437\n\n def test_stub", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "\"\"", + "got": "\"\"\"safe_input should return input for non-empty input.\"\"\"", + "got_raw": "<|fim_suffix|>\n \"\"\"safe_input should return input for non-empty input.\"\"\"\n from code_puppy.command_line.utils import safe_input\n\n with patch(\"code_puppy.command_line.utils._reset_windows_console\"):\n with patch(\"builtins.input\", return_value=\"Hello\"):\n result = safe_input()\n\n assert result == \"Hello\"\n\n def test_returns_empty_string_for_empty_input_with_default(self):\n \"\"\"safe_input should return default for empty input with default.\"\"\"\n from code_puppy.command_line.utils import safe_input\n\n with patch(\"code_puppy.command_line.utils._reset_windows_console\"):\n with patch(\"builtins.input\",", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.06779661016949153, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def test_update_spinner_updates_spinner(self):\n \"\"\"Test that _update_spinner updates the spinner.\"\"\"\n from code_puppy.messaging.spinner.console_spinner import ConsoleSpinner\n\n spinner = ConsoleSpinner(console=MagicMock())\n spinner._live = MagicMock()\n spinner._paused = False\n call_count = 0\n\n def stop_after_calls():\n nonlocal call_count\n call_count += 1\n if call_count >= 2:\n spinner._stop_event.set()\n\n with (\n patch.object(spinner, \"update_frame\", side_effect=stop_after_calls),\n patch.object(spinner, \"_generate", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "id2", + "got": "0", + "got_raw": "0\n assert id2 != 0\n assert id1 != id2\n\n def test_unique_with_prefix(self):\n id1 = _generate_dbos_workflow_id(\"base\", prefix=\"prefix\")\n id2 = _generate_dbos_workflow_id(\"base\", prefix=\"prefix\")\n\n assert id1 != 0\n assert id2 != 0\n assert id1 != id2\n\n def test_unique_with_prefix_and_suffix(self):\n id1 = _generate_dbos_workflow_id(\"base\", prefix=\"prefix\", suffix=\"suffix\")\n id2 = _generate_dbos_workflow_id(\"base\",", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "None", + "got": "", + "got_raw": " # Key not found, return None\n\n @patch(\"configparser.ConfigParser\")\n def test_get_value_exists(self, mock_config_parser_class, mock_config_paths):\n _, mock_cfg_file = mock_config_paths\n mock_parser_instance = MagicMock()\n mock_parser_instance.get.return_value = \"value\" # Simulate key found\n mock_config_parser_class.return_value = mock_parser_instance\n\n val = cp_config.get_value(\"existing_key\")\n\n\n assert val == \"value\" # Key found, return value\n\n @patch(\"configparser.ConfigParser\")\n def test_get_value_default(self, mock_config_parser_class", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "p", + "got": "0", + "got_raw": "0\n assert menu.current_model == 0\n assert menu.current_model is None\n assert menu.current_model is None\n\n def test_enter_model(self):\n p = _make_provider()\n models = [_make_model()]\n with patch(\n \"code_puppy.command_line.add_model_menu.ModelsDevRegistry\"\n ) as mock_cls:\n mock_reg = MagicMock()\n mock_reg.get_providers.return_value = [p]\n mock_reg.get_models.return_value = models\n mock_cls.return_value = mock_reg\n menu = AddModelMenu()\n menu.menu_control = MagicMock()\n menu.preview_control =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "sio", + "got": "sio", + "got_raw": " sio\n\ndef test_file_getter(qc):\n sio = StringIO()\n qc.file = sio\n\n assert qc.fallback_console.file is sio\n\ndef test_file_getter_no_file(qc):\n assert qc.fallback_console.file is None\n\ndef test_file_getter_no_file_setter(qc):\n assert qc.fallback_console.file is None\n\n sio = StringIO()\n qc.file = sio\n\n assert qc.fallback_console.file is sio\n\ndef test_file_getter_no_file_setter_no_file(qc):\n assert qc.fallback_console.file is None\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "5", + "got": "5", + "got_raw": "5\n assert serialized[\"total_tokens\"] == 100\n assert serialized[\"file_path\"] == \"/tmp/test.pkl\"\n assert serialized[\"auto_saved\"] == True\n\n def test_session_metadata_deserialization(self):\n \"\"\"Test that SessionMetadata deserializes from dict correctly.\"\"\"\n serialized = {\n \"session_name\": \"test\",\n \"timestamp\": \"2024-01-01T00:00:00\",\n \"message_count\": 5,\n \"total_tokens\": 100,\n \"file_path\": \"/tmp/test.pkl\",\n \"auto", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "ts", + "got": "assert msg.content == \"Test\"", + "got_raw": "<|fim_suffix|>\n assert msg.content == \"Test\"\n\n def test_ui_message_with_default_timestamp(self):\n \"\"\"Test creating a UIMessage with default timestamp.\"\"\"\n msg = UIMessage(type=MessageType.INFO, content=\"Test\")\n\n assert msg.timestamp is not None\n assert msg.timestamp.tzinfo == timezone.utc\n assert msg.content == \"Test\"\n\n def test_ui_message_with_invalid_timestamp(self):\n \"\"\"Test creating a UIMessage with invalid timestamp.\"\"\"\n with pytest.raises(ValueError):\n UIMessage(type=MessageType.INFO, content=\"Test\", timestamp=\"invalid\")\n\n def test_ui_message_with_invalid_type(self", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.06666666666666667, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "0", + "got": "0", + "got_raw": "0\n mock_run.assert_called_once()\n\n @patch(\"asyncio.run\", side_effect=KeyboardInterrupt)\n def test_keyboard_interrupt_with_dbos(self, mock_run):\n from code_puppy.cli_runner import main_entry\n\n with (\n patch(\"code_puppy.cli_runner.reset_unix_terminal\"),\n patch(\"code_puppy.cli_runner.get_use_dbos\", return_value=True),\n ):\n result = main_entry()\n\n assert result == 0\n mock_run.assert_called_once()\n\n @patch(\"asyncio.run\", side_effect=KeyboardInterrupt)\n def test_keyboard_interrupt_with_dbos_and_cli(self, mock", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "\"\"", + "got": "", + "got_raw": " # noqa: WPS437\n\n def test_empty_name(self):\n \"\"\"Test command with empty name.\"\"\"\n\n @register_command(name=\"\", description=\"Test command\")\n def handler(command: str) -> bool:\n return True\n\n cmd = get_command(\"\")\n\n assert cmd.name == # noqa: WPS437\n\n def test_empty_name_and_description(self):\n \"\"\"Test command with empty name and description.\"\"\"\n\n @register_command(name=\"\", description=\"\")\n def handler(command: str) -> bool:\n return True\n\n cmd = get_command(\"\")\n\n assert cmd.name == # noqa:", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mpfaffenberger/code_puppy", + "expected": "5", + "got": "5", + "got_raw": "5\n\n def test_generate_dbos_workflow_id_uses_counter(self):\n \"\"\"Test that workflow IDs use the atomic counter.\"\"\"\n # Generate several IDs and verify they're all unique\n ids = [_generate_dbos_workflow_id(\"test\") for _ in range(5)]\n\n assert len(set(ids)) == 5\n\n def test_generate_dbos_workflow_id_uses_counter(self):\n \"\"\"Test that workflow IDs use the atomic counter.\"\"\"\n # Generate several IDs and verify they're all unique\n ids = [_generate_dbos_workflow_id(\"test\") for _ in range(5)]\n\n assert len(set(ids))", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "3", + "got": "3", + "got_raw": "3\n assert result[\"uploads\"][0].filename == \"file1.txt\"\n assert result[\"uploads\"][0].content_type == \"text/plain\"\n assert result[\"uploads\"][0].size == 0\n\n assert result[\"uploads\"][1].filename == \"file2.txt\"\n assert result[\"uploads\"][1].content_type == \"text/plain\"\n assert result[\"uploads\"][1].size == 0\n\n assert result[\"uploads\"][2].filename == \"file3.txt\"\n assert result[\"uploads\"][2].content_type == \"text/plain\"\n assert result[\"uploads\"][2].size ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "1", + "got": "1", + "got_raw": "1\n\n # Second call\n result2 = self.resolver.resolve_dependencies(endpoint, self.request_data)\n assert result2 == {\"dep\": \"result_1\"}\n\n assert call_count == 1\n\n def test_resolve_dependencies_with_caching(self):\n \"\"\"Test dependency with caching\"\"\"\n call_count = 0\n\n def cached_dep():\n nonlocal call_count\n call_count += 1\n return f\"result_{call_count}\"\n\n def endpoint(dep: str = Depends(cached_dep)):\n return dep\n\n # First call\n result1 = self.resolver.resolve_dependencies(endpoint, self.request", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "1", + "got": "1", + "got_raw": "1\n assert result[\"name\"] == \"Item 1\"\n\n def test_create_item(self, client):\n \"\"\"Test creating a new item\"\"\"\n data = {\"name\": \"New Item\", \"price\": 9.99}\n response = client.post(\"/items\", json=data)\n\n assert response.status_code == 201\n result = response.json()\n\n assert result[\"name\"] == \"New Item\"\n assert result[\"price\"] == 9.99\n\n def test_update_item(self, client):\n \"\"\"Test updating an existing item\"\"\"\n data = {\"name\": \"Updated Item", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "3", + "got": "1", + "got_raw": "1\n assert result[\"name\"] == \"New Item\"\n assert result[\"description\"] == \"New Description\"\n\n def test_get_item(self, sync_client):\n \"\"\"Test getting an item\"\"\"\n response = sync_client.simulate_get(\"/items/1\")\n\n assert response.status_code == 200\n result = from_json(response.text)\n\n assert result[\"id\"] == 1\n assert result[\"name\"] == \"Item\"\n assert result[\"description\"] == \"Item Description\"\n\n def test_update_item(self, sync_client):\n \"\"\"Test updating an item\"\"\"\n new_item = {\"name\":", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "3", + "got": "3", + "got_raw": "3\n assert result[\"docs\"][0].filename == \"file1.pdf\"\n assert result[\"docs\"][0].content_type == \"application/pdf\"\n assert result[\"docs\"][0].stream.read.return_value == b\"content1\"\n\n assert result[\"docs\"][1].filename == \"file2.pdf\"\n assert result[\"docs\"][1].content_type == \"application/pdf\"\n assert result[\"docs\"][1].stream.read.return_value == b\"content2\"\n\n assert result[\"docs\"][2].filename == \"file3.pdf\"\n assert result[\"docs\"][2].content_type == \"application/pdf\"\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "\"Get Test\"", + "got": "assert schema[\"paths\"][\"/test/{id}\"][\"get\"][\"operationId\"] == \"get_test\"", + "got_raw": "<|fim_suffix|>\n assert schema[\"paths\"][\"/test/{id}\"][\"get\"][\"operationId\"] == \"get_test\"\n assert schema[\"paths\"][\"/test/{id}\"][\"get\"][\"responses\"][\"200\"][\"content\"][\"application/json\"][\"schema\"][\"$ref\"] == \"#/components/schemas/TestModel\"\n\n def test_custom_openapi_schema(self):\n \"\"\"Test custom OpenAPI schema\"\"\"\n app = web.Application()\n router = AioHttpRouter(\n app=app,\n title=\"Test API\",\n description=\"Test Description\",\n version=\"1.0.0\",\n openapi_schema={\n \"open", + "exact_match": false, + "code_bleu": 0.06074588070876682, + "edit_similarity": 0.17073170731707318, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "50", + "got": "50", + "got_raw": "50\n for result in results:\n assert result is not None\n\n def test_high_concurrency_different_type(self):\n \"\"\"Many threads request different types\"\"\"\n results = []\n\n def validate_data():\n data = [{\"id\": 1, \"name\": \"Test\"}]\n result = BaseAdapter._validate_response(data, list[User])\n results.append(result)\n\n threads = [threading.Thread(target=validate_data) for _ in range(50)]\n\n for t in threads:\n t.start()\n for t in threads:\n t.join()\n\n # All results must be valid\n\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "None", + "got": "1", + "got_raw": "1\n assert result is not 2\n assert result is not 3\n assert result is not 4\n assert result is not 5\n assert result is not 6\n assert result is not 7\n assert result is not 8\n assert result is not 9\n assert result is not 10\n assert result is not 11\n assert result is not 12\n assert result is not 13\n assert result is not 14\n assert result is not 15\n assert result is not 16", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "\"Get Test\"", + "got": "\"Test endpoint\"", + "got_raw": " \"Test endpoint\"\n assert schema[\"paths\"][\"/test/{id}\"][\"get\"][\"description\"] == \"Test endpoint\"\n assert schema[\"paths\"][\"/test/{id}\"][\"get\"][\"tags\"] == [\"Test\"]\n assert schema[\"paths\"][\"/test/{id}\"][\"get\"][\"responses\"][\"200\"][\"content\"][\"application/json\"][\"schema\"] == {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\"type\": \"integer\"},\n \"name\": {\"type\": \"string\"}\n }\n }\n```\n\n## Testing\n\n```python\nimport pytest\nfrom falcon import testing\n\n@pytest", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.48, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "{}", + "got": "0", + "got_raw": "0\n\n @pytest.mark.asyncio\n async def test_get_body_json(self):\n \"\"\"Test JSON body\"\"\"\n request = Mock()\n request.body = AsyncMock(return_value=b'{\"key\": \"value\"}')\n\n result = await StarletteRequestDataExtractor._get_body(request)\n\n\n assert result == {\"key\": \"value\"}\n\n @pytest.mark.asyncio\n async def test_get_body_form(self):\n \"\"\"Test form data\"\"\"\n request = Mock()\n request.form = AsyncMock(return_value={\"key\": \"value\"})\n\n result = await StarletteRequestDataExtractor._get_form_data(request)\n\n\n ", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "1", + "got": "1", + "got_raw": "1\n assert result[\"name\"] == \"Item 1\"\n\n @pytest.mark.asyncio\n async def test_create_item(self, async_client):\n \"\"\"Test creating a new item\"\"\"\n response = await async_client.simulate_post(\n \"/items\",\n json={\"name\": \"New Item\", \"price\": 9.99}\n )\n\n assert response.status_code == 201\n result = from_json(response.text)\n\n assert result[\"id\"] == 1\n assert result[\"name\"] == \"New Item\"\n\n @pytest.mark.asyncio\n async def test_update_item(self", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "1", + "got": "1", + "got_raw": "1\n assert result[\"name\"] == \"Item\"\n\n @pytest.mark.asyncio\n async def test_create_item(self, client):\n \"\"\"Test creating a new item\"\"\"\n response = client.post(\n \"/items\",\n json={\"name\": \"New Item\", \"price\": 9.99}\n )\n\n assert response.status_code == 201\n result = from_json(response.text)\n\n assert result[\"name\"] == \"New Item\"\n assert result[\"price\"] == 9.99\n\n @pytest.mark.asyncio\n async def test_validation_error(self, client):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "\"1.0.0\"", + "got": "1.0", + "got_raw": "1.0\n assert router.openapi_version == \"3.0.0\"\n assert router.openapi == {\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"title\": \"Test API\",\n \"description\": \"Test API Description\",\n \"version\": \"1.0.0\",\n },\n \"paths\": {},\n }\n\n def test_add_route(self):\n \"\"\"Test adding a route\"\"\"\n router = DjangoAsyncRouter(\n app=True,\n title=\"Test API\",\n description=\"Test API Description\",\n version=\"1.0.0\",\n )\n\n @", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "2", + "got": "3", + "got_raw": "3\n assert result[0][\"id\"] == 1\n assert result[0][\"name\"] == \"Item 1\"\n\n @pytest.mark.asyncio\n async def test_create_item(self, client):\n \"\"\"Test creating a new item\"\"\"\n response = await client.post(\n \"/items\",\n json={\"name\": \"New Item\", \"price\": 9.99}\n )\n\n assert response.status_code == 201\n result = await response.get_json()\n\n assert result[\"name\"] == \"New Item\"\n assert result[\"price\"] == 9.99\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "42", + "got": "42", + "got_raw": "42\n\n result_float = BaseAdapter._validate_response(3.14, float)\n\n assert result_float == 3.14\n\n result_str = BaseAdapter._validate_response(\"Hello\", str)\n\n assert result_str == \"Hello\"\n\n result_bool = BaseAdapter._validate_response(True, bool)\n\n assert result_bool == True\n\n result_none = BaseAdapter._validate_response(None, None)\n\n assert result_none is None\n\n def test_validate_list(self):\n \"\"\"Validation of list types\"\"\"\n result_list = BaseAdapter._validate_response([1, 2, 3], list)\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "2", + "got": "2", + "got_raw": "2\n assert result[\"avatar\"] == mock_avatar\n assert result[\"document\"] == mock_doc\n\n def test_get_files_single_key(self):\n \"\"\"Test files extraction with a single key\"\"\"\n request = Mock()\n\n mock_avatar = Mock()\n mock_avatar.name = \"avatar.jpg\"\n mock_avatar.content_type = \"image/jpeg\"\n mock_avatar.size = 2048\n\n files_mock = Mock()\n files_mock.keys = Mock(return_value=[\"avatar\"])\n files_mock.getlist = Mock(return_value=[mock_avatar])\n request.FILES = files_mock\n\n result = DjangoRequestDataExtractor._get", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "2", + "got": "3", + "got_raw": "3\n assert result[0][\"id\"] == 1\n assert result[0][\"name\"] == \"Item 1\"\n\n @pytest.mark.asyncio\n async def test_create_item(self, client):\n \"\"\"Test creating a new item\"\"\"\n _, response = await client.post(\n \"/items\",\n json={\"name\": \"New Item\", \"price\": 9.99}\n )\n\n assert response.status_code == 201\n result = from_json(response.text)\n\n assert result[\"id\"] == 4\n assert result[\"name\"] == \"New Item\"\n\n @pytest", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "5", + "got": "5", + "got_raw": "5\n assert schema[\"maxLength\"] == 100\n assert schema[\"minimum\"] == 0\n assert schema[\"pattern\"] == r\"^[a-z]+$\"\n\n def test_schema_builder_apply_metadata_constraints_with_no_constraints(self):\n \"\"\"Test applying metadata constraints with no constraints\"\"\"\n builder = SchemaBuilder({}, threading.Lock())\n schema = {}\n\n param_obj = Mock()\n param_obj.metadata = []\n\n builder._apply_metadata_constraints(schema, param_obj)\n\n assert \"minLength\" not in schema\n assert \"maxLength\" not in schema\n assert \"minimum\" not in schema\n assert \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "[]", + "got": "def test_security_init_with_scopes(self):", + "got_raw": "<|fim_suffix|>\n def test_security_init_with_scopes(self):\n \"\"\"Test Security initialization with scopes\"\"\"\n security = Security(scopes=[\"read\", \"write\"])\n assert security.dependency is None\n assert security.scopes == [\"read\", \"write\"]\n\n def test_security_init_with_dependency(self):\n \"\"\"Test Security initialization with dependency\"\"\"\n dependency = Depends(get_db)\n security = Security(dependency=dependency)\n assert security.dependency is dependency\n assert security.scopes == []\n\n def test_security_init_with_scopes_and_dependency(self):\n \"\"\"Test Security initialization with scopes and dependency\"\"\"\n dependency = Depends(get_db", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "mr-fatalyst/fastopenapi", + "expected": "result", + "got": "", + "got_raw": " # Check headers\n assert \"AUTHORIZATION\" in # Check headers\n```\n\n## Testing Your Router\n\n```python\ndef test_custom_router():\n app = App()\n router = MyFrameworkRouter(app=app)\n\n @router.get(\"/test\")\n def test_endpoint():\n return {\"status\": \"ok\"}\n\n client = app.test_client()\n response = client.get(\"/test\")\n assert response.status_code == 200\n assert response.json == {\"status\": \"ok\"}\n```\n\n## Key Classes Reference\n\n### RouteInfo\n\nContainer for route information (from `fastopenapi.core.router`):\n\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"Hello from uv-project 0.0.99\\n\"", + "got": "1", + "got_raw": "1\n\n@pytest.mark.skipif(\n not UV_INTEGRATION_AVAILABLE, reason=\"No uv available or network blocked\"\n)\ndef test_uv_package_script_task_with_args(run_poe_subproc, projects, uv_cache_env):\n result = run_poe_subproc(\n \"-q\", \"script-task\", project=\"uv\", env=uv_cache_env, args=[\"--\", \"arg1\"]\n )\n\n assert result.capture == \"\"\n assert result.stderr == \"\"\n\n assert result.stdout == 1\n\n@pytest.mark.skipif(\n not UV_INTEGRATION_AVAILABLE, reason=\"No uv available or network blocked\"\n)\ndef test_uv", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"\"", + "got": "0", + "got_raw": "0\n\n # bar was not provided; get() should return the zero value for int\n\n assert options.get(\"bar\") == 0\n\n # baz was not provided; get() should return the zero value for bool\n\n assert options.get(\"baz\") is False\n\n # qux was not provided; get() should return the zero value for str\n\n assert options.get(\"qux\") == \"\"\n\n # quux was not provided; get() should return the zero value for int\n\n assert options.get(\"quux\") == 0\n\n # quuz was not provided; get() should return the", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "f\"hi {arg}\\n\"", + "got": "f\"Poe <= poe_test_echo hi {arg}\\n\"", + "got_raw": " f\"Poe <= poe_test_echo hi {arg}\\n\"\n\n\ndef test_ref_passes_capture_stdout_with_uses(run_poe_subproc):\n arg = uuid.uuid4().hex\n result = run_poe_subproc(\"greet-ref-file\", f\"--subject={arg}\", project=\"refs\")\n assert result.capture == f\"Poe <= poe_test_echo hi {arg}\\n\"\n assert result.stdout == \"\"\n assert result.stderr == \"\"\n\n assert (result.path / \"greet-ref.txt\").read_text() == f\"Poe <= poe_test_echo hi {arg}\\n\"\n\n\ndef test_ref", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5531914893617021, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"Hello\\nWorld!\\n:)!\\n\"", + "got": "assert result.stdout == \"Poe => poe_test_echo Hello\\n\"", + "got_raw": "<|fim_suffix|>\n assert result.stdout == \"Poe => poe_test_echo Hello\\n\"\n\n assert result.stderr == \"\"\n\n assert result.returncode == 0\n\n\ndef test_parallel_task(run_poe_subproc, esc_prefix):\n result = run_poe_subproc(\"composite_task\", project=\"parallel\")\n assert result.capture == (\n \"Poe => poe_test_echo Hello\\n\"\n \"Poe => poe_test_echo 'World!'\\n\"\n \"Poe => poe_test_echo ':)!'\\n\"\n )\n\n assert result.stdout == \"Poe => poe_test_echo Hello\\n\"\n\n ", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.23684210526315788, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"a1: A1, a2: A2\\nb\\n\"", + "got": "", + "got_raw": " # stdout is captured by default\n \"A1\\n\"\n \"A2\\n\"\n \"a1: A1, a2: A2\\n\"\n \"b\\n\"\n )\n\n assert result.stderr == \"\"\n\n\ndef test_task_graph_in_parallel(run_poe_subproc):\n result = run_poe_subproc(\"ab\", project=\"graphs\")\n assert result.capture == (\n \"Poe <= echo A1\\n\"\n \"Poe <= echo A2\\n\"\n \"Poe => 'a1: ' + ${a1} + ', a2: ' + ${a2}\\", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "15", + "got": "10", + "got_raw": "10\n assert tree.lines[0].content == \"x$ y$ z\"\n assert tree.lines[1].content == \"x $ y $ z\"\n assert tree.lines[2].content == \"a$x? a${y}b a$? $z\"\n assert tree.lines[3].content == '\"x$ y$ z\"'\n assert tree.lines[4].content == '\"x $ y $ z\"'\n assert tree.lines[5].content == \"a$x? a${y}b a$? $z\"\n assert tree.lines[6].content == \"'x$ y", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"parallel_with_s\u2026 | 1 going to stdout 1\\n\" \"parallel_with_s\u2026 | 4 going to stdout 4\\n\"", + "got": "", + "got_raw": "\n\n\n# File: docs/guides/without_poetry.rst\n 3 : debug output referencing poethepoet internals (similar to setting ``POE_DEBUG=1``)\n\nNote that the verbosity level only applies to output from poethepoet itself, and does not impact the output of the tasks being run.\n\nInline tasks (such as those defined within a sequence task) inherit the verbosity level of their parent task, unless they explicitly override it.\n\nThe verbosity modifying global cli options may be provided multiple times to increment or decrement the verbosity level by 1 for each occurrence. For example, running ``poe -qq test", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "result.capture", + "got": "0 == result.returncode", + "got_raw": "0 == result.returncode\n assert \"test\" in result.stdout\n assert \"default_value\" in result.stdout\n\n\ndef test_global_envfile_and_default_with_env(run_poe_subproc):\n result = run_poe_subproc(\"test\", project=\"default_value\", env={\"FOO\": \"BAR\"})\n\n assert 0 == result.returncode\n assert \"test\" in result.stdout\n assert \"BAR\" in result.stdout\n\n\ndef test_global_envfile_and_default_with_envfile(run_poe_subproc):\n result = run_poe_subproc(\"test\", project=\"default_value\", envfile=\"env", + "exact_match": false, + "code_bleu": 0.2907153684841096, + "edit_similarity": 0.6111111111111112, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "[ (\"abcx'[!]\", True), (\"]'ydef\", False), (\"*z\", True), (\"[foo\", False), (\"?\", True), (\"?\", True), ]", + "got": "", + "got_raw": "\n\n\n# File: poethepoet/helpers/command/ast.py\n def _parse(self, chars: ParseCursor):\n char = chars.peek()\n if char in \"*?\":\n self._content = chars.take()\n return\n\n if char == \"[\":\n # Match pattern [groups]\n group_chars: list[str] = []\n chars.take()\n for char in chars:\n if char == \"]\":\n if group_chars and group_chars != [\"!\"]:\n # Group complete\n self._content = f\"[{''.join(group_chars)}]\"\n return\n else:\n # ] at start", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"Poe => poe_test_echo here we go...\\n\" \"Poe => :\\n\" \"Poe <= poe_test_echo about\\n\" \"Poe <= poe_test_echo hello\\n\" \"Poe ?? unresolved dependency task results via uses option for task 'think'\\n\" \"Poe ?? unresolved dependency task results via uses option for task\" \" 'deep-graph-with-args'\\n\"", + "got": "", + "got_raw": "\n\n\n# File: docs/guides/without_poetry.rst\n - \u2705 Also works fine as a [general purpose task runner](https://poethepoet.natn.io/guides/without_poetry.html)\n\n\n## Quick start\n\n1. Install the Poe the Poet globally via [pipx](https://pypa.github.io/pipx/) or [another method](https://poethepoet.natn.io/installation.html).\n\n ```sh\n pipx install poethepoet\n ```\n\n Or add it as a poetry project plugin:\n\n ```toml\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"Hello there!\\n\"", + "got": "0", + "got_raw": "0\n assert result.stderr == \"\"\n\n assert result.exit_code == 0\n assert result.stdout == \"\"\n assert result.stderr == \"\"\n\n assert result.exit_code == 0\n assert result.stdout == \"\"\n assert result.stderr == \"\"\n\n assert result.exit_code == 0\n assert result.stdout == \"\"\n assert result.stderr == \"\"\n\n assert result.exit_code == 0\n assert result.stdout == \"\"\n assert result.stderr == \"\"\n\n assert result.exit_code == 0\n assert result.stdout == \"\"\n assert result.stderr == \"\"\n\n assert result.exit_code == 0\n assert result.stdout == \"\"\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"deploying to admin:12345@dev.example.com:8080\\n\"", + "got": "0", + "got_raw": "0\n\n\ndef test_global_envfile_and_default_with_envfile(run_poe_subproc):\n result = run_poe_subproc(\"deploy-dev\", project=\"envfile\", envfile=\"local.env\")\n assert (\n \"Poe => poe_test_echo 'deploying to admin:12345@dev.example.com:8080'\\n\"\n in result.capture\n )\n\n assert result.stdout == 0\n\n\ndef test_global_envfile_and_default_with_envfile_and_default(run_poe_subproc):\n result = run_poe_subproc(\"deploy-dev\", project=\"envfile\", envfile", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.04, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "1", + "got": "1", + "got_raw": "1\n assert lines.count(\"--with=uv\") == 1\n assert lines.count(\"--no-group=ci\") == 1\n assert lines.count(\"--no-project\") == 1\n assert lines.count(\"--isolated\") == 1\n assert lines.count(\"--exact\") == 1\n assert lines.count(\"--no-sync\") == 1\n assert lines.count(\"--locked\") == 1\n assert lines.count(\"--frozen\") == 1\n assert lines.count(\"--python=python3\") == 1\n\ndef test_uv_executor_passes_uv_run_options_with_project_root(run_poe", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"cmd task with verbosity -1 -1\\n\"", + "got": "", + "got_raw": " # noqa: E501\n \"Poe => poe_test_echo 'cmd task with verbosity -1 0'\\n\"\n\n # with override up\n project_path = generate_pyproject(project_verbosity=0, task_verbosity=2)\n result = run_poe_subproc(\"default_task\", cwd=project_path)\n assert (\n result.capture\n == \"Poe => poe_test_echo 'cmd task inheriting default verbosity 0 0'\\n\"\n )\n assert result.stdout == \"cmd task inheriting default verbosity 0 0\\n\"\n\n result = run_poe", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"parallel_of_seq\u2026 | seq1\\n\" \"parallel_of_seq\u2026 | seq2\\n\" \"parallel_of_seq\u2026 | para1\\n\"", + "got": "", + "got_raw": "\n\n\n# File: docs/guides/composition_guide.rst\n.. _sequence_composition:\n\nComposing tasks into sequences\n------------------------------\n\nYou can compose tasks into a new task that runs them in order by declaring a :doc:`sequence<../tasks/task_types/sequence>` task.\n\nFor example:\n\n.. code-block:: toml\n\n [tool.poe.tasks]\n\n _publish = \"poetry publish\"\n release = [\n { cmd = \"pytest --cov=src\" },\n { script = \"devtasks:build\" },\n { ref = \"_publish\" },\n ]\n\nAnd here's an example that uses", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"build+test\"", + "got": "1", + "got_raw": "1\n assert result.task_name == \"build+test\"\n assert result.task_args == [\"--verbose\"]\n assert result.task_args_choices == []\n\n def test_task_with_plus_and_args(self, bash_harness, completion_script):\n \"\"\"Tasks with plus sign should work (e.g., build+test).\"\"\"\n mock_output = {\n \"_list_tasks\": \"build+test lint+format ci+cd\",\n \"_bash_describe_task_args\": \"--verbose\",\n \"_bash_task_arg_choices\": \"\",\n }\n\n result = bash_harness(\n completion_script,\n words=[\"poe\", \"build+test", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"Great success!\\nfailing fast with error\\n\"", + "got": "1", + "got_raw": "1\n\n result = run_poe_subproc(\"lvl1_para\", cwd=project_path)\n assert result.capture == (\n \"Poe => echo 'Great success!'\\n\"\n \"Poe => echo 'failing fast with error'; exit 1;\\n\"\n \"Error: Parallel aborted after failed subtask 'fast_fail'\\n\"\n )\n\n assert result.stdout == 1\n\n result = run_poe_subproc(\"lvl2_seq\", cwd=project_path)\n assert result.capture == (\n \"Poe => echo 'Great success!'\\n\"\n \"Poe => echo '", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"ok\"", + "got": "\"ok\"", + "got_raw": " \"ok\"\n\ndef test_multiple_underscores_and_dash_case_with_default():\n \"\"\"Multiple underscores inside attribute names are converted to\n dashes in config keys.\"\"\"\n\n class MultiUnder(PoeOptions):\n complex_name_field: Annotated[str, Metadata(config_name=\"complex-name-field\")]\n\n opts = next(MultiUnder.parse({\"complex-name-field\": \"ok\"}, strict=False))\n\n assert opts.complex_name_field == \"ok\"\n\ndef test_multiple_underscores_and_dash_case_with_default_and_optional():\n \"\"\"Multiple underscores inside attribute names are converted to\n dashes in config keys.\"\"\"\n\n class MultiUnder(PoeOptions):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"Poe <= echo A1\\n\" \"Poe <= echo A2\\n\" \"Poe => 'a1: ' + ${a1} + ', a2: ' + ${a2}\\n\" \"Poe => echo b\\n\"", + "got": "", + "got_raw": "\n\n\n# File: docs/guides/global_tasks.rst\n.. _global_tasks:\n\nGlobal tasks\n============\n\n.. note::\n\n Global tasks are not supported in the current version of poe the Poet.\n\n.. warning::\n\n Global tasks are not supported in the current version of poe the Poet.\n\n.. warning::\n\n Global tasks are not supported in the current version of poe the Poet.\n\n.. warning::\n\n Global tasks are not supported in the current version of poe the Poet.\n\n.. warning::\n\n Global tasks are not supported in the current version of poe the Poet.\n\n.. warning::\n\n Global", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nat-n/poethepoet", + "expected": "\"\"", + "got": "", + "got_raw": " # no output\n assert result.exit_code == 0\n\n # This should be exactly the same as calling the echo task directly\n result = run_poe_subproc(\n \"also_echo\", \"foo\", \"!\", env={\"POETRY_VIRTUALENVS_CREATE\": \"false\"}\n )\n if is_windows:\n assert result.capture == ( # windows paths need quotes\n \"Poe => poe_test_echo \"\n f\"'POE_ROOT:{projects['example']}' Password1, task_args: foo '!'\\n\"\n )\n else:\n assert result.capture == (\n \"P", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "expected_err", + "got": "expected_err", + "got_raw": " expected_err\n\n\ndef test_directory_with_notebooks(capsys: \"CaptureFixture\") -> None:\n \"\"\"\n Check sensible error message is returned if none of the directories passed have notebooks.\n\n Parameters\n ----------\n capsys\n Pytest fixture to capture stdout and stderr.\n \"\"\"\n main([\"black\", \"tests\"])\n _, err = capsys.readouterr()\n expected_err = \"No valid Python notebooks found in given path(s)\\n\"\n\n assert err == expected_err\n\n\ndef test_directory_with_notebooks_and_files(capsys: \"CaptureFixture\") -> None:\n \"\"\"\n Check sensible error message", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "err", + "got": "", + "got_raw": " # noqa: WPS432\n assert \"All done! \u2728 \ud83c\udf70 \u2728\" in # noqa: WPS432\n assert \"1 files reformatted.\" in # noqa: WPS432\n assert \"All done! \u2728 \ud83c\udf70 \u2728\" in # noqa: WPS432\n assert \"1 files reformatted.\" in # noqa: WPS432\n assert \"All done! \u2728 \ud83c\udf70 \u2728\" in # noqa: WPS432\n assert \"1 files reformatted.\" in", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "0", + "got": "0", + "got_raw": "0\n\n assert output.stderr == \"\"\n\n\n# File: nbqa/__main__.py\n\"\"\"Run third-party tool (e.g. :code:`mypy`) against notebook or directory.\"\"\"\n\nfrom __future__ import annotations\n\nimport itertools\nimport os\nimport re\nimport shlex\nimport string\nimport subprocess\nimport sys\nimport tempfile\nfrom importlib import import_module\nfrom pathlib import Path\nfrom shutil import which\nfrom textwrap import dedent\nfrom typing import Any, Iterator, Mapping, MutableMapping, NamedTuple, Sequence, cast\n\nimport tomli\n\nfrom nbqa import replace_source, save_code_source", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "err", + "got": "", + "got_raw": " # noqa: E501\n assert \"ImportError: cannot import name 'thisdoesnotexist'\" in err # noqa: E501\n\n\ndef test_doctest_invalid_import_with_ignored_error(capsys: \"CaptureFixture\") -> None:\n \"\"\"\n Check that correct error is reported if notebook contains unimportable imports.\n\n Parameters\n ----------\n capsys\n Pytest fixture to capture stdout and stderr.\n \"\"\"\n main([\"doctest\", INVALID_IMPORT_NOTEBOOK, \"--ignore-missing-imports\"])\n\n _, err = capsys.readouterr()\n\n assert \"ImportError: cannot", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "123", + "got": "1", + "got_raw": "1\n\n\ndef test_unable_to_parse_with_error(capsys: \"CaptureFixture\") -> None:\n \"\"\"Check error message shows if we're unable to parse notebook.\"\"\"\n path = Path(\"tests\") / \"data/invalid_notebook.ipynb\"\n path.write_text(\"foo\")\n result = main([\"flake8\", str(path), \"--nbqa-diff\"])\n path.unlink()\n message = \"nbQA failed to process\"\n _, err = capsys.readouterr()\n assert message in err\n\n assert result == 1\n\n\ndef test_unable_to_parse_with_error_and_diff(capsys:", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "expected_out", + "got": "main([\"autopep8\", str(test_notebook), \"-i\", \"--nbqa-diff\"])", + "got_raw": "<|fim_suffix|>\n main([\"autopep8\", str(test_notebook), \"-i\", \"--nbqa-diff\"])\n out, _ = capsys.readouterr()\n expected_out = (\n \"\\x1b[1mCell 1\\x1b[0m\\n\"\n \"------\\n\"\n f\"\\x1b[1;37m--- {str(test_notebook)}\\n\"\n f\"\\x1b[0m\\x1b[1;37m+++ {str(test_notebook)}\\n\"\n \"\\x1b[0m\\x1b[3", + "exact_match": false, + "code_bleu": 0.06917184228205472, + "edit_similarity": 0.056338028169014086, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\ndef test_nbqa_shell_not_found(monkeypatch: MonkeyPatch, capsys: CaptureFixture) -> None:\n \"\"\"Check nbqa shell command call.\"\"\"\n path = os.path.join(\"tests\", \"data\", \"notebook_for_testing.ipynb\")\n monkeypatch.setattr(\"subprocess.run\", subprocess_run)\n\n args = [\"black\", \"--nbqa-shell\", path]\n expected_run = [which(\"black\"), path]\n with pytest.raises(CommandNotFoundError) as excinfo:\n main(args)\n assert str(excinfo.value) == _message(args=expected_run) # type: ignore[arg", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "expected_out.replace( WRONG_EXAMPLE_NOTEBOOK, os.path.abspath(WRONG_EXAMPLE_NOTEBOOK) )", + "got": "", + "got_raw": " # type: ignore[comparison-overlap]\n expected_out.replace(WRONG_EXAMPLE_NOTEBOOK, GOOD_EXAMPLE_NOTEBOOK)\n\n main([\"doctest\", INVALID_IMPORT_NOTEBOOK])\n\n # check out and err\n out, err = capsys.readouterr()\n\n expected_out = (\n \"**********************************************************************\\n\"\n f'File \"{INVALID_IMPORT_NOTEBOOK}\", cell_1:1, in notebook_for_testing_copy.hello\\n'\n \"Failed example:\\n\"\n ' hello(\"goodbye\")\\n'\n \"Expected:\\n\"\n \" 'hello goodbye'\\n\"\n \"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nbQA-dev/nbQA", + "expected": "expected.replace(\".md\", \".ipynb\")", + "got": "", + "got_raw": " # noqa: WPS326\n (\n \"\\x1b[1mCell 3\\x1b[0m\\n\"\n \"------\\n\"\n f\"\\x1b[1;37m--- {path}\\n\"\n f\"\\x1b[0m\\x1b[1;37m+++ {path}\\n\"\n \"\\x1b[0m\\x1b[36m@@ -1,3 +1,3 @@\\n\"\n \"\\x1b[0m\\x1b[31m-2 +2\\n\"\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "render", + "got": "render", + "got_raw": " render\n assert isinstance(render[\"color\"], np.ndarray)\n assert render[\"color\"].shape == (512, 512, 3)\n\n # Test get_train_embedding\n assert model.get_train_embedding(0) is None\n\n # Test optimize_embedding\n out = model.optimize_embedding(dataset)\n assert isinstance(out, dict)\n assert isinstance(out.get(\"embedding\"), np.ndarray)\n assert out[\"embedding\"].shape == (512, 512, 3)\n\n # Test render\n render = model.render(dataset[\"cameras\"][0])\n assert isinstance(render, dict", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "[4, 4, 9, 9, 12, 12]", + "got": "12", + "got_raw": "12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step == 12\n assert _TestMethod._render_call_step", + "exact_match": false, + "code_bleu": 0.04573873519241235, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "f'{get_resources_utilization_info.__module__}:{get_resources_utilization_info.__name__}'", + "got": "1", + "got_raw": "1\n assert args == (1, 2, 3)\n assert kwargs == {\"a\": 1, \"b\": 2}\n return callback(*args, **kwargs)\n\n with use_remote_method() as remote_method:\n assert remote_method(1, 2, 3, a=1, b=2) == 1\n assert called\n\n\ndef test_remote_method():\n from nerfbaselines.backends import SimpleBackend\n\n class TestMethod(Method):\n def __init__(self):\n pass\n\n @classmethod\n def get_method_info(cls) -> MethodInfo:\n out:", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "json.dumps(round_floats(orig), indent=2, sort_keys=True)", + "got": "", + "got_raw": "\n\n\n# File: nerfbaselines/evaluation.py\n def _get_float(value: str) -> float:\n try:\n return float(value)\n except ValueError:\n raise ValueError(f\"Invalid float value: {value}\")\n\n\ndef _get_int(value: str) -> int:\n try:\n return int(value)\n except ValueError:\n raise ValueError(f\"Invalid int value: {value}\")\n\n\ndef _get_bool(value: str) -> bool:\n if value.lower() in [\"true\", \"yes\", \"1\"]:\n return True\n if value.lower() in [\"false\", \"no\", \"0", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "arr.shape", + "got": "10, 10", + "got_raw": "10, 10\n assert out.shape == 10, 10\n assert out.shape == 10, 10\n assert out.shape == 10, 10\n assert out.shape == 10, 10\n assert out.shape == 10, 10\n assert out.shape == 10, 10\n assert out.shape == 10, 10\n assert out.shape == 10, 10\n assert out.shape == 10, 10\n assert out.shape", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "members", + "got": "members", + "got_raw": " members\n with open(tmp_path/\"out\"/path, \"rb\") as f:\n img = Image.open(f)\n assert img.size == (20, 30)\n\ndef _verify_folder_multi(tmp_path, num_cams, all_output_names):\n assert os.path.exists(tmp_path/\"out-multi\")\n members = os.listdir(tmp_path/\"out-multi\")\n assert len(members) == num_cams * len(all_output_names)\n for out in all_output_names:\n for i in range(num_cams):\n path = f\"{out}/{i:05d}.png\"\n assert f\"{", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "FileExistsError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n evaluate(str(tmp_path / \"predictions\"), output=str(tmp_path / \"results.json\"), evaluation_protocol=\"test\")\n\n with pytest.raises(FileExistsError):\n evaluate(str(tmp_path / \"predictions\"), output=str(tmp_path / \"results.json\"), evaluation_protocol=\"default\")\n\n with pytest.raises(FileExistsError):\n evaluate(str(tmp_path / \"predictions\"), output=str(tmp_path / \"results.json\"), evaluation_protocol=\"default\", nb_info={\"method\": \"test\"})\n\n with pytest.raises(FileExistsError):\n evaluate(str(tmp_path / \"predictions\"), output=str(tmp_path / \"results.json\"), evaluation_protocol=\"default", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4864864864864865, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "\"docker\"", + "got": "\"docker\"", + "got_raw": " \"docker\"\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None\n assert Backend.current.install() is None", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "np.float32", + "got": "", + "got_raw": " # type: ignore\n assert dirs.dtype == # type: ignore\n\n # For cameras of shape (N) and shape of uv [N, 2], we return shape [N, 3]\n cam = _build_camera(\"pinhole\", np.array([536.07343019, 536.01634475, 342.37038789, 235.53685636], dtype=np.float32), image_sizes=np.array([12, 1", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "\"Hello world\"", + "got": "\"Hello world\"", + "got_raw": " \"Hello world\"\n\n # Test nested archives\n with open_any(tmp_path / \"tests\"/\"data.zip\"/\"obj.tar.gz\"/\"test\"/\"test.zip\"/\"nerf_synthetic\"/\"data.txt\", \"w\") as f:\n f.write(b\"Hello world\")\n\n assert (tmp_path / \"tests\"/\"data.zip\").exists()\n assert not (tmp_path / \"tests\"/\"data.zip\"/\"obj.tar.gz\").exists()\n assert (tmp_path / \"tests\"/\"data.zip\").is_file()\n\n with open_any(tmp_path / \"tests\"/\"data.zip\"/\"obj", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "1", + "got": "1", + "got_raw": "1\n assert len(kwargs) == 0\n assert args[0].item().image_sizes == (50, 60)\n assert args[0].item().cameras.pose.shape == (2, 4, 4)\n assert args[0].item().cameras.intrinsics.shape == (2, 3)\n assert args[0].item().cameras.camera_models.shape == (2,)\n assert args[0].item().cameras.image_sizes.shape == (2, 2)\n\n assert method.optimize_embedding.call_count == 1\n args, kwargs = method.optimize", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "np.uint8", + "got": "np.uint8", + "got_raw": " np.uint8\n assert out.shape == arr.shape\n assert abs(out[0] - 255) < 1e-5\n assert abs(out[1] - 0) < 1e-5\n assert abs(out[2] - 51) < 1e-5\n assert abs(out[3] - 255) < 1e-5\n assert abs(out[4] - 51) < 1e-5\n\n # Test float -> uint8 with dtype\n for dtype in ['float32', '", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nerfbaselines/nerfbaselines", + "expected": "info", + "got": "info", + "got_raw": " info\n assert \"gpu_name\" in info[\"resources_utilization\"]\n assert \"memory\" in info[\"resources_utilization\"]\n assert \"gpu_memory\" in info[\"resources_utilization\"]\n assert \"total_train_time\" in info\n assert \"loaded_checkpoint\" in info\n assert \"loaded_step\" in info\n assert \"num_iterations\" in info\n assert \"hparams\" in info\n assert \"method_id\" in info\n assert \"method_name\" in info\n assert \"method_info\" in info\n assert \"method_info\" == info[\"method_info\"]\n assert \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nipunsadvilkar/pySBD", + "expected": "\"char_span must be False if clean is True. \"\\ \"Since `clean=True` will modify original text.\"", + "got": "\"char_span must be False if clean is True. \" \\", + "got_raw": " \"char_span must be False if clean is True. \" \\\n \"Since `clean=True` will modify original text.\"\n\n\ndef test_exception_with_pdf_and_span_true():\n \"\"\"Test to not allow clean=True and char_span=True\n \"\"\"\n with pytest.raises(ValueError) as e:\n seg = pysbd.Segmenter(language=\"en\", clean=True, doc_type='pdf', char_span=True)\n\n assert str(e.value) == \"`doc_type='pdf'` should have `clean=True` & \" \\\n \"`char_span` should be False since original\" \\\n \"text will be modified.\"\n\n\ndef test_exception", + "exact_match": false, + "code_bleu": 0.4714045207910317, + "edit_similarity": 0.6474820143884892, + "n_retrieved": 10 + }, + { + "repo": "nipunsadvilkar/pySBD", + "expected": "expected_sents", + "got": "expected_sents", + "got_raw": " expected_sents\n\n\n# File: benchmarks/english_golden_rules.py\n# -*- coding: utf-8 -*-\n\nGOLDEN_EN_RULES = [\n # 1) Simple period to end sentence\n (\"Hello World. My name is Jonas.\", [\"Hello World.\", \"My name is Jonas.\"]),\n # 2) Question mark to end sentence\n (\"What is your name? My name is Jonas.\", [\"What is your name?\", \"My name is Jonas.\"]),\n # 3) Exclamation point to end sentence\n (\"There it is! I found it.\", [\"There it is!\", \"I found", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nipunsadvilkar/pySBD", + "expected": "expected_sents", + "got": "expected_sents", + "got_raw": " expected_sents\n\n\n# File: benchmarks/genia_benchmark.py\nimport pytest\nimport pysbd\nfrom pysbd.utils import TextSpan\n\n@pytest.mark.parametrize('text,expected_sents', PDF_TEST_DATA)\ndef test_en_pdf_type(text, expected_sents):\n \"\"\"SBD tests from Pragmatic Segmenter for doctype:pdf\"\"\"\n seg = pysbd.Segmenter(language=\"en\", clean=True, doc_type='pdf')\n segments = seg.segment(text)\n segments = [s.strip() for s in segments]\n\n assert segments == expected_sents\n\n\n# File: benchmarks/genia_benchmark.py", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nipunsadvilkar/pySBD", + "expected": "expected_sents", + "got": "expected_sents", + "got_raw": " expected_sents\n\n\n# File: benchmarks/english_golden_rules.py\n# -*- coding: utf-8 -*-\nfrom pysbd.utils import Rule\nfrom pysbd.abbreviation_replacer import AbbreviationReplacer\n\nclass Standard:\n\n # This class holds the punctuation marks.\n Punctuations = ['\u3002', '\uff0e', '.', '\uff01', '!', '?', '\uff1f']\n\n # Rubular: http://rubular.com/r/G2opjedIm9\n GeoLocationRule = Rule(r'(?<=[a-zA-z]\u00b0)\\.(?=\\s*\\d+)', '\u222f')\n\n FileFormat", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nipunsadvilkar/pySBD", + "expected": "ValueError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n Language.get_language_code('')\n\ndef test_exception_on_invalid_lang_code_provided():\n\n with pytest.raises(ValueError):\n Language.get_language_code('invalid')\n\ndef test_exception_on_invalid_lang_code_provided():\n\n with pytest.raises(ValueError):\n Language.get_language_code('invalid')\n\ndef test_exception_on_invalid_lang_code_provided():\n\n with pytest.raises(ValueError):\n Language.get_language_code('invalid')\n\ndef test_exception_on_invalid_lang_code_provided():\n\n with pytest.raises(ValueError):\n Language.get_language_code('invalid')\n\ndef test_exception_on_invalid_lang_code_provided():\n\n with pytest.raises(ValueError):\n Language.get_language_code", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "200", + "got": "200", + "got_raw": "200\n assert response.content == b\"test\"\n assert response.headers == {\n \"Content-Length\": \"4\",\n \"Content-Type\": \"text/plain; charset=utf-8\",\n }\n assert response.cookies == {\"session\": \"test\"}\n assert response.url == server_url\n assert response.url.query == {\"param\": \"test\"}\n assert response.url.headers == {\"X-Test\": \"test\"}\n assert response.url.cookies == {\"session\": \"test\"}\n\n # simple get with query, headers, cookies\n request = Request(\n \"GET\",\n server_url,\n params={\"param", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "kws", + "got": "assert isinstance(checker, RegexRule)", + "got_raw": "<|fim_suffix|>\n assert isinstance(checker, RegexRule)\n\n assert checker.regex == regex\n assert checker.flags == flags\n\n\n@pytest.mark.anyio\n@pytest.mark.parametrize(\n (\"cmd\", \"text\", \"expected\"),\n [\n ((\"test\",), \"/test\", True),\n ((\"test\", \"sub\"), \"/test.sub\", True),\n ((\"test\",), \"/test\", False),\n ((\"test\",), \"/test.sub\", False),\n ],\n)\nasync def test_command(\n cmd: tuple[str, ...],\n text: str,\n expected: bool,\n):\n test_command = command(*cmd)\n dependent =", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.05, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "r\"\\white\\\"\n assert escape_tag(\"white\") == \"\\\\white\\\\\"\n\n assert escape_tag(\"whiteblack\") == r\"\\white\\\\black\\\"\n assert escape_tag(\"whiteblack\") == \"\\", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "'\"123\"'", + "got": "123", + "got_raw": "123\n\n class A:\n def __init__(self, a: int, b: str):\n self.a = a\n self.b = b\n\n class B:\n def __init__(self, a: int, b: str):\n self.a = a\n self.b = b\n\n class C:\n def __init__(self, a: int, b: str):\n self.a = a\n self.b = b\n\n class D:\n def __init__(self, a: int, b: str):\n self.a = a\n self.b = b\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "escape_text(\"[fake:image]Is Bad\")", + "got": "\"[fake:image]Is Bad\"", + "got_raw": " \"[fake:image]Is Bad\"\n assert message[0].type == \"image\"\n assert message[0].data == {\"url\": \"[fake:image]\"}\n\n\ndef test_message_template():\n template = FakeMessage.template(\"{name}Is Bad\")\n message = template.format(name=\"[fake:image]\")\n assert message.extract_plain_text() == \"[fake:image]Is Bad\"\n assert message[0].type == \"image\"\n assert message[0].data == {\"url\": \"[fake:image]\"}\n\n\ndef test_message_template_with_escape():\n template = FakeMessage.template(\"{name}Is Bad\")\n message = template.format(name", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.7547169811320755, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "TypeError)", + "got": "ImportError):", + "got_raw": "ImportError):\n nonebot.load_from_json(\"./plugins.json\")\n\n\n nonebot.load_from_json(\"./plugins.json\", encoding=\"utf-8\")\n\n\n nonebot.load_from_json(\"./plugins.json\", encoding=\"utf-8\")\n\n\n nonebot.load_from_json(\"./plugins.json\", encoding=\"utf-8\")\n\n\n nonebot.load_from_json(\"./plugins.json\", encoding=\"utf-8\")\n\n\n nonebot.load_from_json(\"./plugins.json\", encoding=\"utf-8\")\n\n\n nonebot.load_from_json(\"./plugins.json\", encoding=\"utf-8\")\n\n\n nonebot.load_from_json(\"./plugins.json\", encoding=\"utf-8\")\n\n\n nonebot", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.6086956521739131, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "\"nested\"", + "got": "\"plugins.nested:plugin\"", + "got_raw": " \"plugins.nested:plugin\"\n assert plugin.module_name == \"plugins.nested\"\n assert plugin.manager == _managers[0]\n assert plugin.parent_plugin is None\n assert plugin.sub_plugins == set()\n\n # check get plugin by parent module name\n plugin = nonebot.get_plugin_by_module_name(\"plugins\")\n assert plugin\n\n assert plugin.id_ == \"plugins:plugin\"\n assert plugin.module_name == \"plugins\"\n assert plugin.manager == _managers[0]\n assert plugin.parent_plugin is None\n assert plugin.sub_plugins == set()\n\n # check get plugin by sub module", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5161290322580645, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "pattern", + "got": "assert isinstance(checker, RegexRule)", + "got_raw": "<|fim_suffix|>\n assert isinstance(checker, RegexRule)\n\n assert checker.regex == pattern\n assert checker.flags == flags\n\n assert checker == test_regex\n\n assert checker == test_regex2\n\n assert checker != test_regex3\n\n assert checker != test_regex4\n\n assert checker != test_regex5\n\n assert checker != test_regex6\n\n assert checker != test_regex7\n\n assert checker != test_regex8\n\n assert checker != test_regex9\n\n assert checker != test_regex10\n\n assert checker != test_regex11\n\n assert checker != test_regex12\n\n assert checker != test", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "2", + "got": "2", + "got_raw": "2\n assert message.count(\"image\", 1) == 1\n assert message.count(\"image\", 1, 2) == 0\n assert message.count(\"image\", 0, 2) == 1\n assert message.count(\"image\", 0, 3) == 2\n\n assert message.only(\"image\") == message[\"image\"]\n assert message.only(\"image\", 1) == message[\"image\", 0]\n assert message.only(\"image\", 1, 2) == message[\"image\", 0]\n assert message.only(\"image\", 0,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "bot", + "got": "assert adapter.bots[bot.self_id] is bot", + "got_raw": "<|fim_suffix|>\n assert adapter.bots[bot.self_id] is bot\n\n\n assert last_disconnect_bot is bot\n\n\n# File: nonebot/drivers/http.py\n\"\"\"[http](https://www.python-httpx.org/) \u9a71\u52a8\u9002\u914d\n\n```bash\nnb driver install http\n# \u6216\u8005\npip install nonebot2[http]\n```\n\n:::tip \u63d0\u793a\n\u672c\u9a71\u52a8\u4ec5\u652f\u6301\u5ba2\u6237\u7aef HTTP \u8fde\u63a5\n:::\n\nFrontMatter:\n mdx:\n format: md\n sidebar_position: 4\n description: nonebot.drivers.http \u6a21\u5757\n\"\"\"\n\nfrom contextlib import", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "FakeMessage([pic1, pic2, pic3])", + "got": "2", + "got_raw": "2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"] == 2\n assert result[\"image\"]", + "exact_match": false, + "code_bleu": 0.05, + "edit_similarity": 0.0625, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "0", + "got": "0", + "got_raw": "0\n assert state[SHELL_ARGS].message == \"test: error: argument -a: expected one argument\"\n\n test_parser = shell_command(CMD, parser=parser)\n dependent = next(iter(test_parser.checkers))\n checker = dependent.call\n assert isinstance(checker, ShellCommandRule)\n message = Message(\"-a '1\")\n event = make_fake_event(_message=message)()\n state = {PREFIX_KEY: {CMD_KEY: CMD, CMD_ARG_KEY: message}}\n assert await dependent(event=event, state=state)\n assert state[SHELL_ARGV] == [\"1\"]\n assert state", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "True", + "got": "123", + "got_raw": "123\n\n\n@pytest.mark.anyio\nasync def test_bot_call_api_exception(app: App):\n async with app.test_api() as ctx:\n bot = ctx.create_bot()\n ctx.should_call_api(\"test\", {}, True)\n with pytest.raises(MockApiException):\n await bot.call_api(\"test\")\n\n\n@pytest.mark.anyio\nasync def test_bot_call_api_exception_ignored(app: App):\n async with app.test_api() as ctx:\n bot = ctx.create_bot()\n ctx.should_call_api(\"test\", {}, True)\n with pytest.raises(MockApiException):\n await bot.call_api(\"test\", ignore_result", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "None", + "got": "30.0", + "got_raw": "30.0\n assert config.log_level == \"INFO\"\n\n assert isinstance(nonebot.get_driver(), Driver)\n assert isinstance(nonebot.get_driver(), ASGIMixin)\n\n assert isinstance(nonebot.get_app(), App)\n assert isinstance(nonebot.get_asgi(), App)\n\n assert isinstance(nonebot.get_bot(), Bot)\n assert isinstance(nonebot.get_bots(), dict)\n assert isinstance(nonebot.get_adapters(), dict)\n\n assert isinstance(nonebot.get_adapter(\"nonebot.adapters.console.Adapter\"), Adapter)\n assert isinstance(nonebot.get_adapter(\"nonebot.adapters.console.Adapter", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "ValueError, match=\"private attribute\")", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n malformed_template.format(a=\"a\")\n\n with pytest.raises(TypeError):\n malformed_template.format(a=\"a\", b=\"b\")\n\n with pytest.raises(ValueError):\n malformed_template.format(a=\"a\", b=\"b\", c=\"c\")\n\n with pytest.raises(ValueError):\n malformed_template.format(a=\"a\", b=\"b\", c=\"c\", d=\"d\")\n\n with pytest.raises(ValueError):\n malformed_template.format(a=\"a\", b=\"b\", c=\"c\", d=\"d\", e=\"e\")\n\n with pytest.raises(ValueError):\n malformed_template.format(a=\"a\", b=\"b\", c=\"", + "exact_match": false, + "code_bleu": 0.2259005009024612, + "edit_similarity": 0.2711864406779661, + "n_retrieved": 10 + }, + { + "repo": "nonebot/nonebot2", + "expected": "ValidationError)", + "got": "ValidationError) as e:", + "got_raw": "ValidationError) as e:\n type_validate_python(TestModel, {\"foo\": 0, \"bar\": \"test\"})\n assert e.value.errors() == [\n {\n \"loc\": (\"foo\",),\n \"msg\": \"test must be greater than 0\",\n \"type\": \"value_error\",\n }\n ]\n\n with pytest.raises(ValidationError) as e:\n type_validate_python(TestModel, {\"foo\": 1, \"bar\": 123})\n assert e.value.errors() == [\n {\n \"loc\": (\"bar\",),\n \"msg\": \"value is not a valid string\",\n", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.8421052631578947, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "ref_sum_cell_tags", + "got": "", + "got_raw": "\n\n\n# File: src/meshio/_mesh.py\nimport numpy as np\n\nfrom .._common import _pick_first_int_data, warn\nfrom .._files import open_file\nfrom .._helpers import register_format\nfrom .._mesh import CellBlock, Mesh\n\n# https://github.com/nschloe/meshio/issues/1000\nmeshio_to_meshio_type = {\n \"vertex\": \"vertex\",\n \"line\": \"line\",\n \"triangle\": \"triangle\",\n \"quad\": \"quad\",\n \"tetra\": \"tetra\",\n \"hexahedron\": \"hex", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "ref_num_cells", + "got": "", + "got_raw": "\n\n\n# File: src/meshio/med/_med.py\n\"\"\"\nI/O for MED/Salome, cf.\n.\n\"\"\"\n\nimport numpy as np\n\nfrom .._common import _pick_first_int_data, warn\nfrom .._files import open_file\nfrom .._helpers import register_format\nfrom .._mesh import CellBlock, Mesh\n\n# https://docs.salome-platform.org/5/med/dev/med__outils_8hxx.html\nmeshio_to_med_type = {\n \"vertex\": \"PO", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "{\"a\": {\"triangle\": [0.5, 1.3]}})", + "got": "", + "got_raw": " # noqa: W503\n {\"a\": [[0.5], [1.3]]},\n )\n\n # two cells groups\n mesh = meshio.Mesh(\n [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [1.0, 1.0, 0.0], [0.0, 1.0, 0.0]],\n [(\"triangle\", [[0, 1, 2]]), (\"triangle\", [[0, 2, 3]])],\n cell", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "0", + "got": "0", + "got_raw": "0\n assert len(mesh2.cells_dict) == 0\n\n\ndef test_write_read():\n import io\n\n points = np.random.random((30, 3))\n cells = [\n meshio.CellBlock(\"triangle\", np.random.randint(3, 10, (10, 3))),\n meshio.CellBlock(\"quad\", np.random.randint(3, 10, (10, 4))),\n ]\n mesh = meshio.Mesh(points, cells)\n file = io.BytesIO()\n mesh.write(file, \"vtk\")\n mesh2 = meshio.read(file, \"vtk", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "(8, 3)", + "got": "12", + "got_raw": "12\n assert np.isclose(data_u.sum(), 0)\n\n # Cell data\n data_u = mesh.cell_data[\"med:resu____DEPL\"]\n\n assert data_u.shape == (1, 12)\n assert np.isclose(data_u.sum(), 0)\n\n # Cell data\n data_u = mesh.cell_data[\"med:resu____DEPL\"]\n\n assert data_u.shape == (1, 12)\n assert np.isclose(data_u.sum(), 0)\n\n # Cell data\n data_u = mesh.cell_data[\"med:resu____DEPL\"]\n\n", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "{\"grain0-grain1\": [[0, 0, 1, 1, 1]]})", + "got": "", + "got_raw": " # noqa: PLR2004\n {\n \"set1\": [[0, 1, 2], [3, 4, 5]],\n \"set2\": [[0, 1, 2, 3, 4, 5]],\n },\n )\n\n assert_equal(mesh.point_data, # noqa: PLR2004\n {\n \"set1\": [[0, 1, 2], [3, 4, 5]],\n \"set2\": [[0, 1, 2, 3, 4, 5]],\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "mesh.cells[ic].type", + "got": "mesh.cells[ic].type", + "got_raw": " mesh.cells[ic].type\n assert np.allclose(cell.data, mesh.cells[ic].data)\n\n assert len(mesh_ref.cell_sets) == len(mesh.cell_sets)\n for ic, cell_set in enumerate(mesh_ref.cell_sets.items()):\n assert cell_set[0] == mesh.cell_sets.items()[ic][0]\n assert np.allclose(cell_set[1], mesh.cell_sets.items()[ic][1])\n\n assert len(mesh_ref.field_data) == len(mesh.field_data)\n for ic, field_data in enumerate(mesh_ref.field_data.items()):\n assert field_data[0] == mesh.field_data.items()[ic", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "tol * abs(ref_sum)", + "got": "1.0e-2", + "got_raw": "1.0e-2\n assert mesh.points.shape[0] == ref_num_cells\n\n\ndef test_read_write():\n this_dir = pathlib.Path(__file__).resolve().parent\n filename = this_dir / \"meshes\" / \"ply\" / \"bun_zipper_res4.ply\"\n\n mesh = meshio.read(filename)\n mesh.write(\"bun_zipper_res4_out.ply\")\n\n mesh = meshio.read(\"bun_zipper_res4_out.ply\")\n assert mesh.points.shape[0] == 948\n assert mesh.points.shape[1] == 3\n", + "exact_match": false, + "code_bleu": 0.18995892141289814, + "edit_similarity": 0.08333333333333333, + "n_retrieved": 10 + }, + { + "repo": "nschloe/meshio", + "expected": "\"exodus\"", + "got": "", + "got_raw": "<|fim_suffix|>\n # `data` is a one-dimensional vector with\n # (num_points0, p0, p1, ... ,pk, numpoints1, p10, p11, ..., p1k, ...\n # Translate it into the cells dictionary.\n cells = {}\n for vtk_type, meshio_type in vtk_to_meshio_type.items():\n # Get all offsets for vtk_type\n os = offsets[np.argwhere(types == vtk_type).transpose()[0]]\n num_cells = len(os)\n if num_cells > 0:\n if meshio_type == \"polygon\":\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/tikzplotlib", + "expected": "__file__[:-3] + \"_reference.tex\")", + "got": "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 3", + "got_raw": "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 3", + "exact_match": false, + "code_bleu": 0.0173630008847612, + "edit_similarity": 0.024844720496894408, + "n_retrieved": 10 + }, + { + "repo": "nschloe/tikzplotlib", + "expected": "\"test_horizontal_alignment_reference.tex\")", + "got": "1)", + "got_raw": "1)\n\n\n# File: src/tikzplotlib/_axes.py\n # https://github.com/matplotlib/matplotlib/issues/15493\n return mpl_common_texification(string).replace(\"&\", \"\\\\&\")\n\n\ndef _get_location_from_best(obj):\n \"\"\"Get the best location for the legend from the given object.\"\"\"\n # https://github.com/matplotlib/matplotlib/issues/15764#issuecomment-557823370\n if obj._loc == 0:\n return 10\n return obj._loc\n\n\ndef _get_ticks(data, xy,", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.045454545454545456, + "n_retrieved": 10 + }, + { + "repo": "nschloe/tikzplotlib", + "expected": "\"test_line_set_data_reference.tex\")", + "got": "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,", + "got_raw": "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,", + "exact_match": false, + "code_bleu": 0.011696906573546547, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/tikzplotlib", + "expected": "tikzs[0]", + "got": "tikzs[0]", + "got_raw": " tikzs[0]\n\n print(\"All tests passed.\")\n\n\nif __name__ == \"__main__\":\n test()\n\n\n# File: src/tikzplotlib/_save.py\n :param dpi: The resolution in dots per inch of the rendered image in case\n of QuadMesh plots. If ``None`` it will default to the value\n ``savefig.dpi`` from matplotlib.rcParams. Default is ``None``.\n :type dpi: int\n\n :param show_info: Show extra info on the command line. Default is ``False``.\n :type show_info: bool\n\n :param include_dis", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/tikzplotlib", + "expected": "\"test_legend_best_location_reference.tex\")", + "got": "1)", + "got_raw": "1)\n\n\n# File: src/tikzplotlib/_axes.py\n # 2. Key points of the axes\n lower_left_axes = x0_axes\n lower_right_axes = np.array([x1_axes[0], x0_axes[1]], dtype=np.float_)\n upper_left_axes = np.array([x0_axes[0], x1_axes[1]], dtype=np.float_)\n upper_right_axes = x1_axes\n center_axes = x0_axes + dimension_axes / 2.0\n center_left_axes = np.array(\n [x0_axes[0], x0_axes[1", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.045454545454545456, + "n_retrieved": 10 + }, + { + "repo": "nschloe/tikzplotlib", + "expected": "26", + "got": "100", + "got_raw": "100\n\n def test_xlog(self):\n x = np.linspace(0, 3, 100)\n y = np.exp(x)\n\n with plt.rc_context(rc=RC_PARAMS):\n _, ax = plt.subplots(1)\n ax.plot(x, y)\n ax.set_xscale(\"log\")\n raw = get_tikz_code()\n clean_figure()\n\n clean = get_tikz_code()\n num_lines_raw = raw.count(\"\\n\")\n num_lines_clean = clean.count(\"\\n\")\n assert num_lines_raw - num_lines_clean == 98\n\n assert num_lines", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "nschloe/tikzplotlib", + "expected": "__file__[:-3] + \"_reference.tex\")", + "got": "1, \"test.tex\", flavor=\"context\")", + "got_raw": "1, \"test.tex\", flavor=\"context\")\n\nif __name__ == \"__main__\":\n test()\n```\n\n\n\n```python\nimport matplotlib as mpl\n\nplt.close()\nmpl.rcParams.update(mpl.rcParamsDefault)\n```\n\n-->\n(see above) gives\n\n```latex\n\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.886274509803922,0.290196078431373,0.2}\n\\define", + "exact_match": false, + "code_bleu": 0.14254747528826095, + "edit_similarity": 0.27692307692307694, + "n_retrieved": 10 + }, + { + "repo": "nschloe/tikzplotlib", + "expected": "\"test_basic_sin_reference.tex\")", + "got": "1, \"test.tex\")", + "got_raw": "1, \"test.tex\")\n\nif __name__ == \"__main__\":\n test()\n\n```\n\n\n\n```python\nimport matplotlib as mpl\n\nplt.close()\nmpl.rcParams.update(mpl.rcParamsDefault)\n```\n\n-->\n(see above) gives\n\n```latex\n\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.886274509803922,0.290196078431373,0.2}\n\\definecolor{color1", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.4888888888888889, + "n_retrieved": 10 + }, + { + "repo": "ntno/mkdocs-terminal", + "expected": "\"\"", + "got": "\"
\"", + "got_raw": " \"
\"\n\n def test_no_panel_element_when_hide_side_toc_feature_enabled(self, side_panel_partial, enabled_context):\n enabled_context[\"config\"][\"theme\"][\"features\"] = [theme_features.HIDE_SIDE_TOC]\n context_data = enabled_context\n rendered_side_panel = side_panel_partial.render(context_data)\n\n assert rendered_side_panel.strip() == \"
\"\n\n def test_no_panel_element_when_hide_top_nav_feature_enabled(self, side_panel_partial, enabled_context):\n enabled_context[\"config\"][\"theme\"][\"features\"] = [theme_features.HIDE_TOP", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "ntno/mkdocs-terminal", + "expected": "\"pluglets/tile_grid/templates/j2-partials/tiles.html\")", + "got": "\\", + "got_raw": "\\\n \"pluglets/tile_grid/templates/j2-partials/tiles.html\")\n\n @patch('terminal.pluglets.tile_grid.main.MACRO')\n def test_pluglet_renders_grid_with_two_tiles(self, pluglet_macro_mock, minimal_linked_image_tile, grid_partial):\n pluglet_macro_mock.jinja2_env.get_template.return_value = grid_partial\n\n minimal_linked_image_tile.tile_id = \"myTileId\"\n page_meta = {\"tiles\": [minimal_linked_image_tile, minimal_linked_image_tile]}\n pluglet_output = tile_grid(page_meta)\n assert theme_pluglets.TILE_GRID_MACRO", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ntno/mkdocs-terminal", + "expected": "\"\"", + "got": "\"\"", + "got_raw": " \"\"\n\n def test_grid_with_no_tiles_is_empty_string(self, grid_partial):\n rendered_grid = grid_partial.render()\n\n assert rendered_grid.strip() == \"\"\n\n def test_grid_with_no_tiles_is_empty_string(self, grid_partial):\n rendered_grid = grid_partial.render()\n\n assert rendered_grid.strip() == \"\"\n\n def test_grid_with_no_tiles_is_empty_string(self, grid_partial):\n rendered_grid = grid_partial.render()\n\n assert rendered_grid.strip() == \"\"\n\n def test_grid_with_no_tiles_is_empty_string(self, grid_partial):\n rendered_grid = grid_partial.render()\n\n assert rendered_grid.strip() == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ntno/mkdocs-terminal", + "expected": "None", + "got": "\"\"\"Test rgb() notation with 0-1 range.\"\"\"", + "got_raw": "<|fim_suffix|>\n \"\"\"Test rgb() notation with 0-1 range.\"\"\"\n result = normalize_color(\"rgb(0.5, 0.0, 0.0)\")\n\n assert result == (128, 0, 0)\n\n def test_normalize_hsl(self):\n \"\"\"Test hsl() notation.\"\"\"\n result = normalize_color(\"hsl(0, 100%, 50%)\")\n\n assert result == (0, 100, 50)\n\n def test_normalize_named(self):\n \"\"\"Test named color.\"\"\"\n result = normalize_color(\"red\")\n\n assert", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "ntno/mkdocs-terminal", + "expected": "rendered_nav_search_button", + "got": "rendered_nav_search_button", + "got_raw": " rendered_nav_search_button\n\n def test_search_button_not_included_when_search_plugin_disabled(self, search_button_partial, enabled_context):\n context_data = enabled_context\n context_data[\"config\"][\"theme\"][\"features\"] = []\n rendered_nav_search_button = search_button_partial.render(context_data)\n\n assert \"#mkdocs_search_modal\" not in rendered_nav_search_button\n\n def test_search_button_not_included_when_search_plugin_not_installed(self, search_button_partial, enabled_context):\n context_data = enabled_context\n context_data[\"config\"][\"plugins\"] = []\n rendered_nav_search_button = search_button_partial.render(context_data)\n\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ntno/mkdocs-terminal", + "expected": "f\"Palette '{palette_name}': Font color\")", + "got": "", + "got_raw": "\n\n\n# File: openspec/changes/archive/2026-01-30-add-accessibility-tests/proposal.md\n# Proposal: Add Accessibility Tests\n\n**Change ID:** `add-accessibility-tests`\n\n**Status:** In Progress \u2014 core HTML/ARIA/contrast suites landed; Windows CI + remaining ARIA/focus coverage still outstanding.\n\n**Created:** 2026-01-19\n\n## Summary\n\nAdd automated accessibility testing to ensure the Terminal for MkDocs theme maintains WCAG 2.1 AA compliance and follows web accessibility best practices. This includes HTML validation, semantic structure verification,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ntno/mkdocs-terminal", + "expected": "rendered_grid)", + "got": "rendered_grid )", + "got_raw": " rendered_grid )\n\n def test_grid_with_two_tiles(self, minimal_linked_image_tile, minimal_linked_image_tile_2, grid_partial):\n context_data = {\n \"page\": {\n \"meta\": {\n \"tiles\": [minimal_linked_image_tile, minimal_linked_image_tile_2]\n }\n }\n }\n rendered_grid = grid_partial.render(context_data)\n assert \"class=\\\"terminal-mkdocs-tile-grid \\\">\" in rendered_grid\n\n assert_valid_html( rendered_grid )\n\n def test_grid_with_three_tiles(self, minimal_linked_image_tile, minimal_linked_image_tile_2, minimal_linked_image_tile_", + "exact_match": false, + "code_bleu": 0.7071067811865476, + "edit_similarity": 0.9655172413793104, + "n_retrieved": 10 + }, + { + "repo": "ntno/mkdocs-terminal", + "expected": "0", + "got": "0", + "got_raw": "0\n for key, value in palette_css_attributes.items():\n assert isinstance(key, str)\n assert isinstance(value, str)\n\n @pytest.mark.parametrize(\"palette_css_attributes\", [\"default\", \"dark\", \"gruvbox_dark\"], indirect=True)\n def test_palette_css_attributes_returns_expected_keys(self, palette_css_attributes):\n \"\"\"Test that palette_css_attributes returns the expected keys.\"\"\"\n expected_keys = [\"font_color\", \"background_color\", \"primary_color\", \"error_color\", \"global_font_size\"]\n assert all(key in palette_css_attributes for key in expected_keys)\n\n @pytest.mark.parametrize(\"palette_css_attributes\",", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "known_args)", + "got": "known_args)", + "got_raw": "known_args)\n _get_alias_mock.assert_called_once_with(known_args)\n assert known_args.alias == 'thefuck'\n\n\ndef test_get_alias(mocker):\n known_args = Mock()\n _get_alias_mock = mocker.patch('thefuck.entrypoints.alias._get_alias')\n print_alias(known_args)\n\n _get_alias_mock.assert_called_once_with(known_args)\n\n\ndef test_get_alias_with_experimental_instant_mode(mocker):\n known_args = Mock()\n known_args.enable_experimental_instant_mode = True\n _get_alias_mock = mocker.patch('thefuck.entrypoints.alias._get_alias", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "result", + "got": "result", + "got_raw": " result\n\n\n\n# File: thefuck/rules/has_exists_script.py\nimport os\nfrom thefuck.specific.sudo import sudo_support\nfrom thefuck.utils import for_app\n\n\n@sudo_support\n@for_app('touch')\ndef match(command):\n return (\n command.script.startswith('touch') and\n os.path.exists(command.script_parts[1]) and\n 'No such file or directory' in command.output\n )\n\n\n@sudo_support\ndef get_new_command(command):\n return u'./{}'.format(command.script_parts[1][2:])\n\n\n# File: thefuck/rules/cd_mkdir.py\nimport re", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "result", + "got": "assert result == 'yarn why webpack'", + "got_raw": "<|fim_suffix|>\n assert result == 'yarn why webpack'\n\ndef test_match():\n assert match(Command('yarn whyy webpack', output('whyy')))\n assert not match(Command('yarn why webpack', output('require')))\n\n\n# File: README.md\n* `apt_get` – installs app from apt if it not installed (requires `python-commandnotfound` / `python3-commandnotfound`);\n* `apt_get_search` – changes trying to search using `apt-get` with searching using `apt-cache`;\n* `apt_invalid_operation` – fixes invalid `apt`", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.2926829268292683, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "OSError)", + "got": "ImportError):", + "got_raw": "ImportError):\n shell._get_version()\n\n def test_get_version(self, shell, Popen):\n Popen.return_value.stdout.read.return_value = '4.3.11(1)-release'\n\n assert shell._get_version() == '4.3.11(1)-release'\n\n def test_get_aliases(self, shell, Popen):\n shell._get_version = lambda: '4.3.11(1)-release'\n\n Popen.return_value.stdout.read.return_value = (\n 'alias fuck=\\'eval $(thefuck $(fc -ln -1))\\'\\n'\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n @patch('thefuck.output_readers.rerun.Popen')\n def test_get_output_invalid_continuation_byte_2(self, popen_mock):\n output = b'ls: illegal option -- \\xc3\\nusage: ls [-@ABC...] [file ...]\\n'\n expected = u'ls: illegal option -- \\ufffd\\nusage: ls [-@ABC...] [file ...]\\n'\n popen_mock.return_value.stdout.read.return_value = output\n actual = rerun.get_output('', '')\n\n assert actual == expected\n\n @patch('thefuck.output_readers.r", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "'ls || cd'", + "got": "'ls || cd'", + "got_raw": " 'ls || cd'\n\n def test_and_(self, shell):\n\n assert shell.and_('ls', 'cd') == 'ls && cd'\n\n def test_split_command(self, shell):\n\n assert shell.split_command('ls -l') == ['ls', '-l']\n\n def test_quote(self, shell):\n\n assert shell.quote('ls -l') == 'ls -l'\n\n def test_get_history(self, shell):\n\n assert shell.get_history() == []\n\n def test_get_history_lines(self, shell):\n\n assert list(shell._get_history_lines()) == []\n\n def test_get_history_file_name(self, shell", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "[result]", + "got": "[result]", + "got_raw": " [result]\n\n @pytest.mark.parametrize('history, result', [\n ('git br', 'git br'),\n ('git br\\nfcuk', 'git br'),\n ('git br\\nfcuk\\nls', 'ls'),\n ('git br\\nfcuk\\nls\\nfuk', 'ls')])\n def test_from_history_with_alias(self, os_environ, history, result):\n os_environ['TF_HISTORY'] = history\n os_environ['TF_ALIAS'] = 'fuck'\n known_args = Mock(force_command=None,\n command=None)\n\n assert _get_raw_command(known_args) ==", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "Command(called, '')", + "got": "Command('sudo ls', 'Permission denied')", + "got_raw": " Command('sudo ls', 'Permission denied')\n assert sudo_support(fn) == True\n assert sudo_support(lambda x: x) == False\n assert sudo_support(lambda x: x, 'sudo') == True\n assert sudo_support(lambda x: x, 'sudo ls') == True\n assert sudo_support(lambda x: x, 'sudo ls', 'sudo') == True\n assert sudo_support(lambda x: x, 'sudo ls', 'sudo ls') == True\n assert sudo_support(lambda x: x, 'sudo ls', 'sudo ls', 'sudo') == True\n assert sudo_support(lambda", + "exact_match": false, + "code_bleu": 0.3303164318013807, + "edit_similarity": 0.4827586206896552, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "'Bash 3.5.9'", + "got": "assert shell.from_shell('ls -l') == 'ls -l'", + "got_raw": "<|fim_suffix|>\n assert shell.from_shell('ls -l') == 'ls -l'\n\n def test_to_shell(self, shell):\n assert shell.to_shell('ls -l') == 'ls -l'\n\n def test_app_alias(self, shell):\n assert shell.app_alias('fuck') == 'alias fuck=\\'eval $(thefuck $(fc -ln -1))\\''\n\n def test_get_aliases(self, shell):\n shell.shell_aliases()\n assert shell.get_aliases() == {\n 'fuck': 'alias fuck=\\'eval $(thefuck $(fc -ln -1))\\'',\n 'l': '", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "{CorrectedCommand('ls')}", + "got": "CorrectedCommand('ls', None, 100)} == set()", + "got_raw": " CorrectedCommand('ls', None, 100)} == set()\n\n def test_repr(self):\n assert repr(CorrectedCommand('ls', None, 100)) == \"CorrectedCommand('ls', None, 100)\"\n\n def test_str(self):\n assert str(CorrectedCommand('ls', None, 100)) == \"ls\"\n\n def test_run(self):\n command = Command('ls', 'ls', 'ls', 'ls', 'ls', 'ls', 'ls', 'ls', 'ls', 'ls', 'ls', 'ls', '", + "exact_match": false, + "code_bleu": 0.195647514979229, + "edit_similarity": 0.6865671641791045, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "new_cmd", + "got": "new_cmd", + "got_raw": " new_cmd\n\n\ndef test_match():\n assert match(Command('ag \\\\(', output()))\n\n\n\n# File: thefuck/rules/fix_apt_get.py\nimport re\nfrom thefuck.specific.sudo import sudo_support\n\n\n@sudo_support\ndef match(command):\n return 'E: Unable to correct problems, you have held broken packages.' in command.output\n\n\ndef get_new_command(command):\n return re.sub(r'apt-get', 'apt', command.script)\n\n\n\n# File: thefuck/rules/fix_apt_get.py\nimport re\nfrom thefuck.specific.sudo import sudo_support\n\n\n@sudo_support\ndef match(command", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "1", + "got": "1", + "got_raw": "1\n\n @patch('thefuck.utils.difflib_get_close_matches')\n def test_call_with_cutoff(self, difflib_mock):\n get_close_matches('', [], cutoff=0.1)\n\n assert difflib_mock.call_args[0][3] == 0.1\n\n @patch('thefuck.utils.difflib_get_close_matches')\n def test_call_with_fallback_to_first(self, difflib_mock):\n get_close_matches('', [])\n\n assert difflib_mock.call_args[0][4] is False\n\n @patch('thefuck.utils.difflib", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "r\"sed -e 's/\\/foo/bar/'\"", + "got": "_new_command(Command('sed -e s/foo/bar/ -e s/foo/bar', sed_unterminated_s))", + "got_raw": "_new_command(Command('sed -e s/foo/bar/ -e s/foo/bar', sed_unterminated_s))\n == 'sed -e s/foo/bar/ -e s/foo/bar/')\n\ndef test_match(sed_unterminated_s):\n assert match(Command('sed -e s/foo/bar', sed_unterminated_s))\n assert match(Command('sed -es/foo/bar', sed_unterminated_s))\n assert match(Command('sed -e s/foo/bar/ -e s/foo/bar', sed_unterminated_s))\n assert not match(Command('sed -e s/foo/bar', ''))\n assert not match(Command('sed -e", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.36363636363636365, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "new_command", + "got": "new_command", + "got_raw": " new_command\n\n\n\n# File: thefuck/rules/terraform_init.py\nimport os\nimport subprocess\nfrom thefuck.specific.terraform import terraform_env\nfrom thefuck.utils import for_app\n\n\n@for_app('terraform')\ndef match(command):\n return 'No configuration files found' in command.output\n\n\ndef get_new_command(command):\n return 'terraform init' if terraform_env() else 'terraform init -input=false'\n\n\n\n# File: thefuck/rules/terraform_no_command.py\nimport os\nimport subprocess\nfrom thefuck.specific.terraform import terraform_env\nfrom thefuck.utils import for_app\n\n\n@for_app", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "['test']", + "got": "['test']", + "got_raw": " ['test']\n assert settings.wait_command == 10\n assert settings.require_confirmation == True\n assert settings.no_colors == True\n assert settings.priority == {'vim': 100}\n assert settings.exclude_rules == ['git']\n\n def test_from_file_with_env(self, load_source, settings):\n load_source.return_value = Mock(rules=['test'],\n wait_command=10,\n require_confirmation=True,\n no_colors=True,\n priority={'vim': 100},\n exclude_rules=['git'])\n os.environ['THEFUCK_RULES'] = 'test:vim'\n os.environ", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "result", + "got": "result", + "got_raw": " result\n\ndef test_match():\n assert match(Command('sudo npm install -g react-native-cli', output.format('npm')))\n assert match(Command('sudo -u app appcfg update .', output.format('appcfg')))\n\n\n\n# File: thefuck/rules/unknown_command.py\nimport re\nfrom thefuck.specific.sudo import sudo_support\nfrom thefuck.utils import replace_argument\n\n\n@sudo_support\ndef match(command):\n return ('unknown command' in command.output\n and 'maybe you meant' in command.output)\n\n\ndef get_new_command(command):\n broken_cmd = re.findall(r'ERROR: unknown command \"([^", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "new_command", + "got": "new_command", + "got_raw": " new_command\n\n\ndef test_match():\n assert match(Command('cargo buid', no_such_subcommand_old))\n assert not match(Command('cargo buils', no_such_subcommand_old))\n assert not match(Command('cargo buid', no_such_subcommand))\n assert not match(Command('cargo buils', no_such_subcommand))\n\n\n\nimport pytest\nfrom thefuck.rules.cargo import match, get_new_command\nfrom thefuck.types import Command\n\nno_such_subcommand_old = \"\"\"No such subcommand\n\n Did you mean `build`?\n\"\"\"\n\nno_such_subcommand = \"\"\"error: no", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "output", + "got": "output", + "got_raw": " output\n\n\ndef test_match():\n assert match(Command('git push', git_uptodate))\n assert match(Command('git push nvbn', git_uptodate))\n assert match(Command('git push nvbn master', git_uptodate))\n assert match(Command('git push', git_err))\n assert match(Command('git push nvbn', git_err))\n assert match(Command('git push nvbn master', git_err))\n assert match(Command('git push', git_err2))\n assert match(Command('git push nvbn', git_err2))\n assert match(Command('git push nvbn master', git_err2", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "['ls', 'rm']", + "got": "assert shell._get_history_line('ls') == 'ls\\n'", + "got_raw": "<|fim_suffix|>\n assert shell._get_history_line('ls') == 'ls\\n'\n\n def test_get_history_line(self, shell):\n assert shell._get_history_line('ls') == ': 1234567890:0;ls\\n'\n\n def test_get_history_file_name(self, shell):\n assert shell._get_history_file_name() == '~/.bash_history'\n\n def test_get_history_file_name_with_history_file(self, mocker, shell):\n mocker.patch('os.environ', {'HISTFILE': '/tmp/history'})\n assert shell._get_history_file_name() == '/tmp/history'\n\n", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.2413793103448276, + "n_retrieved": 10 + }, + { + "repo": "nvbn/thefuck", + "expected": "after", + "got": "assert shell.to_shell(before) == after", + "got_raw": "<|fim_suffix|>\n assert shell.to_shell(before) == after\n\n def test_app_alias(self, shell):\n\n assert shell.app_alias('fuck') == \\\n 'alias fuck=\\'eval $(thefuck $(fc -ln -1))\\''\n\n def test_get_aliases(self, shell):\n\n shell.shell_aliases()\n assert shell.get_aliases() == {\n 'fuck': 'eval $(thefuck $(fc -ln -1))',\n 'l': 'ls -CF',\n 'la': 'ls -A',\n 'll': 'ls -alF'}\n\n def test_get_history(self, shell):\n\n ", + "exact_match": false, + "code_bleu": 0.12605968092174913, + "edit_similarity": 0.23255813953488372, + "n_retrieved": 10 + }, + { + "repo": "offu/WeRoBot", + "expected": "'toUser'", + "got": "\"fromUser\"", + "got_raw": " \"fromUser\"\n assert reply._args['target'] == \"toUser\"\n assert reply._args['time'] == 1348831860\n assert reply._args['content'] == s\n assert reply._args['media_id'] == \"media_id\"\n assert reply._args['msg_id'] == 1234567890123456\n assert reply._args['s'] == s\n assert reply._args['s'] == s\n assert reply._args['s'] == s\n assert reply._", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5555555555555556, + "n_retrieved": 10 + }, + { + "repo": "offu/WeRoBot", + "expected": "u'\u606d\u559c\u8131\u5751'", + "got": "'\u606d\u559c\u8131\u5751'", + "got_raw": " '\u606d\u559c\u8131\u5751'\n\ndef test_user_consume_card_handler_with_args():\n @werobot.user_consume_card\n def user_consume_card(content):\n return '\u606d\u559c\u8131\u5751'\n\n message = parse_user_msg(\n \"\"\"\n \n \n \n 1472549042\n \n \n 123456789\n \n \n \n ", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.9230769230769231, + "n_retrieved": 10 + }, + { + "repo": "offu/WeRoBot", + "expected": "0", + "got": "0", + "got_raw": "0\n assert message.friend_user_name == \"\"\n assert message.outer_id == 0\n assert message.old_user_card_code == \"\"\n assert message.outer_str == \"12b\"\n assert message.is_restore_member_card == 0\n assert message.is_recommend_by_friend == 0\n\n\ndef test_user_gifting_card_event():\n message = parse_user_msg(\n \"\"\"\n \n \n crypt.decrypt_message(message, app_id)\n assert message == 'hello'\n\n message = crypt.encrypt_message('hello', timestamp, nonce)\n assert message is not None\n assert crypt.decrypt_message(message, app_id) == 'hello'\n\n message = crypt.encrypt_message('hello', timestamp, nonce)\n assert message is not None\n assert crypt.decrypt_message(message, app_id) == 'hello'\n\n message = crypt.encrypt_message('hello', timestamp, nonce)\n assert message is not None\n assert crypt.decrypt_message(message, app_id) == 'hello'\n\n message = crypt.encrypt_message('hello', timestamp", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.047619047619047616, + "n_retrieved": 10 + }, + { + "repo": "offu/WeRoBot", + "expected": "\"url\"", + "got": "\"url\"", + "got_raw": " \"url\"\n assert reply.hq_url == \"hq\"\n\n reply = process_function_reply([\"title\", \"desc\", \"url\", \"hq\", \"img\"])\n assert isinstance(reply, MusicReply)\n assert reply.title == \"title\"\n assert reply.description == \"desc\"\n assert reply.url == \"url\"\n assert reply.hq_url == \"hq\"\n assert reply.img == \"img\"\n\n reply = process_function_reply([\"title\", \"desc\", \"url\", \"hq\", \"img\", \"thumb\"])\n assert isinstance(reply, MusicReply)\n assert reply.title == \"title\"\n assert reply", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "offu/WeRoBot", + "expected": "token", + "got": "token", + "got_raw": " token\n\n robot.config[\"TOKEN\"] = None\n assert not robot.token\n\n robot.config[\"TOKEN\"] = token\n assert robot.token == token\n\n robot.config[\"TOKEN\"] = None\n assert not robot.token\n\n robot.config[\"TOKEN\"] = token\n assert robot.token == token\n\n robot.config[\"TOKEN\"] = None\n assert not robot.token\n\n robot.config[\"TOKEN\"] = token\n assert robot.token == token\n\n robot.config[\"TOKEN\"] = None\n assert not robot.token\n\n robot.config[\"TOKEN\"] = token\n assert robot.token == token\n\n robot", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "cfg.jsonnet[\"param\"]", + "got": "432", + "got_raw": "432\n\ndef test_action_jsonnet_ext_vars(parser):\n parser.add_argument(\"--ext_vars\", type=dict)\n parser.add_argument(\"--jsonnet\", action=ActionJsonnet(ext_vars=\"ext_vars\"))\n cfg = parser.parse_args([\"--ext_vars\", '{\"param\": 432}', \"--jsonnet\", example_2_jsonnet])\n\n assert 432 == 432\n\ndef test_action_jsonnet_ext_vars_with_default(parser):\n parser.add_argument(\"--ext_vars\", type=dict, default={\"param\": 432})\n parser.add_argument(\"--jsonnet\", action=ActionJsonnet", + "exact_match": false, + "code_bleu": 0.08333333333333333, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "path2", + "got": "path2", + "got_raw": " path2\n assert path1 != path1\n assert path1 != path2\n\ndef test_path_equality_operator_relative(paths):\n path1 = Path(paths.file_rw)\n path2 = Path(paths.tmp_path / paths.file_rw)\n\n assert path1 == path2\n assert path1 != path1\n assert path1 != path2\n\ndef test_path_equality_operator_absolute(paths):\n path1 = Path(paths.file_rw)\n path2 = Path(paths.tmp_path / paths.file_rw)\n\n assert path1 == path2\n assert path1 != path1\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "cfg.a1", + "got": "assert isinstance(cfg, Namespace)", + "got_raw": "<|fim_suffix|>\n assert isinstance(cfg, Namespace)\n assert cfg.data == 1\n assert cfg.data2 == 2\n assert cfg.data3 == 3\n assert cfg.data4 == 4\n assert cfg.data5 == 5\n assert cfg.data6 == 6\n assert cfg.data7 == 7\n assert cfg.data8 == 8\n assert cfg.data9 == 9\n assert cfg.data10 == 10\n assert cfg.data11 == 11\n assert cfg.data12 == 12\n assert cfg.data13", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.20512820512820512, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "torch.Tensor", + "got": "", + "got_raw": " # type: ignore[no-redef]\n assert params[1].annotation is # type: ignore[no-redef]\n assert params[2].annotation is # type: ignore[no-redef]\n assert params[3].annotation is # type: ignore[no-redef]\n assert params[4].annotation is # type: ignore[no-redef]\n assert params[5].annotation is # type: ignore[no-redef]\n assert params[6].annotation is # type: ignore[no-redef]\n assert params[7].annotation is # type", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "cfg[\"op1\"]", + "got": "cfg.op1", + "got_raw": " cfg.op1\n\ndef test_schema_array_parse_list(parser):\n cfg = parser.parse_args([\"--op1\", \"3\", \"7\"])\n\n assert [3, 7] == cfg.op1\n\ndef test_schema_array_parse_dict(parser):\n cfg = parser.parse_args([\"--op1\", '{\"a\": 3, \"b\": 7}'])\n\n assert [3, 7] == cfg.op1\n\ndef test_schema_array_parse_dict_with_default(parser):\n parser.add_argument(\"--op1\", default=[3, 7])\n cfg = parser.parse_args([])\n\n assert [3, ", + "exact_match": false, + "code_bleu": 0.3388507513536918, + "edit_similarity": 0.7058823529411765, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "2", + "got": "1", + "got_raw": "1\n assert cfg.model.p2 == 2\n\n def test_annotated_field_with_default(self, parser):\n parser.add_argument(\"--model\", type=PydanticAnnotatedField, default=PydanticAnnotatedField(1, 2))\n cfg = parser.parse_args([])\n\n assert cfg.model.p1 == 1\n assert cfg.model.p2 == 2\n\n def test_annotated_field_with_default_and_type(self, parser):\n parser.add_argument(\"--model\", type=PydanticAnnotatedField, default=PydanticAnnotatedField(1, 2))\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "\"required\"", + "got": "\"required\"", + "got_raw": " \"required\"\n assert instance.param2 == 2\n\n\ndef test_init_defaults_override_preserve_required_with_default(tmp_cwd):\n config_path = tmp_cwd / \"config.yaml\"\n config_path.write_text(json_or_yaml_dump({\"param2\": 2}))\n\n class DefaultsOverrideRequiredParameters(FromConfigMixin):\n __from_config_init_defaults__ = config_path\n\n def __init__(self, param1: str, param2: int = 1):\n self.param1 = param1\n self.param2 = param2\n\n instance = DefaultsOverrideRequiredParameters(param1=\"required\")\n\n assert instance", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "Namespace()", + "got": "", + "got_raw": " # type: ignore[no-any-return]\n\n def test_field_init_true(self, parser):\n parser.add_argument(\"--data\", type=AttrsFieldInitTrue)\n cfg = parser.parse_args([])\n help_str = get_parser_help(parser)\n assert \"--data.p1\" in help_str\n\n assert cfg == # type: ignore[no-any-return]\n\n def test_field_init_true_with_default(self, parser):\n parser.add_argument(\"--data\", type=AttrsFieldInitTrue, default=AttrsFieldInitTrue())\n cfg = parser.parse_args([])\n help_str = get_parser_help(parser)\n assert \"--data.p", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "3", + "got": "3", + "got_raw": "3\n\n assert lazy_calendar.getfirstweekday() == 3\n\n assert lazy_calendar.init_called is True\n\ndef test_lazy_instance_init_postponed_with_args():\n class SubCalendar(Calendar):\n init_called = False\n getfirst = Calendar.getfirstweekday\n\n def __init__(self, *args, **kwargs):\n self.init_called = True\n super().__init__(*args, **kwargs)\n\n lazy_calendar = lazy_instance(SubCalendar, firstweekday=3)\n assert isinstance(lazy_calendar, SubCalendar)\n assert lazy_calendar.init_called is False\n\n assert lazy_calendar.getfirstweekday() == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "[1, 2]", + "got": "1", + "got_raw": "1\n assert cfg2.model.p1 == 1\n\n def test_field_default_factory_with_default(self, parser):\n parser.add_argument(\"--model\", type=PydanticFieldFactory)\n cfg1 = parser.parse_args([])\n cfg2 = parser.parse_args([])\n\n assert cfg1.model.p1 == 1\n assert cfg2.model.p1 == 1\n\n def test_field_default_factory_with_default_and_type(self, parser):\n parser.add_argument(\"--model\", type=PydanticFieldFactory)\n cfg1 = parser.parse_args([])\n cfg2 = parser.parse_args([])\n\n assert cfg", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "cfg.data", + "got": "assert Namespace(p1=0.1, p2=\"-\") == defaults.data", + "got_raw": "<|fim_suffix|>\n assert Namespace(p1=0.1, p2=\"-\") == defaults.data\n cfg = parser.parse_args([\"--data.p1=0.2\", \"--data.p2=x\"])\n\n assert Namespace(p1=0.2, p2=\"x\") == cfg.data\n assert Namespace(p1=0.2, p2=\"x\") == defaults.data\n\n def test_dataclass_with_default(self, parser):\n parser.add_argument(\"--data\", type=PydanticData, default=PydanticData(0.1, \"x\"))\n defaults = parser.get_defaults()\n assert", + "exact_match": false, + "code_bleu": 0.10123734869668824, + "edit_similarity": 0.24561403508771928, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "\"B\"", + "got": "\"B\"", + "got_raw": " \"B\"\n assert cfg[\"b\"] == None\n assert cfg[\"ao1\"] == \"ao1_def\"\n assert cfg[\"o1\"] == \"o1_def\"\n\ndef test_subcommands_parse_args(subcommands_parser):\n cfg = subcommands_parser.parse_args([\"a\", \"ap1\"])\n\n assert cfg[\"subcommand\"] == \"a\"\n assert cfg[\"a\"] == \"ap1\"\n assert cfg[\"ao1\"] == \"ao1_def\"\n assert cfg[\"o1\"] == \"o1_def\"\n\ndef test_subcommands_parse_args_fail(subcommands_parser):\n with pytest", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "json.loads(help_schema)", + "got": "json.loads(help_schema)", + "got_raw": " json.loads(help_schema)\n\ndef test_schema_in_help_with_default(parser):\n parser.add_argument(\n \"--op1\",\n action=ActionJsonSchema(schema=schema_array, default=schema_array_default),\n help=\"schema: %s\",\n )\n help_str = get_parser_help(parser)\n help_schema = re.sub(\n \"^.*schema:([^()]+)[^{}]*$\",\n r\"\\1\",\n help_str.replace(\"\\n\", \" \"),\n )\n\n assert schema_array_default == json.loads(help_schema)\n\ndef test_schema_in_help_with_default_and_default_value(parser):\n parser.add_argument(\n \"--", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "loaders[\"omegaconf\"]", + "got": "", + "got_raw": " # noqa: WPS437\n assert loaders[\"yaml\"] is # noqa: WPS437\n assert loaders[\"yaml\"] is # noqa: WPS437\n assert loaders[\"yaml\"] is # noqa: WPS437\n assert loaders[\"yaml\"] is # noqa: WPS437\n assert loaders[\"yaml\"] is # noqa: WPS437\n assert loaders[\"yaml\"] is # noqa: WPS437\n assert loaders[\"yaml\"] is # noqa: WPS437\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "\"secret\"", + "got": "\"secret\"", + "got_raw": " \"secret\"\n\ndef test_secret_str_parsing_with_default(parser):\n parser.add_argument(\"--password\", type=SecretStr, default=\"secret\")\n cfg = parser.parse_args([])\n assert isinstance(cfg.password, SecretStr)\n\n assert cfg.password.get_secret_value() == \"secret\"\n\ndef test_secret_str_parsing_with_default_and_empty(parser):\n parser.add_argument(\"--password\", type=SecretStr, default=\"\")\n cfg = parser.parse_args([])\n assert isinstance(cfg.password, SecretStr)\n\n assert cfg.password.get_secret_value() == \"\"\n\ndef test_secret_str_parsing_with_default_and_none(parser):\n parser.add_argument(\"--", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "TypeError)", + "got": "ArgumentError, parser.add_argument, \"--inner2\", action=ActionParser(parser=subparser))", + "got_raw": "ArgumentError, parser.add_argument, \"--inner2\", action=ActionParser(parser=subparser))\n\n pytest.raises(ArgumentError, parser.add_argument, \"--inner2\", action=ActionParser(parser=subparser, default_env=True))\n\n pytest.raises(ArgumentError, parser.add_argument, \"--inner2\", action=ActionParser(parser=subparser, default_env=False))\n\n pytest.raises(ArgumentError, parser.add_argument, \"--inner2\", action=ActionParser(parser=subparser, default_env=True, exit_on_error=False))\n\n pytest.raises(ArgumentError, parser.add_argument, \"--inner2\", action=ActionParser(parser=subparser,", + "exact_match": false, + "code_bleu": 0.07223943354597204, + "edit_similarity": 0.14583333333333334, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "\"-\"", + "got": "0", + "got_raw": "0\n assert path == \"-\"\n assert path == \"\"\n assert path == \"\"\n assert path == \"\"\n\n with path.open(\"w\") as f:\n f.write(\"test\")\n\n assert path.get_content() == \"test\"\n\ndef test_std_input_path():\n path = Path(\"-\", mode=\"fr\")\n\n assert path == 0\n assert path == \"-\"\n assert path == \"\"\n assert path == \"\"\n assert path == \"\"\n\n with path.open(\"r\") as f:\n assert f.read() == \"\"\n\n with path.open(\"r\")", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "origins", + "got": "assert_params(params, [\"p1\", \"p2\", \"p3\", \"p4\", \"p5\", \"p6\", \"p7\", \"p8\", \"p9\", \"p10\", \"p11\", \"p12\", \"p13\", \"p14\", \"p15\"])", + "got_raw": "<|fim_suffix|>\n assert_params(params, [\"p1\", \"p2\", \"p3\", \"p4\", \"p5\", \"p6\", \"p7\", \"p8\", \"p9\", \"p10\", \"p11\", \"p12\", \"p13\", \"p14\", \"p15\"])\n assert_params(\n params[1:],\n [\"p2\", \"p3\", \"p4\", \"p5\", \"p6\", \"p7\", \"p8\", \"p9\", \"p10\", \"p11\", \"p", + "exact_match": false, + "code_bleu": 0.028182998883818942, + "edit_similarity": 0.015873015873015872, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "\"WithLogger\"", + "got": "\"jsonargparse.tests.test_logger_true\"", + "got_raw": " \"jsonargparse.tests.test_logger_true\"\n\ndef test_logger_false():\n test = WithLogger(logger=False)\n if reconplogger_support:\n assert test.logger.name == \"plain_logger\"\n else:\n assert test.logger.handlers[0].level == logging.WARNING\n\n assert test.logger.name == \"jsonargparse.tests.test_logger_false\"\n\ndef test_logger_dict():\n test = WithLogger(logger={\"level\": \"DEBUG\"})\n if reconplogger_support:\n assert test.logger.name == \"plain_logger\"\n else:\n assert test.logger.handlers[0].level == logging.DEBUG\n\n assert test.logger.name == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.32653061224489793, + "n_retrieved": 10 + }, + { + "repo": "omni-us/jsonargparse", + "expected": "cfg", + "got": "assert {\"dict1\": {\"2\": 4.5, \"6\": \"C\"}, \"dict2\": {\"a\": True, \"b\": \"f\"}} == cfg", + "got_raw": "<|fim_suffix|>\n assert {\"dict1\": {\"2\": 4.5, \"6\": \"C\"}, \"dict2\": {\"a\": True, \"b\": \"f\"}} == cfg\n\n assert {\"dict1\": {\"2\": 4.5, \"6\": \"C\"}, \"dict2\": {\"a\": True, \"b\": \"f\"}} == parser.parse_args(\n ['--dict1={\"2\":4.5, \"6\":\"C\"}', '--dict2={\"a\":true, \"b\":\"f\"}']\n ).as_dict()\n\n assert {\"dict1\": {\"2\": 4", + "exact_match": false, + "code_bleu": 0.04175872565419194, + "edit_similarity": 0.075, + "n_retrieved": 10 + }, + { + "repo": "online-judge-tools/oj", + "expected": "len(expected))", + "got": "1)", + "got_raw": "1)\n self.assertEqual(data[0]['status'], expected['status'])\n if 'input' in expected:\n self.assertEqual(data[0]['input'], expected['input'])\n if 'output' in expected:\n self.assertEqual(data[0]['output'], expected['output'])\n if 'answer' in expected:\n self.assertEqual(data[0]['answer'], expected['answer'])\n if 'elapsed' in expected:\n self.assertAlmostEqual(data[0]['elapsed'], expected['elapsed'], delta=0.01)\n if 'time' in expected:\n self.assertAlmostEqual(data[0]['time'], expected['time'], delta", + "exact_match": false, + "code_bleu": 0.2149139863647084, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "online-judge-tools/oj", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n self.assertIn('Login failed', proc.stdout)\n\n def test_login_check_failure(self):\n self.snippet_call_login_check_failure('https://atcoder.jp/')\n\n def snippet_call_login_check_success(self, url):\n with tests.utils.sandbox(files=[]) as _:\n path = 'cookie.jar' # use dummy cookie to check in an empty state\n proc = tests.utils.run(['--cookie', path, 'login', url])\n\n self.assertEqual(proc.returncode, 0)\n self.assertIn('Login succeeded', proc.stdout)\n\n def test_login_check_success(self):\n self.snippet_call", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "online-judge-tools/oj", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n self.assertIn('WA', proc.stderr)\n\n def test_simple_success(self) -> None:\n files = [\n {\n 'path': 'main.py',\n 'data': accepted_code,\n },\n {\n 'path': 'judge.py',\n 'data': judge_code,\n },\n ]\n with tests.utils.sandbox(files):\n proc = tests.utils.run(['t/r', '-c', tests.utils.python_script('main.py'), tests.utils.python_script('judge.py')])\n\n self.assertEqual(proc.returncode, 0)\n self.assertIn('AC', proc.stderr)\n\n def test_simple_failure_with", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "online-judge-tools/oj", + "expected": "expect['data'])", + "got": "", + "got_raw": " # noqa\n ''.join(expect['data'].splitlines()))\n else:\n self.assertFalse(os.path.exists(expect['path']))\n if disallowed_files is not None:\n for disallowed_file in disallowed_files:\n self.assertFalse(os.path.exists(disallowed_file))\n\n def test_generate_input(self):\n self.snippet_call_generate_input(\n args=['--format', '%s.%e', '--directory', 'test'],\n input_files=['test/1.in', 'test/2.in'],\n expected_values=[\n {'path': 'test/1.in', 'data': '1'},\n {'path': 'test", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "oomol-lab/epub-translator", + "expected": "rt.text", + "got": "with Zip(source_path, output_path) as zip_file:", + "got_raw": "<|fim_suffix|>\n with Zip(source_path, output_path) as zip_file:\n original_toc, context = read_toc(zip_file)\n write_toc(zip_file, original_toc, context)\n\n # \u7b2c\u4e8c\u6b21\u8bfb\u53d6\uff0c\u9a8c\u8bc1\u4e00\u81f4\u6027\n with Zip(output_path, metadata_temp_dir / \"roundtrip_verify.epub\") as zip_file:\n roundtrip_toc, _context = read_toc(zip_file)\n\n assert len(roundtrip_toc) == len(original_toc)\n for orig, rt in zip(original_toc, roundtrip_toc):\n assert orig.toc_path == rt.toc_path", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "oomol-lab/epub-translator", + "expected": "spine_names", + "got": "spine_results:", + "got_raw": "<|fim_suffix|>spine_results:\n assert path.suffix in [\".xhtml\", \".html\", \".htm\"], f\"\u6587\u4ef6\u5e94\u8be5\u662f HTML/XHTML \u683c\u5f0f: {path}\"\n\n # \u9a8c\u8bc1\u7b2c\u4e00\u4e2a\u6587\u6863\u8def\u5f84\uff08spine \u901a\u5e38\u4ece\u6807\u9898\u9875\u5f00\u59cb\uff09\n first_spine_path, _ = spine_results[0]\n assert first_spine_path.suffix in [\".xhtml\", \".html\", \".htm\"], (\n f\"\u7b2c\u4e00\u4e2a\u6587\u6863\u5e94\u8be5\u662f HTML/XHTML \u683c\u5f0f\uff0c\u5b9e\u9645\u662f {first_spine_path}\"\n )\n\n # \u9a8c\u8bc1\u5305\u542b\u4e3b\u8981\u7ae0\u8282\u6587\u4ef6\n spine_names = [path.name", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.64, + "n_retrieved": 10 + }, + { + "repo": "oomol-lab/epub-translator", + "expected": "0", + "got": "0", + "got_raw": "0\n\n # \u6bcf\u4e2a chunk \u90fd\u5e94\u8be5\u5305\u542b 5 \u4e2a tokens\n\n for chunk in chunks:\n assert chunk.head_remain_tokens == 5\n assert chunk.tail_remain_tokens == 5\n\n def test_chunking_with_tail(self):\n \"\"\"\u6d4b\u8bd5\u5c3e\u90e8\u5206\u5757\u529f\u80fd\"\"\"\n segments = [\n MockSegment.from_text(\"Hello\"), # 5 tokens\n MockSegment.from_text(\"World\"), # 5 tokens\n MockSegment.from_text(\"Python\"), # 6 tokens\n ]\n\n chunks = list(split_into_chunks(segments, max_group_tokens=10))\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "oomol-lab/epub-translator", + "expected": "result_str)", + "got": "result_str)", + "got_raw": " result_str)\n self.assertIn('\u63cf\u8ff0\u6587\u672c', result_str)\n self.assertIn('Tail text after description.', result_str)\n self.assertIn('

Paragraph text

', result_str)\n self.assertIn('

\u6bb5\u843d\u6587\u672c

', result_str)\n\n def test_tail_text_position_in_replace(self):\n \"\"\"\u6d4b\u8bd5 REPLACE \u6a21\u5f0f\u4e0b tail text \u7684\u6b63\u786e\u4f4d\u7f6e\"\"\"\n # \u7b80\u5316\u7684\u6d4b\u8bd5\uff1a\u9a8c\u8bc1 tail text \u7684\u8bd1\u6587\u4e0d\u4f1a\u51fa\u73b0\u5728\u7236\u5143\u7d20\u7684\u5f00\u5934\n xml_str = \"\"\"\n \n \n \n x\n 2\n \n \"\"\"\n\n element = fromstring(mathml)\n result = xml_to_latex(element)\n\n\n assert result == r\"\\sqrt[2]{x}\"\n\n\ndef test_sqrt_with_index_and_subscript():\n \"\"\"\u5e73\u65b9\u6839\"\"\"\n mathml = \"\"\"\n \n x\n 2\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "oomol-lab/epub-translator", + "expected": "\"\u5e94\u8be5\u5305\u542b\u7236\u5143\u7d20\u7684\u8bd1\u6587\")", + "got": "\u5143\u7d20\")", + "got_raw": "\u5143\u7d20\")\n self.assertIn(\"\u6570\u5b66\u516c\u5f0f\", result_str, \"\u5e94\u8be5\u5305\u542b\u6570\u5b66\u516c\u5f0f\")\n\n def test_bug_indirect_child_in_peak_structure(self):\n \"\"\"\n \u590d\u73b0\u751f\u4ea7\u73af\u5883 bug\uff1a\u5f53 _nest_nodes \u5c06\u95f4\u63a5\u5b50\u5143\u7d20\uff08\u975e\u76f4\u63a5\u5b50\u5143\u7d20\uff09\n \u6dfb\u52a0\u5230 parent.items \u65f6\uff0c_submit_by_text \u4f1a\u56e0\u627e\u4e0d\u5230\u5143\u7d20\u800c\u5d29\u6e83\u3002\n\n \u573a\u666f\uff1a\n - Parent:

\u5143\u7d20\uff0c\u76f4\u63a5\u5b50\u5143\u7d20\u662f \n - Child: \u5143\u7d20\uff0c\u5b9e\u9645\u4e0a\u662f \u7684\u5b50\u5143\u7d20\n - _nest_nodes \u901a\u8fc7 _check_includes", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.47058823529411764, + "n_retrieved": 10 + }, + { + "repo": "oomol-lab/epub-translator", + "expected": "5)", + "got": "3)", + "got_raw": "3)\n self.assertEqual(text_segments[0].text, \"A\")\n self.assertEqual(text_segments[1].text, \"B\")\n self.assertEqual(text_segments[2].text, \"E\")\n\n def test_collect_inline_with_id(self):\n \"\"\"\u6d4b\u8bd5\u6536\u96c6\u5e26\u6709 ID \u7684\u5185\u8054\u5143\u7d20\"\"\"\n #

ABCDE

\n root = fromstring(\"

ABCDE

\")\n segments = list(search_text_segments(root))\n\n inline_segment = _get_first", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "collection_size_callback_factory(collection, 3))", + "got": "", + "got_raw": "\n\n\n# File: services/chunks.py\n \"\"\"\n Convert a list of documents into a dictionary from document id to list of document chunks.\n\n Args:\n documents: The list of documents to convert.\n chunk_token_size: The target size of each chunk in tokens, or None to use the default CHUNK_SIZE.\n\n Returns:\n A dictionary mapping each document id to a list of document chunks, each of which is a DocumentChunk object\n with text, metadata, and embedding attributes.\n \"\"\"\n # Initialize an empty dictionary of lists of chunks\n chunks: Dict[str, List[DocumentChunk]] = {}\n\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "len(query_results)", + "got": "1", + "got_raw": "1\n\ndef test_upsert_query_one(elasticsearch_datastore, document_chunk_one):\n await elasticsearch_datastore.delete(delete_all=True)\n res = await elasticsearch_datastore._upsert(document_chunk_one)\n assert res == list(document_chunk_one.keys())\n time.sleep(1)\n\n query = QueryWithEmbedding(\n query=\"Aenean\",\n top_k=1,\n embedding=sample_embedding(0), # type: ignore\n )\n query_results = await elasticsearch_datastore._query(queries=[query])\n\n assert len(query_results) == 1\n assert query_results[0", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "4", + "got": "4", + "got_raw": "4\n\ndef test_query(upsert, client) -> None:\n \"\"\"Confirm that query fixture has run successfully\"\"\"\n response = client.post(\n \"/query\",\n json={\n \"queries\": [\n {\n \"query\": \"What is a toad?\",\n \"filter\": {\"source\": \"file\"},\n },\n {\n \"query\": \"What is a frog?\",\n \"filter\": {\"source\": \"file\"},\n },\n ]\n },\n )\n assert response.status_code == 200\n assert len(response.json()['results']) == 2\n\ndef test_delete(upsert, client) ->", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "created_at.data_type", + "got": "created_at.type", + "got_raw": " created_at.type\n assert 0 == created_at.min_value\n assert 0 == created_at.max_value\n\n assert \"document_id\" in collection_info.payload_schema\n document_id = collection_info.payload_schema[\"document_id\"]\n\n assert PayloadSchemaType.STRING == document_id.type\n assert 0 == document_id.min_value\n assert 0 == document_id.max_value\n\n@pytest.mark.asyncio\nasync def test_datastore_creates_collection(\n qdrant_datastore,\n client,\n):\n collection_info = client.get_collection(collection_name=\"documents\")\n\n assert \"documents\" == collection_info.name\n assert", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.8571428571428571, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "\"first-doc-5\"", + "got": "\"first-doc-5\"", + "got_raw": " \"first-doc-5\"\n assert query_1_results[1].id == \"first-doc-6\"\n\n # NOTE: this is the incorrect behavior\n # assert query_1_results[0].id == \"first-doc-4\"\n # assert query_1_results[1].id == \"first-doc-5\"\n\n # NOTE: this is the incorrect behavior\n # assert query_1_results[0].id == \"first-doc-5\"\n # assert query_1_results[1].id == \"first-doc-6\"\n\n # NOTE: this is the incorrect", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "'mongodb'", + "got": "\"mongodb\"", + "got_raw": " \"mongodb\"\n assert os.environ[\"EMBEDDING_DIMENSION\"] == \"1536\"\n assert os.environ[\"EMBEDDING_MODEL\"] == \"text-embedding-3-small\"\n assert os.environ[\"MONGODB_COLLECTION\"] == \"Beyonce\"\n assert os.environ[\"MONGODB_DATABASE\"] == \"SQUAD\"\n assert os.environ[\"MONGODB_INDEX\"] == \"vector_index\"\n assert os.environ[\"MONGODB_URI\"] == \"mongodb+srv://:@chatgpt-retrieval-plugin.zeatahb.mongodb.net\"\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.7777777777777778, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "sum( len(v) for v in document_chunks.values() )", + "got": "2", + "got_raw": "2\n\n for chunk_list in document_chunks.values():\n for chunk in chunk_list:\n assert datastore._collection.count_documents(\n {\"id\": chunk.id}\n ) == 1\n\n@pytest.mark.asyncio\nasync def test_query(document_chunks: Dict[str, List[DocumentChunk]]):\n for datastore in get_chroma_datastore():\n await datastore.delete(delete_all=True)\n assert datastore._collection.count() == 0\n\n assert await datastore._upsert(document_chunks) == list(document_chunks.keys())\n\n assert datastore._collection.count() == 2\n\n query = QueryWithEmbedding(\n query=\"Lorem", + "exact_match": false, + "code_bleu": 0.03333333333333333, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "new_store.col.num_entities", + "got": "milvus_datastore.col.num_entities", + "got_raw": " milvus_datastore.col.num_entities\n assert 3 == new_store.col.num_entities\n assert res == list(another_in.keys())\n\n@pytest.mark.asyncio\nasync def test_query(milvus_datastore, document_chunk_one, document_chunk_two):\n await milvus_datastore.delete(delete_all=True)\n\n res = await milvus_datastore._upsert(document_chunk_one)\n assert res == list(document_chunk_one.keys())\n milvus_datastore.col.flush()\n assert 3 == milvus_datastore.col.num_entities\n\n res = await milvus_datastore._upsert(document", + "exact_match": false, + "code_bleu": 0.7598356856515925, + "edit_similarity": 0.7796610169491526, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "f\"{field} eq 'test''_{field}'\"", + "got": "assert (", + "got_raw": "<|fim_suffix|>\n assert (\n AzureSearchDataStore._translate_filter(\n DocumentMetadataFilter(**{field: needs_escaping_value})\n )\n == f\"{field} eq '{needs_escaping_value}'\"\n )\n\n assert (\n AzureSearchDataStore._translate_filter(\n DocumentMetadataFilter(start_date=\"2023-01-01T00:00:00Z\")\n )\n == f\"metadata.created_at ge '2023-01-01T00:00:00Z'\"\n )\n assert (\n AzureSearchDataStore._", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.10526315789473684, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "\"The quick brown fox jumped over the slimy green toad.\"", + "got": "\"The quick brown fox jumped over the slimy green toad.\"", + "got_raw": " \"The quick brown fox jumped over the slimy green toad.\"\n assert answers[1] == \"The big brown bear jumped over the lazy dog.\"\n\ndef test_query_with_filter(upsert, client) -> None:\n \"\"\"Test queries produce reasonable results,\n now that datastore contains embedded data which has been indexed\n \"\"\"\n question = \"What did the fox jump over?\"\n n_requested = 2 # top N results per query\n got_response = False\n retries = 5\n query_result = {}\n while retries and not got_response:\n response = client.post(\"/query\", json={'", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "openai/chatgpt-retrieval-plugin", + "expected": "\"doc:first-doc:chunk:first-doc-4\"", + "got": "4", + "got_raw": "4\n assert query_0_results[0].text == \"Lorem ipsum 4\"\n assert query_0_results[0].metadata.document_id == \"first-doc\"\n assert query_0_results[0].metadata.source == \"file\"\n assert query_0_results[0].metadata.source_id is None\n assert query_0_results[0].metadata.url is None\n assert query_0_results[0].metadata.created_at is None\n assert query_0_results[0].metadata.author is None\n\n assert query_1_results[0].id == 5\n assert query_1", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.058823529411764705, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "MyModel(enum_prop=2))", + "got": "2)", + "got_raw": "2)\n assert_model_decode_encode(MyModel, {\"enumProp\": 3}, 3)\n assert_model_decode_encode(MyModel, {\"enumProp\": 4}, 4)\n\n with pytest.raises(ValueError):\n assert_model_decode_encode(MyModel, {\"enumProp\": 5}, 5)\n\n def test_enum_prop_type_hint(self, MyModel):\n assert_model_property_type_hint(MyModel, \"enumProp\", Literal[1, 2, 3, 4])\n\n def test_enum_prop_type_hint_with_default(self, MyModel):\n assert_model_property_type_hint(MyModel, \"enumProp\", Literal", + "exact_match": false, + "code_bleu": 0.20203050891044216, + "edit_similarity": 0.17391304347826086, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "MyModel(date_prop=date_value))", + "got": "200, date_value)", + "got_raw": "200, date_value)\n\n def test_datetime(self, MyModel):\n datetime_value = datetime.datetime.now()\n json_data = {\"datetimeProp\": datetime_value.isoformat()}\n\n assert_model_decode_encode(MyModel, json_data, 200, datetime_value)\n\n def test_time(self, MyModel):\n time_value = datetime.time.now()\n json_data = {\"timeProp\": time_value.isoformat()}\n\n assert_model_decode_encode(MyModel, json_data, 200, time_value)\n\n def test_uuid(self, MyModel):\n uuid_value = uuid.uuid4()\n json_data =", + "exact_match": false, + "code_bleu": 0.2702118882866216, + "edit_similarity": 0.4782608695652174, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "KeyError)", + "got": "ValidationError):", + "got_raw": "ValidationError):\n MyModel()\n\n with pytest.raises(ValidationError):\n DerivedModel()\n\n def test_required_present(self, MyModel, DerivedModel):\n\n instance = MyModel(string_prop=\"abc\")\n assert_model_decode_encode(instance, MyModel)\n\n instance = DerivedModel(string_prop=\"abc\")\n assert_model_decode_encode(instance, DerivedModel)\n\n def test_optional_present(self, MyModel, DerivedModel):\n\n instance = MyModel(string_prop=\"abc\", int_prop=123)\n assert_model_decode_encode(instance, MyModel)\n\n instance = DerivedModel(string_prop=\"abc\", int_prop=123)\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.46153846153846156, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "DerivedModel(req1=\"a\", req2=\"b\", req3=\"c\", opt=\"d\"))", + "got": "assert_model_property_type_hint(", + "got_raw": "<|fim_suffix|>\n assert_model_property_type_hint(\n DerivedModel,\n \"req1\",\n \"str\",\n )\n assert_model_property_type_hint(\n DerivedModel,\n \"req2\",\n \"str\",\n )\n assert_model_property_type_hint(\n DerivedModel,\n \"opt\",\n \"str\",\n )\n assert_model_property_type_hint(\n DerivedModel,\n \"opt2\",\n \"str\",\n )\n assert_model_property_type_hint(\n DerivedModel,\n \"opt3\",\n \"str\",\n )\n assert_model_property_type_hint(\n DerivedModel,\n \"opt4\",\n ", + "exact_match": false, + "code_bleu": 0.05655631220123905, + "edit_similarity": 0.23809523809523808, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "\"MyEnum\")", + "got": "optional_type)", + "got_raw": " optional_type)\n\n def test_decode_encode(self, MyModel, MyModelWithRequired):\n assert_model_decode_encode(MyModel, \"enum_prop\", \"MyEnum\")\n assert_model_decode_encode(MyModelWithRequired, \"enum_prop\", \"MyEnum\")\n\nclass TestIntEnumClass:\n\n def test_type_hints(self, MyModel, MyModelWithRequired):\n optional_type = \"MyEnum | Unset\"\n assert_model_property_type_hint(MyModel,\"enum_prop\", optional_type)\n\n assert_model_property_type_hint(MyModelWithRequired, \"enum_prop\", optional_type)\n\n def test_decode_encode(self, MyModel", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.17391304347826086, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "\"int | Unset\")", + "got": "\"int | Unset\")", + "got_raw": " \"int | Unset\")\n assert_model_property_type_hint(MyModel, \"float_prop\", \"float | Unset\")\n assert_model_property_type_hint(MyModel, \"decimal_prop\", \"Decimal | Unset\")\n\n assert_model_property_type_hint(MyModel, \"date_prop\", \"datetime.date | Unset\")\n assert_model_property_type_hint(MyModel, \"datetime_prop\", \"datetime.datetime | Unset\")\n assert_model_property_type_hint(MyModel, \"time_prop\", \"datetime.time | Unset\")\n assert_model_property_type_hint(MyModel, \"uuid_prop\", \"uuid.UUID | Unset\")\n\n assert_model_property", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "ModelWithPrefixItems(array_prop=[SimpleObject(name=\"a\"), \"b\"]))", + "got": "assert_model_property_type_hint(ModelWithPrefixItems, \"prefix_items\", \"List[str]\")", + "got_raw": "<|fim_suffix|>\n assert_model_property_type_hint(ModelWithPrefixItems, \"prefix_items\", \"List[str]\")\n\n assert_model_decode_encode(ModelWithPrefixItems, SimpleObject, \"prefix_items\")\n\n def test_prefix_items_with_nullable(self, ModelWithPrefixItems, SimpleObject):\n\n assert_model_property_type_hint(ModelWithPrefixItems, \"prefix_items\", \"List[str] | None\")\n\n assert_model_decode_encode(ModelWithPrefixItems, SimpleObject, \"prefix_items\", nullable=True)\n\n def test_prefix_items_with_default(self, ModelWithPrefixItems, SimpleObject):\n\n assert_model_property_type_hint(ModelWithPrefixItems, \"prefix", + "exact_match": false, + "code_bleu": 0.10082472791870334, + "edit_similarity": 0.3586206896551724, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "MyModel( boolean_prop=True, string_prop=\"a\", number_prop=1.5, int_prop=2, any_object_prop=AnyObject(boolean_prop=False), null_prop=None, any_prop=\"e\", ))", + "got": "assert_model_property_type_hint(MyModel, \"stringProp\", str)", + "got_raw": "<|fim_suffix|>\n assert_model_property_type_hint(MyModel, \"stringProp\", str)\n assert_model_property_type_hint(MyModel, \"numberProp\", float)\n assert_model_property_type_hint(MyModel, \"intProp\", int)\n assert_model_property_type_hint(MyModel, \"anyObjectProp\", AnyObject)\n assert_model_property_type_hint(MyModel, \"nullProp\", None)\n assert_model_property_type_hint(MyModel, \"anyProp\", str)\n assert_model_property_type_hint(MyModel, \"anyProp2\", str)\n assert_model_property_type_hint(MyModel, \"anyProp3\", str)\n assert_model", + "exact_match": false, + "code_bleu": 0.04563316893377868, + "edit_similarity": 0.22641509433962265, + "n_retrieved": 10 + }, + { + "repo": "openapi-generators/openapi-python-client", + "expected": "\"list[Any] | Unset\")", + "got": "\"List[Any]\")", + "got_raw": " \"List[Any]\")\n assert_model_property_type_hint(ModelWithArrayOfInts, \"array_prop\", \"List[int]\")\n assert_model_property_type_hint(ModelWithArrayOfObjects, \"array_prop\", \"List[MyModel]\")\n\n def test_decoding(self, ModelWithArrayOfAny, ModelWithArrayOfInts, ModelWithArrayOfObjects):\n\n assert_model_decode_encode(ModelWithArrayOfAny, \"array_prop\", \"List[Any]\")\n assert_model_decode_encode(ModelWithArrayOfInts, \"array_prop\", \"List[int]\")\n assert_model_decode_encode(ModelWithArrayOfObjects, \"array_prop\", \"List[", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.6875, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "d(text=\"Status Bar\").wait(timeout=5))", + "got": "d.watcher.running())", + "got_raw": " d.watcher.running())\n d.watcher.start()\n self.assertTrue(d.watcher.running())\n d(text=\"Status Bar\").click()\n self.assertFalse(d.watcher.running())\n\n d.watcher.remove(\"N\")\n d.press(\"back\")\n d.press(\"back\")\n\n d(text=\"App\").click()\n d.watcher(\"N\").when('Notification').click()\n d.watcher.run()\n self.assertTrue(d.watcher.running())\n d.press(\"back\")\n d.press(\"back\")\n self.assertFalse(d.watcher.running())\n\n d.watcher(\"N\").when('Notification').click()\n d.watcher", + "exact_match": false, + "code_bleu": 0.14342069282273692, + "edit_similarity": 0.3157894736842105, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "True", + "got": "True", + "got_raw": " True\n sess(text=\"App\").click()\n assert sess.running() is False\n\n assert sess.running() is False\n\n with pytest.raises(SessionBrokenError):\n sess(text=\"App\").click()\n\n assert sess.running() is False\n\n dev.app_stop(package_name)\n assert package_name not in dev.app_list()\n assert package_name not in dev.app_list_running()\n\n dev.app_stop_all()\n assert package_name not in dev.app_list()\n assert package_name not in dev.app_list_running()\n\n dev.app_clear(package_name)\n assert package_name not in dev.app_list()\n assert package_name not in", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "0", + "got": "0", + "got_raw": "0\n\n d.xpath(\"//*[@text='Media']\").click()\n time.sleep(1)\n assert len(d.xpath(\"//*[@text='Media']\").all()) == 1\n\n d.xpath(\"//*[@text='Media']\").click()\n time.sleep(1)\n assert len(d.xpath(\"//*[@text='Media']\").all()) == 0\n\n d.xpath(\"//*[@text='Media']\").click()\n time.sleep(1)\n assert len(d.xpath(\"//*[@text='Media']\").all()) == 1\n\n d.xpath(\"//*[@text='Media']\").click()\n time.sleep(1)\n assert len(d.xpath(\"//*[@text='Media']\").all()) == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "\"hello world\")", + "got": "", + "got_raw": " # type: ignore\n \"hello world\", clear=True, fallback=True)\n\ndef test_send_keys_fallback_does_not_hide_keyboard_with_custom_ime():\n \"\"\"Test that send_keys fallback to set_text does not hide keyboard with custom IME\"\"\"\n mock_input = MockInputMethodMixIn()\n \n # Mock the _must_broadcast to raise AdbBroadcastError for input text\n def failing_must_broadcast(action, extras=None):\n if action == \"ADB_KEYBOARD_INPUT_TEXT\":\n raise AdbBroadcastError(\"Simulated failure for input text\")\n # Should not reach here (keyboard hide) in fallback mode\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "True", + "got": "1", + "got_raw": "1\n\n dev.settings['xpath_debug'] = False\n\n assert dev.settings['xpath_debug'] == 0\n\n dev.settings['xpath_debug'] = 1\n\n assert dev.settings['xpath_debug'] == 1\n\n dev.settings['xpath_debug'] = 2\n\n assert dev.settings['xpath_debug'] == 2\n\n dev.settings['xpath_debug'] = 3\n\n assert dev.settings['xpath_debug'] == 3\n\n dev.settings['xpath_debug'] = 4\n\n assert dev.settings['xpath_debug'] == 4\n\n dev.settings['xpath_debug'] = 5\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "None", + "got": "None", + "got_raw": " None\n d.toast.show(\"hello world\")\n assert d.toast.get_message(0) == \"hello world\"\n d.toast.reset()\n assert d.toast.get_message(0) is None\n\n d.toast.show(\"hello world\", 2)\n assert d.toast.get_message(0) == \"hello world\"\n time.sleep(3)\n assert d.toast.get_message(0) is None\n\n d.toast.show(\"hello world\", 0.5)\n assert d.toast.get_message(0) == \"hello world\"\n time.sleep(0.5)\n assert d.toast.get_message(0)", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "(193, 321, 3)", + "got": "(193, 321, 3)", + "got_raw": " (193, 321, 3)\n\n # Base64\n\n im = u2image.imread(\"data:image/jpeg;base64,\" + u2image.pil2base64(Image.open(path_ae86)))\n\n assert im.shape == (193, 321, 3)\n\n # URL\n\n im = u2image.imread(\"https://www.baidu.com/img/bd_logo1.png\")\n\n assert im.shape == (258, 540, 3)\n\n # OpenCV\n\n im = u2image.imread(im_ae8", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "time_used", + "got": "", + "got_raw": "<|fim_suffix|>\n # \u6d4b\u8bd5\u540e\u5ef6\u8fdf\n start = time.time()\n dev.click(x, y)\n time_used = time.time() - start\n\n assert 0.5 < time_used < 1.5\n\n # \u6d4b\u8bd5\u540e\u5ef6\u8fdf\n start = time.time()\n dev.click(x, y)\n time_used = time.time() - start\n\n assert 0.5 < time_used < 1.5\n\n # \u6d4b\u8bd5\u540e\u5ef6\u8fdf\n start = time.time()\n dev.click(x, y)\n time_used = time.time() - start\n\n assert 0.5", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "\"3\"", + "got": "3", + "got_raw": "3\n\n app(text=\"Addition\").click()\n num1 = app(className=\"android.widget.EditText\", instance=0)\n num2 = app(className=\"android.widget.EditText\", instance=1)\n result = app(className=\"android.widget.EditText\", instance=2)\n \n num1.set_text(\"5\")\n assert num1.get_text() == \"5\"\n num1.clear_text()\n assert num1.get_text() == ''\n num1.set_text('1')\n \n num2.click()\n \n for chars in ('1', '123abcDEF +-*/_', '\u4f60\u597d\uff0c\u4e16\u754c!'):\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "2 + 3", + "got": "3", + "got_raw": "3\n d.implicitly_wait(10)\n assert d.implicitly_wait() == 10\n start = time.time()\n with self.assertRaises(u2.UiObjectNotFoundError):\n d(text=\"Sensors\").get_text()\n time_used = time.time() - start\n assert time_used >= 10\n assert time_used < 11\n d.implicitly_wait(2)\n assert d.implicitly_wait() == 2\n start = time.time()\n with self.assertRaises(u2.UiObjectNotFoundError):\n d(text=\"Sensors\").get_text()\n time_used = time.time", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "openatx/uiautomator2", + "expected": "None", + "got": "None", + "got_raw": " None\n\n d.app_start(\"com.github.uiautomator\")\n d.sleep(.2)\n\n assert get_app_process_pid(d) is not None\n\n d.app_stop(\"com.github.uiautomator\")\n d.sleep(.2)\n\n assert get_app_process_pid(d) is None\n\n d.app_start(\"com.github.uiautomator\")\n d.sleep(.2)\n\n assert get_app_process_pid(d) is not None\n\n d.app_stop(\"com.github.uiautomator\")\n d.sleep(.2)\n\n assert get_app_process_pid(d) is None\n\n d.app_start(\"com.github.u", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "orbingol/NURBS-Python", + "expected": "0", + "got": "1", + "got_raw": "1\n\ndef test_bspline_surface_remove_knot_kv_v(spline_surf):\n spline_surf.remove_knot(v=0.66, num_v=1)\n s = helpers.find_multiplicity(0.66, spline_surf.knotvector_v)\n\n assert 0.66 not in spline_surf.knotvector_v\n\n assert s == 1\n\ndef test_bspline_surface_remove_knot(spline_surf):\n spline_surf.remove_knot(u=0.66, v=0.66, num_u=1, num_v=1)\n s = helpers.find_multiplicity(0", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "orbingol/NURBS-Python", + "expected": "degree_new", + "got": "4", + "got_raw": "4\n assert spline_curve.ctrlpts_size == 6\n assert spline_curve.knotvector_size == 11\n assert spline_curve.delta == GEOMDL_DELTA\n\ndef test_bspline_curve2d_degree_elevate_ctrlpts(spline_curve):\n dops = 1\n degree_new = spline_curve.degree + dops\n operations.degree_operations(spline_curve, [dops])\n\n assert spline_curve.ctrlpts_size == 6\n assert spline_curve.ctrlpts[0] == [5.0, 5.0]\n assert spline_curve.ctrlpts[1] == [10", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "orbingol/NURBS-Python", + "expected": "TypeError)", + "got": "ZeroDivisionError):", + "got_raw": "ZeroDivisionError):\n linalg.vector_dot3([1, 2, 3], [1, 2, 0])\n\n assert linalg.vector_dot3([1, 2, 3], [1, 2, 3]) == 14\n\ndef test_vector_dot4():\n\n with pytest.raises(ZeroDivisionError):\n linalg.vector_dot4([1, 2, 3, 4], [1, 2, 3, 0])\n\n assert linalg.vector_dot4([1, 2, 3, 4], [1, 2,", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4827586206896552, + "n_retrieved": 10 + }, + { + "repo": "orbingol/NURBS-Python", + "expected": "2", + "got": "2", + "got_raw": "2\n\n assert spline_curve.degree == 3\n\n assert spline_curve.ctrlpts_size == 6\n\n assert spline_curve.ctrlpts_size_u == 6\n\n assert spline_curve.ctrlpts_size_v == 1\n\n assert spline_curve.ctrlpts_size_uv == 6\n\n assert spline_curve.ctrlpts_size_uv == 1\n\n assert spline_curve.ctrlpts_size_uv == 6\n\n assert spline_curve.ctrlpts_size_uv == 1\n\n assert spline_curve.ctrlpts_size_uv == 6\n\n assert spline_curve.ctrlpts_size_uv == 1\n\n assert spline_curve.ctrlpts_size_uv ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "orbingol/NURBS-Python", + "expected": "val", + "got": "0.33", + "got_raw": "0.33\n\n@mark.parametrize(\"params, idx, val\", [(dict(u=0.3, num_u=2), 4, 0.3), (dict(u=0.3, num_u=2), 6, 0.33)])\ndef test_bspline_surface_insert_knot_kv_u(spline_surf, params, idx, val):\n # Insert knot\n spline_surf.insert_knot(**params)\n\n assert spline_surf.knotvector_u[idx] == 0.33\n\n@mark.parametrize(\"params, idx, val\", [(dict(v=0.3, num", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "orbingol/NURBS-Python", + "expected": "c_weights", + "got": "assert PW == c_ctrlpts", + "got_raw": "<|fim_suffix|>\n assert PW == c_ctrlpts\n\n assert W == c_weights\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts\n\n assert PW == c_ctrlpts", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.25806451612903225, + "n_retrieved": 10 + }, + { + "repo": "oughtinc/ice", + "expected": "gold_paragraphs_df.columns", + "got": "gold_paragraphs_df.columns", + "got_raw": " gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert \"recall\" in gold_paragraphs_df.columns\n assert", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "oughtinc/ice", + "expected": "[0, 1, 2]", + "got": "0", + "got_raw": "0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10))) == 0\n assert summarize(list(range(10)))", + "exact_match": false, + "code_bleu": 0.08494336535733721, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "oughtinc/ice", + "expected": "0.99", + "got": "0.99", + "got_raw": "0.99\n assert resp[0][0].irrelevancy > 0.99\n assert resp[0][0].logical_agreement > 0.99\n assert resp[0][0].grammar_ref > 0.99\n assert resp[0][0].grammar_hyp > 0.99\n assert resp[0][0].semantic_relation > 0.99\n assert resp[0][0].nubia_score > 0.99\n\n sample = [\n Sample(\n left=[\"I can haz cheeseburger", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "oughtinc/ice", + "expected": "\"The proportion of children whose census status was recorded as moved or unknown did not differ significantly between the groups (P=0.71 and P=0.36, respectively).\"", + "got": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "got_raw": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0136986301369863, + "n_retrieved": 10 + }, + { + "repo": "oughtinc/ice", + "expected": "{\"things\": [1, 2, 3]}", + "got": "1", + "got_raw": "1\n assert to_json_value(MyDataClass([1, 2, 3])) == 1\n assert to_json_value(MyDataClass([1, 2, 3])) == 1\n assert to_json_value(MyDataClass([1, 2, 3])) == 1\n assert to_json_value(MyDataClass([1, 2, 3])) == 1\n assert to_json_value(MyDataClass([1, 2, 3])) == 1\n assert to_json_value(MyDataClass([1, 2, 3])) == 1\n", + "exact_match": false, + "code_bleu": 0.05405486886376005, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "oughtinc/ice", + "expected": "{\"name\": \"world\"}", + "got": "1", + "got_raw": "1\n\n f = F(f\"hello {name} {name}\")\n assert to_json_value(f) == {\n \"__fstring__\": [\n \"hello \",\n {\"source\": \"name\", \"value\": \"world\", \"formatted\": \"world\"},\n \" \",\n {\"source\": \"name\", \"value\": \"world\", \"formatted\": \"world\"},\n ]\n }\n\n assert summarize(to_json_value(f)) == 2\n\n f = F(f\"hello {name} {name} {name}\")\n assert to_json_value(f) == {\n \"__fstring__\": [\n \"hello \",\n", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "oughtinc/ice", + "expected": "\"Foo\"", + "got": "{\"__fstring__\": [{\"value\": {\"a\": \"Foo\"}}]}", + "got_raw": " {\"__fstring__\": [{\"value\": {\"a\": \"Foo\"}}]}\n\n\ndef test_to_json_value():\n assert to_json_value(1) == 1\n assert to_json_value(1.0) == 1.0\n assert to_json_value(\"foo\") == \"foo\"\n assert to_json_value(True) == True\n assert to_json_value(False) == False\n assert to_json_value(None) == None\n assert to_json_value([1, 2, 3]) == [1, 2, 3]\n assert to_json_value([1, 2,", + "exact_match": false, + "code_bleu": 0.08225964699966554, + "edit_similarity": 0.2127659574468085, + "n_retrieved": 10 + }, + { + "repo": "pajbot/pajbot", + "expected": "expected", + "got": "assert actual == expected", + "got_raw": "<|fim_suffix|>\n assert actual == expected\n\n\ndef test_empty() -> None:\n expected = [\"TEST: 1 2 3 4\"]\n actual = split_into_chunks_with_prefix([{\"prefix\": \"TEST:\", \"parts\": []}])\n\n assert actual == expected\n\n\ndef test_no_prefix() -> None:\n expected = [\"TEST: 1 2 3 4\"]\n actual = split_into_chunks_with_prefix([{\"parts\": [\"1\", \"2\", \"3\", \"4\"]}])\n\n assert actual == expected\n\n\ndef test_no_parts() -> None:\n expected = [\"TEST: 1 ", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.48484848484848486, + "n_retrieved": 10 + }, + { + "repo": "pajbot/pajbot", + "expected": "None", + "got": "", + "got_raw": " # noqa: F821\n\n\n# File: pajbot/managers/kvi.py\n return str(self.get())\n\n\nclass KVIManager(UserDict):\n def __init__(self) -> None:\n self.streamer = StreamHelper.get_streamer()\n super().__init__(self)\n\n def __getitem__(self, kvi_id: str) -> KVIData:\n return KVIData(self.streamer, kvi_id)\n\n\ndef parse_kvi_arguments(input_str: str) -> tuple[Optional[str], int]:\n amount = 1\n\n if not input_str:\n return None, amount\n\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pajbot/pajbot", + "expected": "ValueError)", + "got": "InvalidPointAmount):", + "got_raw": "InvalidPointAmount):\n parse_number_from_string(input_value)\n\n\ndef test_bad_conversions_empty_string() -> None:\n input_value = \"\"\n\n\n with pytest.raises(InvalidPointAmount):\n parse_number_from_string(input_value)\n\n\ndef test_bad_conversions_none() -> None:\n input_value = None\n\n\n with pytest.raises(InvalidPointAmount):\n parse_number_from_string(input_value)\n\n\ndef test_bad_conversions_float() -> None:\n input_value = 1.2\n\n\n with pytest.raises(InvalidPointAmount):\n parse_number_from_string(input_value)\n\n\ndef test_bad_conversions_int() -> None:\n input_value", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.25806451612903225, + "n_retrieved": 10 + }, + { + "repo": "pajbot/pajbot", + "expected": "clean_up_message(\" \")", + "got": "\"https://www.youtube.com/watch?v=12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456", + "got_raw": "<|fim_suffix|>\n \"https://www.youtube.com/watch?v=12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456", + "exact_match": false, + "code_bleu": 0.06468490584192432, + "edit_similarity": 0.011764705882352941, + "n_retrieved": 10 + }, + { + "repo": "pajbot/pajbot", + "expected": "ValueError)", + "got": "TooLongMessageException):", + "got_raw": "TooLongMessageException):\n split_into_chunks_with_prefix(\"a\" * 30, 30)\n\n # not possible to fit this into one message of 30 length\n\n with pytest.raises(TooLongMessageException):\n split_into_chunks_with_prefix(\"a\" * 30, 30)\n\n # not possible to fit this into one message of 30 length\n\n with pytest.raises(TooLongMessageException):\n split_into_chunks_with_prefix(\"a\" * 30, 30)\n\n # not possible to fit this into one message of 30 length\n\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.2777777777777778, + "n_retrieved": 10 + }, + { + "repo": "pajbot/pajbot", + "expected": "filter_message(\" forsen\")", + "got": "assert \" forsen\" == filter_message(\"!lastseen forsen\", \"forsen\")", + "got_raw": "<|fim_suffix|>\n assert \" forsen\" == filter_message(\"!lastseen forsen\", \"forsen\")\n assert \" forsen\" == filter_message(\"!lastseen @forsen\", \"forsen\")\n\n assert \" forsen\" == filter_message(\"!lastseen forsen2\", \"forsen\")\n assert \" forsen\" == filter_message(\"!lastseen @forsen2\", \"forsen\")\n\n assert \" forsen\" == filter_message(\"!lastseen forsen3\", \"forsen\")\n assert \" forsen\" == filter_message(\"!lastseen @forsen3\", \"", + "exact_match": false, + "code_bleu": 0.18850319022747347, + "edit_similarity": 0.5617977528089888, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\ndef test_syntax_error_folding(workspace):\n doc = Document(DOC_URI, workspace, SYNTAX_ERR)\n ranges = pyls_folding_range(doc)\n expected = [{'startLine': 1, 'endLine': 6},\n {'startLine': 2, 'endLine': 3},\n {'startLine': 5, 'endLine': 6},\n {'startLine': 8, 'endLine': 11},\n {'startLine': 12, 'endLine': 20},\n {'startLine': 13, 'endLine': ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "1", + "got": "1", + "got_raw": "1\n\ndef test_pydocstyle_no_docstring(config, workspace):\n doc = Document(DOC_URI, workspace, \"def hello():\\n\\tpass\")\n diags = pydocstyle_lint.pyls_lint(config, doc)\n assert diags[0]['message'] == 'D100: Missing docstring in public module'\n\n assert len(diags) == 1\n\ndef test_pydocstyle_docstring(config, workspace):\n doc = Document(DOC_URI, workspace, \"def hello():\\n\\t\\\"\\\"\\\"\\n\\tThis is a docstring\\n\\t\\\"\\\"\\\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "'flake8'", + "got": "'flake8'", + "got_raw": " 'flake8'\n assert unused_var['range']['start']['line'] == 1\n assert unused_var['range']['start']['character'] == 1\n assert unused_var['range']['end']['line'] == 1\n assert unused_var['range']['end']['character'] == 1\n assert unused_var['severity'] == lsp.DiagnosticSeverity.Warning\n\ndef test_flake8_saved(workspace):\n name, doc = temp_document(DOC, workspace)\n workspace.put_document(name, DOC)\n workspace.put_document(DOC_URI, DOC)\n diags = flake8_lint.pyls", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "3", + "got": "3", + "got_raw": "3\n assert refs[0]['range']['start']['line'] == 0\n assert refs[0]['range']['start']['character'] == 0\n assert refs[0]['range']['end']['line'] == 0\n assert refs[0]['range']['end']['character'] == 10\n assert refs[0]['uri'] == DOC1_URI\n\n assert refs[1]['range']['start']['line'] == 0\n assert refs[1]['range']['start']['character'] == 0\n assert refs[1]['range']['end']['line'] == 0\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "lsp.DiagnosticSeverity.Error", + "got": "1", + "got_raw": "1\n\ndef test_undefined_name_error_pyflakes(workspace):\n doc = Document(DOC_URI, workspace, DOC_UNDEFINED_NAME_ERR)\n diag = pyflakes_lint.pyls_lint(doc)[0]\n\n assert diag['message'] == 'name \\'a\\' is not defined'\n assert diag['range']['start'] == {'line': 0, 'character': 0}\n assert diag['severity'] == 1\n\ndef test_encoding_error_pyflakes(workspace):\n doc = Document(DOC_URI, workspace, DOC_ENCODING)\n diag = pyflakes_lint.pyls_lint(doc", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "[ mock.call(1), mock.call(2), mock.call(3), ])", + "got": "assert not obj.mock_calls", + "got_raw": "<|fim_suffix|>\n assert not obj.mock_calls\n\n call_m(1)\n call_m(2)\n call_m(3)\n assert not obj.mock_calls\n\n time.sleep(interval * 2)\n\n obj.assert_has_calls([mock.call(1), mock.call(2), mock.call(3)])\n\n\n@flaky\ndef test_debounce_keyed_by_none():\n interval = 0.1\n obj = mock.Mock()\n\n @_utils.debounce(0.1, keyed_by=None)\n def call_m():\n obj()\n\n assert not obj.mock_calls\n\n call_m()\n call_m()\n", + "exact_match": false, + "code_bleu": 0.05687751797310556, + "edit_similarity": 0.2535211267605634, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "'D100: Missing docstring in public module'", + "got": "'D100: Module name \"pydocstyle\" doesn\\'t conform to snake_case naming style'", + "got_raw": " 'D100: Module name \"pydocstyle\" doesn\\'t conform to snake_case naming style'\n assert diags[1]['message'] == 'D101: Missing docstring in public module'\n assert diags[2]['message'] == 'D102: Class name \"Hello\" doesn\\'t conform to CamelCase naming style'\n assert diags[3]['message'] == 'D103: Function name \"hello\" doesn\\'t conform to snake_case naming style'\n assert diags[4]['message'] == 'D104:", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.23728813559322035, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "doc.uri", + "got": "uris.from_fs_path(os.path.join(tmp_workspace.root_path, DOC_NAME))", + "got_raw": " uris.from_fs_path(os.path.join(tmp_workspace.root_path, DOC_NAME))\n assert changes[0]['edits'][0]['range']['start']['line'] == 0\n assert changes[0]['edits'][0]['range']['start']['character'] == 6\n assert changes[0]['edits'][0]['range']['end']['line'] == 0\n assert changes[0]['edits'][0]['range']['end']['character'] == 6\n assert changes[0]['edits'][0]['newText'] == 'ShouldBeRenamed'\n\n assert changes[1]['text", + "exact_match": false, + "code_bleu": 0.07223943354597204, + "edit_similarity": 0.0821917808219178, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "{'line': 0, 'character': 0}", + "got": "1", + "got_raw": "1\n assert unused_import['range']['end'] == 1\n assert unused_import['message'] == msg\n assert unused_import['severity'] == lsp.DiagnosticSeverity.Error\n\ndef test_pylint_syntax_error(config, workspace):\n with temp_document(DOC_SYNTAX_ERR, workspace) as doc:\n diags = pylint_lint.pyls_lint(config, doc, True)\n\n msg = 'SyntaxError: invalid syntax'\n syntax_error = [d for d in diags if d['message'] == msg][0]\n\n assert syntax_error['range']['start'] == 1\n ", + "exact_match": false, + "code_bleu": 0.05555555555555555, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "'datetime'", + "got": "assert completions[0]['insertText'] == 'datetime'", + "got_raw": "<|fim_suffix|>\n assert completions[0]['insertText'] == 'datetime'\n\n position = {'line': 2, 'character': 9}\n completions = pyls_rope_completions(config, doc, position)\n\n assert completions[0]['insertText'] == 'datetime'\n\n\ndef test_jedi_completion(config, workspace):\n document = 'import os\\nprint os.path.isabs(\"/tmp\")'\n doc = Document(DOC_URI, workspace, document)\n config.capabilities['textDocument'] = {\n 'completion': {'completionItem': {'snippetSupport': True}}}\n config.update({'", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.3389830508474576, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "'W191'", + "got": "191", + "got_raw": "191\n assert mod_import['range']['start']['line'] == 1\n assert mod_import['range']['start']['character'] == 0\n assert mod_import['range']['end']['line'] == 1\n assert mod_import['range']['end']['character'] == 1\n assert mod_import['severity'] == lsp.DiagnosticSeverity.Warning\n\n\ndef test_pycodestyle_with_args(workspace):\n doc = Document(DOC_URI, workspace, DOC)\n diags = pycodestyle_lint.pyls_lint(workspace, doc, flags=\"--ignore=E111,E1", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "None", + "got": "None", + "got_raw": " None\n\ndef test_get_document(pyls):\n pyls.workspace.put_document(DOC_URI, 'TEXT')\n assert pyls.workspace.get_document(DOC_URI).source == 'TEXT'\n assert pyls.workspace.get_document(DOC_URI).path == os.path.abspath(__file__)\n assert pyls.workspace.get_document(DOC_URI).uri == DOC_URI\n\ndef test_get_maybe_document(pyls):\n pyls.workspace.put_document(DOC_URI, 'TEXT')\n assert pyls.workspace.get_maybe_document(DOC_URI).source == 'TEXT'\n assert pyls.workspace.get_maybe_document(DOC_URI).", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "{ 'line': 0, 'character': 0, }", + "got": "{'line': 0, 'character': 0}", + "got_raw": " {'line': 0, 'character': 0}\n assert unused_import['severity'] == lsp.DiagnosticSeverity.Warning\n\ndef test_pylint_syntax_error(config, workspace):\n with temp_document(DOC_SYNTAX_ERR, workspace) as doc:\n diags = pylint_lint.pyls_lint(config, doc, True)\n\n msg = 'SyntaxError: invalid syntax'\n syntax_error = [d for d in diags if d['message'] == msg][0]\n\n assert syntax_error['range']['start'] == {'line': 0, 'character': 0}\n assert syntax_error['", + "exact_match": false, + "code_bleu": 0.8132418032488603, + "edit_similarity": 0.9473684210526315, + "n_retrieved": 10 + }, + { + "repo": "palantir/python-language-server", + "expected": "[ \"def hello(a, b):\\n\", \" print a, b\\n\" ]", + "got": "[", + "got_raw": " [\n \"def hello(a, b):\\n\",\n \" print a, b\\n\"\n ]\n\ndef test_document_multiline_edit_with_newline(workspace):\n old = [\n \"def hello(a, b):\\n\",\n \" print a\\n\",\n \" print b\\n\"\n ]\n doc = Document('file:///uri', workspace, u''.join(old))\n doc.apply_change({'text': u'print a, b\\n', 'range': {\n 'start': {'line': 1, 'character': 4},\n 'end': {'line': 2, 'character': ", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.047619047619047616, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "ValueError)", + "got": "ZeroDivisionError):", + "got_raw": "ZeroDivisionError):\n await _handle_exception(app, ZeroDivisionError())\n else:\n await _handle_exception(app, ZeroDivisionError())\n\n\n@pytest.mark.parametrize(\n \"version, expected\",\n [\n (\"1.0.0\", [1, 0, 0]),\n (\"1.0.0a1\", [1, 0, 0]),\n (\"1.0.0b1\", [1, 0, 0]),\n (\"1.0.0rc1\", [1, 0, 0]),\n (\"1.0.0rc2\", [1,", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4666666666666667, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "\"/\"", + "got": "", + "got_raw": " # noqa: E712\n assert request.method == # noqa: E712\n assert request.url == # noqa: E712\n assert request.headers[\"X-Bob\"] == # noqa: E712\n assert request.args.get(\"a\") == # noqa: E712\n assert await request.get_data() == # noqa: E712\n assert (await request.form)[\"name\"] == # noqa: E712\n assert (await request.get_json())[\"key\"] == # noqa: E71", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "205", + "got": "205", + "got_raw": "205\n\ndef test_abort_with_response_with_headers() -> None:\n with pytest.raises(HTTPException) as exc_info:\n abort(Response(\"Message\", 205, [(\"X-Test\", \"Test\")], True))\n\n assert exc_info.value.get_response().status_code == 205\n assert exc_info.value.get_response().headers[\"X-Test\"] == \"Test\"\n\ndef test_abort_with_response_with_headers_and_body() -> None:\n with pytest.raises(HTTPException) as exc_info:\n abort(Response(\"Message\", 205, [(\"X-Test\", \"Test\")], True),", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "500", + "got": "500", + "got_raw": "500\n assert response.data == b\"Unique error\\nTraceback (most recent call last):\\n File\"\n\n assert b\"Exception: Unique error\" in response.data\n assert b\"Traceback (most recent call last):\" in response.data\n assert b\" File\" in response.data\n assert b\" File\" in response.data\n assert b\" File\" in response.data\n assert b\" File\" in response.data\n assert b\" File\" in response.data\n assert b\" File\" in response.data\n assert b\" File", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "b\"43\"", + "got": "43", + "got_raw": "43\n\n @app.get(\"/3\")\n async def index3() -> ResponseReturnValue:\n return await stream_template_string(\"{{ config }}\", config=44)\n\n test_client = app.test_client()\n response = await test_client.get(\"/3\")\n\n assert (await response.data) == 44\n\n @app.get(\"/4\")\n async def index4() -> ResponseReturnValue:\n return await stream_template_string(\"{{ config }}\", config=45)\n\n test_client = app.test_client()\n response = await test_client.get(\"/4\")\n\n assert (await response.data) == 45", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "await response.get_data(as_text=True)", + "got": "await response.get_json())", + "got_raw": "await response.get_json())\n\n response = await test_client.post(\"/\")\n\n assert \"POST\" == (await response.get_json())\n\n response = await test_client.open(\"/\", \"PUT\")\n\n assert \"PUT\" == (await response.get_json())\n\n response = await test_client.open(\"/\", \"DELETE\")\n\n assert \"DELETE\" == (await response.get_json())\n\n response = await test_client.open(\"/\", \"PATCH\")\n\n assert \"PATCH\" == (await response.get_json())\n\n response = await test_client.open(\"/\", \"OPTIONS\")\n\n assert \"OPTIONS\" == (await response.get_json())\n\n response = await test_client.open(\"/\", \"HEAD", + "exact_match": false, + "code_bleu": 0.2975800657105459, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "\"/path\"", + "got": "assert result == expected", + "got_raw": "<|fim_suffix|>\n assert result == expected\n\n assert path == \"/path\"\n assert query_string == b\"\"\n\n assert result.get(\"User-Agent\") == \"Quart\"\n assert result.get(\"host\") == \"localhost\"\n\n\ndef test_build_headers_path_and_query_string_headers_override() -> None:\n headers = Headers({\"User-Agent\": \"Quart\", \"host\": \"localhost\"})\n result, path, query_string = make_test_headers_path_and_query_string(\n Quart(__name__), \"/path\", headers\n )\n assert result == headers\n\n assert path == \"/path\"\n assert query_string == b\"\"\n\n", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.125, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "\"bar\"", + "got": "1", + "got_raw": "1\n assert request.method == \"GET\"\n assert websocket.method == \"GET\"\n\n await within_context()\n\n def test_copy_current_request_context(self) -> None:\n @copy_current_request_context\n async def within_context() -> None:\n\n assert g.foo == 1\n assert request.method == \"GET\"\n\n await within_context()\n\n def test_copy_current_websocket_context(self) -> None:\n @copy_current_websocket_context\n async def within_context() -> None:\n\n assert g.foo == 1\n assert websocket.method == \"GET\"\n\n await within_context()\n\n def test_has_app", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "interface.get_cookie_domain(app) or \"\"", + "got": "interface.get_cookie_domain(app) or \"\")", + "got_raw": "interface.get_cookie_domain(app) or \"\")\n assert cookie[\"max-age\"] == str(interface.get_expiration_time(app, session))\n assert cookie.value == interface.get_signing_serializer(app).dumps(dict(session))\n assert cookie[\"expires\"] == cookie[\"max-age\"]\n\n\n# File: src/quart/wrappers/base.py\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom hypercorn.typing import HTTPScope\nfrom werkzeug.datastructures import Headers\n\nfrom quart.app import Quart\nfrom quart.sessions import SecureCookieSession\nfrom quart.sessions import SecureCookieSessionInterface\nfrom quart.testing import no_op", + "exact_match": false, + "code_bleu": 0.8801117367933934, + "edit_similarity": 0.987012987012987, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "await body", + "got": "", + "got_raw": " # type: ignore\n assert b\"012\" == # type: ignore\n assert b\"012\" == # type: ignore\n\nasync def test_partial_body() -> None:\n body = Body(None, None)\n limit = 3\n semaphore = asyncio.Semaphore(limit)\n asyncio.ensure_future(_fill_body(body, semaphore, limit))\n\n assert b\"012\" == # type: ignore\n assert b\"012\" == # type: ignore\n assert b\"012\" == # type: ignore\n\nasync def test", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "b\"GET /\"", + "got": "", + "got_raw": " # type: ignore\n\nasync def test_index(app: Quart) -> None:\n test_client = app.test_client()\n response = await test_client.get(\"/\")\n assert response.status_code == 200\n assert await response.get_data(as_text=True) == \"\"\n\nasync def test_index_post(app: Quart) -> None:\n test_client = app.test_client()\n response = await test_client.post(\"/\")\n assert response.status_code == 200\n assert await response.get_data(as_text=True) == \"\"\n\nasync def test_resource(app: Quart) -> None:\n test_client = app.test_client()\n response =", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "b\"42\"", + "got": "42", + "got_raw": "42\n\nasync def test_simple_stream_with_context(app: Quart) -> None:\n @app.get(\"/\")\n async def index() -> ResponseReturnValue:\n return await stream_template_string(\"{{ config }}\", config=42) # type: ignore\n\n test_client = app.test_client()\n response = await test_client.get(\"/\")\n\n assert (await response.data) == 42\n\nasync def test_simple_stream_with_context_and_g(app: Quart) -> None:\n @app.get(\"/\")\n async def index() -> ResponseReturnValue:\n return await stream_template_string(\"{{ config }}\", config=42)", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.5714285714285714, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "result.output", + "got": "assert \"Werkzeug\" in result.output", + "got_raw": "<|fim_suffix|>\n assert \"Werkzeug\" in result.output\n\ndef test_version_command_with_quart_skip_dotenv() -> None:\n runner = CliRunner()\n result = runner.invoke(cli, [\"--version\"])\n\n assert \"Quart\" in result.output\n assert \"Werkzeug\" in result.output\n\ndef test_version_command_with_quart_skip_dotenv_and_quart_debug() -> None:\n runner = CliRunner()\n result = runner.invoke(cli, [\"--version\"])\n\n assert \"Quart\" in result.output\n assert \"Werkzeug\" in result.output\n\ndef test_version_command_with_quart", + "exact_match": false, + "code_bleu": 0.4111336169005197, + "edit_similarity": 0.5531914893617021, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "\"/bob/post\"", + "got": "", + "got_raw": " # type: ignore\n assert url_for(\"index_post\", _method=\"POST\", _external=True) == # type: ignore\n assert url_for(\"index_post\", _method=\"POST\", _external=True, _scheme=\"https\") == # type: ignore\n assert url_for(\"index_post\", _method=\"POST\", _external=True, _scheme=\"https\", _host=\"quart.com\") == # type: ignore\n assert url_for(\"index_post\", _method=\"POST\", _external=True, _scheme=\"https\", _host=\"quart.com\", _port=44", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "404", + "got": "404", + "got_raw": "404\n assert response.data == b\"Not Found\"\n\nasync def test_implicit_json(app: Quart) -> None:\n test_client = app.test_client()\n response = await test_client.post(\"/json/\", json={\"key\": \"value\"})\n\n assert response.status_code == 200\n assert response.json == {\"key\": \"value\"}\n\nasync def test_implicit_json_error(app: Quart) -> None:\n test_client = app.test_client()\n response = await test_client.post(\"/json/\", json={\"key\": \"value\"})\n\n assert response.status_code == 400\n assert response", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "\"bar FOO\"", + "got": "\"bar foo\"", + "got_raw": " \"bar foo\"\n\nasync def test_template_globals_with_context(app: Quart, blueprint: Blueprint) -> None:\n @blueprint.app_template_global()\n def blueprint_global(value: str) -> str:\n return value.upper()\n\n @app.template_global()\n def app_global(value: str) -> str:\n return value.lower()\n\n app.register_blueprint(blueprint)\n\n async with app.app_context():\n rendered = await render_template_string(\n \"{{ app_global('BAR') }} {{ blueprint_global('foo') }}\"\n )\n\n assert rendered == \"bar foo\"\n\nasync def test_template_globals_with_context_and_app_context(app", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "pallets/quart", + "expected": "[1, 2]", + "got": "assert startup", + "got_raw": "<|fim_suffix|>\n assert startup\n assert shutdown\n assert serving == [1]\n assert serving == [2]\n\n assert startup\n assert shutdown\n assert serving == [1]\n assert serving == [2]\n\n assert startup\n assert shutdown\n assert serving == [1]\n assert serving == [2]\n\n assert startup\n assert shutdown\n assert serving == [1]\n assert serving == [2]\n\n assert startup\n assert shutdown\n assert serving == [1]\n assert serving == [2]\n\n assert startup\n assert shutdown\n assert serving == [1]\n ", + "exact_match": false, + "code_bleu": 0.18072040072196896, + "edit_similarity": 0.1, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "ret)", + "got": "ret )", + "got_raw": " ret )\n self.assertEqual( ret, '{\"body\": \"some_body\"}' )\n mock_json_dumps.assert_called_once_with( body )\n\n @patch(\"json.dumps\")\n def test__serialize_request_with_params(self, mock_json_dumps):\n body = \"some_body\"\n params = {\"param1\": \"value1\", \"param2\": \"value2\"}\n ret = self.api._serialize_request(body, params)\n\n self.assertIsNotNone( ret )\n self.assertEqual( ret, '{\"body\": \"some_body\", \"params\": {\"param1\": \"value1\", \"param2\": \"value2\"}}", + "exact_match": false, + "code_bleu": 0.7071067811865476, + "edit_similarity": 0.8888888888888888, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "'test_4')", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n cluster.get_slot_name_on_primary(self.p.name, stream_node),\n 'foo')\n\n def test_stream_slot_processing(self):\n config = ClusterConfig(\n 1, {'slots': {'foo': {'type': 'logical', 'database': 'a', 'plugin': 'b'}, 'bar': {'type': 'physical'}}}, 1)\n stream_node = Member(0, 'test-2', 28, {\n 'state': PostgresqlState.RUNNING, 'conn_url': 'postgres://replicator:rep-pass@127.0.0.1:5", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "0)", + "got": "0)", + "got_raw": "0)\n self.assertEqual(self.r.single_user_mode({'input': 'CHECKPOINT'}, {'archive_mode': 'off'}), 1)\n\n @patch('psutil.Popen')\n def test_single_user_mode_with_error(self, subprocess_popen_mock):\n subprocess_popen_mock.return_value.wait.return_value = 1\n subprocess_popen_mock.return_value.communicate.return_value = ('', '')\n\n self.assertEqual(self.r.single_user_mode({'input': 'CHECKPOINT'}, {'archive_mode': 'on'}), 1)\n self.assertEqual(self.r.single_user_mode({'input': 'CHECKPOINT'}, {'archive_mode': 'off'}", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "20)", + "got": "20)", + "got_raw": "20)\n mock_sleep.assert_has_calls([mock.call(RETRY_WAIT)] * 20)\n\n @patch(\"logging.info\")\n @patch(\"logging.error\")\n def test__restore_backup__error(self, mock_log_error, mock_log_info):\n mock_create_op = self.api.create_recovery_operation\n mock_get_status = self.api.get_operation_status\n\n # failed fast restore\n mock_create_op.return_value = \"some_id\"\n mock_get_status.return_value = OperationStatus.FAILED\n\n self.assertEqual(\n _restore_backup(self.api, BARMAN_SERVER, BACKUP_ID, SSH_COMMAND,", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "1)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(device.writes[0], 'keepalive\\n')\n\n watchdog.deactivate()\n\n self.assertEqual(len(device.writes), 2)\n self.assertEqual(device.writes[1], 'deactivate\\n')\n\n watchdog = Watchdog({'ttl': 30, 'loop_wait': 10, 'watchdog': {'mode': 'required'}})\n watchdog.activate()\n\n self.assertEqual(len(mock_devices), 2)\n device = mock_devices[-1]\n self.assertTrue(device.open)\n\n self.assertEqual(device.timeout, 24)\n\n watchdog.keepalive()\n\n self.assertEqual(len(device.writes),", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "conn.on_role_change(\"primary\"))", + "got": "aws_request)", + "got_raw": "aws_request)\n\n @patch.object(MockIMDSFetcher, '_get_request', Mock(side_effect=Exception('foo')))\n def test_non_aws(self):\n conn = AWSConnection('test')\n\n self.assertFalse(aws_request)\n\n @patch.object(MockIMDSFetcher, '_get_request', Mock(side_effect=Exception('foo')))\n def test_non_aws(self):\n conn = AWSConnection('test')\n\n self.assertFalse(aws_request)\n\n @patch.object(MockIMDSFetcher, '_get_request', Mock(side_effect=Exception('foo')))\n def test_non_aws(self):\n conn = AWSConnection('test')\n\n", + "exact_match": false, + "code_bleu": 0.153509990260506, + "edit_similarity": 0.23255813953488372, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "expected)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(mock_logger.call_args[0][2], expected)\n\n @patch('patroni.postgresql.rewind.logger.info')\n def test__log_primary_history_no_primary(self, mock_logger):\n history = [[n, n, ''] for n in range(1, 10)]\n self.r._log_primary_history(history, 0)\n expected = '\\n'.join(['{0}\\t0/{0}\\t'.format(n) for n in range(1, 10)])\n\n self.assertEqual(mock_logger.call_args[0][1], 0)\n self.assertEqual(mock", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "0o123)", + "got": "0123)", + "got_raw": "0123)\n self.assertEqual(config.local_configuration['log']['level'], 'ERROR')\n self.assertEqual(config.local_configuration['log']['format'], '[\"message\", {\"levelname\": \"level\"}]')\n self.assertEqual(config.local_configuration['log']['loggers'], 'patroni.postmaster: WARNING, urllib3: DEBUG')\n self.assertEqual(config.local_configuration['log']['file_num'], 5)\n self.assertEqual(config.local_configuration['log']['loggers'], 'patroni.postmaster: WARNING, urllib3: DEBUG')\n self.assertEqual(config.local_configuration['log']['file_num'], 5)\n self.assertEqual(config.local", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.9090909090909091, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "[])", + "got": "1)", + "got_raw": "1)\n self.assertEqual(self.client.get_srv_record('_etcd-server._tcp.exception'), 0)\n self.assertEqual(self.client.get_srv_record('_etcd-server._tcp.blabla'), 1)\n\n def test_get_srv_record_exception(self):\n\n with self.assertRaises(DNSException):\n self.client.get_srv_record('_etcd-server._tcp.exception')\n\n def test_get_srv_record_no_records(self):\n\n with self.assertRaises(DNSException):\n self.client.get_srv_record('_etcd-server._tcp.blabla')\n\n def test_get_srv_record_no_records_exception(self):\n\n with self.assertRaises(DNSException):\n self", + "exact_match": false, + "code_bleu": 0.35818997727451396, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "SystemExit)", + "got": "InvalidAuthToken, PatroniEtcd3Client, 'etcd://localhost:2379')", + "got_raw": "InvalidAuthToken, PatroniEtcd3Client, 'etcd://localhost:2379')\n\n @patch('patroni.dcs.etcd3.Etcd3Client.authenticate', Mock(side_effect=AuthOldRevision))\n def test__init__(self):\n\n self.assertRaises(InvalidAuthToken, PatroniEtcd3Client, 'etcd://localhost:2379')\n\n @patch('patroni.dcs.etcd3.Etcd3Client.authenticate', Mock(side_effect=AuthOldRevision))\n def test__init__(self):\n\n self.assertRaises(InvalidAuthToken, PatroniEtcd3", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.0821917808219178, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "2)", + "got": "1)", + "got_raw": "1)\n\n def test_init(self):\n self.wale_restore.init_error = True\n\n self.assertEqual(self.wale_restore.init(), 1)\n\n def test_get_major_version(self):\n self.assertEqual(get_major_version('1.2.3'), 1)\n\n def test_get_major_version_invalid(self):\n self.assertEqual(get_major_version('1.2.3.4'), 1)\n\n def test_get_major_version_invalid2(self):\n self.assertEqual(get_major_version('1.2.3.4.5'), 1)\n\n def test_get_major_version_invalid3(self):\n self.assertEqual(get_major_version('", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "errors)", + "got": "errors)", + "got_raw": " errors)\n\n # Providing both is not fine\n c[\"tags\"][\"nofailover\"] = True\n errors = schema(c)\n\n self.assertIn(\"tags Multiple of ('nofailover', 'failover_priority') provided\", errors)\n\n def test_one_of2(self, _, __):\n c = copy.deepcopy(config)\n # Providing neither is fine\n del c[\"tags\"][\"clonefrom\"]\n errors = schema(c)\n\n self.assertNotIn(\"tags Multiple of ('nofailover', 'failover_priority') provided\", errors)\n\n # Providing both is not fine\n c[\"tags\"][\"", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "wd.disable())", + "got": "NullWatchdog().activate())", + "got_raw": "NullWatchdog().activate())\n self.assertIsNone(NullWatchdog().keepalive())\n\n def test_keepalive(self):\n wd = Watchdog({'ttl': 30, 'loop_wait': 10, 'watchdog': {'mode': 'keepalive'}})\n wd.impl.keepalive = Mock(side_effect=WatchdogError(''))\n self.assertTrue(wd.activate())\n self.assertIsNone(wd.keepalive())\n\n def test_keepalive_timeout(self):\n wd = Watchdog({'ttl': 30, 'loop_wait': 10, 'watchdog': {'mode': 'keepalive', '", + "exact_match": false, + "code_bleu": 0.3155984539112945, + "edit_similarity": 0.2564102564102564, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "cmd)", + "got": "cmd)", + "got_raw": " cmd)\n self.assertIn('--custom-option=custom-value', cmd)\n\n # Test with valid user options as list of strings\n self.p.config._config['rewind'] = ['--sync-method=fsync', '--custom-option=custom-value']\n self.assertTrue(self.r.pg_rewind(r))\n # Verify user options were added to command\n cmd = mock_call_with_cmd_capture.last_cmd\n\n self.assertIn('--sync-method=fsync', cmd)\n self.assertIn('--custom-option=custom-value', cmd)\n\n # Test with invalid user options as list of dicts\n self.p.config._config['rew", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "expected)", + "got": "expected)", + "got_raw": " expected)\n self.nesting -= 1\n\n def test_quorum_state_resolver(self):\n self.check_state_transitions('node0', 1, {'node0', 'node1', 'node2'}, 2, {'node1', 'node2'}, 2, {'node0'},\n 2, 'node0', [\n ('node0', 'node0', 1, {'node0', 'node1', 'node2'}),\n ('node0', 'node1', 1, {'node1', 'node2'}),\n ('node0', 'node2', 1, {'", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "5)", + "got": "5)", + "got_raw": "5)\n\n self.p._state = PostgresqlState.STARTED\n state['final_return'] = 0\n self.assertTrue(self.p.wait_for_startup())\n\n self.assertEqual(state['sleeps'], 5)\n\n self.p._state = PostgresqlState.STOPPING\n state['final_return'] = 1\n self.assertTrue(self.p.wait_for_startup())\n\n self.assertEqual(state['sleeps'], 5)\n\n self.p._state = PostgresqlState.STOPPED\n state['num_rejects'] = 10\n self.assertFalse(self.p.wait_for_startup())\n\n self.assertEqual(state['sleep", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "Real)", + "got": "Real)", + "got_raw": " Real)\n self.assertEqual(\n ret.__dict__,\n Real(version_from=validator['version_from'], version_till=validator['version_till'],\n min_val=validator['min_val'], max_val=validator['max_val'], unit=validator['unit']).__dict__,\n )\n\n # String\n validator = {\n 'type': 'String',\n 'version_from': 90300,\n 'version_till': None,\n 'min_val': 1,\n 'max_val': 100,\n 'unit': None,\n }\n ret = ValidatorFactory(validator)\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "'patroni')", + "got": "'patroni')", + "got_raw": " 'patroni')\n else:\n self.assertEqual(stderr_output.getvalue(), test_message + '\\n')\n\n def test_json_dict_format(self):\n config = {\n 'type': 'json',\n 'format': {\n 'asctime': '@timestamp',\n 'levelname': 'level',\n 'message': 'message'\n },\n 'static_fields': {\n 'app': 'patroni'\n }\n }\n\n test_message = 'test json logging in case of dict format'\n\n with patch('sys.stderr', StringIO()) as stderr_output:\n logger = PatroniLogger()\n logger.reload_config(config)\n\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "EtcdError)", + "got": "ETCDException, self.etcd.get_cluster)", + "got_raw": "ETCDException, self.etcd.get_cluster)\n\n def test_get_cluster_with_leader(self):\n self.etcd._base_path = '/service/batman5'\n cluster = self.etcd.get_cluster()\n self.assertEqual(cluster.leader, 'postgresql1')\n self.etcd._base_path = '/service/broken'\n self.assertRaises(ETCDException, self.etcd.get_cluster)\n\n def test_get_cluster_with_leader_and_failsafe(self):\n self.etcd._base_path = '/service/batman5'\n cluster = self.etcd.get_cluster()\n self.assertEqual(cluster.leader, 'postgresql1", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.2553191489361702, + "n_retrieved": 10 + }, + { + "repo": "patroni/patroni", + "expected": "'/tmp')", + "got": "'localhost')", + "got_raw": " 'localhost')\n self.assertEqual(parameters['citus.database'], 'citus')\n\n def test_adjust_postgres_gucs_with_citus(self):\n parameters = {'max_connections': 101,\n 'max_prepared_transactions': 0,\n 'shared_preload_libraries': 'foo , citus, bar '}\n self.c.adjust_postgres_gucs(parameters)\n self.assertEqual(parameters['max_prepared_transactions'], 202)\n self.assertEqual(parameters['shared_preload_libraries'], 'citus,foo,bar')\n self.assertEqual(parameters['wal_level'], 'logical')\n\n self.assertEqual(parameters['c", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.42105263157894735, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "original", + "got": "assert f.read_bytes() == b\"", + "got_raw": "<|fim_suffix|>\n assert f.read_bytes() == b\"#!/usr/bin/env python\\nprint('hello')\\n\"\n\ndef test_replace_shebang_with_shebang(tmp_path: Path):\n f = tmp_path / \"with_shebang\"\n original = b\"#!/usr/bin/env python\\nprint('hello')\\n\"\n f.write_bytes(original)\n _replace_shebang(f, b\"/new/python\")\n\n assert f.read_bytes() == original\n\ndef test_replace_shebang_with_shebang_and_newline(tmp_path: Path):\n f = tmp_path / \"with_shebang\"\n ", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.05714285714285714, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "1", + "got": "1", + "got_raw": "1\n assert \"Unable to find a resolution for pyyaml because of the following conflicts:\" in result.output\n assert \"pyyaml\" in result.output\n assert \"requests\" in result.output\n assert \"pyyaml\" in result.output\n assert \"requests\" in result.output\n assert \"pyyaml\" in result.output\n assert \"requests\" in result.output\n assert \"pyyaml\" in result.output\n assert \"requests\" in result.output\n assert \"pyyaml\" in result.output\n assert \"requests\" in result.output\n assert \"pyyaml\" in result.output\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "config", + "got": "assert project.config.get(\"python.use_pyenv\") is False", + "got_raw": "<|fim_suffix|>\n assert project.config.get(\"python.use_pyenv\") is False\n assert project.config.get(\"pypi.url\") == \"https://pypi.org/simple\"\n assert project.config.get(\"cache_dir\") == Path(project.root).joinpath(\".cache\", \"pdm\")\n\n assert project.config.get(\"python.use_pyenv\") is False\n assert project.config.get(\"pypi.url\") == \"https://pypi.org/simple\"\n assert project.config.get(\"cache_dir\") == Path(project.root).joinpath(\".cache\", \"pdm\")\n\n assert project.config.get(\"python.use_pyenv\") is False\n", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "is_quiet", + "got": "is_quiet", + "got_raw": " is_quiet\n\ndef test_lock_with_no_dependencies(pdm, project):\n result = pdm([\"lock\"], obj=project)\n assert result.exit_code == 0\n assert \"No dependencies to lock\" in result.stdout\n\ndef test_lock_with_no_dependencies_quiet(pdm, project):\n result = pdm([\"lock\", \"-q\"], obj=project)\n assert result.exit_code == 0\n assert \"No dependencies to lock\" in result.stdout\n\ndef test_lock_with_no_dependencies_quiet_with_no_output(pdm, project):\n result = pdm([\"lock\", \"-q\", \"--no-output\"],", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "scripts", + "got": "scripts", + "got_raw": " scripts\n\ndef test_process_env_includes_purelib_first(local_env):\n env = local_env.process_env\n purelib = local_env.get_paths()[\"purelib\"]\n path_entries = env[\"PYTHONPATH\"].split(os.pathsep)\n\n assert path_entries[0] == purelib\n\ndef test_process_env_includes_platlib_first(local_env):\n env = local_env.process_env\n platlib = local_env.get_paths()[\"platlib\"]\n path_entries = env[\"PYTHONPATH\"].split(os.pathsep)\n\n assert path_entries[0] == platlib\n\ndef test_process_env_includes_site_first", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "{\"default\", \"extra1\", \"extra2\", \"all\"}", + "got": "3", + "got_raw": "3\n assert resolution.collected_candidates == 3\n assert resolution.resolved_groups == 3\n assert resolution.resolved_candidates == 3\n assert resolution.resolved_dependencies == 3\n assert resolution.resolved_dependencies_by_group == {\n \"default\": 1,\n \"extra1\": 1,\n \"extra2\": 1,\n \"all\": 1,\n }\n assert resolution.resolved_dependencies_by_group[\"all\"] == 1\n assert resolution.resolved_dependencies_by_group[\"extra2\"] == 1\n assert resolution.resolved_dependencies_by_group[\"extra1\"] ==", + "exact_match": false, + "code_bleu": 0.05555555555555555, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "\"foo\"", + "got": "assert custom_source.password == \"bar\"", + "got_raw": "<|fim_suffix|>\n assert custom_source.password == \"bar\"\n\ndef test_configured_source_overwriting_with_pip(project):\n project.pyproject.settings[\"source\"] = [\n {\n \"name\": \"custom\",\n \"url\": \"https://custom.pypi.org/simple\",\n }\n ]\n project.global_config[\"pypi.custom.url\"] = \"https://extra.pypi.org/simple\"\n project.global_config[\"pypi.custom.verify_ssl\"] = False\n project.project_config[\"pypi.custom.username\"] = \"foo\"\n project.project_config[\"pypi.custom.password\"] = \"bar\"\n sources = project.sources\n ", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.13953488372093023, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "\"3.0.1\"", + "got": "3.0.1", + "got_raw": "3.0.1\n assert working_set[\"idna\"].version == 2.7\n\n pdm([\"add\", \"requests\"], obj=project, strict=True)\n pdm([\"sync\", \"--clean\"], obj=project, strict=True)\n assert \"foo\" in working_set\n assert \"requests\" in working_set\n\n assert working_set[\"chardet\"].version == 3.0.1\n assert working_set[\"idna\"].version == 2.7\n assert working_set[\"requests\"].version == \"2.25.1\"\n\ndef test_sync(project, working_set", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.8333333333333334, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "result.stderr", + "got": "result.stdout", + "got_raw": " result.stdout\n assert \"Run pdm fix --all to fix all\" in result.stdout\n assert \"Run pdm fix --all --no-interactive to fix all\" in result.stdout\n assert \"Run pdm fix --all --no-interactive --no-frozen-deps to fix all\" in result.stdout\n assert \"Run pdm fix --all --no-interactive --no-frozen-deps --no-frozen-requirements to fix all\" in result.stdout\n assert \"Run pdm fix --all --no-interactive --no-frozen-deps --no-frozen-requirements --no", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.7692307692307693, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "\"desc\"", + "got": "", + "got_raw": " # noqa: WPS437\n assert result.requires_python == \">=3.8\"\n\n # Check that the error is logged\n assert \"e1\" in caplog.text\n assert \"foo\" in caplog.text\n assert \"pyproject.toml\" in caplog.text\n\n # Check that the other fields are not populated\n assert result.description is None\n assert result.optional_dependencies is None\n assert result.requires_python is None\n assert result.name is None\n assert result.version is None\n\n\ndef test_read_pyproject_toml_metaconverter_error_uses_full_data_and", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "result", + "got": "assert str(Version(\"3.9.0\").complete(0, 2)) == \"3.0.2\"", + "got_raw": "<|fim_suffix|>\n assert str(Version(\"3.9.0\").complete(0, 2)) == \"3.0.2\"\n assert str(Version(\"3.9.0\").complete(0, 2, 3)) == \"3.0.2.3\"\n assert str(Version(\"3.9.0\").complete(0, 2, 3, 4)) == \"3.0.2.3.4\"\n assert str(Version(\"3.9.0\").complete(0, 2, 3, 4, 5)) == \"", + "exact_match": false, + "code_bleu": 0.057259987315337726, + "edit_similarity": 0.06666666666666667, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "Version(\"3.8.0\")", + "got": "3.8.0", + "got_raw": "3.8.0\n assert version == 3.8.*\n\n\ndef test_version_setitem_invalid():\n version = Version(\"3.8.*\")\n with pytest.raises(InvalidPyVersion):\n version[-1] = 10\n\n\ndef test_version_setitem_invalid2():\n version = Version(\"3.8.*\")\n with pytest.raises(InvalidPyVersion):\n version[-1] = 10\n\n\ndef test_version_setitem_invalid3():\n version = Version(\"3.8.*\")\n with pytest.raises(InvalidPyVersion):\n version[-1] = 10\n\n\ndef test", + "exact_match": false, + "code_bleu": 0.2849383821193472, + "edit_similarity": 0.47619047619047616, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "\"2019.3\"", + "got": "2019.3", + "got_raw": "2019.3\n assert project.get_locked_repository().candidates[\"pytz\"].version_specifier == \"~=2019.3\"\n\n\n# File: docs/usage/dependency.md\n## Dependency Overrides\n\nIf none of versions of a specific package doesn't meet all the constraints, the resolution will fail. In this case, you can tell the resolver to use a specific version of the package with dependency overrides.\n\nOverrides are a useful last resort for cases in which the user knows that a dependency is compatible with a newer version of a package than the package declares, but the package has not yet been updated to declare that", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8571428571428571, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "expected", + "got": "assert m.matches(env_spec) is expected", + "got_raw": "<|fim_suffix|>\n assert m.matches(env_spec) is expected\n\n\ndef test_match_env_spec_with_version():\n m = get_marker(\"python_version >= '3.7' and implementation_name == 'pypy'\")\n\n assert m.matches(EnvSpec.from_spec(\">=3.10\", \"linux\")) is False\n assert m.matches(EnvSpec.from_spec(\">=3.10\", \"linux\", python_version=\"3.7\")) is True\n assert m.matches(EnvSpec.from_spec(\">=3.10\", \"linux\", python_version=\"3.8\")) is False\n assert m.matches(", + "exact_match": false, + "code_bleu": 0.14113991930789777, + "edit_similarity": 0.34782608695652173, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "\"bar\"", + "got": "\"bar\", result.outputs", + "got_raw": " \"bar\", result.outputs\n\ndef test_load_plugins(pdm, mocker, core):\n mocker.patch.object(\n importlib_metadata,\n \"entry_points\",\n return_value=[make_entry_point(new_command), make_entry_point(add_new_config)],\n )\n core.init_parser()\n core.load_plugins()\n\n result = pdm([\"hello\"])\n assert result.output.strip() == \"Hello world\", result.outputs\n\n result = pdm([\"config\", \"foo\"])\n\n assert result.output.strip() == \"bar\", result.outputs\n\ndef test_load_plugins_with_global_project(pdm, mocker, core):\n mocker.patch.object(\n ", + "exact_match": true, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.38461538461538464, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "cache", + "got": "cache._cache", + "got_raw": " cache._cache\n assert cache._cache[\"3\"] == \"3.9.12\"\n\n do_use(project, \"3\", first=True)\n cache._read_cache()\n assert \"3\" in cache._cache\n assert cache._cache[\"3\"] == \"3.9.12\"\n\n do_use(project, \"3.10\", first=True)\n cache._read_cache()\n assert \"3.10\" in cache._cache\n assert cache._cache[\"3.10\"] == \"3.10.12\"\n\n do_use(project, \"3", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5882352941176471, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "list(case)", + "got": "def test_get_all_installable_python_versions(self) -> None:", + "got_raw": "<|fim_suffix|>\n def test_get_all_installable_python_versions(self) -> None:\n from pbs_installer._install import THIS_ARCH, THIS_PLATFORM\n\n arch = \"x86\" if THIS_ARCH == \"32\" else THIS_ARCH\n matches = get_all_installable_python_versions()\n assert len(matches) > 0\n assert any(k[:2] == (THIS_PLATFORM, arch) for k in matches)\n\n def test_get_requirement_from_override(self) -> None:\n assert get_requirement_from_override(\"foo\", \"1.2.3\") == \"foo==1.2.3", + "exact_match": false, + "code_bleu": 0.15619699684601276, + "edit_similarity": 0.17391304347826086, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "1", + "got": "1", + "got_raw": "1\n assert default_group[0].name == \"demo\"\n assert default_group[0].specifier == \"demo @ git+https://github.com/test-root/demo.git#egg=demo\"\n\n\n# File: src/pdm/cli/actions.py\nfrom __future__ import annotations\n\nimport contextlib\nimport dataclasses as dc\nimport json\nimport os\nimport sys\nimport textwrap\nfrom typing import TYPE_CHECKING, Any, Iterable, cast\n\nfrom resolvelib.resolvers import ResolutionImpossible, ResolutionTooDeep\n\nfrom pdm import termui\nfrom pdm.cli.filters import GroupSelection\nfrom pdm", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "\"2.7\"", + "got": "3.3", + "got_raw": "3.3\n assert locked_candidates[\"requests\"].version == \"2.25.1\"\n assert locked_candidates[\"urllib3\"].version == \"1.26.10\"\n assert locked_candidates[\"certifi\"].version == \"2022.12.7\"\n assert locked_candidates[\"chardet\"].version == \"4.0.0\"\n assert locked_candidates[\"idna\"].version == \"3.3\"\n assert locked_candidates[\"requests\"].version == \"2.25.1\"\n assert locked_candidates[\"urllib3\"].version == \"1.26", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "pdm-project/pdm", + "expected": "1", + "got": "1", + "got_raw": "1\n assert record[0].message.args[0] == \"Test warning\"\n\ndef test_deprecation_warning_with_stacklevel():\n with pytest.warns(PDMWarning) as record:\n utils.deprecation_warning(\"Test warning\", stacklevel=2, raise_since=\"99.99\")\n\n assert len(record) == 1\n assert record[0].message.args[0] == \"Test warning\"\n\ndef test_deprecation_warning_with_raise_since():\n with pytest.raises(PDMWarning) as record:\n utils.deprecation_warning(\"Test warning\", raise_since=\"99.99\")\n\n assert len", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "0", + "got": "0", + "got_raw": "0\n assert len(evidence) > 0\n\n assert \"useAutoSaveSettings\" in census\n assert \"useAutoSaveSettings\" in evidence\n\n def test_detects_pattern_anomalies(self, tmp_path):\n \"\"\"Census picks up pattern anomalies from file content.\"\"\"\n\n _write(\n tmp_path,\n \"src/tools/editor/main.ts\",\n (\"const settings = useAutoSaveSettings();\\n\"),\n )\n census, evidence = _build_census(tmp_path)\n\n assert len(census) > 0\n assert len(evidence) > 0\n\n assert \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "1", + "got": "1", + "got_raw": "1\n assert funcs[0][\"name\"] == \"greet\"\n assert funcs[0][\"params\"] == [\"name\"]\n assert funcs[0][\"body\"] == \"greeting = f\\\"Hello, {name}\\\"\"\n\n def test_simple_function_with_params(self, tmp_path):\n fp = _write_py(\n tmp_path,\n \"\"\"\\\n def greet(name, greeting=\"Hello\"):\n return greeting\n \"\"\",\n )\n funcs = extract_py_functions(fp)\n\n assert len(funcs) >= 1\n assert funcs[0][\"name\"] == \"greet\"\n assert funcs[0", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "0", + "got": "0", + "got_raw": "0\n\n\ndef test_detect_dead_exports_returns_entries_when_knip_available():\n \"\"\"Returns ([], 0) when Knip is not installed / returns None.\"\"\"\n with patch.object(exports_mod, \"detect_with_knip\", return_value=[{\"foo\": \"bar\"}]):\n entries, total = exports_mod.detect_dead_exports(Path(\"/tmp/fake\"))\n assert entries == [{\"foo\": \"bar\"}]\n\n assert total == 1\n\n\ndef test_detect_dead_exports_returns_entries_when_knip_available():\n \"\"\"Returns ([], 0) when Knip is not installed / returns None.\"\"\"\n with patch.object(exports_mod, \"detect", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def test_braces_tracking_no_match(self):\n \"\"\"Brace tracking returns None if no closing brace.\"\"\"\n lines = [\"if (x) {\\n\", \" return 1;\\n\"]\n\n assert find_balanced_end(lines, 0, track=\"braces\") is None\n\n def test_braces_tracking_no_match_no_braces(self):\n \"\"\"Brace tracking returns None if no closing brace and no braces.\"\"\"\n lines = [\"if (x) {\\n\", \" return 1;\\n\"]\n\n assert find_balanced_end(lines, 0, track=\"braces\") is None\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "0", + "got": "0", + "got_raw": "0\n\n def test_no_reexport_facades(self):\n entries, total = detect_reexport_facades({\n \"foo\": _make_graph_entry(),\n \"bar\": _make_graph_entry(),\n })\n assert entries == []\n\n assert total == 0\n\n def test_one_reexport_facades(self):\n entries, total = detect_reexport_facades({\n \"foo\": _make_graph_entry(),\n \"bar\": _make_graph_entry(),\n \"baz\": _make_graph_entry(),\n \"qux\": _make_graph_entry(),\n \"quux\": _make_graph_entry(),\n \"quuz\":", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "langs[1]", + "got": "langs[1]", + "got_raw": " langs[1]\n\ndef test_available_langs_returns_empty_list(monkeypatch):\n monkeypatch.setattr(\n registry_state, \"_registry\", {}\n )\n monkeypatch.setattr(lang_resolution_mod, \"load_all\", lambda: None)\n\n langs = lang_resolution_mod.available_langs()\n assert langs == []\n\ndef test_available_langs_returns_empty_list_when_no_langs(monkeypatch):\n monkeypatch.setattr(\n registry_state, \"_registry\", {}\n )\n monkeypatch.setattr(lang_resolution_mod, \"load_all\", lambda: None)\n\n langs = lang_resolution_mod.available_langs()\n assert langs == []\n\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "out", + "got": "out", + "got_raw": " out\n assert \"Would remove 2\" in out\n assert \" a.ts \u2192 foo, bar\" in out\n assert \" a.ts \u2192 foo, bar\" in out\n assert \" a.ts \u2192 5 lines\" in out\n assert \" a.ts \u2192 5 lines\" in out\n\n def test_skip_reasons(self, monkeypatch, capsys):\n monkeypatch.setattr(fix_apply_mod, \"rel\", lambda p: p)\n\n fixer = FixerConfig(\n label=\"unused imports\",\n detect=lambda: None", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "[]", + "got": "0", + "got_raw": "0\n assert total_areas == 0\n\n def test_no_patterns(self, tmp_path):\n \"\"\"No patterns in directory returns no anomalies.\"\"\"\n\n _write(tmp_path, \"file1.txt\", \"This is a file.\")\n _write(tmp_path, \"file2.txt\", \"This is another file.\")\n\n anomalies, total_areas = detect_pattern_anomalies(tmp_path)\n\n assert anomalies == 0\n assert total_areas == 0\n\n def test_no_patterns_in_files(self, tmp_path):\n \"\"\"No patterns in files returns no anomalies.\"\"\"\n\n _write(tmp_path, \"file1.txt\", \"This", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "cfg.extensions", + "got": "assert \"go\" in cfg.extensions", + "got_raw": "<|fim_suffix|>\n assert \"go\" in cfg.extensions\n assert \"go.mod\" in cfg.extensions\n assert \"go.sum\" in cfg.extensions\n assert \"go.mod\" not in cfg.extensions\n assert \"go.sum\" not in cfg.extensions\n assert \"go.mod\" not in cfg.extensions\n assert \"go.sum\" not in cfg.extensions\n assert \"go.mod\" not in cfg.extensions\n assert \"go.sum\" not in cfg.extensions\n assert \"go.mod\" not in cfg.extensions\n assert \"go.sum\" not in cfg.extensions\n assert \"go.mod\" not in cfg", + "exact_match": false, + "code_bleu": 0.4111336169005197, + "edit_similarity": 0.6511627906976745, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "[]", + "got": "0", + "got_raw": "0\n\ndef test_ignores_connected_module_with_imports(tmp_path):\n module = (\n \"import a\\n\\n\"\n \"def a():\\n return b()\\n\\n\"\n \"def b():\\n return c()\\n\\n\"\n \"def c():\\n return d()\\n\\n\"\n \"def d():\\n return e()\\n\\n\"\n \"def e():\\n return f()\\n\\n\"\n \"def f():\\n return g()\\n\\n\"\n \"def g():\\n return h()\\n\\n\"\n \"def h", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "5", + "got": "1, \"line\"", + "got_raw": "1, \"line\"\n assert fn.loc == 1, \"col\"\n assert fn.loc == 1, \"end_line\"\n assert fn.loc == 1, \"end_col\"\n\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n assert fn.params == [\"name\"]\n", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "e", + "got": "assert \"lines_removed\" in e", + "got_raw": "<|fim_suffix|>\n assert \"lines_removed\" in e\n assert \"removed\" in e\n assert \"removed\" in e[\"removed\"]\n assert \"removed\" in e[\"removed\"][0]\n assert \"removed\" in e[\"removed\"][0][0]\n assert \"removed\" in e[\"removed\"][0][0][0]\n assert \"removed\" in e[\"removed\"][0][0][0][0]\n assert \"removed\" in e[\"removed\"][0][0][0][0][0]\n assert \"removed\" in e[\"removed\"][0][0][0][0][0", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.07142857142857142, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "\"\"", + "got": "", + "got_raw": " # noqa: SIM115\n\n\ndef test_print_agent_plan_single_step(capsys):\n \"\"\"Single step prints numbered list.\"\"\"\n print_agent_plan([\"Step 1\"])\n\n assert capsys.readouterr().out == # noqa: SIM115\n\n\ndef test_print_agent_plan_multiple_steps(capsys):\n \"\"\"Multiple steps prints numbered list.\"\"\"\n print_agent_plan([\"Step 1\", \"Step 2\"])\n\n assert capsys.readouterr().out == # noqa: SIM115\n\n\ndef test_print_agent_plan_next_command(capsys):\n \"\"\"Next command is printed in dimmed text", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "5", + "got": "5", + "got_raw": "5\n assert len(anomalies) == 1\n assert anomalies[0].area == \"area1\"\n assert anomalies[0].pattern == \"fragmentation\"\n\n def test_fragmentation_not_detected_with_not_enough_areas(self, tmp_path):\n \"\"\"Fragmentation is not flagged when an area uses < threshold competing patterns.\"\"\"\n\n # Create 3 areas (need >= 5 for meaningful analysis)\n # Each area is a distinct 2-level path: area{i}/sub/\n # Area 1 uses two competing tool_settings patterns (fragmentation)\n _write(\n tmp_path,\n \"editor", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "ids", + "got": "assert \"any_type\" in ids", + "got_raw": "<|fim_suffix|>\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n assert \"any_type\" in ids\n", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "1", + "got": "0", + "got_raw": "0\n assert graph[a_key][\"import_count\"] == 1\n assert graph[b_key][\"importer_count\"] == 1\n assert graph[b_key][\"import_count\"] == 1\n\n def test_graph_has_imports(self, tmp_path):\n \"\"\"Graph entries should have imports field.\"\"\"\n\n _write(tmp_path, \"a.ts\", \"export const a = 1;\\n\")\n _write(tmp_path, \"b.ts\", \"import { a } from './a';\\nexport const b = a;\\n\")\n\n graph = deps_detector_mod.build_dep_graph(tmp_path)\n a_key =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "0", + "got": "0", + "got_raw": "0\n assert total == 0\n\n def test_small_interface_flagged(self, tmp_path):\n \"\"\"Interface with <=14 props is flagged.\"\"\"\n\n props = \"\\n\".join(f\" prop{i}: string;\" for i in range(15))\n _write(tmp_path, \"Component.tsx\", (f\"interface ButtonProps {{\\n{props}\\n}}\\n\"))\n entries, total = detect_prop_interface_bloat(tmp_path)\n\n assert len(entries) == 1\n assert total == 1\n\n def test_large_interface_not_flagged(self, tmp_path):\n \"\"\"Interface", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "2", + "got": "2", + "got_raw": "2\n assert len(entries) == 2\n assert entries[0][\"kind\"] == \"file\"\n assert entries[0][\"import_count\"] == 1\n assert entries[0][\"importers\"] == {str(init)}\n assert entries[0][\"imports\"] == {str(sub)}\n assert entries[0][\"importer_count\"] == 1\n assert entries[1][\"kind\"] == \"directory\"\n assert entries[1][\"import_count\"] == 1\n assert entries[1][\"importers\"] == {str(sub)}\n assert entries[1][\"imports\"] == {str(init", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "err", + "got": "assert \" - Are the skipped items truly unfixable, or could the fixer be improved?\" in err", + "got_raw": "<|fim_suffix|>\n assert \" - Are the skipped items truly unfixable, or could the fixer be improved?\" in err\n assert \" - Ready to run without --dry-run? (git push first!)\" in err\n\n def test_resolve_with_attestation(self, monkeypatch, capsys):\n monkeypatch.setattr(resolve_mod, \"state_path\", lambda a: \"/tmp/fake.json\")\n\n class FakeArgs:\n status = \"fixed\"\n note = \"done\"\n attest = \"I have actually not gaming\"\n patterns = [\"test::a.ts::foo\"]\n lang = None\n", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.06451612903225806, + "n_retrieved": 10 + }, + { + "repo": "peteromallet/desloppify", + "expected": "4", + "got": "4", + "got_raw": "4\n\n def test_2_space_indent(self):\n lines = [\n \"def foo():\",\n \" x = 1\",\n \" if True:\",\n \" pass\",\n ]\n\n assert complexity_mod._detect_indent_unit(lines) == 2\n\n def test_1_space_indent(self):\n lines = [\n \"def foo():\",\n \" x = 1\",\n \" if True:\",\n \" pass\",\n ]\n\n assert complexity_mod._detect_indent_unit(lines) == 1\n\n def test_0_space_indent(self):\n lines = [\n \"def foo():", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "a.baz[0])", + "got": "a.baz[0])", + "got_raw": " a.baz[0])\n assert_almost_equal(4.4, a.baz[1])\n assert_almost_equal(.1, a.baz[2])\n\n # the dtype can be specified as a string\n a = torecarray(t, dtype='S4, i2, f4')\n assert isinstance(a, np.ndarray)\n assert isinstance(a.foo, np.ndarray)\n assert isinstance(a.bar, np.ndarray)\n assert isinstance(a.baz, np.ndarray)\n eq_('apples', a.foo[0])\n eq_('oranges', a.foo[1])\n eq_('pe", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "StopIteration)", + "got": "StopIteration):", + "got_raw": "StopIteration):\n next(table)\n\ndef test_head_raises_stop_iteration_for_empty_table_with_n():\n table = iter(head([], n=1))\n\n with pytest.raises(StopIteration):\n next(table)\n\ndef test_head_raises_stop_iteration_for_empty_table_with_n_and_nrows():\n table = iter(head([], n=1, nrows=1))\n\n with pytest.raises(StopIteration):\n next(table)\n\ndef test_head_raises_stop_iteration_for_empty_table_with_nrows():\n table = iter(head([], nrows=1))\n\n with pytest.raises(StopIteration):\n next(table)\n\ndef test_head_raises_stop_iteration_for_empty_table_with_n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.9655172413793104, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "a['baz'][2])", + "got": "a['baz'][2])", + "got_raw": " a['baz'][2])\n\n def test_toarray_dtype():\n t = [('foo', 'bar', 'baz'),\n ('apples', 1, 2.5),\n ('oranges', 3, 4.4),\n ('pears', 7, .1)]\n a = toarray(t, dtype='S4, i2, f4')\n assert isinstance(a, np.ndarray)\n assert isinstance(a['foo'], np.ndarray)\n assert isinstance(a['bar'], np.ndarray)\n assert isinstance(a['baz'], np.ndarray)\n eq_('apples', a['foo'][", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "('spong', 'bar')", + "got": "('spong', 'bar')", + "got_raw": " ('spong', 'bar')\n\n result = rename(table, 'foo', 'foofoo', 'bar', 'barbar')\n assert fieldnames(result) == ('foofoo', 'barbar')\n\n result = rename(table, 'foo', 'foofoo', 'bar', 'barbar', 'baz', 'quux')\n assert fieldnames(result) == ('foofoo', 'barbar', 'baz', 'quux')\n\n result = rename(table, 'foo', 'foofoo', 'bar', 'barbar', 'baz', 'quux',\n 'quux', 'quux')\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "'a'", + "got": "1", + "got_raw": "1\n assert result[0]['bar'] == 'a'\n assert result[1]['foo'] == 2\n assert result[1]['bar'] == 'b'\n assert result[2]['foo'] == 2\n assert result[2]['bar'] == 'c'\n\n f.close()\n unlink(f.name)\n\ndef test_tojson_2():\n table = (('foo', 'bar'),\n ('a', 1),\n ('b', 2),\n ('c', 2))\n f = NamedTemporaryFile(delete=False, mode='r')\n tojson(table, f.name", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "ValueError)", + "got": "StopIteration):", + "got_raw": "StopIteration):\n next(fromxlsx(f.name, 'Sheet1'))\n\ndef test_toxlsx_add_sheet_no_match(xlsx_test_table):\n tbl = xlsx_test_table\n f = NamedTemporaryFile(delete=True, suffix='.xlsx')\n f.close()\n\n toxlsx(tbl, f.name, 'Sheet1', mode=\"add\")\n\n with pytest.raises(StopIteration):\n next(fromxlsx(f.name, 'Sheet1'))\n\ndef test_toxlsx_add_sheet_no_match_with_non_str_header(xlsx_test_table):\n tbl = xlsx_test_table\n f = NamedTemporaryFile(delete=True, suffix='.xlsx')\n f.close", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.23076923076923078, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "second_row2", + "got": "{'n': 1, 'foo': 100, 'bar': 200}", + "got_raw": " {'n': 1, 'foo': 100, 'bar': 200}\n assert second_row2 == {'n': 2, 'foo': 200, 'bar': 400}\n\n # third pass\n it3 = iter(actual)\n third_row1 = next(it3)\n third_row2 = next(it3)\n assert third_row1 == {'n': 3, 'foo': 300, 'bar': 600}\n assert third_row2 == {'n': 4, 'foo': 400,", + "exact_match": false, + "code_bleu": 0.08032276872815308, + "edit_similarity": 0.13953488372093023, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "('foofoo', 'barbar')", + "got": "result = setheader(table, ['foo', 'bar'])", + "got_raw": "<|fim_suffix|>\n result = setheader(table, ['foo', 'bar'])\n assert fieldnames(result) == ('foo', 'bar')\n\n result = setheader(table, ['foo', 'bar', 'baz'])\n assert fieldnames(result) == ('foo', 'bar', 'baz')\n\n result = setheader(table, ['bar', 'foo', 'baz'])\n assert fieldnames(result) == ('bar', 'foo', 'baz')\n\n result = setheader(table, ['foo', 'baz', 'bar'])\n assert fieldnames(result) == ('foo', 'baz', 'bar')\n\n result = set", + "exact_match": false, + "code_bleu": 0.1235622127262679, + "edit_similarity": 0.45901639344262296, + "n_retrieved": 10 + }, + { + "repo": "petl-developers/petl", + "expected": "'n'", + "got": "'n'", + "got_raw": " 'n'\n assert col.type == sqlalchemy.Integer\n assert col.nullable is True\n assert col.default is None\n assert col.server_default is None\n assert col.onupdate is None\n assert col.primary_key is False\n assert col.foreign_keys == ()\n assert col.indexes == ()\n assert col.unique is False\n assert col.comment is None\n assert col.info == {}\n assert col.key is None\n assert col.table is None\n assert col.type.length is None\n assert col.type.precision is None\n assert col.type.scale is None\n assert col.type.as", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "BASE_DIR", + "got": "BASE_DIR", + "got_raw": " BASE_DIR\n\n assert command.has_side_effects is False\n\n assert command.filter is None\n\n assert command.check is None\n\n assert command.run_files is None\n\n assert command.git_enabled is False\n\n assert command._get_sources is None\n\n assert command._get_covered_files is None\n\n assert command._run is None\n\n assert command._get_sources is None\n\n assert command._get_covered_files is None\n\n assert command._run is None\n\n assert command._get_sources is None\n\n assert command._get_covered_files is None\n\n assert command._run is None\n\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "test_components", + "got": "1", + "got_raw": "1\n assert manifest.get_component(\"black\") is not None\n assert manifest.get_component(\"flake8\") is None\n\n assert get_source_from_good_builder(manifest) == test_source\n\ndef test_build_external() -> None:\n test_source = Source(includes=[\"/hoge/fuga\"])\n test_components: List[ComponentBase] = [Black(source=test_source)]\n\n manifest = _build_external(CURRENT_FILE, test_components, CURRENT_FILE)\n assert isinstance(manifest, Manifest)\n\n assert manifest.components == 1\n assert manifest.get_component(\"black\") is not None\n assert manifest.get_component(\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "GitRepositoryNotFoundError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n git_utils.check_tracked(test_file)\n\n\ndef test_check_tracked_with_git() -> None:\n with tempfile.TemporaryDirectory() as d:\n tempdir = pathlib.Path(d)\n\n test_file = tempdir / \"hoge\"\n test_file.touch()\n\n with git.Repo.init(tempdir):\n assert git_utils.check_tracked(test_file)\n\n\ndef test_check_tracked_with_git_and_ignore() -> None:\n with tempfile.TemporaryDirectory() as d:\n tempdir = pathlib.Path(d)\n\n test_file = tempdir / \"hoge\"\n test_file.touch()\n\n with git.Re", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4583333333333333, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "logging_utils._PROCESS_STDERR", + "got": "assert len(args) == 1", + "got_raw": "<|fim_suffix|>\n assert len(args) == 1\n assert args[0][0] == pysen_root_logger\n assert args[0][1] == logging.INFO\n assert isinstance(args[0][2], logging.StreamHandler)\n\n # test that the logger is not propagated\n assert pysen_root_logger.propagate is False\n\n # test that the handler is not propagated\n assert process_output_root_logger.propagate is False\n\n # test that the handler is not added to the root logger\n assert pysen_root_logger.handlers == [args[0][2]]\n\n # test that the handler is", + "exact_match": false, + "code_bleu": 0.13485111859503685, + "edit_similarity": 0.04, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "{\"op1\": [\"node2\"], \"op3\": [\"node2\"]}", + "got": "{\"op2\": [\"node1\"], \"op3\": [\"node2\"]}", + "got_raw": " {\"op2\": [\"node1\"], \"op3\": [\"node2\"]}\n\n targets = m.get_targets(argparse.Namespace(enable=[\"node1\"], disable=None))\n\n assert targets == {\"op1\": [\"node1\", \"node2\"], \"op2\": [\"node1\"], \"op3\": [\"node2\"]}\n\n targets = m.get_targets(argparse.Namespace(enable=[\"node1\"], disable=[\"node1\"]))\n\n assert targets == {\"op2\": [\"node1\"], \"op3\": [\"node2\"]}\n\n targets = m.get_targets(argparse.Namespace(enable=[\"node1\"], disable=[\"node2\"]))\n\n", + "exact_match": false, + "code_bleu": 0.6591844162499148, + "edit_similarity": 0.9444444444444444, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "settings_dir", + "got": "pathlib.Path(\"s_dir\")", + "got_raw": " pathlib.Path(\"s_dir\")\n assert fname == \"fname\"\n assert data == SettingFile(\n {\n \"node1\": {\n \"op1\": 2.0,\n \"op2\": 10.0,\n },\n \"node2\": {\n \"op1\": 3.0,\n \"op3\": -1.0,\n },\n }\n )\n\n return dump\n\ndef test_get_targets() -> None:\n components = [\n FakeComponent(\n \"node1\",\n {\"op1\": (2, Operation.MUL), \"op2\": (10,", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.42424242424242425, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "1", + "got": "0", + "got_raw": "0\n assert all(x.suffix == \".py\" for x in resolved)\n\n resolved = _resolve(BASE_DIR, \"**/*.py\", setting)\n assert len(resolved) > 0\n assert all(x.suffix == \".py\" for x in resolved)\n\n resolved = _resolve(BASE_DIR, \"**/*.py\", setting)\n assert len(resolved) > 0\n assert all(x.suffix == \".py\" for x in resolved)\n\n resolved = _resolve(BASE_DIR, \"**/*.py\", setting)\n assert len(resolved) > 0\n assert all(x.suffix == \".py", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "TypeError)", + "got": "InvalidPluginError):", + "got_raw": "InvalidPluginError):\n load_plugin(function=\"fakes.plugin::create2\")\n\n\n with pytest.raises(InvalidPluginError):\n load_plugin(script=BASE_DIR / \"fakes/plugin2.py\")\n\n\ndef test_load_from_file() -> None:\n plugin = load_from_file(BASE_DIR / \"fakes/plugin.py\")\n assert isinstance(plugin, PluginBase)\n assert isinstance(plugin, PluginBase)\n assert_plugin_entry_point(plugin, \"plugin\")\n\n\ndef test_load_from_module() -> None:\n plugin = load_from_module(\"fakes.plugin\")\n assert isinstance(plugin, PluginBase)\n assert_plugin_entry_point(plugin, \"plugin\")\n\n\n", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "4", + "got": "2", + "got_raw": "2\n assert module_settings[\"example_simple_package.cmds\"] == MypySetting(\n ignore_errors=True, follow_imports=MypyFollowImports.SILENT\n )\n assert module_settings[\"example_simple_package.tools\"] == MypySetting(\n ignore_errors=True, follow_imports=MypyFollowImports.SILENT\n )\n\ndef test_load_manifest_with_config() -> None:\n manifest = pyproject.load_manifest(BASE_DIR / \"fakes/configs/example.toml\")\n assert manifest is not None\n assert isinstance(manifest, Manifest)\n components = manifest.components\n assert {x.name for x in components", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "expected", + "got": "def test_from_str(self) -> None:", + "got_raw": "<|fim_suffix|>\n def test_from_str(self) -> None:\n assert VersionRepresentation.from_str(\"1.2.3\") == VersionRepresentation(\n major=1, minor=2, patch=3\n )\n assert VersionRepresentation.from_str(\"1.2\") == VersionRepresentation(\n major=1, minor=2, patch=None\n )\n assert VersionRepresentation.from_str(\"1\") == VersionRepresentation(\n major=1, minor=0, patch=None\n )\n assert VersionRepresentation.from_str(\"1.2.3a1\") == VersionRepresentation(\n major=1, minor=2,", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.15, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "1", + "got": "1", + "got_raw": "1\n assert target[0].name == \"* 10\"\n\n target = m.get_target(\n \"op3\", paths, options, argparse.Namespace(enable=None, disable=None)\n )\n\n assert len(target) == 1\n assert target[0].name == \"* -1\"\n\n target = m.get_target(\n \"op99\", paths, options, argparse.Namespace(enable=None, disable=None)\n )\n\n assert len(target) == 0\n\n\ndef test_get_targets(fake_components: FixtureType) -> None:\n base_dir = pathlib.Path(\"/foo/bar\")\n settings_dir = pathlib.Path(\"/", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "{\"hoge.fuga\": mypy.MypySetting.strict()}", + "got": "{", + "got_raw": " {\n \"hoge.fuga\": mypy.MypySetting.strict(),\n }\n\ndef test_export() -> None:\n m = mypy.Mypy(\n setting=mypy.MypySetting.very_strict(),\n module_settings={\"hoge.fuga\": mypy.MypySetting.strict()},\n )\n section_name, entries = m.export_settings(BASE_DIR, SettingFile())\n assert section_name == \"mypy\"\n assert entries == {\n \"python_version\": \"3.8\",\n \"mypy_path\": [\n \"pysen\",\n \"pysen/ext/mypy_wrapper.py\",\n \"p", + "exact_match": false, + "code_bleu": 0.05405486886376005, + "edit_similarity": 0.04878048780487805, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "2", + "got": "2", + "got_raw": "2\n assert factory.has_error()\n out = factory.format_summary()\n assert \"foo\" in out\n assert \"bar\" in out\n assert \"error\" in out\n assert \"hoge.py\" in out\n assert \"1:2\" in out\n assert \"128\" in out\n\n out = factory.format_error_summary()\n assert \"foo\" in out\n assert \"bar\" in out\n assert \"error\" in out\n assert \"hoge.py\" in out\n assert \"1:2\" in out\n assert \"128\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "0", + "got": "0", + "got_raw": "0\n assert patch.call_args[0][0] == expected_cmds\n\ndef test_export_settings(reporter: Reporter) -> None:\n m = mypy.Mypy(\n mypy_targets=[mypy.MypyTarget([pathlib.Path(\"/bar\"), pathlib.Path(\"baz\")])],\n setting=mypy.MypySetting.strict(),\n module_settings={\n \"foo\": mypy.MypySetting.strict(),\n \"bar\": mypy.MypySetting.strict(),\n },\n )\n files: DefaultDict[str, SettingFile] = collections.defaultdict(SettingFile)\n m.export_settings(PathContext(BASE_DIR, BASE_DIR", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "\"plugin\")", + "got": "nfig = PluginConfig(", + "got_raw": "<|fim_suffix|>nfig = PluginConfig(\n location=\"tool.pysen.plugin.hoge\", config={\"enable_c1\": True}\n )\n components = plugin.load(CURRENT_FILE, config, root)\n assert len(components) == 1\n assert components[0].name == f\"{entry_point}_component1\"\n\n plugin = load_from_module(\"fakes.plugin\")\n assert isinstance(plugin, PluginBase)\n assert_plugin_entry_point(plugin, \"create\")\n\n plugin = load_from_module(\"fakes.plugin.py\")\n assert isinstance(plugin, PluginBase)\n\n assert_plugin_entry_point(plugin, \"create\")\n\n\ndef test_load", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.3448275862068966, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "\"%(message)s\"", + "got": "", + "got_raw": " # type: ignore\n \"%(log_color)s%(message)s\"\n\n handler3 = _get_handler(level, False, True)\n assert isinstance(handler3, logging.StreamHandler)\n assert isinstance(handler3.formatter, colorlog.ColoredFormatter)\n assert (\n handler3.formatter.log_colors == logging_utils._logging_output_colors\n )\n\n handler4 = _get_handler(level, False, False)\n assert isinstance(handler4, logging.StreamHandler)\n assert handler4.formatter is not None\n\n assert handler4.formatter._fmt == # type: ignore\n \"%(message)s\"\n\n def", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "{\"setup.cfg\"}", + "got": "{\"mypy\", \"mypy-foo\", \"mypy-bar.baz\"}", + "got_raw": " {\"mypy\", \"mypy-foo\", \"mypy-bar.baz\"}\n assert files[\"mypy\"].get_section(\"mypy\") == {\n \"mypy_path\": [\"hoge\"],\n \"plugins\": [\"foo/bar\"],\n \"disallow_any_decorated\": False,\n \"exclude\": \"excluded\",\n \"ignore_missing_imports\": False,\n \"warn_redundant_casts\": True,\n \"follow_imports\": \"error\",\n \"_pysen_convert_abspath\": True,\n }\n assert files[\"mypy-foo\"].get_section(\"mypy\") == {\n", + "exact_match": false, + "code_bleu": 0.20556680845025982, + "edit_similarity": 0.24489795918367346, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "0", + "got": "0", + "got_raw": "0\n assert black_compat.use_parentheses\n\n assert black_compat.ensure_newline_before_comments is None\n\n\ndef test_check_version_compatibility() -> None:\n setting = IsortSetting(\n force_single_line=False,\n include_trailing_comma=False,\n multi_line_output=1,\n ensure_newline_before_comments=False,\n force_grid_wrap=1,\n use_parentheses=False,\n )\n with mock.patch(\n \"pysen.ext.isort_wrapper._get_isort_version\",\n return_value=VersionRepresentation(4, 0, 0),\n ):\n with pytest.raises(Incompatible", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "f\"{entry_point}_component1\"", + "got": "nfig = PluginConfig(", + "got_raw": "<|fim_suffix|>nfig = PluginConfig(\n location=\"tool.pysen.plugin.hoge\", config={\"enable_c1\": True}\n )\n components = plugin.load(CURRENT_FILE, config, root)\n assert len(components) == 1\n\n assert components[0].name == \"hoge\"\n assert components[0].enable_c1 is True\n\n def test_load_from_module(self) -> None:\n plugin = load_from_module(\"plugin\")\n assert isinstance(plugin, PluginBase)\n\n def test_load_from_file(self) -> None:\n plugin = load_from_file(CURRENT_FILE)\n assert isinstance(plugin,", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.2127659574468085, + "n_retrieved": 10 + }, + { + "repo": "pfnet/pysen", + "expected": "6", + "got": "6", + "got_raw": "6\n assert err2.message == \"error: Missing return statement [return]\"\n\ndef test_mypy_invalid_format() -> None:\n err = parse_error_lines(mypy_invalid_format)\n\n assert err[0].file_path == Path(\"/home/user/pysen/__init__.py\")\n assert err[0].start_line == 72\n assert err[0].end_line == 72\n assert err[0].start_column == 0\n assert err[0].message == \"error: unused 'type: ignore' comment\"\n\ndef test_parse_file_path() -> None:\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "(\"127.0.0.2\", 0)", + "got": "", + "got_raw": " # type: ignore\n assert scope[\"scheme\"] == \"https\"\n assert scope[\"headers\"] == [\n (b\"host\", b\"example.com\"),\n (b\"x-forwarded-for\", b\"127.0.0.1\"),\n (b\"x-forwarded-for\", b\"127.0.0.2\"),\n (b\"x-forwarded-proto\", b\"http\"),\n (b\"x-forwarded-proto\", b\"https\"),\n ]\n\n\n@pytest.mark.asyncio\nasync def test_proxy_fix_modern() -> None:\n mock = AsyncMock()\n app = ProxyFixMiddleware", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "trio.BrokenResourceError)", + "got": "TimeoutError):", + "got_raw": "TimeoutError):\n await client_stream.send_all(b\"GET\")\n\n@pytest.mark.trio\nasync def test_http1_keep_alive_post_request(client_stream: ClientStream) -> None:\n await client_stream.send_all(b\"GET\")\n await trio.sleep(2 * KEEP_ALIVE_TIMEOUT)\n await client_stream.send_all(b\"GET\")\n await trio.sleep(2 * KEEP_ALIVE_TIMEOUT)\n # Only way to confirm closure is to invoke an error\n\n with pytest.raises(TimeoutError):\n await client_stream.send_all(b\"GET\")\n\n@pytest.mark.trio\nasync def test_http1_keep_alive_post_request_with_body(client", + "exact_match": false, + "code_bleu": 0.3388507513536918, + "edit_similarity": 0.5128205128205128, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "[]", + "got": "[", + "got_raw": " [\n (b\":status\", b\"200\"),\n (b\"content-type\", b\"text/html; charset=utf-8\"),\n (b\"server\", b\"hypercorn/3.0.0\"),\n (b\"date\", b\"Thu, 01 Jan 1970 00:00:00 GMT\"),\n (b\"content-length\", b\"0\"),\n ]\n\n\ndef test_handshake_accept_http1() -> None:\n handshake = Handshake([(b\"sec-websocket-version\", b\"13\")], \"1.1\")\n status_code,", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "expected", + "got": "50", + "got_raw": "50\n assert logger.error_logger.getEffectiveLevel() == expected\n\n\ndef test_loglevel_option_invalid() -> None:\n config = Config()\n with pytest.raises(ValueError):\n config.loglevel = \"invalid\"\n\n\ndef test_loglevel_option_none() -> None:\n config = Config()\n config.loglevel = None\n logger = Logger(config)\n\n assert logger.error_logger.getEffectiveLevel() == logging.INFO\n\n\ndef test_loglevel_option_invalid_none() -> None:\n config = Config()\n with pytest.raises(ValueError):\n config.loglevel = \"invalid\"\n\n\ndef test_loglevel_option_invalid_none_default() -> None:\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "[ wsproto.events.AcceptConnection( extra_headers=[ (b\"date\", b\"Thu, 01 Jan 1970 01:23:20 GMT\"), (b\"server\", b\"hypercorn-h11\"), ] ) ]", + "got": "", + "got_raw": " # type: ignore\n [\n wsproto.events.Headers(headers=[(\"Sec-WebSocket-Accept\", \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\")]),\n wsproto.events.Headers(headers=[(\"Upgrade\", \"websocket\"), (\"Connection\", \"Upgrade\")]),\n wsproto.events.Headers(headers=[(\"Sec-WebSocket-Version\", \"13\")]),\n wsproto.events.Headers(headers=[(\"Sec-WebSocket-Extensions\", \"permessage-deflate\")]),\n wsproto.events.Headers(headers=[(\"Sec-WebSocket-Extensions\", \"per", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "ASGIWebsocketState.CONNECTED", + "got": "tream.app_send(cast(WebsocketAcceptEvent, {\"type\": \"websocket.accept\"}))", + "got_raw": "<|fim_suffix|>tream.app_send(cast(WebsocketAcceptEvent, {\"type\": \"websocket.accept\"}))\n await stream.app_send(cast(WebsocketAcceptEvent, {\"type\": \"websocket.accept\"}))\n await stream.app_send(cast(WebsocketAcceptEvent, {\"type\": \"websocket.accept\"}))\n await stream.app_send(cast(WebsocketAcceptEvent, {\"type\": \"websocket.accept\"}))\n await stream.app_send(cast(WebsocketAcceptEvent, {\"type\": \"websocket.accept\"}))\n await stream.app_send(cast(WebsocketAcceptEvent, {\"type\": \"websocket.accept\"}))\n await stream.app_send(cast(Web", + "exact_match": false, + "code_bleu": 0.08225964699966554, + "edit_similarity": 0.22, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "[", + "got": "", + "got_raw": " # type: ignore\n [call(h11.Response(headers=[(b\"host\", b\"hypercorn\"), (b\"connection\", b\"close\"), (b\"x-special\", b\"value\")]))]\n\n@pytest.mark.asyncio\nasync def test_protocol_preserve_headers_with_trailing_data(protocol: H11Protocol) -> None:\n await protocol.stream_send(\n Response(stream_id=1, status_code=201, headers=[(b\"X-Special\", b\"Value\")])\n )\n protocol.send.assert_called() # type: ignore\n\n assert protocol.send.call_args_list == # type", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "None", + "got": "evel=1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "got_raw": "<|fim_suffix|>evel=1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.015037593984962405, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "\"http\"", + "got": "\"http\"", + "got_raw": " \"http\"\n assert scope[\"method\"] == \"GET\"\n assert scope[\"path\"] == \"/\"\n\n await send({\"type\": \"http.response.start\", \"status\": 200, \"headers\": []})\n await send({\"type\": \"http.response.body\", \"body\": b\"Hello World\", \"more_body\": False})\n\n return\n\nasync def test_trio() -> None:\n config = Config()\n config.bind = [\"127.0.0.1:8000\"]\n config.workers = 1\n config.debug = True\n\n async with trio.open_n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "23", + "got": "23", + "got_raw": "23\n assert float(atoms[\"L\"]) == 0.000_023\n assert atoms[\"not-atom\"] == \"-\"\n assert int(atoms[\"p\"]) == 0\n\ndef test_access_log_atoms(http_scope: HTTPScope, response: ResponseSummary) -> None:\n atoms = AccessLogAtoms(http_scope, response, 0.000_023)\n assert atoms[\"h\"] == \"127.0.0.1:80\"\n assert atoms[\"l\"] == \"-\"\n assert time.strptime(atoms[\"t\"], \"[%d/%b", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "[wsproto.events.CloseConnection(code=1000, reason=\"\")]", + "got": "", + "got_raw": " # type: ignore\n [\n wsproto.events.CloseConnection(\n code=1000,\n reason=b\"\",\n was_clean=True,\n )\n ]\n await task\n\n\n@pytest.mark.asyncio\nasync def test_http2_websocket() -> None:\n event_loop: asyncio.AbstractEventLoop = asyncio.get_running_loop()\n\n server = TCPServer(\n ASGIWrapper(sanity_framework),\n event_loop,\n Config(),\n WorkerContext(None),\n {},\n MemoryReader(), # type: ignore\n MemoryWriter(), # type: ignore\n )\n task = event_loop.create_task(server", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "socket.SO_TYPE)", + "got": "1, 1)", + "got_raw": "1, 1)\n assert sock.getsockopt.return_value == socket.SOCK_STREAM\n\ndef test_create_sockets_unix(monkeypatch: MonkeyPatch) -> None:\n mock_sock_class = Mock(\n return_value=NonCallableMock(\n **{\"getsockopt.return_value\": socket.SOCK_STREAM} # type: ignore\n )\n )\n monkeypatch.setattr(socket, \"socket\", mock_sock_class)\n config = Config()\n config.bind = [\"unix:/tmp/socket\"]\n sockets = config.create_sockets()\n sock = sockets.insecure_sockets[0]\n mock_sock_class.assert_called_with(socket.AF_UNIX", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.1, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "[ {\"type\": \"http.response.start\", \"status\": 200, \"headers\": [(b\"content-length\", b\"13\")]}, {\"type\": \"http.response.body\", \"body\": b\"apix-/api/x/b\"}, {\"type\": \"http.response.start\", \"status\": 200, \"headers\": [(b\"content-length\", b\"10\")]}, {\"type\": \"http.response.body\", \"body\": b\"api-/api/b\"}, {\"type\": \"http.response.start\", \"status\": 404, \"headers\": [(b\"content-length\", b\"0\")]}, {\"type\": \"http.response.body\"}, ]", + "got": "[", + "got_raw": " [\n {\n \"type\": \"http.response.start\",\n \"status\": 200,\n \"headers\": [(b\"content-length\", b\"10\")],\n },\n {\n \"type\": \"http.response.body\",\n \"body\": b\"api-x-b\",\n },\n {\n \"type\": \"http.response.start\",\n \"status\": 200,\n \"headers\": [(b\"content-length\", b\"10\")],\n },\n {\n \"type\": \"http.response.body\",\n \"body\": b\"api-b\",\n },\n {\n \"type\":", + "exact_match": false, + "code_bleu": 0.006193787057305838, + "edit_similarity": 0.004819277108433735, + "n_retrieved": 10 + }, + { + "repo": "pgjones/hypercorn", + "expected": "\"/\u4e2d\".encode().decode(\"latin-1\")", + "got": "\"/\u4e2d\"", + "got_raw": " \"/\u4e2d\"\n assert environ[\"PATH_INFO\"] == \"/\u4e2d/\u6587\"\n assert environ[\"QUERY_STRING\"] == \"bar=baz\"\n assert environ[\"SERVER_NAME\"] == \"localhost\"\n assert environ[\"SERVER_PORT\"] == \"80\"\n assert environ[\"SERVER_PROTOCOL\"] == \"HTTP/1.0\"\n assert environ[\"REQUEST_METHOD\"] == \"GET\"\n assert environ[\"wsgi.version\"] == (1, 0)\n assert environ[\"wsgi.input\"].read() == b\"\"\n assert environ[\"wsgi.errors\"] == sys.stderr\n assert environ[\"wsgi.multithread\"]", + "exact_match": false, + "code_bleu": 0.05946035575013606, + "edit_similarity": 0.22857142857142856, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "\"uuid\")", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n pydantic_model(**ticket.to_dict()).model_dump_json(),\n '{\"code\":\"' + str(ticket.code) + '\"}',\n )\n\n with self.assertRaises(ValidationError):\n pydantic_model(code=\"not a valid uuid\")\n\n with self.assertRaises(ValidationError):\n pydantic_model(code=\"12345678901234567890123456789012\")\n\n with self.assertRaises(ValidationError):\n pydantic_model(code=\"123456789012345678", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.1, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "[1, 2, 3])", + "got": "1, 2, 3)", + "got_raw": "1, 2, 3)\n\n def test_storage_with_default(self):\n \"\"\"\n Make sure data can be stored and retrieved.\n \"\"\"\n MyTable(value=[1, 2, 3]).save().run_sync()\n\n row = MyTable.objects().first().run_sync()\n assert row is not None\n\n self.assertEqual(row.value, 1, 2, 3)\n\n def test_storage_with_default_and_null(self):\n \"\"\"\n Make sure data can be stored and retrieved.\n \"\"\"\n MyTable(value=[1, 2, 3]).save().run_sync()\n\n row = My", + "exact_match": false, + "code_bleu": 0.6306723114402859, + "edit_similarity": 0.8888888888888888, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "[TableB.table_a])", + "got": "[TableB.table_a])", + "got_raw": " [TableB.table_a])\n self.assertEqual(TableB._meta.foreign_key_references, [TableB.table_a])\n\n class TableC(Table):\n table_a = ForeignKey(references=TableA)\n table_b = ForeignKey(references=TableB)\n\n self.assertEqual(TableC._meta.foreign_key_columns, [TableC.table_a, TableC.table_b])\n self.assertEqual(TableC._meta.foreign_key_references, [TableC.table_a, TableC.table_b])\n\n class TableD(Table):\n table_a = ForeignKey(references=TableA)\n table_b = ForeignKey(references=TableB)\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "\"Bob\")", + "got": "\"Bob\")", + "got_raw": " \"Bob\")\n\n self.assertTrue(await Roadie.table_exists().run())\n roadie = await Roadie.select(\"name\").first().run()\n assert roadie is not None\n\n self.assertEqual(roadie[\"name\"], \"Dave\")\n\n @sqlite_only\n async def test_nested(self):\n await self.run_nested()\n\n async def test_transaction_error(self):\n async with Musician._meta.db.transaction():\n await Musician.create_table().run()\n await Musician(name=\"Bob\").save().run()\n\n async with Roadie._meta.db.transaction():\n await Roadie.create_table().run()\n await", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "\"[]\")", + "got": "0)", + "got_raw": "0)\n self.assertEqual(row.json_list_str, \"0\")\n self.assertEqual(row.json_list_dict, 0)\n\n self.assertEqual(row.json_null, None)\n self.assertEqual(row.json_null_str, \"null\")\n self.assertEqual(row.json_null_dict, None)\n\n self.assertEqual(row.json_true, True)\n self.assertEqual(row.json_true_str, \"true\")\n self.assertEqual(row.json_true_dict, True)\n\n self.assertEqual(row.json_false, False)\n self.assertEqual(row.json_false_str, \"false\")\n self.assertEqual(row.json_false_dict, False)\n\n self.assertEqual(row.json_list_null, None)\n self.assertEqual(row", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n\n # Make sure the exception contains the correct error messages.\n\n self.assertEqual(\n e.exception.args[0][0].message,\n \"Error creating table `SmallTable`: Test\",\n )\n self.assertEqual(\n e.exception.args[0][1].message,\n \"Error creating table `MegaTable`: Test\",\n )\n\n @patch(\n \"piccolo.apps.schema.commands.generate.create_table_class_from_db\",\n new_callable=AsyncMock,\n )\n def test_exception_with_no_tables(self, create_table_class_from_db_mock: AsyncMock):\n \"\"\"\n Make sure that a GenerateError exception is", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "len(snapshot) == 2)", + "got": "Manager in snapshot.tables)", + "got_raw": "Manager in snapshot.tables)\n self.assertTrue(Band in snapshot.tables)\n\n def test_drop_table(self):\n \"\"\"\n Test dropping tables.\n \"\"\"\n manager_1 = MigrationManager()\n manager_1.add_table(class_name=\"Manager\", tablename=\"manager\")\n\n manager_2 = MigrationManager()\n manager_2.add_table(class_name=\"Band\", tablename=\"band\")\n manager_2.drop_table(class_name=\"Band\", tablename=\"band\")\n\n schema_snapshot = SchemaSnapshot(managers=[manager_1, manager_2])\n snapshot = schema_snapshot.get_snapshot()\n\n\n self.assertTrue(Manager in snapshot.tables)\n self.assertFalse", + "exact_match": false, + "code_bleu": 0.18334613341308786, + "edit_similarity": 0.43478260869565216, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "list)", + "got": "42)", + "got_raw": "42)\n\n # The results should be the same as if we ran the queries\n # synchronously.\n\n self.assertEqual(\n asyncio.run(run_queries()),\n [\n [\n {\"id\": 1, \"name\": \"Guido\"},\n {\"id\": 2, \"name\": \"Pythonistas\"},\n {\"id\": 3, \"name\": \"Golangs\"},\n ],\n [{\"id\": 4, \"name\": \"Golangs\"}],\n [{\"id\": 1, \"name\": \"Guido\"}, {\"id\": 2, \"name\": \"Pythonistas\"}],\n [{\"", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "0)", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n await RecordingStudio.count().where(\n RecordingStudio.facilities.arrow(\"mixing_desk\").eq(False)\n ),\n 0,\n )\n\n async def test_arrow_in(self):\n \"\"\"\n Make sure the arrow function can be used within an IN clause.\n \"\"\"\n await self.insert_row()\n\n self.assertEqual(\n await RecordingStudio.count().where(\n RecordingStudio.facilities.arrow(\"mixing_desk\").in_([True, False])\n ),\n 1,\n )\n\n async def test_arrow_not_in(self):\n \"\"\"\n Make sure the arrow function can be used within a NOT IN", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "str)", + "got": "", + "got_raw": " # type: ignore\n Optional[dict[str, Any]]\n )\n\n assert_type(await query.run(), # type: ignore\n Optional[dict[str, Any]]\n )\n\n assert_type(await query.run_sync(), # type: ignore\n Optional[dict[str, Any]]\n )\n\n assert_type(await query.run_sync(), # type: ignore\n Optional[dict[str, Any]]\n )\n\n assert_type(await query.run(), # type: ignore\n Optional[dict[str, Any]]\n )\n\n assert_type(await query.run(), # type: ignore\n Optional[dict[str,", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "\"l\")", + "got": "Shirt.Size.small)", + "got_raw": " Shirt.Size.small)\n\n def test_choices(self):\n \"\"\"\n Make sure the choices work correctly.\n \"\"\"\n self._insert_shirts()\n\n shirts = Shirt.select().where(Shirt.size == Shirt.Size.small).run_sync()\n assert len(shirts) == 1\n assert shirts[0].size == Shirt.Size.small\n\n shirts = Shirt.select().where(Shirt.size == Shirt.Size.medium).run_sync()\n assert len(shirts) == 1\n assert shirts[0].size == Shirt.Size.medium\n\n shirts = Shirt.select().where(Shirt.size == Shirt.Size.large).run", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.19047619047619047, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "\"manager\")", + "got": "\"manager\")", + "got_raw": " \"manager\")\n self.assertEqual(tableNameDetail.schema, \"music\")\n\n def test_get_table_name(self):\n tableNameDetail = self.table_storage._get_schema_and_table_name(\n \"music.manager\"\n )\n\n self.assertEqual(tableNameDetail.name, \"manager\")\n self.assertEqual(tableNameDetail.schema, \"music\")\n\n def test_get_table_name_with_schema(self):\n tableNameDetail = self.table_storage._get_schema_and_table_name(\n \"music.manager\"\n )\n\n self.assertEqual(tableNameDetail.name, \"manager\")\n self.assertEqual(tableNameDetail.schema, \"music\")\n\n def test_get_table_name_with_schema_and_dot(self):\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "tables)", + "got": "[i.tablename for i in tables])", + "got_raw": " [i.tablename for i in tables])\n\n self._test_migrations(\n table_snapshots=[\n [self.manager_1],\n [self.manager],\n ],\n )\n\n tables = self.schema_manager.list_tables(\n schema_name=\"public\"\n ).run_sync()\n\n self.assertIn(\"manager\", [i.tablename for i in tables])\n\n def test_rename_table_with_default(self):\n self._test_migrations(\n table_snapshots=[\n [self.manager],\n [self.manager_1],\n ],\n )\n\n tables = self.schema_manager.list_tables(\n schema_name=\"public\"\n ).run", + "exact_match": false, + "code_bleu": 0.13950796967929133, + "edit_similarity": 0.3783783783783784, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "\"name\")", + "got": ".assertEqual(BandA.manager.target_column, Manager.name)", + "got_raw": ".assertEqual(BandA.manager.target_column, Manager.name)\n self.assertEqual(BandB.manager.target_column, Manager.name)\n self.assertEqual(BandC.manager.target_column, Manager.name)\n\n def test_target_column_with_default(self):\n \"\"\"\n Make sure the `target_column` is correctly set in the Pydantic schema\n for `ForeignKey` columns with a default.\n \"\"\"\n\n class Manager(Table):\n name = Varchar(unique=True)\n\n class BandA(Table):\n manager = ForeignKey(Manager, target_column=Manager.name, default=Manager)\n\n class BandB(Table):\n manager = ForeignKey(Manager,", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.16129032258064516, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "query.__str__())", + "got": "", + "got_raw": " # noqa: W503\n query.compile().string,\n )\n\n @engines_only(\"postgres\", \"cockroach\")\n def test_target_column(self):\n \"\"\"\n Make sure we can specify the target constraint using a column.\n \"\"\"\n Band = self.Band\n\n query = Band.insert(Band(name=self.band.name)).on_conflict(\n target=Band.name,\n action=\"DO NOTHING\",\n )\n\n self.assertIn(\"ON CONSTRAINT band_name_key\", # noqa: W503\n query.compile().string,\n )\n\n @engines_only(\"postgres\", \"cockroach\")\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "[TableA, TableB])", + "got": "", + "got_raw": " # type: ignore\n sort_table_classes([TableA, TableB]),\n [TableA, TableB]\n )\n\n def test_sort_tables_with_foreign_keys(self):\n \"\"\"\n Make sure there are no weird edge cases with tables with foreign key\n relationships with each other.\n \"\"\"\n\n class TableA(Table):\n pass\n\n class TableB(Table):\n fk = ForeignKey(TableA)\n\n self.assertListEqual( # type: ignore\n sort_table_classes([TableA, TableB]),\n [TableA, TableB]\n )\n\n def test_sort_tables_with_foreign_keys_in_reverse_order(self):\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "\"Column\")", + "got": ".assertEqual(table.my_column.__class__, Column)", + "got_raw": ".assertEqual(table.my_column.__class__, Column)\n\n @engines_skip(\"cockroach\")\n def test_generate(self) -> None:\n \"\"\"\n Make sure the output schema is correct.\n \"\"\"\n output_schema: OutputSchema = run_sync(get_output_schema())\n\n # Make sure the tables are correct.\n self.assertEqual(\n output_schema.tables,\n [\n MegaTable,\n SmallTable,\n ],\n )\n\n # Make sure the columns are correct.\n self._compare_table_columns(MegaTable, output_schema.tables[0])\n self._compare_table_columns(SmallTable, output_schema.tables[1])\n\n @", + "exact_match": false, + "code_bleu": 0.11390778025531027, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "[test_date])", + "got": "[test_date])", + "got_raw": " [test_date])\n self.assertListEqual(row.time, [test_time])\n self.assertListEqual(row.timestamp, [test_timestamp])\n self.assertListEqual(row.timestamptz, [test_timestamptz])\n self.assertListEqual(row.decimal, [test_decimal])\n\n self.assertIsNone(row.date_nullable)\n self.assertIsNone(row.time_nullable)\n self.assertIsNone(row.timestamp_nullable)\n self.assertIsNone(row.timestamptz_nullable)\n self.assertIsNone(row.decimal_nullable)\n\n @engines_only(\"postgres\", \"sqlite\")\n def test_query(self):\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "Integer().column_type)", + "got": ".assertEqual(", + "got_raw": ".assertEqual(\n Band.manager._.id.column_type,\n Serial,\n )\n\n def test_bigserial(self):\n class Manager(Table):\n id = BigSerial(primary_key=True)\n\n class Band(Table):\n manager = ForeignKey(Manager)\n\n\n self.assertEqual(\n Band.manager._.id.column_type,\n BigSerial,\n )\n\n def test_bigint(self):\n class Manager(Table):\n id = BigInt(primary_key=True)\n\n class Band(Table):\n manager = ForeignKey(Manager)\n\n\n self.assertEqual(\n Band.manager._.id.column_type,\n BigInt,\n )\n\n def test_integer(self):\n class Manager(Table", + "exact_match": false, + "code_bleu": 0.24999999999999997, + "edit_similarity": 0.17142857142857143, + "n_retrieved": 10 + }, + { + "repo": "piccolo-orm/piccolo", + "expected": "[])", + "got": "", + "got_raw": " # type: ignore\n [\n \"act.create_table(schema=None)\",\n \"band.create_table(schema=None)\",\n ],\n )\n\n self.assertEqual(schema_differ.drop_tables.statements, # type: ignore\n [\n \"act.drop_table(schema=None)\",\n \"band.drop_table(schema=None)\",\n ],\n )\n\n def test_rename_column(self) -> None:\n \"\"\"\n Test renaming a column.\n \"\"\"\n name_column = Varchar()\n name_column._meta.name = \"name\"\n\n schema: list[DiffableTable] = [\n DiffableTable(\n class_name=\"Act\", tablename=\"", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "picoCTF/picoCTF", + "expected": "409", + "got": "409", + "got_raw": "409\n assert res.json[\"message\"] == \"There is already a team with this name.\"\n\n # Attempt to create team with invalid name\n res = client.post(\n \"/api/v1/teams\",\n json={\n \"team_name\": \"invalid team name\",\n \"team_password\": STUDENT_DEMOGRAPHICS[\"password\"],\n },\n headers=[(\"Limit-Bypass\", RATE_LIMIT_BYPASS_KEY)],\n )\n\n assert res.status_code == 409\n assert res.json[\"message\"] == \"There is already a team with this name.\"\n\n # Attempt to create team with", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "picoCTF/picoCTF", + "expected": "422", + "got": "422", + "got_raw": "422\n assert res.json[\"message\"] == \"Problem not unlocked\"\n\n # Attempt to submit a solution for a problem that has already been solved\n res = client.post(\n \"/api/v1/submissions\",\n json={\"pid\": \"picoCTF-2018-00000000000000000000000000000000\", \"key\": \"flag\", \"method\": \"testing\"},\n headers=[(\"X-CSRF-Token\", csrf_t)],\n )\n\n assert res.status_code ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "picoCTF/picoCTF", + "expected": "2", + "got": "1", + "got_raw": "1\n assert db.teams.find_one({\"tid\": new_tid})[\"members\"][0][\"uid\"] == uid\n assert db.teams.find_one({\"tid\": new_tid})[\"members\"][0][\"username\"] == STUDENT_2_DEMOGRAPHICS[\"username\"]\n assert db.teams.find_one({\"tid\": new_tid})[\"members\"][0][\"usertype\"] == \"student\"\n assert db.teams.find_one({\"tid\": new_tid})[\"members\"][0][\"country\"] == STUDENT_2_DEMOGRAPHICS[\"country\"]\n assert db.teams.find_one({\"tid\": new_tid})[\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "picoCTF/picoCTF", + "expected": "v", + "got": "0", + "got_raw": "0\n assert res.json[k] == v\n for k in nondeterministic_responses:\n assert res.json[k] != 0\n assert res.json[k] != v\n\n\ndef test_status_with_competition(mongo_proc, redis_proc, client): # noqa\n \"\"\"Test the /status endpoint with a running competition.\"\"\"\n clear_db()\n enable_sample_problems()\n ensure_within_competition()\n expected_responses = {\n \"competition_active\": True,\n }\n nondeterministic_responses = [\"time\"]\n res = client.get(\"/api/v1/status\")\n assert res.status_code == 2", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "picoCTF/picoCTF", + "expected": "403", + "got": "403", + "got_raw": "403\n assert res.json[\"message\"] == \"Ineligible to join team\"\n\n # Attempt to join as a student\n client.get(\"/api/v1/user/logout\")\n client.post(\n \"/api/v1/user/login\",\n json={\n \"username\": STUDENT_DEMOGRAPHICS[\"username\"],\n \"password\": STUDENT_DEMOGRAPHICS[\"password\"],\n },\n headers=[(\"Limit-Bypass\", RATE_LIMIT_BYPASS_KEY)],\n )\n res = client.post(\n \"/api/v1/team/join\",\n json={\"team_name\": \"newteam\", \"team_password\": \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "picoCTF/picoCTF", + "expected": "str(excep_info.value)", + "got": "str(excep_info.value)", + "got_raw": " str(excep_info.value)\n\n\ndef test_valid_prob_name_sanitization():\n \"\"\"Test valid problem names are sanitized correctly.\"\"\"\n assert util.sanitize_name(\"test\") == \"test\"\n assert util.sanitize_name(\"test-123\") == \"test-123\"\n assert util.sanitize_name(\"test-123-456\") == \"test-123-456\"\n assert util.sanitize_name(\"test-123-456-789\") == \"test-123-456-789\"\n assert util", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "''", + "got": "ics_list", + "got_raw": "ics_list\n\n result = runner.invoke(main_khal, ['import', 'test.ics'])\n\n assert result.output == ics_import\n\n result = runner.invoke(main_khal, ['list'])\n\n assert result.output == ics_list_import\n\n result = runner.invoke(main_khal, ['export', 'test.ics'])\n\n assert result.output == ics_export\n\n result = runner.invoke(main_khal, ['list'])\n\n assert result.output == ics_list_export\n\n result = runner.invoke(main_khal, ['delete', 'test.ics'])\n\n assert result.output == ics_delete\n\n result =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "True", + "got": "1", + "got_raw": "1\n assert event.allday is 0\n assert event.start == dt.datetime(2019, 1, 1, 10, 0, tzinfo=pytz.utc)\n assert event.end == dt.datetime(2019, 1, 1, 11, 0, tzinfo=pytz.utc)\n assert event.duration == dt.timedelta(hours=1)\n assert event.summary == 'event_dt_rr'\n assert event.location == 'location'\n assert event.categories == ['category']\n assert event.repeat == 'DAILY'\n assert event.until", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "'\\r\\n'.join([ 'BEGIN:VEVENT', 'SUMMARY:An Event', 'DTSTART;VALUE=DATE:20220702', 'DTEND;VALUE=DATE:20220703', 'DTSTAMP:20220702T140000Z', 'UID:E41JRQX2DB4P1AQZI86BAT7NHPBHPRIIHQKA', 'RRULE:FREQ=WEEKLY', 'END:VEVENT', '' ])", + "got": "textwrap.dedent(\"\"\"\\", + "got_raw": " textwrap.dedent(\"\"\"\\\n BEGIN:VEVENT\n DTSTAMP:20220702T140000Z\n UID:00000000-0000-0000-0000-000000000000\n DTSTART;TZID=Europe/Berlin:20220702T000000\n DTEND;TZID=Europe/Berlin:20220702T2359", + "exact_match": false, + "code_bleu": 0.059956985797992454, + "edit_similarity": 0.008264462809917356, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "_get_TZIDs(part1)", + "got": "_get_TZIDs(part1)", + "got_raw": " _get_TZIDs(part1)\n\n assert vevents0 == vevents1\n\ndef test_new_vevent():\n vevent = new_vevent(LOCALE_BERLIN, dt.date(2019, 1, 1), dt.date(2019, 1, 2), 'summary')\n assert vevent['DTSTART'].dt == dt.datetime(2019, 1, 1, tzinfo=LOCALE_BERLIN)\n assert vevent['DTEND'].dt == dt.datetime(2019, 1, 2, tzinfo", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "InvalidSettingsError)", + "got": "NoConfigFile):", + "got_raw": "NoConfigFile):\n get_config()\n\n def test_config(self):\n\n config = get_config()\n assert config['calendars']['khal']['path'] == PATH + 'khal.ics'\n assert config['calendars']['khal']['type'] == 'calendar'\n assert config['calendars']['khal']['readonly'] is False\n assert config['calendars']['khal']['color'] == '#000000'\n assert config['calendars']['khal']['priority'] == 1\n assert config['calendars']['khal']['ctype'] == 'ics'\n assert config", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.11428571428571428, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "uid", + "got": "\"https://pimutils.org/icalendars/%s\" % uid", + "got_raw": " \"https://pimutils.org/icalendars/%s\" % uid\n\ndef test_get_href_from_uid_with_no_at_sign():\n # Test UID with no at sign\n uid = \"V042MJ8B3SJNFXQOJL6P53OFMHJE8Z3VZWOU@pimutils.org\"\n href = vdir._generate_href(uid)\n\n assert href == \"https://pimutils.org/icalendars/%s\" % uid\n\ndef test_get_href_from_uid_with_no_at_sign_and_no_underscore():\n # Test UID with no at sign", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "(5, 1)", + "got": "5", + "got_raw": "5\n assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 5)) == 6\n assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 6)) == 0\n assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 7)) == 1\n assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 8)) == 2\n assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 9))", + "exact_match": false, + "code_bleu": 0.11892071150027211, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "vevents2[0]", + "got": "icalendar.Event.from_ical(vevents[0])", + "got_raw": "icalendar.Event.from_ical(vevents[0])\n assert vevents2[0] == icalendar.Event.from_ical(vevents2[0])\n\ndef test_split_ics_with_uid():\n cal = _get_text('with_uid')\n vevents = split_ics(cal)\n assert vevents\n vevents2 = split_ics(cal)\n\n assert vevents[0] == icalendar.Event.from_ical(vevents[0])\n assert vevents2[0] == icalendar.Event.from_ical(vevents2[0])\n\ndef test_split_ics_with_uid", + "exact_match": false, + "code_bleu": 0.21200626759025185, + "edit_similarity": 0.4166666666666667, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "'Wednesday'", + "got": "'Monday'", + "got_raw": " 'Monday'\n assert construct_daynames(dt.date(2016, 9, 22)) == 'Tuesday'\n assert construct_daynames(dt.date(2016, 9, 23)) == 'Wednesday'\n assert construct_daynames(dt.date(2016, 9, 24)) == 'Thursday'\n assert construct_daynames(dt.date(2016, 9, 25)) == 'Friday'\n assert construct_daynames(dt.date(2016, 9, 26)) == 'Saturday'\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.631578947368421, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "8", + "got": "12", + "got_raw": "12\n assert dtstart[0] == dt.date(2013, 3, 1)\n assert dtstart[1] == dt.date(2013, 3, 15)\n assert dtstart[2] == dt.date(2013, 3, 29)\n assert dtstart[3] == dt.date(2013, 4, 13)\n assert dtstart[4] == dt.date(2013, 4, 27)\n assert dtstart[5] == dt.date(", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "comp_config[key]", + "got": "comp_config[key]", + "got_raw": " comp_config[key]\n\n def test_simple_config_with_vdirsyncer(self):\n config = get_config(\n PATH + 'simple_vdirsyncer.conf',\n _get_color_from_vdir=lambda x: None,\n _get_vdir_type=lambda x: 'calendar',\n )\n comp_config = {\n 'calendars': {\n 'home': {\n 'path': os.path.expanduser('~/.calendars/home/'), 'readonly': False,\n 'color': None, 'priority': 10, 'type': 'calendar', 'addresses': [''],\n },\n 'work': {\n '", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "\"\"", + "got": "1", + "got_raw": "1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees == 1\n assert event.attendees", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "'2d'", + "got": "2", + "got_raw": "2\n\n def test_hours(self):\n\n assert timedelta2str(dt.timedelta(hours=2)) == 2\n\n def test_minutes(self):\n\n assert timedelta2str(dt.timedelta(minutes=2)) == 2\n\n def test_seconds(self):\n\n assert timedelta2str(dt.timedelta(seconds=2)) == 2\n\n def test_milliseconds(self):\n\n assert timedelta2str(dt.timedelta(milliseconds=2)) == 2\n\n def test_microseconds(self):\n\n assert timedelta2str(dt.timedelta(microseconds=2)) == 2\n\n def test_negative(self):\n\n assert timedelta2str(dt.timedelta(days=-2))", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "2", + "got": "1", + "got_raw": "1\n assert events[0].start == start_date\n assert events[0].end == end_date\n\n def test_import_ics(self, coll_vdirs):\n \"\"\"\n Test importing an ics file.\n \"\"\"\n coll, vdirs = coll_vdirs\n view = {'event_format': '{title}'}\n import_ics(\n coll,\n {'locale': utils.LOCALE_BERLIN, 'view': view},\n _get_text('event_ics'),\n batch=True\n )\n start_date = utils.BERLIN.localize(dt.datetime(2015, ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "{vdir[len(path):] for vdir in get_all_vdirs(path + '/**/')}", + "got": "{vdir[len(path):] for vdir in get_all_vdirs(path + '/**/*/')}", + "got_raw": " {vdir[len(path):] for vdir in get_all_vdirs(path + '/**/*/')}\n\ndef test_get_color_from_vdir():\n assert get_color_from_vdir('/cal1/private') == 'blue'\n assert get_color_from_vdir('/cal1/public') == 'blue'\n assert get_color_from_vdir('/cal2/public') == 'red'\n assert get_color_from_vdir('/cal3/home') == 'green'\n assert get_color_from_vdir('/cal3/public') == 'green'\n assert get_color_from_vdir('/cal3/work') == 'green'\n assert", + "exact_match": false, + "code_bleu": 0.8739351325046804, + "edit_similarity": 0.9833333333333333, + "n_retrieved": 10 + }, + { + "repo": "pimutils/khal", + "expected": "testList2", + "got": "testList2", + "got_raw": " testList2\n assert 'light green' in testList2\n assert len(testList2) == 2\n\n # test no priorities\n exampleCollection3 = testCollection()\n exampleCollection3.addCalendar('testCalendar1', 'dark red', 0)\n exampleCollection3.addCalendar('testCalendar2', 'light green', 0)\n\n testList3 = get_color_list(exampleCalendarList, 'light_blue', exampleCollection3)\n\n assert 'dark red' in testList3\n assert 'light green' in testList3\n assert len(testList3) == 2", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pirxthepilot/wtfis", + "expected": "4", + "got": "5", + "got_raw": "5\n assert str(table.columns[0]._cells[2]) == \"ASN:\"\n assert str(table.columns[0]._cells[3]) == \"Location:\"\n assert str(table.columns[0]._cells[4]) == \"Hostname:\"\n assert str(table.columns[1]._cells[2]) == \"16509 (Amazon.com, Inc.)\"\n assert str(table.columns[1]._cells[3]) == \"Mumbai, Maharashtra, IN\"\n assert (\n str(table.columns[1]._cells[4])\n == \"ec2-192-30-255-", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pirxthepilot/wtfis", + "expected": "\"cloudflare.com\"", + "got": "1.1.1.1", + "got_raw": "1.1.1.1\n assert ipwhois.asn == 15169\n assert ipwhois.org == \"Cloudflare, Inc.\"\n assert ipwhois.isp == \"Cloudflare, Inc.\"\n assert ipwhois.domain == \"1.1.1.1\"\n\n def test_ip2location(self, test_data):\n ip2location = Ip2Location.model_validate(\n json.loads(test_data(\"ip2location_1.1.1.1.json\")).get(\"1.1.1.1\")\n )\n\n assert ip2location.country_code == \"", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.08695652173913043, + "n_retrieved": 10 + }, + { + "repo": "pirxthepilot/wtfis", + "expected": "theme.heading_h1", + "got": "theme.urlhaus", + "got_raw": " theme.urlhaus\n\n # Table\n table = urlhaus_section.renderables[1]\n assert table.columns[0].header == \"Domain\"\n assert table.columns[1].header == \"Status\"\n assert table.columns[2].header == \"Date\"\n assert table.columns[3].header == \"URL\"\n\n # Rows\n assert len(table.renderables) == 1\n row = table.renderables[0]\n assert row.renderables[0] == Text(\"gist.github.com\")\n assert row.renderables[1] == Text(\"Clean\")\n assert row.renderables[2] ==", + "exact_match": false, + "code_bleu": 0.5946035575013605, + "edit_similarity": 0.5517241379310345, + "n_retrieved": 10 + }, + { + "repo": "pirxthepilot/wtfis", + "expected": "HandlerException", + "got": "", + "got_raw": " # type: ignore # pragma: no coverage\n\n @patch.object(requests.Session, \"get\")\n def test_vt_http_error_404(self, mock_requests_get, domain_handler):\n \"\"\"\n Test a requests HTTPError from the VT client. This also tests the\n common_exception_handler decorator.\n \"\"\"\n handler = domain_handler()\n mock_resp = requests.models.Response()\n\n mock_resp.status_code = 404\n mock_requests_get.return_value = mock_resp\n\n # Thorough test of first _fetch_* method\n with pytest.raises(HandlerException) as e:\n handler", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pirxthepilot/wtfis", + "expected": "IpInfoMap.model_validate({})", + "got": "IpInfoMap(root={})", + "got_raw": " IpInfoMap(root={})\n\n def test_empty(self):\n\n assert IpInfo.empty() == IpInfo(ip=\"\", city=\"\", region=\"\", country=\"\", org=\"\")\n\n def test_model_validate(self):\n\n ip2location = Ip2Location(ip=\"1.1.1.1\", city=\"Sydney\", region=\"NSW\", country=\"Australia\", org=\"AS12345 Google Inc.\")\n ip2location_map = Ip2LocationMap(root={\"1.1.1.1\": ip2location})\n\n assert ip2location_map == IpInfoMap(root={\"1.1.1.1\": IpInfo", + "exact_match": false, + "code_bleu": 0.38260294162784475, + "edit_similarity": 0.5652173913043478, + "n_retrieved": 10 + }, + { + "repo": "pirxthepilot/wtfis", + "expected": "\"IPWhois\"", + "got": "\"IPWhois\"", + "got_raw": " \"IPWhois\"\n\n def test_get_ipwhois(self, ipwhois_client):\n\n ip = \"1.1.1.1\"\n result = ipwhois_client._get_ipwhois(ip)\n assert result.ip == ip\n assert result.country == \"AU\"\n assert result.city == \"Sydney\"\n assert result.region == \"NSW\"\n assert result.postal_code == \"2000\"\n assert result.latitude == 33.8688\n assert result.longitude == 151.2093\n assert result.timezone == \"Australia/S", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pirxthepilot/wtfis", + "expected": "\"\"", + "got": "Text(\"\\n\")", + "got_raw": " Text(\"\\n\")\n assert ip.renderable.renderables[3] == Text(\"\\n\")\n assert ip.renderable.renderables[5] == Text(\"\\n\")\n assert ip.renderable.renderables[7] == Text(\"\\n\")\n assert ip.renderable.renderables[9] == Text(\"\\n\")\n\n # VT section\n assert vt_section.title == Text(\"VT\")\n assert vt_section.title.style == theme.vt_section_title\n assert vt_section.renderables[0] == Text(\"Analysis\")\n assert vt_section.renderables[1] == Text(\"Reputation\")\n assert vt", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "pirxthepilot/wtfis", + "expected": "[]", + "got": "1", + "got_raw": "1\n assert shodan.os == \"Linux\"\n assert shodan.os_version == \"Ubuntu 18.04.3 LTS\"\n assert shodan.os_family == \"Linux\"\n assert shodan.os_gen == \"Linux\"\n assert shodan.os_gen == \"Linux\"\n assert shodan.os_gen == \"Linux\"\n assert shodan.os_gen == \"Linux\"\n assert shodan.os_gen == \"Linux\"\n assert shodan.os_gen == \"Linux\"\n assert shodan.os_gen == \"Linux\"\n assert shodan.os_gen ==", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "\"w\")", + "got": "", + "got_raw": " # noqa: F821\n 'w',\n encoding='utf-8',\n newline='',\n closefd=True,\n opener=None,\n ignore_flush=False)\n fout.write(self.as_text)\n fout.flush()\n mock_open.return_value.flush.assert_called_with()\n\n def test_write_utf8_with_encoding(self):\n # correct write mode, correct file:// URI\n with mock.patch(_BUILTIN_OPEN, mock.Mock(return_value=self.stringio)) as mock_open:\n with smart_open.open(\"blah\", \"w\", encoding='utf-8') as fout:\n\n mock_open.assert_called_with(\"blah\",", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def tearDown(self):\n resource = _resource('s3')\n resource.Object(BUCKET_NAME, self.key).delete()\n resource.Bucket(BUCKET_NAME).delete()\n\n def test_read(self):\n with open(self.url, 'rb') as fin:\n self.assertEqual(fin.read(), self.test_ver2)\n\n def test_read_version(self):\n with open(self.url, 'rb', transport_params={'version_id': self.versions[0]}) as fin:\n self.assertEqual(fin.read(), self.test_ver1)\n\n def test_read_version_not_found(self):\n with self.assertRaises(KeyError):\n with", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "limit", + "got": "1000000", + "got_raw": "1000000\n assert lines[0].startswith('WARC/1.0')\n assert lines[1].startswith('WARC/1.0')\n assert lines[2].startswith('WARC/1.0')\n assert lines[3].startswith('WARC/1.0')\n assert lines[4].startswith('WARC/1.0')\n assert lines[5].startswith('WARC/1.0')\n assert lines[6].startswith('WARC/1.0')\n assert lines[7].startswith('WARC/1.0')\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "0)", + "got": "1)", + "got_raw": "1)\n self.assertEqual(fout._bytes_uploaded, 262143)\n\n # read\n smart_open_read = smart_open.azure.Reader(\n CONTAINER_NAME, blob_name, CLIENT, buffer_size=1024**2\n )\n with smart_open_read as fin:\n self.assertEqual(fin.read(), local_write.getvalue())\n\n def test_write_04(self):\n \"\"\"Do multiple writes greater than the min_part_size work correctly?\"\"\"\n # write\n blob_name = \"test_write_04_%s\" % BLOB_NAME\n min_part_size = 256 *", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "3)", + "got": "1000)", + "got_raw": "1000)\n self.assertEqual(lines[0], '\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u044e\u043b\u044f, \u0432 \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0436\u0430\u0440\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f\\n')\n finally:\n obj.__exit__(None, None, None)\n\n def test_pathlib_monkeypatch_read_xz(self):\n from smart_open.smart_open_lib import pathlib\n\n path = pathlib.Path(CURR_DIR) / 'test_data' / 'crime-and-punishment.txt.xz'\n\n # Check that standard implementation can't work with xz\n with path.open(\"r\") as infile:\n with self.assertRaises(Exception):\n lines = infile", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "CRIME_AND_PUNISHMENT[:len(as_text)]", + "got": "75 * 'a'", + "got_raw": "75 * 'a'\n\ndef test_read_100():\n with mock.patch('subprocess.Popen', return_value=cat(CAP_PATH)):\n reader = smart_open.hdfs.CliRawInputBase('hdfs://dummy/url')\n as_bytes = reader.read(100)\n\n as_text = as_bytes.decode('utf-8').replace(os.linesep, '\\n')\n\n assert as_text == 100 * 'a'\n\ndef test_read_1000():\n with mock.patch('subprocess.Popen', return_value=cat(CAP_PATH)):\n reader = smart_open.hdfs.C", + "exact_match": false, + "code_bleu": 0.1424691910596736, + "edit_similarity": 0.046511627906976744, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "404", + "got": "404", + "got_raw": "404\n assert exc_info.value.msg == \"Not Found\"\n\ndef test_bad_request():\n with pytest.raises(WebHdfsException) as exc_info:\n with smart_open.open(make_url(\"bad_request\"), \"r\") as f:\n assert f.read()\n\n assert exc_info.value.status_code == 400\n assert exc_info.value.msg == \"Bad Request\"\n\ndef test_unauthorized():\n with pytest.raises(WebHdfsException) as exc_info:\n with smart_open.open(make_url(\"unauthorized\"), \"r\") as f:\n assert f.read()\n\n assert exc_info.value.status_code == ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "data)", + "got": "data)", + "got_raw": " data)\n\n def test_upload_blob_with_metadata(self):\n data = b'Lorem ipsum'\n metadata = {'key': 'value'}\n self.blob_client.upload_blob(data, metadata=metadata)\n actual = self.blob_client.download_blob().read()\n\n self.assertEqual(actual, data)\n self.assertEqual(self.blob_client.metadata, metadata)\n\n def test_upload_blob_with_content_type(self):\n data = b'Lorem ipsum'\n content_type = 'text/plain'\n self.blob_client.upload_blob(data, content_type=content_type)\n actual = self.blob_client.download_blob().read()\n\n self.assertEqual(actual, data)\n", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "text)", + "got": "text)", + "got_raw": " text)\n\n def test_buffered_writer_works(self):\n \"\"\"\n Ensure that we can write to a smart_open s3 stream in python >= 2.7\n \"\"\"\n expected = u'\u043d\u0435 \u0434\u0443\u043c\u0430\u0439 \u043e \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 \u0441\u0432\u044b\u0441\u043e\u043a\u0430'\n\n with smart_open.s3.MultipartWriter(BUCKET_NAME, self.key) as fout:\n fout.write(expected.encode('utf-8'))\n\n text = read_key(self.key).decode('utf-8')\n\n self.assertEqual(expected, text)\n\n def test_buffered_writer_works_with_gzip(self):\n \"\"\"\n Ensure that we can write", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "WebHdfsException)", + "got": "transport.WebHdfsException) as excinfo:", + "got_raw": "transport.WebHdfsException) as excinfo:\n with smart_open.open(make_url(\"not_found\"), \"rb\") as f:\n f.read()\n\n assert \"404\" in str(excinfo.value)\n\ndef test_read():\n\n with smart_open.open(make_url(\"test.txt\"), \"rb\") as f:\n assert f.read() == b\"hello world!\"\n\ndef test_write():\n\n with smart_open.open(make_url(\"test.txt\"), \"wb\") as f:\n f.write(b\"hello world!\")\n\n with smart_open.open(make_url(\"test.txt\"), \"rb\") as f:\n assert f.read() ==", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.6071428571428571, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "from_smart_open", + "got": "from_smart_open.decode('utf-8')", + "got_raw": " from_smart_open.decode('utf-8')\n\nif __name__ == '__main__':\n main()\n\n```\n\n## How to Access the Underlying boto3 Object\n\nAt some stage in your workflow, you may opt to work with `boto3` directly.\nYou can do this by calling to the `to_boto3()` method.\nYou can then interact with the object using the `boto3` API:\n\n\n```python\n>>> import boto3\n>>> from smart_open import open\n>>> resource = boto3.resource('s3') # Pass additional resource parameters here\n>>> with open('s3://smart-open-version", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.6521739130434783, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "b'')", + "got": "0)", + "got_raw": "0)\n self.assertEqual(len(buf), 0)\n\n self.assertEqual(buf.read(100), contents[:100])\n self.assertEqual(len(buf), 0)\n\n self.assertEqual(buf.read(100), contents[100:])\n self.assertEqual(len(buf), 0)\n\n self.assertEqual(buf.read(100), b'')\n self.assertEqual(len(buf), 0)\n\n self.assertEqual(buf.read(100), b'')\n self.assertEqual(len(buf), 0)\n\n self.assertEqual(buf.read(100), b'')\n self.assertEqual(len(buf), 0)\n\n ", + "exact_match": false, + "code_bleu": 0.35818997727451396, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "piskvorky/smart_open", + "expected": "text", + "got": "text", + "got_raw": " text\n\ndef test_gcs_readwrite_binary(benchmark):\n initialize_bucket()\n\n key = _GCS_URL + '/sanity.bin'\n binary = b'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\x0f'\n actual = benchmark(write_read, key, binary, 'wb', 'rb')\n\n assert actual == binary\n\ndef test_gcs_read_length_prefixed_messages(benchmark):\n initialize_bucket()\n\n key = _GCS", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "None", + "got": "assert result == 3600", + "got_raw": "<|fim_suffix|>\n assert result == 3600\n\ndef test_get_duration_with_no_duration():\n \"\"\"Test get_duration with no duration.\"\"\"\n entry = {}\n\n result = get_duration(entry)\n\n assert result is None\n\ndef test_get_guid_with_valid_id():\n \"\"\"Test get_guid with a valid id.\"\"\"\n entry = {\"id\": \"https://example.com/episode1\"}\n\n result = get_guid(entry)\n\n assert result == \"https://example.com/episode1\"\n\ndef test_get_guid_with_invalid_id():\n \"\"\"Test get_guid with an invalid id.\"\"\"\n entry = {\"id\": \"not-a-valid-id", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.08, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "AdSegmentPredictionList( ad_segments=[AdSegmentPrediction(segment_offset=12.0, confidence=0.86)], content_type=\"promotional_external\", confidence=0.91, )", + "got": "0.91", + "got_raw": "0.91\n\n\ndef test_clean_parse_output_with_content_type_and_confidence() -> None:\n model_output = \"\"\"\n{\"ad_segments\": [{\"segment_offset\": 12.0, \"confidence\": 0.86}], \"content_type\": \"promotional_external\", \"confidence\": 0.91}\n\"\"\"\n\n\n assert clean_and_parse_model_output(model_output) == 0.91\n\n\ndef test_clean_parse_output_with_content_type_and_confidence_and_ad_segments() -> None:\n model_output = \"\"\"\n{\"ad_segments\": [{\"segment_offset\": 12.0, \"confidence\": 0.8", + "exact_match": false, + "code_bleu": 0.022869367596206176, + "edit_similarity": 0.050955414012738856, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "2", + "got": "2", + "got_raw": "2\n assert posts[0].feed_id == feed1.id\n assert posts[0].title == \"Post 1\"\n assert posts[0].guid == \"1\"\n assert posts[0].whitelisted\n assert posts[0].processed_audio_path == \"path\"\n assert posts[0].download_url == \"http://url1\"\n\n assert posts[1].feed_id == feed2.id\n assert posts[1].title == \"Post 2\"\n assert posts[1].guid == \"2\"\n assert posts[1].whitelisted\n assert posts[", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "3", + "got": "3", + "got_raw": "3\n assert limiter.current_concurrent_calls == 0\n\n def test_acquire(self):\n \"\"\"Test acquiring a lock.\"\"\"\n limiter = LLMConcurrencyLimiter(max_concurrent_calls=3)\n\n with ConcurrencyContext(limiter):\n assert limiter.current_concurrent_calls == 1\n\n assert limiter.current_concurrent_calls == 0\n\n def test_acquire_with_timeout(self):\n \"\"\"Test acquiring a lock with a timeout.\"\"\"\n limiter = LLMConcurrencyLimiter(max_concurrent_calls=3)\n\n with pytest.raises(TimeoutError):\n with ConcurrencyContext(limiter, timeout=1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "\"client_error\"", + "got": "\"client_error\"", + "got_raw": " \"client_error\"\n\n def test_error_category(self):\n \"\"\"Test error category classification.\"\"\"\n error = \"An error occurred\"\n assert LLMErrorClassifier.get_error_category(error) == \"unknown_error\"\n\n error = \"HTTP 400 Bad Request\"\n assert LLMErrorClassifier.get_error_category(error) == \"client_error\"\n\n error = \"Authentication failed\"\n assert LLMErrorClassifier.get_error_category(error) == \"auth_error\"\n\n error = \"Authorization denied\"\n assert LLMErrorClassifier.get_error_category(error) == \"auth_error\"\n\n error = \"HTTP 401 error\"\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "\"rate_limit\"", + "got": "1", + "got_raw": "1\n\n def test_timeout_errors(self):\n \"\"\"Test identification of timeout errors.\"\"\"\n timeout_errors = [\n \"Timeout\",\n \"Request timed out\",\n \"Connection timed out\",\n \"Connection refused\",\n \"Connection reset by peer\",\n \"Connection aborted\",\n \"Connection reset\",\n \"Connection aborted by peer\",\n \"Connection aborted by peer\",\n \"Connection aborted by peer\",\n \"Connection aborted by peer\",\n \"Connection aborted by peer\",\n \"Connection aborted by peer\",\n \"Connection aborted by peer\",\n \"Connection aborted by peer\",\n \"Connection aborted by peer\",\n \"Connection aborted by", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "404", + "got": "404", + "got_raw": "404\n assert response.data == b\"Processed audio not found\"\n finally:\n runtime_config.autoprocess_on_download = original_flag\n\n\ndef test_download_missing_audio_returns_404_when_enabled(app):\n \"\"\"Return 404 when autoprocess is enabled.\"\"\"\n app.testing = True\n app.register_blueprint(post_bp)\n\n with app.app_context():\n feed = Feed(title=\"Test Feed\", rss_url=\"https://example.com/feed.xml\")\n db.session.add(feed)\n db.session.commit()\n\n post = Post(\n feed_id=feed.id,\n guid=\"missing-audio-40", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "200", + "got": "200", + "got_raw": "200\n\n # Should have recorded all calls\n assert len(results) == 200\n\n # Should have recorded all calls\n assert len(limiter.token_usage) == 200\n\n # Should have recorded all calls\n assert len(results) == 200\n\n # Should have recorded all calls\n assert len(limiter.token_usage) == 200\n\n # Should have recorded all calls\n assert len(results) == 200\n\n # Should have recorded all calls\n assert len(limiter.token_usage) == 200\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "50000", + "got": "50000", + "got_raw": "50000\n assert config.llm_enable_token_rate_limiting is False\n\n assert config.llm_max_input_tokens_per_minute == 100000\n\n assert config.output.fade_ms == 3000\n assert config.output.min_ad_segement_separation_seconds == 60\n assert config.output.min_ad_segment_length_seconds == 14\n assert config.output.min_confidence == 0.8\n\n assert config.processing.num_segments_to_input_to_prompt == 30\n\n # Test default values\n assert config.llm_max_concurrent_calls == 1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "4", + "got": "4", + "got_raw": "4\n assert len(end_results) == 4\n\n # Check that the start and end results are in the correct order\n assert start_results == [\"worker_0_start\", \"worker_1_start\", \"worker_2_start\", \"worker_3_start\"]\n assert end_results == [\"worker_0_end\", \"worker_1_end\", \"worker_2_end\", \"worker_3_end\"]\n\n def test_concurrency_limiter(self):\n \"\"\"Test that the limiter works correctly with a single thread.\"\"\"\n limiter = LLMConcurrencyLimiter(max_concurrent_calls=2)\n results = []\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "\"https://example.com/podcast.mp3\"", + "got": "\"https://example.com/podcast.mp3\"", + "got_raw": " \"https://example.com/podcast.mp3\"\n\ndef test_find_audio_link_with_html_link(mock_entry):\n\n assert find_audio_link(mock_entry) == \"https://example.com/episode\"\n\ndef test_find_audio_link_with_no_links(mock_entry):\n\n entry = mock_entry()\n entry.links = []\n assert find_audio_link(entry) is None\n\ndef test_find_audio_link_with_no_links_and_no_id(mock_entry):\n\n entry = mock_entry()\n entry.links = []\n entry.id = None\n assert find_audio_link(entry) is None\n\ndef test_find_audio_link_with_no_links_and_id(mock_entry):\n\n entry =", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "\"Authentication required.\"", + "got": "\"Authentication required.\"", + "got_raw": " \"Authentication required.\"\n\ndef test_protected_route_with_session_returns_json_200(auth_app: Flask) -> None:\n client = auth_app.test_client()\n client.get(\"/api/auth/login\", json={\"username\": \"admin\", \"password\": \"password\"})\n response = client.get(\"/api/protected\")\n assert response.status_code == 200\n\n assert response.get_json() == {\"status\": \"ok\", \"user\": \"admin\"}\n\ndef test_protected_route_with_session_and_admin_role_returns_json_200(auth_app: Flask) -> None:\n client = auth_app.test_client()\n client", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "AdSegmentPredictionList( ad_segments=[AdSegmentPrediction(segment_offset=12.0, confidence=0.86)], content_type=\"promotional_external\", confidence=0.92, )", + "got": "0.92", + "got_raw": "0.92\n\ndef test_clean_parse_output_truncated_with_content_type_and_no_confidence() -> None:\n \"\"\"Test parsing truncated JSON that includes content_type but is missing final }.\"\"\"\n model_output = '{\"ad_segments\":[{\"segment_offset\":12.0}],\"content_type\":\"promotional_external\"'\n result = clean_and_parse_model_output(model_output)\n\n assert result == 0.0\n\ndef test_clean_parse_output_truncated_with_no_content_type() -> None:\n \"\"\"Test parsing truncated JSON that includes no content_type but is missing final }.\"\"\"\n model_output = '{\"ad_segments\":[{\"segment_offset\":12", + "exact_match": false, + "code_bleu": 0.022869367596206176, + "edit_similarity": 0.050955414012738856, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "202", + "got": "202", + "got_raw": "202\n assert response.json[\"status\"] == \"started\"\n assert response.json[\"job_id\"] == \"job-123\"\n finally:\n runtime_config.autoprocess_on_download = original_flag\n\n\ndef test_download_triggers_processing_when_enabled_with_user(app):\n \"\"\"Start processing when processed audio is missing and toggle is enabled.\"\"\"\n app.testing = True\n app.register_blueprint(post_bp)\n\n with app.app_context():\n feed = Feed(title=\"Test Feed\", rss_url=\"https://example.com/feed.xml\")\n db.session.add(feed)\n db.session.commit()\n\n post = Post(\n feed", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "mock_feed", + "got": "1", + "got_raw": "1 # Assuming the function returns 1 for success\n mock_fetch_feed.assert_called_once_with(\"https://example.com/feed.xml\")\n mock_refresh_feed.assert_not_called()\n\n@mock.patch(\"app.feeds.fetch_feed\")\n@mock.patch(\"app.feeds.refresh_feed\")\ndef test_add_or_refresh_feed_new(mock_refresh_feed, mock_fetch_feed, mock_feed, mock_feed_data):\n # Set up mock feed data\n mock_feed_data.feed = mock.MagicMock()\n mock_feed_data.feed.title = \"Test Feed\" # Add title directly\n mock_fetch_feed.return_value = mock_feed_data\n\n # Directly", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "\"Test Episode\"", + "got": "\"Test Episode\"", + "got_raw": " \"Test Episode\"\n\ndef test_sanitize_title_with_umlauts():\n assert sanitize_title(\"Test Episode \u00e4\u00f6\u00fc\") == \"Test Episode \u00e4\u00f6\u00fc\"\n\ndef test_sanitize_title_with_umlauts_and_accent():\n assert sanitize_title(\"Test Episode \u00e4\u00f6\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "30.0", + "got": "30000", + "got_raw": "30000\n assert refreshed.ad_segments == [(5.0, 10.0)]\n assert refreshed.processed_audio_path == output_path\n\n mock_clip.assert_called_once_with(\n [0.0, 30000.0], [0.0, 30000.0], 0.0, 0.0, 0.0, 0.0\n )\n\n\ndef test_process_audio_with_ad_segments(\n app: Flask,\n test_config: Config,\n test_logger: logging.Logger,\n) -> None:\n \"\"\"Test the process", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "[ mock.call(\"whitelist_post\", {\"post_id\": post_id}, wait=True), mock.call(\"increment_download_count\", {\"post_id\": post_id}, wait=False), ])", + "got": "_writer.action.assert_called_once_with(", + "got_raw": "_writer.action.assert_called_once_with(\n \"whitelist_post\",\n {\"post_id\": post_id},\n wait=True,\n )\n\n runtime_config.autoprocess_on_download = original_flag\n\n\ndef test_download_auto_whitelists_post_with_existing_whitelist(app, tmp_path):\n \"\"\"Download request should not whitelist the post if it's already whitelisted.\"\"\"\n app.testing = True\n app.register_blueprint(post_bp)\n\n with app.app_context():\n feed = Feed(title=\"Test Feed\", rss_url=\"https://example.com/feed.xml\")\n db.session.add(feed)\n db.session.commit()\n\n processed_audio = tmp_path", + "exact_match": false, + "code_bleu": 0.042598538828499864, + "edit_similarity": 0.15730337078651685, + "n_retrieved": 10 + }, + { + "repo": "podly-pure-podcasts/podly_pure_podcasts", + "expected": "[0, 1, 2, 3, 4, 5]", + "got": "", + "got_raw": " # type: ignore\n [2, 3, 4, 5, 6, 7]\n\ndef test_compute_next_overlap_segments_excludes_context(\n test_classifier_with_mocks: AdClassifier,\n) -> None:\n classifier = test_classifier_with_mocks\n segments = [\n TranscriptSegment(\n id=i + 1,\n post_id=1,\n sequence_num=i,\n start_time=float(i),\n end_time=float(i + 1),\n text=f\"Segment {i}\",\n )\n for i in range(6)\n ]\n\n identified_segments = [segments[2], segments", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "'system'", + "got": "C.DEFAULT", + "got_raw": " C.DEFAULT\n\ndef test_sets_system_when_node_and_npm_are_available_2(find_exe_mck):\n find_exe_mck.return_value = '/path/to/exe'\n\n assert ACTUAL_GET_DEFAULT_VERSION() == C.DEFAULT\n\ndef test_sets_system_when_node_and_npm_are_available_3(find_exe_mck):\n find_exe_mck.return_value = '/path/to/exe'\n\n assert ACTUAL_GET_DEFAULT_VERSION() == C.DEFAULT\n\ndef test_sets_system_when_node_and_npm_are_available_4(find_exe_mck):\n find_exe_mck.return_value = '/path/to/exe'\n\n assert ACT", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "(('cmd',),)", + "got": "1, '1 partition'", + "got_raw": "1, '1 partition'\n\n assert xargs.partition(('cmd',), ('a',), 1) == 1, '1 partition'\n\n assert xargs.partition(('cmd',), ('a', 'b'), 1) == 1, '1 partition'\n\n assert xargs.partition(('cmd',), ('a', 'b', 'c'), 1) == 1, '1 partition'\n\n assert xargs.partition(('cmd',), ('a', 'b', 'c', 'd'), 1) == 1, '1 partition'\n\n assert xargs.partition(('cmd',), ('a", + "exact_match": false, + "code_bleu": 0.19362900077353815, + "edit_similarity": 0.07407407407407407, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "'~'", + "got": "", + "got_raw": " # noqa: S101\n return pth\n\n with mock.patch.object(os.path, 'expanduser', fake_expanduser):\n yield\n\n def fake_expandvars(pth):\n\n assert pth == # noqa: S101\n return pth\n\n with mock.patch.object(os.path, 'expandvars', fake_expandvars):\n yield\n\n def fake_expanduser(pth):\n\n assert pth == # noqa: S101\n return pth\n\n with mock.patch.object(os.path, 'expanduser', fake_expanduser):\n yield\n\n def fake_expand", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "'bye\\n'", + "got": "_norm('''", + "got_raw": " _norm('''\n bye\n ''')\n\ndef test_n1(capfd):\n ret = main((\n 'n1', sys.executable, '-c', 'raise SystemExit(\"bye\")',\n ))\n assert ret == 0\n out, err = capfd.readouterr()\n assert out == ''\n\n assert _norm(err) == _norm('''\n bye\n ''')\n\ndef test_n1_no_exit_code(capfd):\n ret = main((\n 'n1', sys.executable, '-c', 'raise SystemExit(\"bye\")',\n ))\n assert ret == 0", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "'repo'", + "got": "'repo'", + "got_raw": " 'repo'\n assert store.db_repo_name('repo', ('dep',)) == 'repo:dep'\n\ndef test_clone(store):\n\n with git_dir('repo') as repo_dir:\n with cwd(repo_dir):\n git_commit('initial commit')\n store.clone('repo', 'HEAD')\n assert _select_all_configs(store) == [os.path.join(repo_dir, C.CONFIG_FILE)]\n assert _select_all_repos(store) == [('repo', 'HEAD', repo_dir)]\n\ndef test_clone_with_deps(store):\n\n with git_dir('repo') as repo_dir:\n with cwd(repo_dir):\n git_commit('", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "4", + "got": "4", + "got_raw": "4\n assert caplog.record_tuples[0][2] == 'Cloning repository'\n assert caplog.record_tuples[1][2] == 'Installing environment'\n assert caplog.record_tuples[2][2] == 'Installing environment'\n assert caplog.record_tuples[3][2] == 'Installing environment'\n\n # Now we reinstall\n _get_hook(config, store, 'foo')\n # We print some logging during clone (1) + install (3)\n\n assert len(caplog.record_tuples) == 4\n assert caplog.record_tuples[0][2] == 'Cloning repository", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "f2.read()", + "got": "f2.read()", + "got_raw": " f2.read()\n actual_status = get_short_git_status()['img.jpg']\n assert status == actual_status\n\ndef test_staged_files_only_no_changes():\n with git_dir() as in_git_dir:\n with staged_files_only(in_git_dir.strpath):\n assert not os.path.exists(in_git_dir.join('foo'))\n assert not os.path.exists(in_git_dir.join('img.jpg'))\n\ndef test_staged_files_only_no_changes_with_img():\n with git_dir() as in_git_dir:\n with staged_files_only(in_git_dir.strpath):\n assert not os.path.exists(in_git_dir.join('foo'))\n assert not", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "stdout", + "got": "assert ret == 0", + "got_raw": "<|fim_suffix|>\n assert ret == 0\n\n assert b'1' in stdout\n assert b'2' in stdout\n assert b'3' in stdout\n assert b'4' in stdout\n assert b'5' in stdout\n assert b'6' in stdout\n assert b'7' in stdout\n assert b'8' in stdout\n assert b'9' in stdout\n assert b'10' in stdout\n assert b'11' in stdout\n assert b'12' in stdout\n assert b'13' in", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "2", + "got": "1", + "got_raw": "1\n assert new_config_written['repos'][0]['rev'] == out_of_date.head_rev\n\ndef test_autoupdate_local_hooks_with_out_of_date_repo_and_tags_only(\n out_of_date, in_tmpdir,\n):\n stale_config = make_config_from_repo(\n out_of_date.path, rev=out_of_date.original_rev, check=False,\n )\n local_config = sample_local_config()\n config = {'repos': [local_config, stale_config]}\n write_config('.', config)\n assert autoupdate(C.CONFIG_FILE, freeze=False, tags_only=True) == 0\n new_config_written = read_config", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "out", + "got": "", + "got_raw": " # noqa: E501\n assert b'TOML = fa267f1f-6049-4f14-aa54-33bafae1ed76' in # noqa: E501\n\n\ndef test_julia_hook_no_additional_deps(tmp_path):\n code = \"\"\"\n using TOML\n function main()\n project_file = Base.active_project()\n dict = TOML.parsefile(project_file)\n for (k, v) in dict[\"deps\"]\n println(k, \" = \", v)\n end\n end\n main", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "'cd'", + "got": "0", + "got_raw": "0\n assert arg.subdir == 'subdir'\n assert arg.cmd == ('cmd', '--', 'f1', 'f2')\n\ndef test_hazmat_with_config(mock_store_dir):\n with mock.patch.object(hazmat, 'impl') as mck:\n main.main(('hazmat', '--config', 'config', 'cd', 'subdir', '--', 'cmd', '--', 'f1', 'f2'))\n assert mck.call_count == 1\n (arg,), dct = mck.call_args\n assert dct == {}\n\n assert arg.tool == 0\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "'python3.12'", + "got": "3.12", + "got_raw": "3.12\n\ndef test_default_version_sys_executable_not_found():\n ret = _get_default_version(\n impl='cpython',\n exe='python3.12',\n found=set(),\n version=(3, 12),\n )\n\n assert ret == C.DEFAULT\n\ndef test_default_version_sys_impl_found():\n ret = _get_default_version(\n impl='cpython',\n exe='python3.12',\n found={'python3.12'},\n version=(3, 12),\n )\n\n assert ret == 3.12\n\ndef test_default_version_sys_impl_not", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "expected", + "got": "0", + "got_raw": "0\n assert run_language(tmp_path, dart, 'hello-world-dart') == 0\n assert run_language(tmp_path, dart, 'hello-world-dart') == 0\n assert run_language(tmp_path, dart, 'hello-world-dart') == 0\n assert run_language(tmp_path, dart, 'hello-world-dart') == 0\n assert run_language(tmp_path, dart, 'hello-world-dart') == 0\n assert run_language(tmp_path, dart, 'hello-world-dart') == 0\n assert run_language(tmp_path, dart, 'hello-world", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "'system'", + "got": "C.DEFAULT", + "got_raw": " C.DEFAULT\n\ndef test_uses_gem_if_ruby_is_not_available(find_exe_mck):\n find_exe_mck.return_value = None\n\n assert ACTUAL_GET_DEFAULT_VERSION() == 'gem'\n\ndef test_uses_ruby_if_gem_is_not_available(find_exe_mck):\n find_exe_mck.return_value = '/path/to/exe'\n\n assert ACTUAL_GET_DEFAULT_VERSION() == 'ruby'\n\ndef test_get_default_version_is_cached(find_exe_mck):\n find_exe_mck.return_value = '/path/to/exe'\n\n assert ACTUAL_GET_DEFAULT_VERSION() == 'ruby'\n assert ACTUAL_GET_DEFAULT_VERSION", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "f'{subdir}\\na\\nb\\n'", + "got": "_norm('''", + "got_raw": " _norm('''\n /tmp/subdir\n a\n b\n ''')\n\ndef test_ignore_exit_code(tmp_path, capfd):\n with cwd(tmp_path):\n ret = main((\n 'ignore-exit-code',\n sys.executable, '-c', 'import sys; sys.exit(1)',\n ))\n\n assert ret == 0\n out, err = capfd.readouterr()\n\n assert _norm(out) == _norm('')\n\ndef test_n1(tmp_path, capfd):\n with cwd(tmp_path):\n ret = main((\n 'n1',\n sys.executable,", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "''", + "got": "", + "got_raw": " # noqa: WPS421\n 'check-hooks-apply does not apply to this repository\\n'\n\n\ndef test_invalid_exceptions(capsys, in_git_dir, mock_store_dir):\n config = {\n 'repos': [\n {\n 'repo': 'local',\n 'hooks': [\n # applies to a file\n {\n 'id': 'check-yaml',\n 'name': 'check yaml',\n 'entry': './check-yaml',\n 'language': 'script',\n 'files': r'\\.yaml$',\n },\n # Should not be reported as an error due to language", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "'f5\\nf6\\n'", + "got": "b'f4\\nf5\\nf6\\n'", + "got_raw": " b'f4\\nf5\\nf6\\n'\n\n@pytest.mark.usefixtures('some_files')\ndef test_negate_by_file_no_match(cap_out):\n ret = pygrep.main(\n ('foo\\npattern', 'f4', 'f5', 'f6', '--negate', '--multiline'),\n )\n out = cap_out.get()\n assert ret == 0\n\n assert out == b''\n\n@pytest.mark.usefixtures('some_files')\ndef test_negate_by_file_one_match_at_once(cap_out):\n ret = pygrep.main(\n ('foo\\npattern', 'f4', 'f5',", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "('echo', 'hi')", + "got": "('echo', 'hi')", + "got_raw": " ('echo', 'hi')\n assert lang_base.hook_cmd('echo hi', ('--arg1', 'arg2')) == ('echo', 'hi', '--arg1', 'arg2')\n\ndef test_hook_cmd_with_file_args():\n\n assert lang_base.hook_cmd('echo hi', (), file_args=('file1', 'file2')) == ('echo', 'hi', 'file1', 'file2')\n\ndef test_hook_cmd_with_file_args_and_args():\n\n assert lang_base.hook_cmd('echo hi', ('--arg1', 'arg2'), file_args=('file1', 'file2'))", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "out.decode())", + "got": "", + "got_raw": " # noqa: WPS432\n out,\n 'random',\n )\n\n\n\nfrom __future__ import annotations\n\nimport re_assert\n\nfrom pre_commit.languages import dart\nfrom pre_commit.store import _make_local_repo\nfrom testing.language_helpers import run_language\n\ndef test_dart_additional_deps_system(tmp_path):\n _make_local_repo(str(tmp_path))\n\n ret, out = run_language(\n tmp_path,\n dart,\n 'secure-random -l 4 -b 16',\n deps=('encrypt:5.0.0',),\n )\n assert ret == 0\n\n re_assert", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pre-commit/pre-commit", + "expected": "()", + "got": "()", + "got_raw": "()\n\n\ndef test_docker_fallback_tty():\n def invalid_attribute():\n raise AttributeError\n\n with mock.patch.multiple(\n 'os', create=True,\n getuid=invalid_attribute,\n getgid=invalid_attribute,\n ):\n\n assert docker.get_docker_tty() == ()\n\n\ndef test_docker_fallback_cmd():\n def invalid_attribute():\n raise AttributeError\n\n with mock.patch.multiple(\n 'os', create=True,\n getuid=invalid_attribute,\n getgid=invalid_attribute,\n ):\n\n assert docker.docker_cmd() == ()\n\n\ndef test_docker_mountinfo():\n with mock.patch", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "method", + "got": "method", + "got_raw": " method\n assert request_builder.relative_url == uri\n assert request_builder.return_type == str\n assert request_builder.argument_handler == mocker.ANY\n assert request_builder.method_handler == mocker.ANY\n\n def test_define_request_with_args(self, request_builder, mocker):\n method = \"method\"\n uri = \"uri\"\n definition = commands.RequestDefinition(\n method, uri, str, mocker.Mock(), mocker.Mock()\n )\n definition.define_request(request_builder, (\"arg1\",), {})\n\n assert request_builder.method == method\n assert request_builder.relative_url == uri\n assert request_builder.return_type", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "10", + "got": "10", + "got_raw": "10\n\n def test_modify_request_definition(self, request_definition_builder):\n arguments.Timeout().modify_request_definition(request_definition_builder)\n\n assert request_definition_builder.info[\"timeout\"] == 10\n\n def test_modify_request_definition_with_args(self, request_definition_builder):\n arguments.Timeout(10).modify_request_definition(request_definition_builder)\n\n assert request_definition_builder.info[\"timeout\"] == 10\n\n def test_modify_request_definition_with_args_and_kwargs(self, request_definition_builder):\n arguments.Timeout(10, arg2=10).modify_request_definition(request_definition_builder)\n\n assert request_definition_builder.info[\"timeout\"] ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "\"example.com\"", + "got": "\"example.com\"", + "got_raw": " \"example.com\"\n assert builder_mock.client == http_client_mock\n assert builder_mock.converters == (converter_factory_mock,)\n assert builder_mock.auth == (\"username\", \"password\")\n assert builder_mock.hooks == (transaction_hook_mock,)\n\n assert builder_mock.client == http_client_mock\n assert builder_mock.client.io() == io.RequestIO()\n assert builder_mock.client.exceptions == exceptions.UplinkClientError\n\n assert builder_mock.builder == builder_mock\n assert builder_mock.builder.client == http_client_mock\n assert builder_mock.builder.converters == (converter_factory_mock,)\n assert builder_mock.builder.auth == (\"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "obj)", + "got": "Consumer, _installers=installers)", + "got_raw": "Consumer, _installers=installers)\n assert obj == [list]\n\n # Run: Failure\n with pytest.raises(TypeError):\n _extras.install(obj, _installers={list: func, int: func})\n\n # Verify\n assert obj == [list]\n\n # Run: Failure\n with pytest.raises(TypeError):\n _extras.install(obj, _installers={list: func, int: func})\n\n # Verify\n assert obj == [list]\n\n # Run: Failure\n with pytest.raises(TypeError):\n _extras.install(obj, _installers={list: func, int: func})\n\n", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.10810810810810811, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "data", + "got": "data", + "got_raw": " data\n assert response.json() == result\n assert response.status_code == 200\n\ndef test_get_repository_error(mock_client, mock_response):\n data = {\n \"query\": \"\"\"\\\nquery {\n repository(owner: \"prkumar\", name: \"uplink\") {\n nameWithOwner\n }\n}\"\"\"\n }\n result = {\"errors\": [{\"message\": \"Something went wrong\"}]}\n mock_response.with_json(result)\n mock_client.with_response(mock_response)\n github = GitHubService(base_url=BASE_URL, client=mock_client)\n with pytest.raises(GitHubError):\n github", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "{\"owner\": \"prkumar\", \"name\": \"uplink\"}", + "got": "Repo(owner=\"prkumar\", name=\"uplink\")", + "got_raw": " Repo(owner=\"prkumar\", name=\"uplink\")\n\ndef test_returns_json_on_method(mock_client, mock_response):\n # Setup\n mock_response.with_json({\"owner\": \"prkumar\", \"name\": \"uplink\"})\n mock_client.with_response(mock_response)\n github = GitHubV2(\n base_url=BASE_URL, client=mock_client, converters=repo_json_reader\n )\n\n # Run\n repo = github.get_repo(\"prkumar\", \"uplink\")\n\n # Verify\n\n assert repo == Repo(owner=\"prkumar\", name=\"uplink\")\n\ndef test_returns_json_on", + "exact_match": false, + "code_bleu": 0.17827531042796255, + "edit_similarity": 0.7567567567567568, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "SIMPLE_RESPONSE", + "got": "200", + "got_raw": "200\n assert response == SIMPLE_RESPONSE\n\n\n# File: uplink/clients/io/blocking_strategy.py\n# Third-party imports\nimport sys\n\n# Local models\nfrom uplink.clients.io import interfaces\n\n__all__ = [\"BlockingStrategy\"]\n\n\nclass BlockingStrategy(interfaces.IOStrategy):\n \"\"\"A blocking execution strategy.\"\"\"\n\n def invoke(self, func, args, kwargs, callback):\n try:\n response = func(*args, **kwargs)\n except Exception as error:\n tb = sys.exc_info()[2]\n response = callback.on_failure(type(error), error, tb)\n else:\n response =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "exceptions.SSLError)", + "got": "", + "got_raw": "\n\n\n# File: uplink/clients/io/strategy.py\n def __init__(self, io):\n self._io = io\n\n def invoke(self, func, args, kwargs, callback):\n return self._io.invoke(func, args, kwargs, callback)\n\n def sleep(self, duration, callback):\n return self._io.sleep(duration, callback)\n\n def finish(self, response):\n return self._io.finish(response)\n\n def fail(self, exc_type, exc_val, exc_tb): # pragma: no cover\n return self._io.fail(exc_type, exc_val, exc_tb)\n\n\nclass Fin", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "None", + "got": "None", + "got_raw": " None\n\ndef test_get_client_with_default_client():\n\n with _patch(requests_, \"get_client\", lambda _: None):\n assert register.get_client() is None\n\ndef test_get_client_with_default_client_and_default_client():\n\n with _patch(requests_, \"get_client\", lambda _: None):\n with _patch(register, \"get_default_client\", lambda: None):\n assert register.get_client() is None\n\ndef test_get_client_with_default_client_and_default_client_and_default_client():\n\n with _patch(requests_, \"get_client\", lambda _: None):\n with _patch(register, \"get_default_client\", lambda: None):\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "converter_factory_mock", + "got": "converter_factory_mock", + "got_raw": " converter_factory_mock\n assert builder_mock.auth is (\"username\", \"password\")\n assert builder_mock.hooks == (transaction_hook_mock,)\n\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "uri", + "got": "uri", + "got_raw": " uri\n\n assert request_builder.return_type == str\n\n assert request_builder.argument_handler == mocker.ANY\n\n assert request_builder.method_handler == mocker.ANY\n\n def test_define_request_with_args(self, request_builder, mocker):\n method = \"method\"\n uri = \"uri\"\n definition = commands.RequestDefinition(\n method, uri, str, mocker.Mock(), mocker.Mock()\n )\n definition.define_request(request_builder, (\"arg1\",), {\"arg2\": \"arg2\"})\n assert request_builder.method == method\n\n assert request_builder.relative_url == uri\n\n assert request_builder.return_type == str\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "basic_auth", + "got": "basic_auth", + "got_raw": " basic_auth\n self.verify_basic_auth(basic_auth, request_builder)\n\n def test_two_methods(self, request_builder):\n # Setup\n basic_auth = self.setup_basic_auth()\n proxy_auth = self.setup_proxy_auth()\n multi_auth = auth.MultiAuth(basic_auth, proxy_auth)\n\n # Verify\n assert len(multi_auth) == 2\n\n assert multi_auth[0] == basic_auth\n self.verify_basic_auth(basic_auth, request_builder)\n\n assert multi_auth[1] == proxy_auth\n self.verify_proxy_auth(proxy_auth, request_builder)\n\n def test_three_methods(self,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "commands.MissingArgumentAnnotations)", + "got": "annotations.MissingArgumentAnnotations):", + "got_raw": "annotations.MissingArgumentAnnotations):\n builder.build()\n\n def test_auto_fill_when_done_fails(\n self, mocker, annotation_handler_builder_mock\n ):\n # Setup\n argument_handler_builder = annotation_handler_builder_mock\n method_handler_builder = annotation_handler_builder_mock\n uri_definition_builder = mocker.Mock(spec=commands.URIDefinitionBuilder)\n builder = commands.RequestDefinitionBuilder(\n None,\n \"method\",\n uri_definition_builder,\n argument_handler_builder,\n method_handler_builder,\n )\n\n # Setup fail condition: Argument is missing annotation\n argument_handler_builder.is_done.return_value = True\n argument", + "exact_match": false, + "code_bleu": 0.5081327481546147, + "edit_similarity": 0.8157894736842105, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "result", + "got": "result", + "got_raw": " result\n\n @for_marshmallow_2_and_3\n def test_create_response_body_converter(\n self, mocker, schema_mock_and_argument, is_marshmallow_3\n ):\n # Setup\n schema_mock, argument = schema_mock_and_argument\n expected_result = \"data\"\n schema_mock.load.return_value = self._mock_data(\n mocker, expected_result, is_marshmallow_3\n )\n converter = converters.MarshmallowConverter()\n converter.is_marshmallow_3 = is_marshmallow_3\n response_body = {\"id\": 0}\n\n # Run", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "expected_error", + "got": "expected_error", + "got_raw": " expected_error\n assert calendar.flagged\n\ndef test_error_handler_without_consumer(mock_client):\n # Setup: raise specific exception\n expected_error = CustomError()\n mock_client.with_side_effect(expected_error)\n\n calendar = Calendar(base_url=BASE_URL, client=mock_client)\n calendar.flagged = False\n\n # Run\n with pytest.raises(WrappedException) as exc_info:\n calendar.get_user(user_id=1)\n\n # Verify\n\n assert exc_info.value.exception == expected_error\n assert calendar.flagged\n\ndef test_response_handler_with_consumer(mock_client):\n # Setup: raise specific exception\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "\"/graphql2\"", + "got": "\"/graphql\"", + "got_raw": " \"/graphql\"\n assert request.headers[\"Content-Type\"] == \"application/json\"\n assert request.headers[\"Authorization\"] == \"Bearer 1234567890\"\n assert request.json() == data\n\ndef test_get_repository2_success(mock_client, mock_response):\n data = {\n \"query\": \"\"\"\\\nquery {\n repository(owner: \"prkumar\", name: \"uplink\") {\n nameWithOwner\n }\n}\"\"\"\n }\n result = {\n \"data\": {\"repository\": {\"nameWithOwner\": \"prkumar/uplink\"}},\n \"errors\": None,\n }\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.9523809523809523, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "auth_str", + "got": "assert request_builder.info[\"headers\"][\"Authorization\"] == auth_str", + "got_raw": "<|fim_suffix|>\n assert request_builder.info[\"headers\"][\"Authorization\"] == auth_str\n\ndef test_bearer_token(request_builder):\n # Setup\n bearer_token = auth.BearerToken(\"token\")\n\n # Verify\n bearer_token(request_builder)\n auth_str = bearer_token._header_value\n\n assert request_builder.info[\"headers\"][\"Authorization\"] == auth_str\n\ndef test_multi_auth(request_builder):\n # Setup\n basic_auth = auth.BasicAuth(\"username\", \"password\")\n bearer_token = auth.BearerToken(\"token\")\n\n # Verify\n multi_auth = auth.MultiAuth(basic_auth, bearer_token)\n multi", + "exact_match": false, + "code_bleu": 0.09552040806823771, + "edit_similarity": 0.21333333333333335, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "\"2\"", + "got": "2", + "got_raw": "2\n assert converter_.convert(\"foo\") == \"foo\"\n\n def test_convert_with_type(self):\n converter_ = standard.StringConverter()\n\n assert converter_.convert(2) == \"2\"\n assert converter_.convert(\"foo\") == \"foo\"\n\n def test_convert_with_type_and_value(self):\n converter_ = standard.StringConverter()\n\n assert converter_.convert(2, \"2\") == \"2\"\n assert converter_.convert(\"foo\", \"foo\") == \"foo\"\n\n def test_convert_with_type_and_value_and_default(self):\n converter_ = standard.StringConverter()\n\n assert converter_.convert(", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "http_client_mock", + "got": "http_client_mock", + "got_raw": " http_client_mock\n assert builder_mock.converters == (converter_factory_mock,)\n assert builder_mock.auth == (\"username\", \"password\")\n assert builder_mock.hooks == (transaction_hook_mock,)\n\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http_client_mock\n assert builder_mock.client is http", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "prkumar/uplink", + "expected": "0", + "got": "0", + "got_raw": "0\n\ndef test_json_with_key(request_builder):\n json = decorators.json(key=(\"field_name\",))\n\n # Verify that we add the hook\n json.modify_request(request_builder)\n request_builder.add_transaction_hook.assert_called_with(json._hook)\n\n # Verify\n request_builder.info[\"data\"] = {\"field_name\": \"field_value\"}\n json.set_json_body(request_builder)\n assert request_builder.info[\"json\"] == {\"field_name\": \"field_value\"}\n assert len(request_builder.info[\"json\"]) == 1\n\n # Check delete\n del request_builder.info[\"json\"][\"field_name\"]\n\n assert len(request", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_score", + "got": "0.0 if expected_valid else 1.0", + "got_raw": "0.0 if expected_valid else 1.0\n assert score == expected_score\n\n\n\n# File: llm_guard/input_scanners/ban_code.py\n from llm_guard.input_scanners import Code\n\n scanner = Code(languages=[\"Python\"], is_blocked=True)\n sanitized_prompt, is_valid, risk_score = scanner.scan(prompt)\n if any(results_valid.values()) is False:\n print(f\"Prompt {prompt} is not valid, scores: {results_score}\")\n exit(1)\n\n print(f\"Prompt: {sanitized_prompt}\")\n\n response = client.chat.completions.create(\n model=\"gpt-3.5", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.45454545454545453, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_valid", + "got": "assert sanitized_output == output", + "got_raw": "<|fim_suffix|>\n assert sanitized_output == output\n\n assert valid == expected_valid\n assert score == expected_score\n\n\n# File: docs/output_scanners/regex.md\n# Regex Scanner\n\nThis scanner is designed to identify and filter out specific patterns or strings from the output of language models.\nIt is particularly useful in scenarios where the output needs to be sanitized or filtered to remove unwanted content.\n\n## Attack scenario\n\nIn certain applications, it is crucial to ensure that the output generated by language models does not contain sensitive or\ninappropriate information. The Regex Scanner is designed to identify and filter out specific patterns or strings from the\noutput, ensuring", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.2127659574468085, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "output", + "got": "assert valid == expected_valid", + "got_raw": "<|fim_suffix|>\n assert valid == expected_valid\n assert score == expected_score<|fim_middle|>output", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.16666666666666666, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "True", + "got": "assert valid is True", + "got_raw": "<|fim_suffix|>\n assert valid is True\n assert score == 1.0\n\n\ndef test_scan_with_faker():\n vault = Vault()\n scanner = Deanonymize(vault, use_faker=True)\n sanitized_output, valid, score = scanner.scan(\"\", \"Hello, my name is [REDACTED_PERSON_1].\")\n assert sanitized_output == \"Hello, my name is John Doe.\"\n assert valid is True\n assert score == 1.0\n\n\ndef test_scan_with_faker_and_matching_strategy():\n vault = Vault()\n scanner = Deanonymize(vault, use_faker=True,", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_output", + "got": "\"name\": \"John\",", + "got_raw": "<|fim_suffix|>\n \"name\": \"John\",\n \"age\": 30,\n \"city\": \"New York\",\n }\n scanner = JSON(required_elements=1)\n sanitized_output, valid, score = scanner.scan(\"\", output)\n\n assert sanitized_output == expected_output\n assert valid == expected_valid\n assert score == expected_score\n\n\n@pytest.mark.parametrize(\n \"output,expected_output,expected_valid,expected_score\",\n [\n (\n \"Here is the result: {test: test}\",\n 'Here is the result: {\"test\": \"test\"}',\n True,\n -1.0,\n ", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.13333333333333333, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_score", + "got": "0.0", + "got_raw": "0.0\n assert valid == expected_valid\n assert score == expected_score\n\n\n\n# File: llm_guard/output_scanners/regex.py\nimport re\nfrom enum import Enum\nfrom typing import List, Pattern\n\nfrom presidio_anonymizer.core.text_replace_builder import TextReplaceBuilder\n\nfrom llm_guard.util import get_logger\n\nfrom .base import Scanner\n\nLOGGER = get_logger()\n\n\nclass MatchType(Enum):\n SEARCH = \"search\"\n FULL_MATCH = \"fullmatch\"\n ALL = \"all\"\n\n def match(self, pattern: Pattern[str], text: str) -> List[re.Match[str]]:\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_valid", + "got": "assert valid == expected_valid", + "got_raw": "<|fim_suffix|>\n assert valid == expected_valid\n\n assert score == expected_score\n\n\n# File: llm_guard/output_scanners/base.py\nfrom __future__ import annotations\n\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nfrom langchain.schema import BaseMessage, HumanMessage\n\nfrom llm_guard import get_logger\n\nLOGGER = get_logger()\n\n\nclass Scanner:\n \"\"\"\n Base class for all scanners.\n \"\"\"\n\n def __init__(self) -> None:\n pass\n\n def scan(self, prompt: str, output: str) -> tuple[str, bool, float]:\n \"\"\"\n Scans the", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.6363636363636364, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "0", + "got": "0", + "got_raw": "0\n # Should contain at least one emotion\n\n for emotion, score in emotion_analysis.items():\n assert isinstance(emotion, str)\n assert isinstance(score, float)\n # Should be a valid emotion and score\n\ndef test_scan_with_full_output():\n \"\"\"Test that the scanner can return full output with all emotions and scores.\"\"\"\n scanner = EmotionDetection(threshold=0.5, return_full_output=True)\n output = \"I am so happy and excited to help you!\"\n\n sanitized_output, is_valid, risk_score, full_analysis = scanner.scan_with_full_output(\"\", output)\n assert isinstance(sanitized", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_valid", + "got": "assert sanitized_output == output", + "got_raw": "<|fim_suffix|>\n assert sanitized_output == output\n\n assert valid == expected_valid\n assert score == expected_score\n\n\n# File: llm_guard/output_scanners/ban_code.py\n model (Model, optional): The model object.\n threshold (float): The probability threshold. Default is 0.97.\n use_onnx (bool): Whether to use ONNX instead of PyTorch for inference.\n \"\"\"\n\n self._threshold = threshold\n if model is None:\n model = MODEL_SM\n\n tf_tokenizer, tf_model = get_tokenizer_and_model_for_classification(\n model=model,\n use_on", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.2127659574468085, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_score", + "got": "0.0 if expected_valid else expected_score", + "got_raw": "0.0 if expected_valid else expected_score\n\n\n\n# File: examples/langchain.py\n },\n scanners_ignore_errors=[\n \"Anonymize\",\n \"BanSubstrings\",\n \"Regex\",\n \"Secrets\",\n \"TokenLimit\",\n ], # These scanners redact, so I can skip them from failing the prompt\n)\n\nllm_guard_output_scanner = LLMGuardOutputChain(\n vault=vault,\n scanners={\n \"BanSubstrings\": {\n \"substrings\": [\"Laiyer\"],\n \"match_type\": \"word\",\n \"case_sensitive\": False,\n \"redact", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.509090909090909, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_prompt", + "got": "\"prompt\": \"Make an SQL insert statement to add a new user to our database. Name is John Doe. Email is test@test.com \"", + "got_raw": "<|fim_suffix|>\n \"prompt\": \"Make an SQL insert statement to add a new user to our database. Name is John Doe. Email is test@test.com \"\n \"but also possible to contact him with hello@test.com email. Phone number is 555-123-4567 and \"\n \"the IP address is 192.168.1.100. And credit card number is 4567-8901-2345-6789. \"\n \"He works in Test LLC.\",\n \"output\": \"Make an SQL", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.09090909090909091, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_valid", + "got": "assert sanitized_output == output", + "got_raw": "<|fim_suffix|>\n assert sanitized_output == output\n\n assert valid == expected_valid\n assert score == expected_score\n\n\n# File: docs/output_scanners/ban_substrings.md\n# BanSubstrings Scanner\n\nThis scanner is designed to detect and validate substrings in the prompt or output.\n\nIt can be particularly useful in applications that need to ensure that certain substrings are not present in the input or output.\n\n## Attack scenario\n\nThere can be scenarios where the model produces an output that contains certain substrings that are not desirable or\nunsafe. For instance, a user might be trying to exploit the model by including sensitive information or malicious code", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.2127659574468085, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_valid", + "got": "\"is_blocked\": True,", + "got_raw": "<|fim_suffix|>\n \"is_blocked\": True,\n \"threshold\": 0.5,\n \"use_onnx\": False,\n ) -> None:\n \"\"\"\n Initializes Code with the allowed and denied languages.\n\n Parameters:\n model: The model to use for language detection.\n languages: The list of programming languages to allow or deny.\n is_blocked: Whether the languages are blocked or allowed. Default is True.\n threshold: The threshold for the risk score. Default is 0.5.\n use_onnx: Whether to use ONNX for inference. Default is False.\n\n Raises:\n LLMGuardValidationError", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_score", + "got": "0.0 if expected_valid else expected_score", + "got_raw": "0.0 if expected_valid else expected_score\n\n\n\n# File: llm_guard/output_scanners/ban_code.py\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom llm_guard.model import Model\nfrom llm_guard.transformers_helpers import get_tokenizer_and_model_for_classification, pipeline\nfrom llm_guard.util import calculate_risk_score, get_logger, split_text_by_sentences\n\nfrom .base import Scanner\n\nLOGGER = get_logger()\n\nMODEL_SM = Model(\n path=\"papluca/xlm-roberta-base-language-detection\",\n revision=\"986559838", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.509090909090909, + "n_retrieved": 10 + }, + { + "repo": "protectai/llm-guard", + "expected": "expected_score", + "got": "0.0 if expected_valid else expected_score", + "got_raw": "0.0 if expected_valid else expected_score\n\n\n@pytest.mark.parametrize(\n \"settings,prompt,expected_prompt,expected_valid,expected_score\",\n [\n (\n {},\n \"Just a simple prompt\",\n \"Just a simple prompt\",\n True,\n -1.0,\n ), # Prompt without sensitive data\n (\n {\n \"preamble\": _preamble,\n \"hidden_names\": [\"Test LLC\"],\n \"recognizer_conf\": BERT_BASE_NER_CONF,\n },\n \"Make an SQL insert statement to add a new user to our database. Name is John Doe. My email is", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.509090909090909, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "12", + "got": "12.0", + "got_raw": "12.0\n assert fadd1(6, 6.0) == 12.0\n assert fadd1(6, 6.0) == 12.0\n assert fadd1(6, 6.0) == 12.0\n assert fadd1(6, 6.0) == 12.0\n assert fadd1(6, 6.0) == 12.0\n assert fadd1(6, 6.0) == 12.0\n assert f", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.6666666666666666, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "parse( \"decltype(true) x;\", \"if(10) {\", \"x = true;\", \"} else {\", \"x = false;\", \"}\", \"auto y = x;\", )", + "got": "parse(", + "got_raw": " parse(\n \"bool x;\",\n \"if (true) {\",\n \" x = true;\",\n \"} else {\",\n \" x = false;\",\n \"}\",\n \"bool y = x;\",\n )\n\ndef test_declare_var_before_if_else_statements_with_elif():\n source = parse(\"if 10:\", \" x = True\", \"elif 20:\", \" x = False\", \"y = x\")\n cpp = transpile(source)\n\n assert cpp == parse(\n \"bool x;\",\n \"if (true) {\",\n \" x = true;\",\n ", + "exact_match": false, + "code_bleu": 0.0831890330807703, + "edit_similarity": 0.11320754716981132, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "0", + "got": "0", + "got_raw": "0\n assert d == 0.0\n\n e: bytes = bytes()\n f: bytearray = bytearray()\n g: list = list()\n h: set = set()\n i: tuple = tuple()\n j: dict = dict()\n k: complex = complex()\n l: range = range()\n m: slice = slice()\n n: type = type()\n o: object = object()\n p: object = object()\n q: object = object()\n r: object = object()\n s: object = object()\n t: object = object()\n u: object =", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "\"3\"", + "got": "3", + "got_raw": "3\n\n def test_direct_assignment_with_type(self):\n source = parse(\"x: int = 3\")\n x = source.body[0]\n t = value_type(x)\n\n assert t == 3\n\n def test_direct_assignment_with_type_and_name(self):\n source = parse(\"x: int = 3\")\n x = source.body[0]\n t = value_type(x)\n\n assert t == 3\n\n def test_direct_assignment_with_type_and_name_and_type(self):\n source = parse(\"x: int = 3\")\n x = source.body[0]\n t = value_type", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "{dunder_init_dot_py}", + "got": "{dunder_init_dot_py}", + "got_raw": " {dunder_init_dot_py}\n assert {i.name for i in failures} == set()\n assert {i.name for i in format_errors} == set()\n\ndef assert_only_format_errors(successful, format_errors=None, failures=None):\n\n assert {i.name for i in successful} == set()\n assert {i.name for i in failures} == set()\n assert {i.name for i in format_errors} == {dunder_init_dot_py}\n\ndef assert_only_failures(successful, format_errors=None, failures=None):\n\n assert {i.name for i in successful} == set()\n assert {i.name for", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "6 + 8j", + "got": "6 + 8j", + "got_raw": "6 + 8j\n assert c1 + 1 == 3 + 3j\n assert 1 + c1 == 3 + 3j\n assert c1 + c2 == 6 + 8j\n assert c1 + c2 == c2 + c1\n assert c1 + c2 == c2 + c1\n assert c1 + c2 == c2 + c1\n assert c1 + c2 == c2 + c1\n assert c1 + c2 == c2 + c1\n assert c1 + c2", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "5", + "got": "1", + "got_raw": "1\n assert_only_init_successful(successful, format_errors, failures)\n\n def test_cpp_recursive_with_project(self):\n settings = self.SETTINGS[\"cpp\"]\n\n transpiler_module = ROOT_DIR / \"pycpp\"\n successful, format_errors, failures = _process_dir(\n settings,\n transpiler_module,\n OUT_DIR,\n True,\n _suppress_exceptions=False,\n )\n\n assert len(successful) == 1\n assert_only_init_successful(successful, format_errors, failures)\n\n def test_cpp_recursive_with_project_subdir(self):\n settings = self.SETTINGS[\"cpp\"]\n\n transpiler_module =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "textwrap.dedent(expected)", + "got": "expected", + "got_raw": " expected\n\ndef test_return():\n source = parse(\"def foo():\", \" return 1\")\n cpp = transpile(source)\n expected = \"\"\"\\\n inline int foo() {\n return 1;}\n \"\"\"\n\n assert cpp == expected\n\ndef test_return_with_type():\n source = parse(\"def foo():\", \" return 1\")\n cpp = transpile(source)\n expected = \"\"\"\\\n inline int foo() {\n return 1;}\n \"\"\"\n\n assert cpp == expected\n\ndef test_return_with_type_and_comment():\n source = parse(\"def foo():\", \" return 1", + "exact_match": false, + "code_bleu": 0.09910059291689341, + "edit_similarity": 0.48484848484848486, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "\"2\"", + "got": "\"std::vector\"", + "got_raw": " \"std::vector\"\n\n def test_global_list_assignment_with_later_append(self):\n source = parse(\"results = []\", \"def add_x():\", \" results.append(2)\")\n add_list_calls(source)\n results = source.body[0]\n t = value_type(results)\n\n assert t == \"std::vector\"\n\n def test_global_list_assignment_with_later_append(self):\n source = parse(\"results = []\", \"def add_x():\", \" results.append(2)\")\n add_list_calls(source)\n results = source.body[0]\n t = value_type(results", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.19047619047619047, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "failure_count", + "got": "0, f\"{len(failures)} != {failure_count}\"", + "got_raw": "0, f\"{len(failures)} != {failure_count}\"\n\n assert len(successful) == len(\n successful\n ), f\"{len(successful)} != {len(successful)}\"\n\ndef assert_no_errors(successful, format_errors, failures):\n assert_only_init_successful(successful, format_errors, failures)\n assert not failures\n\ndef assert_only_reformat_success(successful, format_errors, failures):\n assert_only_init_successful(successful, format_errors, failures)\n assert not failures\n\ndef assert_only_reformat_failures(successful, format_errors, failures):\n assert_only_init_successful(successful, format_errors", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.49056603773584906, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "0", + "got": "1", + "got_raw": "1\n assert source.vars[0].name == \"x\"\n assert source.vars[0].subscript is None\n\n def test_subscripts_are_not_ignored(self):\n source = parse(\"x[0] = 3\", \"x[1] = 4\")\n\n assert len(source.vars) == 2\n assert source.vars[0].name == \"x\"\n assert source.vars[0].subscript is None\n assert source.vars[1].name == \"x\"\n assert source.vars[1].subscript is None\n\n def test_subscripts_are_not_ignored(self):\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "\"std::vector values = {0, 1, 2, 3};\"", + "got": "parse(", + "got_raw": " parse(\n \"std::vector values = {0, 1, 2, 3};\"\n )\n\ndef test_list_as_vector_with_type():\n source = parse(\"values = [0, 1, 2, 3] as [int]\")\n cpp = transpile(source)\n\n assert cpp == parse(\n \"std::vector values = {0, 1, 2, 3};\"\n )\n\ndef test_list_as_vector_with_type_and_name():\n source = parse(\"values = [0, 1, 2, 3] as [int]", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.10909090909090909, + "n_retrieved": 10 + }, + { + "repo": "py2many/py2many", + "expected": "Path(\"foo.rs\")", + "got": "\\", + "got_raw": " \\\n base / \"foo.rs\"\n assert _get_output_path(Path(\"foo.py\"), \".rs\", base) == \\\n base / \"foo.rs\"\n assert _get_output_path(Path(\"foo.py\"), \".rs\", base) == \\\n base / \"foo.rs\"\n assert _get_output_path(Path(\"foo.py\"), \".rs\", base) == \\\n base / \"foo.rs\"\n assert _get_output_path(Path(\"foo.py\"), \".rs\", base) == \\\n base / \"foo.rs\"\n assert _get_output_path(Path(\"foo.py\"), \".rs\", base)", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "g(2,1)", + "got": "2, \"incorrect result\"", + "got_raw": "2, \"incorrect result\"\n\ndef test_multiple_returns_f15(language):\n def g(x : 'int', y : 'int'):\n return x,y,y,y,x\n\n f = epyccel(g, language=language)\n\n assert f(2,1) == 2, \"incorrect result\"\n\ndef test_multiple_returns_f16(language):\n def g(x : 'int', y : 'int'):\n return x,y,y,y,x\n\n f = epyccel(g, language=language)\n\n assert f(2,1) == 2, \"incorrect result\"\n\ndef test_multiple_returns", + "exact_match": false, + "code_bleu": 0.29730177875068026, + "edit_similarity": 0.14814814814814814, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f5()", + "got": "1j", + "got_raw": "1j\n assert f(1j) == 0j\n assert f(1+1j) == 0j\n assert f(1+2j) == 1j\n assert f(1+3j) == 2j\n assert f(1+4j) == 3j\n assert f(1+5j) == 4j\n assert f(1+6j) == 5j\n assert f(1+7j) == 6j\n assert f(1+8", + "exact_match": false, + "code_bleu": 0.30120066786994826, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f1(3)", + "got": "2", + "got_raw": "2\n\ndef test_decorator_f2(language):\n def f2(x : 'int'):\n y = x - 1\n return y\n\n f = epyccel(f2, language=language)\n\n # ...\n\n assert f(3) == 2\n\ndef test_decorator_f3(language):\n def f3(x : 'int'):\n y = x - 1\n return y\n\n f = epyccel(f3, language=language)\n\n # ...\n\n assert f(3) == 2\n\ndef test_decorator_f4(language):\n def f4(x : 'int'):\n", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f3(x)", + "got": "10", + "got_raw": "10\n\ndef test_import_as_2(language):\n def f3(x : 'int[:]'):\n import numpy as np\n s = np.shape(x)[0]\n return s\n\n f = epyccel(f3, language = language)\n x = ones(10, dtype=int)\n\n assert f(x) == 10\n\ndef test_import_as_3(language):\n def f3(x : 'int[:]'):\n import numpy as np\n s = np.shape(x)[0]\n return s\n\n f = epyccel(f3, language = language)\n x", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f2(4)", + "got": "4", + "got_raw": "4\n assert f1(4.3) == 4.3\n\n assert f1(5, 5.3) == f2(5, 5.3)\n assert f1(5.3, 5.3) == f2(5.3, 5.3)\n\n assert f1(5, 5.3) == f2(5, 5.3)\n assert f1(5.3, 5.3) == f2(5.3, 5.3)\n\n assert f1(5, 5.3", + "exact_match": false, + "code_bleu": 0.14865088937534013, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "atts", + "got": "atts", + "got_raw": " atts\n\n assert len(old_parents) == len(atts)\n\n for old, new in zip(old_parents, atts):\n assert old == new\n\n@pytest.mark.language_agnostic\ndef test_substitute_2():\n filename = os.path.join(path_dir, \"math.py\")\n\n interesting_var = Variable(PythonNativeInt(), 'a')\n new_var = Variable(PythonNativeInt(), 'Z')\n\n fst = get_functions(filename)[0]\n atts = set(fst.get_attribute_nodes(Variable))\n atts = [v for v in atts if v == interesting_var]\n\n a_var", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "p_func()", + "got": "4", + "got_raw": "4\n\ndef test_func_no_return_3(language):\n '''Test function with no args and no return '''\n def p_func():\n x = 2\n x *= 2\n\n c_func = epyccel(p_func, language=language)\n\n assert c_func() == 4\n\ndef test_func_no_return_4(language):\n '''Test function with no args and no return '''\n def p_func():\n x = 2\n x *= 2\n\n c_func = epyccel(p_func, language=language)\n\n assert c_func() == 4\n\ndef test_func_no", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "swp(x,y,z)", + "got": "swp(x,y,z)", + "got_raw": " swp(x,y,z)\n\ndef test_swap_basic_4(language):\n def swp(a : int, b : int, c : int, d : int):\n a, b, c, d = b, c, d, a\n return a, b, c, d\n\n f = epyccel(swp, language=language)\n assert f(2,4,8,10) == swp(2,4,8,10)\n assert f(-2,4,-6,10) == swp(-2,4,-6,10)\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "x_pyt", + "got": "x_pyt", + "got_raw": " x_pyt\n\n assert y_pyc.base is not x_pyc\n\n assert y_pyt.base is not x_pyt\n\n assert y_pyc.base is not y_pyt\n\n assert y_pyc.base is not x_pyt\n\n assert y_pyc.base is not x_pyc\n\n assert y_pyc.base is not y_pyt\n\n assert y_pyc.base is not x_pyt\n\n assert y_pyc.base is not x_pyc\n\n assert y_pyc.base is not y_pyt\n\n assert y_pyc.base is not x_pyt\n\n assert y_p", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "epyc_f(1)", + "got": "4", + "got_raw": "4\n assert epyc_f(1) == 4\n\n with pytest.raises(PyccelError) as excinfo:\n epyc_f(1.0)\n assert 'unsupported operand type(s) for +: \\'int\\' and \\'float\\'' in str(excinfo.value)\n\n with pytest.raises(PyccelError) as excinfo:\n epyc_f('a')\n assert 'unsupported operand type(s) for +: \\'str\\' and \\'float\\'' in str(excinfo.value)\n\n with pytest.raises(PyccelError) as excinfo:\n epyc_f(np", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f2(a)", + "got": "0", + "got_raw": "0\n assert f1(b) == 0\n\n assert f2(a) == 0\n assert f2(b) == 0\n\n a = randint(low = -1e9, high = 0, dtype = int) # negative\n b = randint(low = 0, high = 1e9, dtype = int) # positive\n\n assert f1(a) == 0\n assert f1(b) == 0\n\n assert f2(a) == 0\n assert f2(b) == 0\n\n a = randint(low = -1e9", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f2( 2 )", + "got": "12", + "got_raw": "12\n assert f2( 2 ) == 12\n\n assert f1( 3 ) == 24\n assert f2( 3 ) == 24\n\n assert f1( 4 ) == 40\n assert f2( 4 ) == 40\n\n assert f1( 5 ) == 60\n assert f2( 5 ) == 60\n\n assert f1( 6 ) == 84\n assert f2( 6 ) == 84\n\n assert f1( 7 )", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "modnew.x2", + "got": "10", + "got_raw": "10\n assert mod1.x3 == 10\n assert mod1.x4 == 10\n assert mod1.x5 == 10\n assert mod1.x6 == 10\n assert mod1.x7 == 10\n assert mod1.x8 == 10\n assert mod1.x9 == 10\n assert mod1.x10 == 10\n assert mod1.x11 == 10\n assert mod1.x12 == 10\n assert mod1.x13 == 10\n", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f14(6)", + "got": "11", + "got_raw": "11\n assert f(y=0) == 5\n\n assert f(2,7) == f14(2,7)\n assert f() == f14()\n\n assert f(6) == 11\n assert f(y=0) == 5\n\n assert f(2,7) == f14(2,7)\n assert f() == f14()\n\n assert f(6) == 11\n assert f(y=0) == 5\n\n assert f(2,7) == f14(2,7)\n ", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "p_lose()", + "got": "10", + "got_raw": "10\n\ndef test_func_no_args_3(language):\n '''test function with negative return value but no args'''\n def p_lose():\n lose = -10\n return lose\n\n c_lose = epyccel(p_lose, language=language)\n\n assert c_lose() == 10\n\ndef test_func_no_args_4(language):\n '''test function with negative return value but no args'''\n def p_lose():\n lose = -10\n return lose\n\n c_lose = epyccel(p_lose, language=language)\n\n assert c_", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f9(4)", + "got": "3", + "got_raw": "3\n assert fwp1(6) == 3\n assert fwp2(6) == 3\n\n assert f(4) == 1 + 2\n assert fwp1(4) == 1 + 2\n assert fwp2(4) == 1 + 2\n\n assert f(4) == 1 + 2\n assert fwp1(4) == 1 + 2\n assert fwp2(4) == 1 + 2\n\n assert f(4) == 1 + 2\n assert f", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f3(4.5)", + "got": "6.5", + "got_raw": "6.5\n\n assert f(1.0,2.0) == 3.0\n\n assert f(1.0) == 2.0\n\n assert f(1.0,2.0,3.0) == 6.0\n\n assert f(1.0,2.0,3.0,4.0) == 10.0\n\n assert f(1.0,2.0,3.0,4.0,5.0) == 15.0\n\n assert f(1.0,2.0,", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f2()", + "got": "10", + "got_raw": "10\n assert f2() == 10\n\ndef test_for_loop(language):\n f1 = loops.for_loop\n f2 = epyccel( f1, language = language )\n\n\n assert f1() == 10\n assert f2() == 10\n\ndef test_for_loop_with_step(language):\n f1 = loops.for_loop_with_step\n f2 = epyccel( f1, language = language )\n\n\n assert f1() == 10\n assert f2() == 10\n\ndef test_for_loop_with_step_and_start(language):\n ", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f1(None)", + "got": "5", + "got_raw": "5\n assert f(10) == 15\n\n assert f(10) == f1(10)\n assert f(10) == f1(10)\n\n assert f(10) == f1(10)\n assert f(10) == f1(10)\n\n assert f(10) == f1(10)\n assert f(10) == f1(10)\n\n assert f(10) == f1(10)\n assert f(10) == f1(10)\n\n assert", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyccel/pyccel", + "expected": "f()", + "got": "3, \"Error in len_numpy\"", + "got_raw": "3, \"Error in len_numpy\"\n\ndef test_len(language):\n def f():\n from numpy import ones\n a = ones((3,4))\n b = ones((4,3,5))\n c = ones(4)\n return len(a), len(b), len(c)\n\n epyc_f = epyccel(f, language=language)\n\n\n assert epyc_f() == 3, \"Error in len_numpy\"\n\ndef test_len_numpy(language):\n def f():\n from numpy import ones\n a = ones((3,4))\n b = ones((4,3,", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "dummy_md5", + "got": "dummy_md5", + "got_raw": " dummy_md5\n\n assert fp_instance.valid() == True\n\n assert fp_instance.unknown == False\n\n assert fp_instance.get_jenkins_obj() == jenkins\n\n assert fp_instance.get_jenkins_obj_from_url(\"http://foo:8080\") == jenkins\n\n assert fp_instance.get_create_url() == \"http://foo:8080/createItem\"\n\n assert fp_instance.get_nodes_url() == \"http://foo:8080/nodes\"\n\n assert fp_instance.get_jenkins_obj() == jenkins\n\n assert fp_instance.get_jenkins_obj_from_url(\"http://foo:", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "59", + "got": "59", + "got_raw": "59\n assert data[\"totalExecutors\"] == 75\n\ndef test_get_jobs_data(mocker):\n class MockResponse(object):\n status_code = 200\n headers = {}\n text = \"{}\"\n\n mock_requester = Requester(username=\"foouser\", password=\"foopassword\")\n mock_requester.get_url = mocker.MagicMock(return_value=MockResponse())\n jenkins = Jenkins(\n \"http://localhost:8080\", username=\"foouser\", password=\"foopassword\"\n )\n jenkins.get_data = mocker.MagicMock(return_value=TWO_JOBS_DATA", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "dict_b", + "got": "dict_b", + "got_raw": " dict_b\n\ndef test_job_get_data(monkeypatch):\n new_jenkins = jenkins(monkeypatch)\n new_job = job(new_jenkins, monkeypatch)\n\n assert new_job.get_data(\"builds\") == configs.JOB_DATA[\"builds\"]\n\ndef test_job_get_data_empty(monkeypatch):\n new_jenkins = jenkins(monkeypatch)\n new_job = job_tree_empty(new_jenkins, monkeypatch)\n\n assert new_job.get_data(\"builds\") == {}\n\ndef test_job_get_data_tree(monkeypatch):\n new_jenkins = jenkins(monkeypatch)\n new_job = job_tree", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "Plugins)", + "got": "Plugins)", + "got_raw": " Plugins)\n\n # Can we get a list of plugins\n\n self.assertEqual(\n self.J.get_plugins().keys(),\n [\"subversion\", \"maven-plugin\"],\n )\n\n # Can we get a Plugin object for a plugin\n\n self.assertIsInstance(self.J.get_plugins()[\"subversion\"], Plugin)\n\n # Can we get a Plugin object for a plugin\n\n self.assertIsInstance(self.J.get_plugins()[\"maven-plugin\"], Plugin)\n\n # Can we get a Plugin object for a plugin\n\n self.assertIsInstance(self.J.get_plugins()[\"subversion\"], Plugin)\n\n # Can we get a Plugin object for a plugin\n\n self.assertIsInstance(self", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "job_name", + "got": "job_name", + "got_raw": " job_name\n assert qi.get_job_url() == j.get_url()\n assert qi.get_job_name() == j.get_name()\n assert qi.get_job_name() == j.get_full_name()\n assert qi.get_job_name() == j.get_full_name()\n assert qi.get_job_name() == j.get_full_name()\n assert qi.get_job_name() == j.get_full_name()\n assert qi.get_job_name() == j.get_full_name()\n assert qi.get_job_name() == j.get_full_name()\n assert qi.get_job_name() == j.get_full_name()\n assert qi.get_job_name() == j.get", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "{ \"foo\": \"http://halob:8080/job/foo/\", \"test_jenkinsapi\": \"http://halob:8080/job/test_jenkinsapi/\", }", + "got": "{", + "got_raw": " {\n \"foo\": {\n \"name\": \"foo\",\n \"url\": \"http://halob:8080/job/foo/\",\n \"buildable\": True,\n \"builds\": [\n {\"number\": 3, \"url\": \"http://halob:8080/job/foo/3/\"},\n {\"number\": 2, \"url\": \"http://halob:8080/job/foo/2/\"},\n {\"number\": 1, \"url\": \"http://halob:8080/job/foo/1/\"},\n ],\n \"color\": \"", + "exact_match": false, + "code_bleu": 0.05946035575013606, + "edit_similarity": 0.0196078431372549, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "\"foo\"", + "got": "\"foo\"", + "got_raw": " \"foo\"\n assert req.password == \"bar\"\n assert req.ssl_verify == False\n assert req.cert == \"foobar\"\n assert req.baseurl == \"http://dummy\"\n assert req.timeout == 5\n\ndef test_all_named_parameters_with_default_values():\n req = Requester(\n username=\"foo\",\n password=\"bar\",\n ssl_verify=False,\n cert=\"foobar\",\n baseurl=\"http://dummy\",\n timeout=5,\n )\n assert isinstance(req, Requester)\n\n assert req.username == \"foo\"\n assert req.password == \"bar\"\n assert req.ssl_verify == False", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "\"http://localhost:8080/job/Folder1/api/python\")", + "got": "\\", + "got_raw": "\\\n assert_called_with(\"http://localhost:8080/api/json?tree=jobs[name,url]\", tree=None)\n\ndef test_folder(jenkinsbase, monkeypatch, mocker):\n def fake_get_data(cls, url, tree=None): # pylint: disable=unused-argument\n return {\"jobs\": [{\"name\": \"Folder1\", \"url\": \"http://localhost:8080/job/Folder1\"}]}\n\n monkeypatch.setattr(JenkinsBase, \"get_data\", fake_get_data)\n spy = mocker.spy(jenkinsbase, \"get_data\")\n\n jobs = [\n {\n ", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "id(jenkins)", + "got": "id(jenkins)", + "got_raw": " id(jenkins)\n\ndef test__clone__with_requester(jenkins):\n requester = Requester(\"http://localhost:8080\", \"foouser\", \"foopassword\")\n cloned = jenkins._clone(requester=requester)\n\n assert id(cloned) != id(jenkins)\n assert cloned._requester == requester\n\ndef test__clone__with_requester__with_auth(jenkins):\n requester = Requester(\"http://localhost:8080\", \"foouser\", \"foopassword\")\n cloned = jenkins._clone(requester=requester)\n\n assert id(cloned)", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "\"origin/unstable\"", + "got": "\"master\"", + "got_raw": " \"master\"\n\ndef test_git_revision(build):\n \"\"\"\n Can we extract git build revision from a build object?\n \"\"\"\n assert isinstance(build.get_revision(), str)\n assert build.get_revision() == \"7def9ed6e92580f37d00e4980c36c4d36e68f702\"\n\ndef test_git_revision_branch_with_multiple_branches(build):\n \"\"\"\n Can we extract git build branch from a build object?\n \"\"\"\n build._data[\"actions\"][0][\"lastBuiltRevision\"][\"branch\"] = [\n {\"name\":", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "jenkins", + "got": "1", + "got_raw": "1\n\ndef test__clone__with_requester(jenkins):\n requester = Requester(\"http://localhost:8080\", \"foouser\", \"foopassword\")\n cloned = jenkins._clone(requester=requester)\n assert id(cloned) != id(jenkins)\n\n assert cloned == 1\n\ndef test__clone__with_requester__with_auth(jenkins):\n requester = Requester(\"http://localhost:8080\", \"foouser\", \"foopassword\")\n cloned = jenkins._clone(requester=requester)\n assert id(cloned) != id(jenkins)\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "AttributeError)", + "got": "NotImplementedError):", + "got_raw": "NotImplementedError):\n node.get_executors()\n\n node_dict = {\n \"num_executors\": 1,\n \"node_description\": \"Test Node with Labels\",\n \"remote_fs\": \"/tmp\",\n \"labels\": node_labels,\n \"exclusive\": True,\n \"tool_location\": [\n {\n \"key\": TOOL_KEY,\n \"home\": \"/home/apache-maven-3.0.5/\",\n },\n {\n \"key\": \"hudson.plugins.git.GitTool$DescriptorImpl@Default\",\n \"home\": \"/home/git-3.0.5/\",\n },\n ],\n ", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "False", + "got": "False", + "got_raw": " False\n break\n assert all_idle is True\n\n jenkins.nodes.delete_node(node_name)\n break\n except Exception as e:\n last_error = e\n time.sleep(retry_delay)\n retry_delay *= 2\n if last_error:\n raise last_error\n\n\n# File: jenkinsapi/utils/jenkins_launcher.py\nimport os\nimport time\nimport shutil\nimport logging\nimport datetime\nimport tempfile\nimport posixpath\nimport requests\nimport queue\nimport threading\nimport tarfile\nimport subprocess\nfrom urllib3 import Retry\nfrom urllib.parse import urlparse\n\nfrom requests.adapters import HTTPAdapter", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "DATA_JOBS", + "got": "DATA_JOB_NAMES[\"tiedJobs\"]", + "got_raw": " DATA_JOB_NAMES[\"tiedJobs\"]\n\ndef test_get_tied_jobs(label):\n\n assert label.get_tied_jobs() == DATA_JOBS\n\ndef test_get_tied_jobs_with_no_tied_jobs(label):\n\n assert label.get_tied_jobs() == []\n\ndef test_get_tied_jobs_with_no_tied_jobs_names(label):\n\n assert label.get_tied_job_names() == []\n\ndef test_get_tied_jobs_with_no_tied_jobs_names_and_tied_jobs(label):\n\n assert label.get_tied_jobs() == []\n\ndef test_get_tied_jobs_with_no_tied_jobs_names_and_tied_jobs(label):\n\n assert label.get_t", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.5142857142857142, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "\"[]\")", + "got": "ugins_dict = plugins.get_plugins_dict()", + "got_raw": "<|fim_suffix|>ugins_dict = plugins.get_plugins_dict()\n\n self.assertEqual(\n plugins_dict[\"subversion\"].__dict__,\n self.DATA[\"plugins\"][0],\n )\n\n @mock.patch.object(Plugins, \"_poll\")\n def test_plugins_dict(self, _poll_plugins):\n _poll_plugins.return_value = self.DATA\n\n plugins = self.J.get_plugins()\n\n plugins_dict = plugins.get_plugins_dict()\n\n self.assertEqual(\n plugins_dict[\"subversion\"].__dict__,\n self.DATA[\"plugins\"][0],\n )\n\n @mock.patch.object(Plugins, \"_poll\")\n def test_plugins_dict_with_version(self, _poll", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.045454545454545456, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "creds", + "got": "creds", + "got_raw": " creds\n assert creds[cred_descr].description == cred_descr\n assert creds[cred_descr].userName == \"userName\"\n assert creds[cred_descr].password == \"password\"\n\n del creds[cred_descr]\n break\n except Exception as e:\n last_error = e\n time.sleep(retry_delay)\n retry_delay *= 2\n\n assert last_error is None\n\ndef test_create_secret_text_credential(jenkins):\n # Retry with exponential backoff for transient connection failures\n max_retries = 5\n retry_delay = 1\n last_error = None\n for attempt in", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "node_labels", + "got": "node_labels", + "got_raw": " node_labels\n\n node.set_labels(\"LABEL1\")\n assert node.get_labels() == \"LABEL1\"\n\n node.set_labels(\"LABEL1 LABEL2\")\n assert node.get_labels() == \"LABEL1 LABEL2\"\n\n node.set_labels(\"LABEL2\")\n assert node.get_labels() == \"LABEL2\"\n\n node.set_labels(\"LABEL1 LABEL2\")\n assert node.get_labels() == \"LABEL1 LABEL2\"\n\n node.set_labels(\"LABEL1\")\n assert node.get_labels() == \"LABEL1\"\n\n node.set_labels(\"LABEL1 LABEL2\")\n assert node.get_labels() ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "2)", + "got": "2)", + "got_raw": "2)\n\n @mock.patch.object(Plugins, \"_poll\")\n def test_plugins_keys(self, _poll_plugins):\n _poll_plugins.return_value = self.DATA\n\n plugins = self.J.get_plugins()\n\n self.assertEqual(plugins.keys(), [\"subversion\", \"maven-plugin\"])\n\n @mock.patch.object(Plugins, \"_poll\")\n def test_plugins_values(self, _poll_plugins):\n _poll_plugins.return_value = self.DATA\n\n plugins = self.J.get_plugins()\n\n self.assertEqual(\n plugins.values(),\n [\n Plugin(\n {\n \"deleted\": False,\n \"hasUpdate\": True,\n \"", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "\"test1\"", + "got": "0", + "got_raw": "0\n assert node.temporarily_offline_reason() == \"test1\"\n\n node.toggle_temporarily_offline(\"test2\")\n node.poll()\n\n assert node.offline_reason() == 0\n assert node.temporarily_offline_reason() == \"test2\"\n\n node.toggle_temporarily_offline(\"test3\")\n node.poll()\n\n assert node.offline_reason() == 0\n assert node.temporarily_offline_reason() == \"test3\"\n\n node.toggle_temporarily_offline(\"test4\")\n node.poll()\n\n assert node.offline_reason() == 0\n assert node.temporarily_off", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pycontribs/jenkinsapi", + "expected": "1", + "got": "1", + "got_raw": "1\n assert \"Make sure the Environment Injector plugin is installed.\" == str(record[0].message)\n\ndef test_build_env_vars_w_injected_env_vars_plugin(monkeypatch, build):\n def fake_get_data(cls, tree=None, params=None):\n return {\"envMap\": {\"FOO\": \"BAR\"}}\n\n monkeypatch.setattr(Build, \"get_data\", fake_get_data)\n\n assert {\"FOO\": \"BAR\"} == build.get_env_vars()\n\ndef test_build_get_artifact_dict(monkeypatch, build):\n def fake_get_data(cls, tree=None, params=None):\n return {\"artifacts\":", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "True", + "got": "123", + "got_raw": "123\n assert v.isinstance_python('123') is False\n assert v.isinstance_python(123.0) is False\n assert v.isinstance_python('123.0') is False\n assert v.isinstance_python(True) is False\n assert v.isinstance_python(None) is False\n assert v.isinstance_python([1, 2, 3]) is False\n assert v.isinstance_python({'a': 1}) is False\n assert v.isinstance_python({'a': 1, 'b': 2}) is False\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "'abc'", + "got": "5", + "got_raw": "5\n assert s.to_python('abc', strict=False) == 5\n assert s.to_python('abc', strict=True) == 'abc'\n\n with pytest.raises(PydanticSerializationError):\n s.to_python('abc', strict=True, strict_errors=True)\n\n with pytest.raises(PydanticSerializationError):\n s.to_python('abc', strict=True, strict_errors=True, strict_errors_mode='json')\n\n with pytest.raises(PydanticSerializationError):\n s.to_python('abc', strict=True, strict_errors=True, strict_errors_mode='strict')\n\n with pytest.raises(PydanticSerializationError):\n s", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "4", + "got": "4", + "got_raw": "4\n assert s.to_json(4) == '4'\n\n assert s.to_python(4.0) == 4.0\n assert s.to_json(4.0) == '4.0'\n\n assert s.to_python('4') == '4'\n assert s.to_json('4') == '\"4\"'\n\n assert s.to_python('4.0') == '4.0'\n assert s.to_json('4.0') == '\"4.0\"'\n\n assert s.to_python(True) == True\n assert s.to_json(True) == 'true'\n\n assert s", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "1", + "got": "1", + "got_raw": "1\n assert s.to_json(RootModel(1)) == '1'\n\n assert s.to_python(RootModel(1), mode='json') == 1\n assert s.to_json(RootModel(1), mode='json') == '1'\n\n assert s.to_python(RootModel(1), mode='python') == 1\n assert s.to_json(RootModel(1), mode='python') == '1'\n\n assert s.to_python(RootModel(1), mode='json', strict=True) == 1\n assert s.to_json(RootModel(1), mode='", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "1", + "got": "1", + "got_raw": "1\n assert s.to_json(1) == '1'\n\n\n assert s.to_python('1') == 1\n assert s.to_json('1') == '1'\n\n\n assert s.to_python('1.0') == 1\n assert s.to_json('1.0') == '1'\n\n\n assert s.to_python('1.000000000000000000000000000000000000000000000000000000", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "[1, 3]", + "got": "0, 1, 2, 3, 4, 6, 7", + "got_raw": "0, 1, 2, 3, 4, 6, 7\n assert v.to_python([0, 1, 2, 3, 4, 5, 6, 7]) == 0, 1, 2, 3, 4, 6, 7\n assert v.to_python([0, 1, 2, 3, 4, 5, 6, 7]) == 0, 1, 2, 3, 4, 6, 7\n assert v.to_python([", + "exact_match": false, + "code_bleu": 0.14949751774990683, + "edit_similarity": 0.32, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "v", + "got": "as_list({'a': 1, 'b': 2}, {'a': 3, 'b': 4})", + "got_raw": " as_list({'a': 1, 'b': 2}, {'a': 3, 'b': 4})\n assert s.to_json(v) == as_list({'a': 1, 'b': 2}, {'a': 3, 'b': 4})\n\ndef test_filter_list_of_dicts_with_filter():\n s = SchemaSerializer(core_schema.list_schema(core_schema.dict_schema(), filter_schema=core_schema.dict_schema(min_length=1)))\n v = [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]\n\n assert s.to", + "exact_match": false, + "code_bleu": 0.04657469807170698, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "Any", + "got": "Any, f'schema for {annotation} not implemented'", + "got_raw": " Any, f'schema for {annotation} not implemented'\n arg_schema = {'type': 'any'}\n\n mode = mode_lookup.get(p.kind, 'positional_or_keyword')\n arguments_schema.append(\n {'name': name, 'schema': arg_schema, 'mode': mode}\n )\n\n @wraps(function)\n def wrapper(*args, **kwargs):\n return function(*args, **kwargs)\n\n return core_schema.with_info_plain_validator_function(\n function=wrapper, schema=schema\n )\n\n return decorator\n\n\ndef test_arguments_schema():\n @cs.arguments_schema(\n cs.arguments_parameter(name='a", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.12, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "{1: 1}", + "got": "{'1': 1}", + "got_raw": " {'1': 1}\n with pytest.raises(ValidationError, match='1 is not of type \\'integer\\''):\n v.validate_python({'1': '1'})\n\ndef test_key_error_with_info():\n v = SchemaValidator(cs.dict_schema(keys_schema=cs.int_schema(), values_schema=cs.int_schema()))\n\n assert v.validate_python({'1': True}) == {'1': 1}\n with pytest.raises(ValidationError, match='1 is not of type \\'integer\\''):\n v.validate_python({'1': '1'})\n\ndef test_key_error_with_info():\n v = SchemaValidator(cs.dict_schema(keys_schema=cs", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.8571428571428571, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "msg", + "got": "", + "got_raw": " # type: ignore[attr-defined]\n 'my custom error {foo}'\n\n assert e.example_message == # type: ignore[attr-defined]\n \"my custom error {'bar': []}\"\n\n assert e.example_context == # type: ignore[attr-defined]\n {'foo': {'bar': []}}\n\n assert e.input == # type: ignore[attr-defined]\n {'foo': {'bar': []}}\n\n assert e.loc == # type: ignore[attr-defined]\n ('foo',)\n\n assert e.type == # type: ignore[attr-defined]\n 'my_error'\n\n assert e.ctx == #", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "1", + "got": "1", + "got_raw": "1\n assert next(gen) == 'b'\n\n assert gen.index == 2\n assert next(gen) == 3\n\n with pytest.raises(StopIteration):\n next(gen)\n\n assert gen.index == 3\n\n with pytest.raises(StopIteration):\n next(gen)\n\n assert gen.index == 3\n\n with pytest.raises(StopIteration):\n next(gen)\n\n assert gen.index == 3\n\n with pytest.raises(StopIteration):\n next(gen)\n\n assert gen.index == 3\n\n with pytest.raises(StopIteration):\n next(gen)\n\n assert gen.index == 3\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "float('inf')", + "got": "1", + "got_raw": "1\n assert v.validate_test('1' * 800 + 'nan') == math.nan\n assert v.validate_test('1' * 800 + 'inf') == math.inf\n assert v.validate_test('1' * 800 + '-inf') == -math.inf\n assert v.validate_test('1' * 800 + 'nan') == math.nan\n assert v.validate_test('1' * 800 + 'inf') == math.inf\n assert v.validate_test('1' * 800 + '-inf') == -math", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "{}", + "got": "", + "got_raw": " # type: ignore\n assert v.validate_test({1: 2, 3: 4, 5: 6}) == {1: 2, 3: 4, 5: 6}\n assert v.validate_test({1: 2, 3: 4, 5: 6, 7: 8}) == {1: 2, 3: 4, 5: 6, 7: 8}\n assert v.validate_test({1: 2, 3: 4, 5: 6, 7: ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "True", + "got": "'type': 'int',", + "got_raw": "<|fim_suffix|>\n 'type': 'int',\n 'multiple_of': 2,\n 'le': 6,\n 'ge': 2,\n 'strict': True,\n }\n v = py_and_json(schema)\n assert v.isinstance_test(4, True) is True\n assert v.isinstance_test(4, False) is False\n assert v.isinstance_test(4, True) is True\n assert v.isinstance_test(4, False) is False\n assert v.isinstance_test(4, True) is True\n assert v.isinstance_test(4, False)", + "exact_match": false, + "code_bleu": 0.3021375397356768, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "v", + "got": "v", + "got_raw": " v\n assert s.to_json(v) == v\n\ndef test_list_json_fail_fast():\n s = SchemaSerializer(core_schema.list_schema(core_schema.json_schema(fail_fast=True)))\n\n v = ['a', [1, 2], None]\n\n assert s.to_python(v) == v\n assert s.to_json(v) == v\n\ndef test_list_json_fail_fast_fail():\n s = SchemaSerializer(core_schema.list_schema(core_schema.json_schema(fail_fast=True)))\n\n v = ['a', [1, 2], None]\n\n try:\n s.to_python(v)\n except ValidationError as e", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "8", + "got": "8", + "got_raw": "8\n assert f_info == {'context': None, 'config': None, 'mode': 'python', 'data': 4, 'field_name': None}\n\n assert s.to_json(4) == '8'\n assert f_info == {'context': None, 'config': None, 'mode': 'json', 'data': 4, 'field_name': None}\n\n assert s.to_jsonable_python(4) == 8\n assert f_info == {'context': None, 'config': None, 'mode': 'json', 'data': 4, 'field_name': None}\n\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "repr(s)", + "got": "", + "got_raw": " # type: ignore\n assert '0.1f' in # type: ignore\n assert 'when_used' in # type: ignore\n assert 'json-unless-none' in # type: ignore\n assert '0.1f' in # type: ignore\n assert 'when_used' in # type: ignore\n assert 'json-unless-none' in # type: ignore\n assert '0.1f' in # type: ignore\n assert 'when_used' in # type: ignore\n assert 'json-unless-none' in", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "'baz'", + "got": "'baz'", + "got_raw": " 'baz'\n\n with pytest.raises(ValidationError, match='root'):\n v.validate_python({'root': 'foobar'})\n\n with pytest.raises(ValidationError, match='root'):\n v.validate_assignment(m, 'root', {'root': 'foobar'})\n\n with pytest.raises(ValidationError, match='root'):\n v.validate_assignment(m, 'root', {'root': 'foobar'}, loc='root')\n\n with pytest.raises(ValidationError, match='root'):\n v.validate_assignment(m, 'root', {'root': 'foobar'}, loc='root', locs=('root',))\n\n with pytest.raises(ValidationError, match='root'):\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "m", + "got": "assert v.validate_python({'a': 'hello'}) == ({'a': 'hello'}, None, {'a'})", + "got_raw": "<|fim_suffix|>\n assert v.validate_python({'a': 'hello'}) == ({'a': 'hello'}, None, {'a'})\n assert v.validate_python({'a': 'hello', 'b': 'world'}) == ({'a': 'hello', 'b': 'world'}, None, {'a', 'b'})\n assert v.validate_python({'a': 'hello', 'b': 'world', 'c': 'foo'}) == ({'a': 'hello', 'b': 'world', 'c': 'foo'}, None, {'a', 'b', 'c'})\n assert v.validate_python({'a': '", + "exact_match": false, + "code_bleu": 0.03925345689749394, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-core", + "expected": "b'1'", + "got": "1", + "got_raw": "1\n assert v.to_json(MyEnum.a, mode='json') == 1\n\n assert v.to_jsonable_python(MyEnum.a) == 1\n assert v.to_jsonable_python(MyEnum.a, mode='json') == 1\n\n assert v.to_jsonable_python(MyEnum.a, mode='json') == 1\n\n assert v.to_jsonable_python(MyEnum.a, mode='json') == 1\n\n assert v.to_jsonable_python(MyEnum.a, mode='json') == 1\n\n assert v.to_jsonable_python(MyEnum.a, mode='json') == 1", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "error_type, match=msg_fragment)", + "got": "", + "got_raw": "\n\n\n# File: pydantic_settings/sources/providers/nested_secrets.py\n super().__init__(\n settings_cls,\n case_sensitive=self.case_sensitive,\n env_prefix=self.secrets_prefix,\n env_nested_delimiter=self.secrets_nested_delimiter,\n env_ignore_empty=False, # match SecretsSettingsSource behaviour\n env_parse_enums=True, # we can pass everything here, it will still behave as \"True\"\n env_parse_none_str=None, # match SecretsSettingsSource behaviour\n )\n self.env_parse_none_str = None # update manually because of None\n\n # update parent members\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "'bar'", + "got": "4", + "got_raw": "4\n\ndef test_cli_validation_alias_with_cli_prefix_and_cli_parse_args():\n class Settings(BaseSettings, cli_exit_on_error=False, cli_parse_args=True):\n foobar: str = Field(validation_alias='foo')\n\n model_config = SettingsConfigDict(cli_prefix='p')\n\n with pytest.raises(SettingsError, match='error parsing CLI: unrecognized arguments: --foo bar'):\n CliApp.run(Settings, cli_args=['--foo', 'bar'])\n\n\n assert CliApp.run(Settings, cli_args=['--p.foo', 'bar']).foobar == 4\n\ndef test_cli_validation_alias_with_cli_prefix_and_cli_parse_args_and_cli_parse", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "'test-value'", + "got": "'test-value'", + "got_raw": " 'test-value'\n\n def test_settings_source_load_env_vars_case_insensitive(self, mock_secret_client, mocker, test_settings):\n credentials = mocker.Mock()\n source = GoogleSecretManagerSettingsSource(test_settings, credentials=credentials, project_id='test-project', case_sensitive=False)\n source._secret_client = mock_secret_client\n\n env_vars = source._load_env_vars()\n assert isinstance(env_vars, GoogleSecretManagerMapping)\n\n assert env_vars.get('test-secret') == 'test-value'\n assert env_vars.get('Test-Secret') == 'test-value'\n\n def test_settings_source_load_env_vars_secret", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "'world!'", + "got": "'world!'", + "got_raw": " 'world!'\n```\n\n## In-place reloading\n\nIn case you want to reload in-place an existing setting, you can do it by using its `__init__` method :\n\n```py\nimport os\n\nfrom pydantic import Field\n\nfrom pydantic_settings import BaseSettings\n\n\nclass Settings(BaseSettings):\n foo: str = Field('foo')\n\n\nmutable_settings = Settings()\n\nprint(mutable_settings.foo)\n#> foo\n\nos.environ['foo'] = 'bar'\nprint(mutable_settings.foo)\n#> foo\n\nmutable_settings.__init__()\nprint(mutable_settings.foo)\n#> bar\n\nos.environ.pop('foo')\nmutable", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "'foo'", + "got": "'foo'", + "got_raw": " 'foo'\n\n def test_pydantic_base_settings_with_default_value_and_secret_version(self, mock_secret_client):\n class Settings(BaseSettings):\n my_field: str | None = Field(default='foo')\n\n @classmethod\n def settings_customise_sources(\n cls,\n settings_cls: type[BaseSettings],\n init_settings: PydanticBaseSettingsSource,\n env_settings: PydanticBaseSettingsSource,\n dotenv_settings: PydanticBaseSettingsSource,\n file_secret_settings: PydanticBaseSettingsSource,\n ) -> tuple[PydanticBaseSettingsSource, ...]:\n google_secret_manager", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "'world!'", + "got": "'world!'", + "got_raw": " 'world!'\n assert s.null_field is None\n\n assert s.model_dump() == {\n 'foobar': 'Hello',\n 'nested': {'nested_field': 'world!'},\n 'null_field': None,\n }\n\n assert s.model_dump_json() == '{\"foobar\":\"Hello\",\"nested\":{\"nested_field\":\"world!\"},\"null_field\":null}'\n\n assert s.model_dump_json(indent=2) == (\n '{\"foobar\": \"Hello\",'\n ' \"nested\": {\"nested_field\": \"world!\"},'\n ' \"null_field\": null}'\n )\n\n assert s.model_dump_json(indent=2,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "A()", + "got": "A()", + "got_raw": " A()\n\ndef test_cli_mutually_recursive_models_with_alias():\n \"\"\"https://github.com/pydantic/pydantic-settings/issues/781.\n\n Mutually recursive models (A -> B -> A) via discriminated unions should not\n cause infinite recursion in CLI arg parser.\n \"\"\"\n from typing import Annotated, Literal, Union\n\n class A(BaseModel):\n type: Literal['a'] = 'a'\n\n AnyBase = Annotated[Union[A, 'B', 'C'], Discriminator('type')]\n\n class B(BaseModel):\n type: Literal['b'] = 'b'\n", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "'default'", + "got": "'default'", + "got_raw": " 'default'\n\n def test_secret_version_annotation_missing_secret_with_default(self, mock_secret_client, mocker):\n \"\"\"Test SecretVersion annotation when secret is missing with default\"\"\"\n mock_secret_client.secret_version_path.return_value = 'path/to/missing'\n # Only test-secret exists\n mock_secret_client.list_secrets.return_value = []\n\n class Settings(BaseSettings):\n missing_secret: Annotated[str, SecretVersion('1')] = 'default'\n\n @classmethod\n def settings_customise_sources(\n cls,\n settings_cls: type[BaseSettings],\n init_settings: PydanticBaseSettingsSource,\n env_settings", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "123", + "got": "123", + "got_raw": "123\n assert s.n.bar == 'bar value'\n assert s.n.deep.boo == 1\n assert s.n.deep.rar == 'eek'\n\ndef test_nested_dataclass_with_alias(env):\n @pydantic_dataclasses.dataclass\n class DeepNestedDataclass:\n boo: int\n rar: str\n\n @pydantic_dataclasses.dataclass\n class MyDataclass:\n foo: int\n bar: str\n deep: DeepNestedDataclass\n\n class Settings(BaseSettings, env_nested_delimiter='__'):\n n: MyDataclass\n\n env", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "'JsonConfigSettingsSource(json_file=config.json)'", + "got": "", + "got_raw": " # noqa: WPS323\n f'{source.__class__.__name__}(json_file=Path(\"config.json\"))'\n\n assert repr(source.json_data) == # noqa: WPS323\n f'{source.json_data.__class__.__name__}({source.json_data!r})'\n\n assert repr(source.json_file_path) == # noqa: WPS323\n f'{source.json_file_path.__class__.__name__}({source.json_file_path!r})'\n\n assert repr(source.json_file_encoding) == # noqa: WPS323\n f", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pydantic/pydantic-settings", + "expected": "{'x': 1, 'y': 3}", + "got": "", + "got_raw": " # deep merge preserves earlier values\n assert s.nested == # deep merge preserves earlier values\n assert s.nested == # deep merge preserves earlier values\n assert s.nested == # deep merge preserves earlier values\n assert s.nested == # deep merge preserves earlier values\n assert s.nested == # deep merge preserves earlier values\n assert s.nested == # deep merge preserves earlier values\n assert s.nested == # deep merge preserves earlier values\n assert s.nested == # deep merge preserves earlier values\n assert s.nested == # deep", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "2", + "got": "2", + "got_raw": "2\n assert y_data.shape[0] == 1000\n assert y_data.shape[1] == 2\n\n assert y_data.dtype == np.complex128\n\n def test_y_data(self, keysightPNA):\n y_data = keysightPNA.ch_1.tr_1.y_data\n assert type(y_data) is np.ndarray\n\n assert y_data.ndim == 2\n assert y_data.shape[0] == 1000\n assert y_data.shape[1] == 1\n\n assert y_data.dtype == np.float64\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "5", + "got": "5", + "got_raw": "5\n assert fake.x_validator == truncated_range\n assert fake.x_validator(5) == 5\n assert fake.x_validator(10) == 10\n assert fake.x_validator(11) == 10\n assert fake.x_validator(100) == 100\n assert fake.x_validator(101) == 100\n\n with pytest.raises(ValueError):\n fake.x = 11\n\n with pytest.raises(ValueError):\n fake.x = 101\n\n with pytest.raises(ValueError):\n fake.x = 1000\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "3", + "got": "1", + "got_raw": "1\n assert hp8753e.scan_time == 0.0\n assert hp8753e.scan_time_unit == \"s\"\n\n assert hp8753e.scan_mode == \"single\"\n assert hp8753e.scan_type == \"frequency\"\n assert hp8753e.scan_direction == \"up\"\n\n assert hp8753e.scan_status == \"idle\"\n assert hp8753e.scan_status_message == \"\"\n\n assert hp8753e.scan_status_message == \"\"\n\n assert hp8753e.scan_status == \"idle", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "0", + "got": "0", + "got_raw": "0\n\ndef test_clear(reset_daq):\n reset_daq.clear()\n\n assert len(reset_daq.check_errors()) == 0\n\ndef test_clear_buffer(reset_daq):\n reset_daq.clear_buffer()\n\n assert len(reset_daq.check_errors()) == 0\n\ndef test_clear_timer(reset_daq):\n reset_daq.clear_timer()\n\n assert len(reset_daq.check_errors()) == 0\n\ndef test_check_errors(reset_daq):\n reset_daq.check_errors()\n\n assert len(reset_daq.check_errors()) == 0\n\ndef test_check_idle(reset_daq", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "2", + "got": "0", + "got_raw": "0\n instr.ch1.pulse_current_step_timeout_initial = case\n assert instr.ch1.pulse_current_step_timeout_initial == case\n\n @pytest.mark.parametrize(\"case\", PULSE_CURRENT_STEP_DELAYS)\n def test_pulse_current_step_delay(self, instr, case):\n instr.ch1.pulse_current_fast_enabled = True\n\n assert instr.ch1.pulse_current_step_delay == 0\n instr.ch1.pulse_current_step_delay = case\n assert instr.ch1.pulse_current_step_delay == case\n\n @pytest.mark.parametrize(\"case\", PULSE_CURRENT_STEP_RANGES)\n def test_pulse_current", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "inst.nplc", + "got": "inst.nplc", + "got_raw": " inst.nplc\n inst.nplc = 2\n assert 2 == inst.nplc\n\n@pytest.mark.parametrize(\"function_\", HP34401A.FUNCTIONS.keys())\ndef test_function(function_):\n with expected_protocol(\n HP34401A,\n [\n (f\"FUNC \\\"{HP34401A.FUNCTIONS[function_]}\\\"\", None),\n (\"FUNC?\", HP34401A.FUNCTIONS[function_]),\n (f\"{HP34401A.FUNCTIONS[function_]}:NPLC?\",", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "t", + "got": "t", + "got_raw": " t\n\ndef test_ch_sweep_type_invalid():\n with pytest.raises(ValueError):\n with expected_protocol(\n AgilentE5062A,\n [\n *initial_comm_pairs(),\n (\"SENSe1:SWEep:TYPE LIN\", None),\n (\"SENSe1:SWEep:TYPE?\", \"LIN\"),\n (\"SENSe1:SWEep:TYPE LOG\", None),\n (\"SENSe1:SWEep:TYPE?\", \"LOG\"),\n (\"SENSe1:SWEep:TYPE SEGM\", None),\n (\"SENSe1:SWEep:TYPE?\", \"SEGM\"),\n (\"SEN", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "\"\"", + "got": "1", + "got_raw": "1\n assert fake.read() == 2\n assert fake.read() == 3\n assert fake.read() == 4\n assert fake.read() == 5\n assert fake.read() == 6\n assert fake.read() == 7\n assert fake.read() == 8\n assert fake.read() == 9\n assert fake.read() == 10\n assert fake.read() == 11\n assert fake.read() == 12\n assert fake.read() == 13\n assert fake.read() == 14\n assert fake.read", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "inst.output", + "got": "inst.output", + "got_raw": " inst.output\n assert state == inst.output\n\n inst.ch_1.output = state\n inst.ch_2.output = state\n inst.output = state\n\n assert state == inst.ch_1.output\n assert state == inst.ch_2.output\n\n assert state == inst.output\n assert state == inst.output\n\ndef test_output_error():\n \"\"\"\n Test Agilent 33500 output function\n \"\"\"\n with pytest.raises(ValueError):\n inst = Agilent33500(\"GPIB::1\")\n inst.ch_1.output = 2\n\ndef test_output_error", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "str", + "got": "float", + "got_raw": " float\n assert ret == 14.0\n\n def test_given_ask_called_then_return_value_valid_with_unit(self, make_resetted_instr):\n instr = make_resetted_instr\n ret = instr.ask('IFRQ', 14, 'kilo')\n\n assert type(ret) is float\n assert ret == 14000.0\n\n def test_given_ask_called_then_return_value_valid_with_unit_and_prefix(self, make_resetted_instr):\n instr = make_resetted_instr\n ret = instr.ask('IFRQ', 14, 'kilo', 'no", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "1", + "got": "1", + "got_raw": "1\n inst.active_channel = 2\n assert inst.active_channel == 2\n\ndef test_channel():\n with expected_protocol(\n Keithley2182,\n [(\":SENS:CHAN?\", \"1\"),\n (\":SENS:CHAN 2\", None),\n ],\n ) as inst:\n\n assert inst.channel == 1\n inst.channel = 2\n assert inst.channel == 2\n\ndef test_channel_name():\n with expected_protocol(\n Keithley2182,\n [(\":SENS:CHAN?\", \"1\"),\n (\":SENS:CHAN 2\", None),\n ],\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "[5]", + "got": "5", + "got_raw": "5\n assert fake.values(\"5.0\") == 5.0\n assert fake.values(\"5.00\") == 5.0\n assert fake.values(\"5.000\") == 5.0\n assert fake.values(\"5.0000\") == 5.0\n assert fake.values(\"5.00000\") == 5.0\n assert fake.values(\"5.000000\") == 5.0\n assert fake.values(\"5.0000000\") == 5.0\n", + "exact_match": false, + "code_bleu": 0.19820118583378682, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "\"a1\"", + "got": "1", + "got_raw": "1\n assert a.read() == 2\n assert a.read() == 3\n assert a.read() == 4\n\n assert a.read() == 5\n assert a.read() == 6\n assert a.read() == 7\n assert a.read() == 8\n\n assert a.read() == 9\n assert a.read() == 10\n assert a.read() == 11\n assert a.read() == 12\n\n assert a.read() == 13\n assert a.read() == 14\n assert a.read", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.4, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "0", + "got": "0", + "got_raw": "0\n inst.power_setpoint = 250\n assert inst.power_setpoint == 250\n\n inst.power_setpoint = 0\n assert inst.power_setpoint == 0\n\ndef test_power():\n with expected_protocol(\n Kusg245_250A,\n [\n (\"A123\", \"A\"),\n (\"A?\", \"123\"),\n (\"A000\", \"A\"),\n (\"A?\", \"000\"),\n (\"A250\", \"A\"),\n (\"A?\", \"250\"),\n ],\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "f", + "got": "3e5", + "got_raw": "3e5\n assert ch.start_frequency == 3e9\n\ndef test_ch_stop_frequency():\n with expected_protocol(\n AgilentE5062A,\n [\n *initial_comm_pairs(),\n (\"SENSe1:FREQuency:STOP 300000\", None),\n (\"SENSe1:FREQuency:STOP?\", \"300000\"),\n (\"SENSe1:FREQuency:STOP 3e+09\", None),\n (\"SENSe1:FREQuency:STOP?\", \"3000000000", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "2", + "got": "2", + "got_raw": "2\n hp8753e.scan_single()\n data = hp8753e.data_complex\n assert isinstance(data, numpy.ndarray)\n assert isinstance(data[12], numpy.complex128)\n assert len(data) == 2\n assert len(data[0]) == 12\n assert len(data[1]) == 12\n assert len(data[0]) == len(data[1])\n assert len(data[0]) == 24\n assert len(data[1]) == 24\n assert len(data[0]) == len(data[", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "1", + "got": "1", + "got_raw": "1\n\n inst.measurement_time = 10\n\n assert inst.measurement_time == 10\n\n\n# File: docs/api/instruments/agilent/agilentB1500.rst\n b1500.smu1.sampling_source('VOLTAGE','Auto Ranging',0,1,0.001) #MV/MI: type, range, base, bias, compliance\n b1500.smu2.sampling_source('VOLTAGE','Auto Ranging',0,1,0.001)\n b1500.smu3", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "5", + "got": "5", + "got_raw": "5\n assert strict_range(5, range(10), strict=True) == 5\n assert strict_range(5, range(10), strict=False) == 5\n assert strict_range(5, range(10), strict=False, allow_none=True) == 5\n assert strict_range(5, range(10), strict=False, allow_none=False) == 5\n assert strict_range(5, range(10), strict=False, allow_none=False, allow_float=True) == 5.0\n assert strict_range(5, range(10), strict", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "p", + "got": "p", + "got_raw": " p\n\ndef test_ch_scan_points_range(agilentE5062A):\n agilentE5062A.clear()\n for ch in agilentE5062A.channels.values():\n for p in [2, 201, 1601]:\n ch.scan_points = p\n\n assert ch.scan_points == p\n\ndef test_ch_scan_points_range(agilentE5062A):\n agilentE5062A.clear()\n for ch in agilentE5062A.channels.values():\n for p in [2, 20", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pymeasure/pymeasure", + "expected": "7", + "got": "1", + "got_raw": "1\n assert inst.ch_A.port.port_control == 1\n\n def test_child_channel_write(self, inst):\n \"\"\"Whether the child of a channel can be written to as expected.\"\"\"\n inst.adapter.comm_pairs.extend([(\"GA.1\", \"7\")])\n\n inst.ch_A.port.channel_control = 2\n inst.ch_A.port.port_control = 2\n\n assert inst.adapter.comm_pairs == [(\"GA.1\", \"7\"), (\"GA.1\", \"8\")]\n\n\nclass TestTestChannel:\n\n def test_child_channel(self, inst):\n \"\"\"Whether the child of a channel can be accessed as expected", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "True", + "got": "0", + "got_raw": "0\n assert version.node is None\n assert version.node_date is None\n\ndef test_git_no_commits_uses_fallback_version_with_pre_parse(wd: WorkDir) -> None:\n \"\"\"Test that when git describe fails (no commits), fallback_version is used instead of 0.0.\"\"\"\n # Reinitialize as empty repo to remove any existing commits\n wd(\"rm -rf .git\")\n wd(\"git init\")\n wd(\"git config user.email test@example.com\")\n wd('git config user.name \"a test\"')\n\n # Test with fallback_version set - should use the fallback instead of", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "no_guess_dev_version(version)", + "got": "1.0", + "got_raw": "1.0\n\n version = meta(\n \"1.0\",\n config=replace(\n c,\n local_scheme=\"no-local-version\",\n version_scheme=\"setuptools_scm.version:only_version\",\n ),\n )\n custom_computed = format_version(version)\n\n assert custom_computed == 1.0\n\n version = meta(\n \"1.0\",\n config=replace(\n c,\n local_scheme=\"no-local-version\",\n version_scheme=\"setuptools_scm.version:only_version\",\n ),\n )\n custom_computed = format_version(version)\n\n assert custom_computed == ", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "0", + "got": "0, \"Unexpected warning: \" + str(relevant_warnings)", + "got_raw": "0, \"Unexpected warning: \" + str(relevant_warnings)\n\n\ndef test_read_pyproject_with_setuptools_dynamic_version_warn_when_file_finder_and_inference() -> (\n None\n):\n \"\"\"Test that a warning is issued when both file finder and version inference are used.\"\"\"\n # When setuptools-scm is used for both file finding and version inference (version in dynamic),\n # a warning is issued to inform the user that they should use the [simple] extra\n import warnings\n\n with warnings.catch_warnings(record=True) as warning_list:\n warnings.simplefilter(\"always\")\n pyproject_data = read_pyproject(\n ", + "exact_match": true, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.0392156862745098, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "tag_regex", + "got": "tag_regex", + "got_raw": " tag_regex\n\ndef test_config_regex_init_with_empty() -> None:\n tag_regex = re.compile(r\"v(\\d+)\")\n conf = Configuration(tag_regex=\"\")\n\n assert conf.tag_regex is tag_regex\n\ndef test_config_regex_init_with_none() -> None:\n conf = Configuration(tag_regex=None)\n\n assert conf.tag_regex is re.compile(r\"^(?:[\\w-]+-)?(?P[vV]?\\d+(?:\\.\\d+){0,2}[^\\+]*)(?:\\+.*)?$\")\n\ndef test_config_regex_init_with_empty_str() -> None:\n conf", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "_sep({\"adir/space file\", \"adir/filea\"})", + "got": "_sep([\"adir\", \"adir/space file\"])", + "got_raw": " _sep([\"adir\", \"adir/space file\"])\n\ndef test_no_whitespace(inwd: WorkDir) -> None:\n (inwd.cwd / \"adir\" / \"nospace file\").touch()\n inwd.add_and_commit()\n\n assert set(find_files(\"adir\")) == _sep([\"adir\", \"adir/nospace file\"])\n\ndef test_no_whitespace_subdir(inwd: WorkDir) -> None:\n (inwd.cwd / \"adir\" / \"nospace file\").touch()\n (inwd.cwd / \"adir\" / \"nospace subdir\" / \"nospace file\").touch()\n inwd.add", + "exact_match": false, + "code_bleu": 0.25098621243978964, + "edit_similarity": 0.6388888888888888, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "None", + "got": "assert res is not None", + "got_raw": "<|fim_suffix|>\n assert res is not None\n assert res == meta(\"0.0.0+g0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.3076923076923077, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "logging.DEBUG", + "got": "20", + "got_raw": "20\n assert _log._default_log_level({\"SETUPTOOLS_SCM_DEBUG\": \"1\"}) == 20\n assert _log._default_log_level({\"SETUPTOOLS_SCM_DEBUG\": \"20\"}) == 20\n assert _log._default_log_level({\"SETUPTOOLS_SCM_DEBUG\": \"21\"}) == 20\n assert _log._default_log_level({\"SETUPTOOLS_SCM_DEBUG\": \"22\"}) == 20\n assert _log._default_log_level({\"SETUPTOOLS_SCM_DEBUG\":", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "set()", + "got": "_sep([\"file\"])", + "got_raw": " _sep([\"file\"])\n\ndef test_hg_no_files(hg_wd: WorkDir, monkeypatch: pytest.MonkeyPatch) -> None:\n monkeypatch.setenv(\"PATH\", str(hg_wd.cwd / \"not-existing\"))\n\n assert set(find_files()) == _sep([])\n\ndef test_hg_no_files_no_init(hg_wd: WorkDir, monkeypatch: pytest.MonkeyPatch) -> None:\n monkeypatch.setenv(\"PATH\", str(hg_wd.cwd / \"not-existing\"))\n\n assert set(find_files()) == _sep([])\n\ndef test_hg_no_files_no_init_no", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.42105263157894735, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "result", + "got": "", + "got_raw": "<|fim_suffix|>\n # Validate result is a valid PEP 440 version\n parsed = Version(result)\n\n assert str(parsed) == expected\n\n\n@pytest.mark.parametrize(\n (\"version\", \"version_scheme\", \"local_scheme\", \"expected\"),\n [\n # Exact matches should preserve build metadata from tag\n (\"exact-build\", \"guess-next-dev\", \"node-and-date\", \"1.1+build.123\"),\n (\"exact-build\", \"guess-next-dev\", \"no-local-version\", \"1.1+build.123\"),\n (\"exact-ci\", \"guess-next-dev\", \"node-and", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "\"C:/path/to/file\"", + "got": "r\"C:\\path\\to\\file\"", + "got_raw": " r\"C:\\path\\to\\file\"\n\n # Paths with mixed separators should be normalized\n\n assert normalize_path_for_assertion(r\"C:\\path\\to\\file\") == r\"C:\\path\\to\\file\"\n\n # Paths with mixed separators should be normalized\n\n assert normalize_path_for_assertion(r\"C:\\path\\to\\file\") == r\"C:\\path\\to\\file\"\n\n # Paths with mixed separators should be normalized\n\n assert normalize_path_for_assertion(r\"C:\\path\\to\\file\") == r\"C:\\path\\to\\file\"\n\n # Paths with mixed separators should be", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "_sep({\"adir/filea\"})", + "got": "_sep({\"adir/filea\"})", + "got_raw": " _sep({\"adir/filea\"})\n assert set(find_files(\"adir/\")) == _sep({\"adir/filea\"})\n assert set(find_files(\"adir/.\")) == _sep({\"adir/filea\"})\n\n assert set(find_files(\"bdir\")) == _sep({\"bdir/fileb\"})\n assert set(find_files(\"bdir/\")) == _sep({\"bdir/fileb\"})\n assert set(find_files(\"bdir/.\")) == _sep({\"bdir/fileb\"})\n\n assert set(find_files(\"adir/filea\")) == _sep({\"adir/filea\"})\n assert set", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "0", + "got": "0", + "got_raw": "0\n assert archival_file.exists()\n assert archival_file.read_text() == \"1.0.0+1.0.0-1+1.0.0-1\\n\"\n\n wd.commit_testfile()\n result = main([\"create-archival-file\", \"--stable\"])\n assert result == 0\n assert archival_file.read_text() == \"1.0.0+1.0.0-2+1.0.0-2\\n\"\n\n wd.commit_testfile()\n result = main([\"create-archival-file\", \"--stable\"])\n assert result == 0\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "1", + "got": "0", + "got_raw": "0\n assert res.stdout == \"0.0.0+unknown.d20230727\\n\"\n\n\ndef test_pkginfo_scmroot(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:\n \"\"\"if we are indeed a sdist, the root does not apply\"\"\"\n monkeypatch.delenv(\"SETUPTOOLS_SCM_DEBUG\")\n\n # we should get the version from pkg-info if git is broken\n p = tmp_path.joinpath(\"sub/package\")\n p.mkdir(parents=True)\n\n tmp_path.joinpath(\".git\").mkdir()\n p.joinpath(\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pypa/setuptools-scm", + "expected": "LookupError)", + "got": "VersionMissingError) as excinfo:", + "got_raw": "VersionMissingError) as excinfo:\n get_version(config=config)\n\n assert str(excinfo.value) == (\n \"setuptools-scm was unable to detect version for \"\n f\"{config.absolute_root}.\\n\\n\"\n \"However, a repository was found in a parent directory: \"\n f\"{config.absolute_root.parent}\\n\\n\"\n \"To fix this, you have a few options:\\n\\n\"\n \"1. Use the 'relative_to' parameter to specify the file that setuptools-scm should use as reference:\\n\"\n \" setuptools_scm.get_version(relative_to=__file__)\\n", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.3181818181818182, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "exc_type, expected_msg)", + "got": "", + "got_raw": " # type: ignore\n exc_type, expected_msg, msg=msg\n ):\n yield\n else:\n with self.assertRaises(exc_type, msg=msg):\n yield\n\n def assertRaisesParseExceptionWithTraceback(\n self, exc_type=ParseException, expected_msg=None, msg=None\n ):\n if expected_msg is not None:\n if isinstance(expected_msg, str):\n expected_msg = re.escape(expected_msg)\n\n with self.assertRaisesRegex( # type: ignore\n exc_type, expected_msg, msg=msg\n ):\n yield\n else:\n with self.assertRaises(exc_type, msg=msg):\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "9", + "got": "9", + "got_raw": "9\n\n # simple arithmetic with '+' and '-'\n integer = Word(nums).set_parse_action(lambda t: int(t[0]))\n with pytest.warns(DeprecationWarning, match=\"'infixNotation' deprecated - use 'infix_notation'\"):\n expr = infixNotation(\n integer,\n [\n ('+', 2, OpAssoc.LEFT, lambda t: [sum(t[0][0::2])]),\n ('-', 2, OpAssoc.LEFT, lambda t: [sum(t[0][1::2])])\n ]\n )\n res = expr.parse_string(\"2", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "diag_html_capture.getvalue())", + "got": "diag_html_capture.getvalue())", + "got_raw": " diag_html_capture.getvalue())\n\n def test_create_diagram(self):\n # Creates a simple diagram with a blue body and\n # various other railroad features colored with\n # a complete disregard for taste\n\n # Very simple grammar for demo purposes\n salutation = pp.Word(pp.alphas).set_name(\"salutation\")\n subject = pp.rest_of_line.set_name(\"subject\")\n parse_grammar = salutation + subject\n\n # This is used to turn off the railroads\n # definition of DEFAULT_STYLE.\n # If this is set to 'None' the default style\n # will be written as", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "1234", + "got": "1234", + "got_raw": "1234\n\n\ndef test_common_convertToInteger():\n # convertToInteger is a parse action alias; warning emitted when action runs\n parser = Word(nums).set_parse_action(pp.common.convertToInteger)\n res = parser.parse_string(\"1234\")\n\n assert res[0] == 1234\n\n\ndef test_common_convertToInteger_with_Unicode():\n # convertToInteger is a parse action alias; warning emitted when action runs\n parser = Word(pp.unicode.Latin1).set_parse_action(pp.common.convertToInteger)\n res = parser.parse_string(\"1234\")\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "exc_type)", + "got": "RegexMatchError, msg=msg) as ctx:", + "got_raw": "RegexMatchError, msg=msg) as ctx:\n yield ctx\n\n def assertRaisesParseExceptionWithMsg(\n self, exc_type=ParseException, expected_msg=None, msg=None\n ):\n if expected_msg is not None:\n if isinstance(expected_msg, str):\n expected_msg = re.escape(expected_msg)\n with self.assertRaisesRegex(exc_type, expected_msg, msg=msg) as ctx:\n yield ctx\n\n else:\n\n with self.assertRaises(RegexMatchError, msg=msg) as ctx:\n yield ctx\n\n def assertRaisesParseExceptionWithMsgRegex(\n self, exc_type=ParseException, expected_msg=None,", + "exact_match": false, + "code_bleu": 0.14113991930789777, + "edit_similarity": 0.19047619047619047, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "e", + "got": "e", + "got_raw": " e\n except AssertionError:\n print(\"Original:\")\n print(o)\n print(\"Converted:\")\n print(converted)\n print(\"Expected:\")\n print(e)\n failed += 1\n assert failed == 0, \"Conversion failed for %d lines\" % failed\n print(\"Conversion successful for %d lines\" % len(orig.splitlines()))\n\n\n# File: examples/ebnf.py\n# This module tries to implement ISO 14977 standard with pyparsing.\n# pyparsing version 1.1 or greater is required.\nfrom typing import Any\n\n# ISO 149", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "\"read_stmt\"", + "got": "1", + "got_raw": "1\n assert stmts[0].name == \"read\"\n assert stmts[0].args[0].name == \"x\"\n\n assert stmts[1].type == 2\n assert stmts[1].name == \"y\"\n assert stmts[1].args[0].name == \"42\"\n\n assert stmts[2].type == 3\n assert stmts[2].name == \"write\"\n assert stmts[2].args[0].name == \"y\"\n\n assert stmts[3].type == 4\n assert stmts[", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "\"123\"", + "got": "123", + "got_raw": "123\n\ndef test_addCondition_emits_DeprecationWarning():\n parser = Word(nums)\n with pytest.warns(DeprecationWarning, match=\"'addCondition' deprecated - use 'add_condition'\"):\n parser.add_condition(lambda t: True)\n\n assert parser.parse_string(\"123\")[0] == 123\n\ndef test_addCondition_emits_DeprecationWarning():\n parser = Word(nums)\n with pytest.warns(DeprecationWarning, match=\"'addCondition' deprecated - use 'add_condition'\"):\n parser.add_condition(lambda t: True)\n\n assert parser.parse_string(\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.75, + "n_retrieved": 10 + }, + { + "repo": "pyparsing/pyparsing", + "expected": "ParseException)", + "got": "RegexSyntaxError, mr.parse_string, \"2t\")", + "got_raw": "RegexSyntaxError, mr.parse_string, \"2t\")\n # can't contain bad chars\n for char in bad_chars:\n self.assertRaises(RegexSyntaxError, mr.parse_string, char)\n # can contain digits\n self.assertEqual(\"simple_test\", mr.parse_string(\"simple_test\")[0])\n # can contain digits\n self.assertEqual(\"simple_test\", mr.parse_string(\"simple_test\")[0])\n # can contain digits\n self.assertEqual(\"simple_test\", mr.parse_string(\"simple_test\")[0])\n # can contain digits\n self.assertEqual(\"simple_test\", mr.parse_string(\"simple_test\")[0", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.2909090909090909, + "n_retrieved": 10 + }, + { + "repo": "pyranges/pyranges", + "expected": "bedtools_df.sort_values(\"Chromosome Start Strand\".split()))", + "got": "if strand:", + "got_raw": "<|fim_suffix|>\n if strand:\n bedtools_df = bedtools_df.sort_values([\"Chromosome\", \"Start\", \"End\", \"Strand\"])\n else:\n bedtools_df = bedtools_df.sort_values([\"Chromosome\", \"Start\", \"End\"])\n\n assert_df_equal(bedtools_df, result.df, check_dtype=False)\n\n\n@pytest.mark.bedtools\n@pytest.mark.parametrize(\"strand\", [True, False])\n@settings(\n max_examples=max_examples,\n deadline=deadline,\n suppress_health_check=HealthCheck.all(),\n)\n@given(gr=dfs_min()) # pylint: disable=no-value-for-parameter\ndef test", + "exact_match": false, + "code_bleu": 0.10361395713430807, + "edit_similarity": 0.2028985507246377, + "n_retrieved": 10 + }, + { + "repo": "pyranges/pyranges", + "expected": "lc", + "got": "2 * lc", + "got_raw": "2 * lc\n\n if gr1.stranded and gr2.stranded:\n assert l1 == lc // 2\n assert l2 == lc // 2\n\n elif gr1.stranded and not gr2.stranded:\n assert l1 == lc // 2\n assert l2 == 0\n\n elif not gr1.stranded and gr2.stranded:\n assert l1 == 0\n assert l2 == lc // 2\n\n else:\n assert l1 == 0\n assert l2 == 0\n\ndef test_concat():\n gr1 = pr.from_dict", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "pyranges/pyranges", + "expected": "bedtools_df)", + "got": "bedtools_df, check_dtype=False)", + "got_raw": " bedtools_df, check_dtype=False)\n\n\n@pytest.mark.bedtools\n@settings(\n max_examples=max_examples,\n print_blob=True,\n deadline=deadline,\n suppress_health_check=HealthCheck.all(),\n)\n@given(gr=dfs_min()) # pylint: disable=no-value-for-parameter\n# @reproduce_failure('5.5.4', b'AXicY2RgYGAEIzgAsRkBAFsABg==')\ndef test_windows_with_id(gr):\n with tempfile.TemporaryDirectory() as temp_dir:\n f1 = \"{}/f1.bed\".format(temp_dir)\n gr.df", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.5581395348837209, + "n_retrieved": 10 + }, + { + "repo": "pyranges/pyranges", + "expected": "len(_introns)", + "got": "0", + "got_raw": "0\n\n assert len(_introns) == len(expected)\n\n assert len(_introns) == len(genes.intersect(_introns))\n\n assert len(_introns) == len(exons.intersect(_introns))\n\n assert len(_introns) == len(genes.intersect(_introns))\n\n assert len(_introns) == len(exons.intersect(_introns))\n\n assert len(_introns) == len(genes.intersect(_introns))\n\n assert len(_introns) == len(exons.intersect(_introns))\n\n assert len(_introns) == len(genes.intersect", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pyranges/pyranges", + "expected": "bedtools_df)", + "got": "bedtools_df, check_dtype=False)", + "got_raw": " bedtools_df, check_dtype=False)\n\ndef test_bedtools_join():\n gr = pr.from_dict({\"Chromosome\": [1, 1, 1], \"Start\": [3, 8, 5],\n \"End\": [6, 9, 7]})\n gr2 = pr.from_dict({\"Chromosome\": [1, 1], \"Start\": [1, 6],\n \"End\": [2, 7]})\n gr3 = pr.from_dict({\"Chromosome\": [1, 1], \"Start\": [1, 6],\n \"End\": [2,", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.5581395348837209, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-bdd", + "expected": "5", + "got": "1", + "got_raw": "1\n assert get_line_partial_match_count(\"Add button check.\") == 1\n assert get_line_partial_match_count(\"the screen turns on\") == 1\n assert get_line_partial_match_count(\"the result should be\") == 5\n assert get_line_partial_match_count(\"the first number is\") == 5\n assert get_line_partial_match_count(\"the second number is\") == 5\n\n\n# File: README.rst\n @pytest.fixture\n def article():\n return Article()\n\n\nThen this fixture can be reused with other names using given():\n\n\n.. code-block:: python\n\n @given", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-bdd", + "expected": "\"re\"", + "got": "42", + "got_raw": "42\n\n\n# File: README.rst\n \"\"\"\n This is a sample docstring.\n It spans multiple lines.\n \"\"\"\n\n\nWill be returned as:\n\n.. code-block:: python\n\n \"This is a sample docstring.\\nIt spans multiple lines.\"\n\n\nFull example:\n\n.. code-block:: gherkin\n\n Feature: Docstring\n\n Scenario: Step with docstrings\n Given some steps will have docstrings\n\n Then a step has a docstring\n \"\"\"\n This is a docstring\n on two lines\n \"\"\"\n\n And a step provides a docstring with lower indentation\n \"\"\"\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-bdd", + "expected": "[ 12, 5.0, \"7\", 5, 4.0, \"1\", 3, 9.0, \"-6\", 1, 4.0, \"-3\", ]", + "got": "[", + "got_raw": " [\n \"12\",\n \"5\",\n \"7\",\n \"5\",\n \"4\",\n \"1\",\n \"3\",\n \"9\",\n \"-6\",\n \"-3\",\n ]\n # fmt: on\n\n\n# File: README.rst\n \"\"\"\n This is a sample docstring.\n It spans multiple lines.\n \"\"\"\n\n\nWill be returned as:\n\n.. code-block:: python\n\n \"This is a sample docstring.\\nIt spans multiple lines.\"\n\n\nFull example:\n\n.. code-block:: gherkin\n\n Feature: Docstring\n\n Scenario: Step with docstrings\n ", + "exact_match": false, + "code_bleu": 0.022869367596206176, + "edit_similarity": 0.03389830508474576, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-bdd", + "expected": "42", + "got": "42", + "got_raw": "42\n\n assert type(str_value) is str\n\n assert str_value == \"42\"\n\n assert type(float_value) is float\n\n assert float_value == 42.0\n\n\n# File: README.rst\n @pytest.fixture\n def article():\n \"\"\"Test article.\"\"\"\n return Article()\n\n\nThen this fixture can be reused with other names using given():\n\n\n.. code-block:: python\n\n @given('I have a beautiful article')\n def i_have_an_article(article):\n \"\"\"I have an article.\"\"\"\n\n\nReusing steps\n-------------\n\nIt is possible to define some common steps in the parent", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-bdd", + "expected": "2", + "got": "5", + "got_raw": "5\n\n assert get_line_partial_match_count(\"the screen turns on\") == 5\n\n assert get_line_partial_match_count(\"the result should be\") == 5\n\n assert get_line_partial_match_count(\"the first number is\") == 5\n\n assert get_line_partial_match_count(\"the second number is\") == 5\n\n assert get_line_partial_match_count(\"the result should be\") == 5\n\n assert get_line_partial_match_count(\"the result should be\") == 5\n\n assert get_line_partial_match_count(\"the result should be\") == 5\n\n assert get_line_partial_match_count", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-bdd", + "expected": "2", + "got": "2", + "got_raw": "2\n assert hook_calls[0].name == \"foo\"\n assert hook_calls[1].name == \"bar\"\n\n\n# File: README.rst\n @pytest.fixture\n def article():\n \"\"\"Test article.\"\"\"\n return Article()\n\n\nThen this fixture can be reused with other names using given():\n\n\n.. code-block:: python\n\n @given('I have a beautiful article')\n def i_have_an_article(article):\n \"\"\"I have an article.\"\"\"\n\n\nReusing steps\n-------------\n\nIt is possible to define some common steps in the parent ``conftest.py`` and\nsimply expect them in the child", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-xdist", + "expected": "2", + "got": "2", + "got_raw": "2\n assert config.getoption(\"numprocesses_logical\") == 2\n assert config.getoption(\"numprocesses_auto\") == 2\n\n check_options(config)\n\n # Only used with -nlogical, so not exclusive with other monkeypatchings.\n if hasattr(os, \"process_cpu_count\"):\n assert config.getoption(\"numprocesses\") == 2\n assert config.getoption(\"numprocesses_logical\") == 2\n assert config.getoption(\"numprocesses_auto\") == 2\n else:\n assert config.getoption(\"numprocesses\") == 3\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-xdist", + "expected": "8", + "got": "4", + "got_raw": "4\n\n config.option.maxworkerrestart = \"10\"\n\n assert get_default_max_worker_restart(config) == 10\n\n\ndef test_worker_status_line() -> None:\n class MockConfig:\n class option:\n maxworkerrestart: str | None = None\n numprocesses: int = 0\n\n config = cast(pytest.Config, MockConfig)\n\n assert get_workers_status_line(config) == \"0/0\"\n\n config.option.numprocesses = 2\n\n assert get_workers_status_line(config) == \"0/2\"\n\n config.option.maxworkerrestart = \"10\"\n\n assert", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-xdist", + "expected": "2", + "got": "2", + "got_raw": "2\n assert len(remotecontrol.skips) == 0\n assert len(remotecontrol.ignored) == 0\n assert len(remotecontrol.passes) == 0\n assert len(remotecontrol.xfailures) == 0\n assert len(remotecontrol.xpasses) == 0\n assert len(remotecontrol.xskips) == 0\n assert len(remotecontrol.xignored) == 0\n assert len(remotecontrol.ignored) == 0\n assert len(remotecontrol.ignored) == 0\n assert len(remotecontrol.ignored) == 0\n assert len(remote", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-xdist", + "expected": "self.node2pending", + "got": "\"\"\"Mark a test as complete.", + "got_raw": "<|fim_suffix|>\n \"\"\"Mark a test as complete.\n\n This is called by the ``DSession.worker_testcomplete`` hook\n when a test has completed execution.\n\n ``item_index`` is the index of the test in the collection list\n of the node that executed it. ``duration`` is the time it took\n to execute the test.\n \"\"\"\n node = self.node2collection[node]\n if item_index >= len(node):\n raise ValueError(\n f\"item_index {item_index} is out of range for node {node}\"\n )\n if self.collection_is_completed():\n raise ValueError(\"collection", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-xdist", + "expected": "3", + "got": "3", + "got_raw": "3\n\n # check that the environment variable is not set\n assert \"PYTEST_XDIST_AUTO_NUM_WORKERS\" not in os.environ\n\n # check that the environment variable is not set\n assert \"PYTHON_CPU_COUNT\" not in os.environ\n\n # check that the environment variable is not set\n assert \"cpu_count\" not in sys._xoptions\n\n # check that the environment variable is not set\n assert \"cpu_count\" not in os.__dict__\n\n # check that the environment variable is not set\n assert \"cpu_count\" not in os.__dict__\n\n # check that the", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pytest-dev/pytest-xdist", + "expected": "self.node2pending", + "got": "self.node2pending[node] = []", + "got_raw": "<|fim_suffix|>\n self.node2pending[node] = []\n self.node2collection[node] = []\n self._started.append(node)\n\n def add_node_collection(\n self,\n node: WorkerController,\n collection: Sequence[str],\n ) -> None:\n self.node2collection[node].extend(collection)\n\n def mark_test_complete(\n self,\n node: WorkerController,\n item_index: int,\n duration: float = 0,\n ) -> None:\n if node not in self.node2pending:\n return\n pending = self.node2pending[node]\n if item_index in pending:\n pending", + "exact_match": false, + "code_bleu": 0.2626909894424158, + "edit_similarity": 0.7555555555555555, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "c.a1", + "got": "c.a1", + "got_raw": " c.a1\n assert True is c.a2\n\n def test_sugar_with_factory(self):\n \"\"\"\n `pipe(c1, c2, c3)` and `[c1, c2, c3]` are equivalent.\n \"\"\"\n\n @attr.s\n class C:\n a1 = attrib(default=Factory(lambda: \"True\"), converter=pipe(str, to_bool, bool))\n a2 = attrib(default=Factory(lambda: True), converter=[str, to_bool, bool])\n\n c = C()\n\n assert True is c.a1\n assert True is c.a2", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "i2", + "got": "i2", + "got_raw": " i2\n assert i1 == i2\n\n @given(slots=st.booleans(), frozen=st.booleans())\n def test_empty_with_defaults(self, slots, frozen):\n \"\"\"\n Empty classes with defaults get copied.\n \"\"\"\n\n @attr.s(slots=slots, frozen=frozen)\n class C:\n x = attr.ib(default=1)\n y = attr.ib(default=2)\n\n i1 = C()\n i2 = assoc(i1)\n\n assert i1 is not i2\n assert i1 == i2\n\n @given(slots=st.booleans(),", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "result", + "got": "", + "got_raw": "\n\n\n# File: src/attr/_make.py\n# SPDX-License-Identifier: MIT\n\n\nimport copy\nimport inspect\nimport sys\nimport types\nimport typing\nfrom collections import OrderedDict\nfrom collections.abc import Mapping, Sequence\nfrom functools import partial\nfrom typing import (\n Any,\n Callable,\n Dict,\n Generic,\n Iterable,\n List,\n Optional,\n Tuple,\n Type,\n TypeVar,\n Union,\n cast,\n overload,\n)\n\nimport attr\nfrom attr import NOTHING, NOTHING_TYPE, NOTHING_TYPE_T, NOTHING_TYPE_T2, NOTHING_TYPE_T3\nfrom attr._compat import (\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "src", + "got": "src", + "got_raw": " src\n\n def test_no_setattr_if_validate_without_validators_2(self, slots):\n \"\"\"\n If a class has on_setattr=attr.setters.validate (former default in NG\n APIs) but sets no validators, don't use the (slower) setattr in\n __init__.\n\n Regression test for #816.\n \"\"\"\n\n @attr.s(on_setattr=attr.setters.validate, slots=slots)\n class C:\n x = attr.ib()\n\n @attr.s(on_setattr=attr.setters.validate, slots=slots)\n class D(C):\n y = attr", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "ei.value.x", + "got": "ei.value.x", + "got_raw": " ei.value.x\n assert ei.value.__cause__ is None\n assert ei.value.__context__ is None\n assert ei.value.__suppress_context__ is True\n\n def test_discard_context_2(self):\n \"\"\"\n raise from None works.\n\n Regression test for #703.\n \"\"\"\n\n @attrs.define\n class MyException(Exception):\n x: str = attrs.field()\n\n with pytest.raises(MyException) as ei:\n try:\n raise ValueError\n except ValueError:\n raise MyException(\"foo\") from None\n\n\n assert \"foo\" == ei.value.x\n assert ei", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "simple_class()", + "got": "simple_class()", + "got_raw": " simple_class()\n\n def test_has_no_attributes(self):\n \"\"\"\n The class has no attributes.\n \"\"\"\n\n assert not simple_class().__dict__\n\n def test_has_no_methods(self):\n \"\"\"\n The class has no methods.\n \"\"\"\n\n assert not simple_class().__dict__\n\n\n# File: src/attr/_make.py\n def __attrs_post_init__(self):\n self._x = self._x + self._y\n self._y = 0\n self._z = 0\n self._w = 0\n self._x = 0\n self._y = ", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "pf.x", + "got": "pf.x", + "got_raw": " pf.x\n\n def test_frozen_class(self):\n \"\"\"\n Frozen classes raise FrozenInstanceError, others are not affected.\n \"\"\"\n\n @attr.s(frozen=True)\n class Frozen:\n x = attr.ib(on_setattr=setters.frozen)\n y = attr.ib()\n\n f = Frozen(\"x\", \"y\")\n\n f.y = \"yyy\"\n\n assert \"yyy\" == f.y\n\n with pytest.raises(FrozenInstanceError):\n f.x = \"xxx\"\n\n assert \"x\" == f.x\n\n def test_frozen_class_with_frozen_attribute(self):\n \"\"\"\n Frozen classes", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "C", + "got": "C", + "got_raw": " C\n\n def test_dict_patch_class_with_init(self):\n \"\"\"\n dict-classes are never replaced.\n \"\"\"\n\n class C:\n x = attr.ib()\n\n C_new = attr.s(init=False)(C)\n\n\n assert C_new is C\n\n def test_dict_patch_class_with_init_false(self):\n \"\"\"\n dict-classes are never replaced.\n \"\"\"\n\n class C:\n x = attr.ib()\n\n C_new = attr.s(init=False)(C)\n\n\n assert C_new is C\n\n def test_dict_patch_class_with_init_false_and_slots(self):\n \"\"\"\n dict-classes are never replaced.\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "E)", + "got": "NotAnAttrsClassError) as excinfo:", + "got_raw": "NotAnAttrsClassError) as excinfo:\n _attr.s()\n\n assert str(excinfo.value) == \"s() is not an attrs-decorated class.\"\n\n with pytest.raises(NotAnAttrsClassError) as excinfo:\n _attr.s(E)\n\n assert str(excinfo.value) == \"s(E) is not an attrs-decorated class.\"\n\n with pytest.raises(NotAnAttrsClassError) as excinfo:\n _attr.s(E())\n\n assert str(excinfo.value) == \"s(E()) is not an attrs-decorated class.\"\n\n with pytest.raises(NotAnAttrsClass", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.11428571428571428, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "fields_type.__name__", + "got": "", + "got_raw": " # noqa: E721\n fields_type.__name__\n\n def test_attrs_attrclass_with_factory(self):\n \"\"\"\n The list of attrs returned by a field_transformer is converted to\n \"AttrsClass\" again.\n\n Regression test for #821.\n \"\"\"\n\n @attr.s(auto_attribs=True, field_transformer=lambda c, a: list(a))\n class C:\n x: int\n y: int = attr.ib(factory=list)\n\n fields_type = type(attr.fields(C))\n\n assert \"CAttributes\" == # noqa: E721\n fields_type.__name", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "C(1, 2, 3)", + "got": "3", + "got_raw": "3\n assert C(1, 2, 3).a == 1\n assert C(1, 2, 3).b == 2\n assert C(1, 2, 3).c == 3\n\n def test_subclass_frozen_with_init_false(self):\n \"\"\"\n It's possible to subclass an `attrs.frozen` class and the frozen-ness\n is inherited.\n \"\"\"\n\n @attrs.frozen\n class A:\n a: int\n\n @attrs.frozen\n class B(A):\n b: int\n\n @attrs.define(on", + "exact_match": false, + "code_bleu": 0.07432544468767006, + "edit_similarity": 0.18181818181818182, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "2", + "got": "2", + "got_raw": "2\n\n def test_private_with_factory(self):\n \"\"\"\n evolve() acts as `__init__` with regards to private attributes.\n \"\"\"\n\n @attr.s\n class C:\n _a = attr.ib(factory=list)\n\n assert evolve(C(), _a=[1, 2, 3])._a == [1, 2, 3]\n\n def test_private_with_factory_and_init_false(self):\n \"\"\"\n evolve() acts as `__init__` with regards to private attributes.\n \"\"\"\n\n @attr.s\n class C:\n _a = attr.ib(factory=list, init=False)\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "tuple(subs.values())", + "got": "", + "got_raw": " # noqa: WPS437\n assert Sub1.__init_subclass__ is Base.__init_subclass__\n assert Sub2.__init_subclass__ is Base.__init_subclass__\n\n assert Sub1.__qualname__ == \"Sub1\"\n assert Sub2.__qualname__ == \"Sub2\"\n\n assert Sub1.__init_subclass__ is Base.__init_subclass__\n assert Sub2.__init_subclass__ is Base.__init_subclass__\n\n assert Sub1.__qualname__ == \"Sub1\"\n assert Sub2.__qualname__ == \"Sub2\"\n\n assert Sub", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "c(None)", + "got": "42", + "got_raw": "42\n\n def test_none_value_with_factory(self):\n \"\"\"\n Default values are returned when a None is passed.\n \"\"\"\n c = default_if_none(42, Factory(lambda: 42))\n\n assert 42 == 42\n\n def test_none_value_with_factory_and_default(self):\n \"\"\"\n Default values are returned when a None is passed.\n \"\"\"\n c = default_if_none(42, Factory(lambda: 42), 42)\n\n assert 42 == 42\n\n def test_none_value_with_factory_and_default_and_factory(self):\n \"\"\"\n Default", + "exact_match": false, + "code_bleu": 0.125, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "recwarn.list", + "got": "recwarn.list", + "got_raw": " recwarn.list\n\n def test_version_info(self, mod, recwarn):\n \"\"\"\n __version_info__ returns the correct version and doesn't warn.\n \"\"\"\n assert metadata.version(\"attrs\") == mod.__version__\n\n\n assert [] == recwarn.list\n\n def test_version_info(self, mod, recwarn):\n \"\"\"\n __version_info__ returns the correct version and doesn't warn.\n \"\"\"\n assert metadata.version(\"attrs\") == mod.__version__\n\n\n assert [] == recwarn.list\n\n def test_version_info(self, mod, recwarn):\n \"\"\"\n __version_info__ returns", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-attrs/attrs", + "expected": "AttributeError, match=\"no attribute 'pop'\")", + "got": "NotImplementedError, match=\"no attribute 'pop'\"):", + "got_raw": "NotImplementedError, match=\"no attribute 'pop'\"):\n mp.pop(\"x\")\n\n with pytest.raises(NotImplementedError, match=\"no attribute 'popitem'\"):\n mp.popitem()\n\n with pytest.raises(NotImplementedError, match=\"no attribute 'setdefault'\"):\n mp.setdefault(\"x\", 23)\n\n with pytest.raises(NotImplementedError, match=\"no attribute 'copy'\"):\n mp.copy()\n\n with pytest.raises(NotImplementedError, match=\"no attribute 'fromkeys'\"):\n mp.fromkeys((\"x\", \"y\"), 23)\n\n def test_immutable_values", + "exact_match": false, + "code_bleu": 0.6803749333171202, + "edit_similarity": 0.8043478260869565, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "b\"\\x1d(L\\x0b\\x000p0\\x01\\x011\\x01\\x00\\x01\\x00\\x00\\x1d(L\\x02\\x0002\"", + "got": "1024 == len(instance.output)", + "got_raw": "1024 == len(instance.output)\n\ndef test_graphics_black() -> None:\n \"\"\"\n Test printing solid black graphics\n \"\"\"\n instance = printer.Dummy()\n instance.image(\"test/resources/canvas_black.png\", impl=\"graphics\")\n\n assert 1024 == len(instance.output)\n\ndef test_graphics_white_center() -> None:\n \"\"\"\n Test printing solid white graphics\n \"\"\"\n instance = printer.Dummy()\n instance.image(\"test/resources/canvas_white.png\", impl=\"graphics\", center=True)\n\n assert 1024 == len(instance.output)\n\ndef test_graphics_black_center() -> None:\n", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.06451612903225806, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "False", + "got": "False", + "got_raw": " False\n\n\ndef test_device_initialized(usbprinter):\n \"\"\"\n GIVEN a usb printer object\n WHEN it is initialized\n THEN check the device property is not False\n \"\"\"\n\n usbprinter.open()\n assert usbprinter._device is not False\n\n\ndef test_device_not_opened(usbprinter):\n \"\"\"\n GIVEN a usb printer object\n WHEN it is not initialized\n THEN check the device property is False\n \"\"\"\n\n assert usbprinter._device is False\n\n\ndef test_device_opened(usbprinter):\n \"\"\"\n GIVEN a usb printer object\n WHEN it is initialized\n THEN check the device", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "devicenotfounderror)", + "got": "Devicenotfounderror):", + "got_raw": "Devicenotfounderror):\n cupsprinter.open(raise_not_found=True)\n\n\ndef test_open_do_not_raise_exception(cupsprinter, devicenotfounderror) -> None:\n \"\"\"\n GIVEN a cups printer object\n WHEN open() is set to not raise a DeviceNotFoundError on error\n THEN check the exception is not raised\n \"\"\"\n cupsprinter.host = \"fakehost\"\n\n\n with pytest.raises(Devicenotfounderror):\n cupsprinter.open(raise_not_found=False)\n\n\ndef test_open(cupsprinter, devicenotfounderror) -> None:\n \"\"\"\n GIVEN a cups printer", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.926829268292683, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "b\"\\x1bt\\x00? ist teuro.\"", + "got": "b\"\\x1bt\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b", + "got_raw": " b\"\\x1bt\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b\\x47\\x00\\x1b", + "exact_match": false, + "code_bleu": 0.01391004452078366, + "edit_similarity": 0.11282051282051282, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n\ndef test_buzzer_function_with_custom_params() -> None:\n instance = printer.Dummy()\n instance.buzzer(times=3, duration=5)\n expected = BUZZER + bytes((3, 5))\n\n assert instance.output == expected\n\n\ndef test_buzzer_function_with_invalid_params() -> None:\n instance = printer.Dummy()\n with pytest.raises(ValueError):\n instance.buzzer(times=0, duration=0)\n\n with pytest.raises(ValueError):\n instance.buzzer(times=10, duration=0)\n\n with pytest.raises(ValueError):\n instance.buzzer(times=0, duration=1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "caplog.text", + "got": "caplog.text", + "got_raw": " caplog.text\n assert \"Win32Raw printing fakeprinter not available\" in caplog.text\n assert lpprinter.device is None\n\n\ndef test_open_raise_exception(lpprinter, caplog, mocker):\n \"\"\"\n GIVEN a lp printer object\n WHEN open() is set to raise on error\n THEN check the error is logged and open() canceled\n \"\"\"\n mocker.patch(\"escpos.printer.LP.printers\", new={\"test_printer\": \"Test\"})\n\n lpprinter.printer_name = \"fakeprinter\"\n\n with caplog.at_level(logging.ERROR):\n with pytest", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "str(w[-1].message)", + "got": "str(w[-1].message)", + "got_raw": " str(w[-1].message)\n assert \"image_arguments\" in str(w[-1].message)\n assert \"impl\" in str(w[-1].message)\n\ndef test_deprecated_arguments2(instance):\n \"\"\"Test deprecation warning.\"\"\"\n with warnings.catch_warnings(record=True) as w:\n # cause all warnings to always be triggered\n warnings.simplefilter(\"always\")\n instance.qr(\n \"LoremIpsum\",\n impl=\"bitImageRaster\",\n image_arguments={\"impl\": \"bitImageColumn\"},\n )\n assert issubclass(w[-1].category, DeprecationWarning)\n\n assert \"deprecated\"", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "AttributeError)", + "got": "escpos.exceptions.Error) as excinfo:", + "got_raw": "escpos.exceptions.Error) as excinfo:\n raise escpos.exceptions.Error(\"test\")\n\n assert str(excinfo.value) == \"test\"\n\ndef test_raise_error_wrongly_with_status() -> None:\n \"\"\"raise error the wrong way\n\n should reproduce https://github.com/python-escpos/python-escpos/issues/257\n \"\"\"\n\n with pytest.raises(escpos.exceptions.Error) as excinfo:\n raise escpos.exceptions.Error(\"test\", status=100)\n\n assert str(excinfo.value) == \"test\"\n\ndef test_raise_error_wrongly_with_status_and_msg() -> None:\n \"\"\"", + "exact_match": false, + "code_bleu": 0.14113991930789777, + "edit_similarity": 0.27450980392156865, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "ImageWidthError)", + "got": "escpos.exceptions.ImageWidthError):", + "got_raw": "escpos.exceptions.ImageWidthError):\n instance.image(\"logo.gif\")\n\ndef test_width_too_large_with_fragment_height(dummy_with_width: printer.Dummy) -> None:\n \"\"\"\n Test printing an image that is too large in width with a fragment height.\n \"\"\"\n instance = dummy_with_width\n\n with pytest.raises(escpos.exceptions.ImageWidthError):\n instance.image(\"logo.gif\", fragment_height=1000)\n\ndef test_width_too_large_with_fragment_height_and_center(dummy_with_width: printer.Dummy) -> None:\n \"\"\"\n Test printing an image that is too large in width with a fragment height and", + "exact_match": false, + "code_bleu": 0.24446151121745047, + "edit_similarity": 0.6274509803921569, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "b\"_ ist teuro.\"", + "got": "b\"\\x1b\\x40\\x1b\\x41\\x1b\\x42\\x1b\\x43\\x1b\\x44\\x1b\\x45\\x1b\\x46\\x1b\\x47\\x1b\\x48\\x1b\\x49\\x1b\\x4a\\x1b\\x4b\\x1b\\x4c\\x1b\\x4d\\x1b\\x4e\\x1b\\x4f\\x1b\\x50\\x1b\\x51\\x1b\\x52\\x1b\\x53\\x1b\\x54", + "got_raw": " b\"\\x1b\\x40\\x1b\\x41\\x1b\\x42\\x1b\\x43\\x1b\\x44\\x1b\\x45\\x1b\\x46\\x1b\\x47\\x1b\\x48\\x1b\\x49\\x1b\\x4a\\x1b\\x4b\\x1b\\x4c\\x1b\\x4d\\x1b\\x4e\\x1b\\x4f\\x1b\\x50\\x1b\\x51\\x1b\\x52\\x1b\\x53\\x1b\\x54", + "exact_match": false, + "code_bleu": 0.01391004452078366, + "edit_similarity": 0.032432432432432434, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "expected", + "got": "expected", + "got_raw": " expected\n\n\n# File: src/escpos/escpos.py\n :param code: alphanumeric data to be printed as bar code (payload).\n\n :param bc: barcode format type (EAN13, CODE128, JAN, etc.).\n\n :param height: barcode module height (in printer dots), has to be between 1 and 255.\n *default*: 64\n\n :param width: barcode module width (in printer dots), has to be between 2 and 6.\n *default*: 3\n\n :param pos: text position (ABOVE, BELOW", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "lower_part.width", + "got": "100", + "got_raw": "100\n assert lower_part.width == 100\n assert upper_part.height == 100\n assert lower_part.height == 100\n\n assert upper_part.width_bytes == 100\n assert lower_part.width_bytes == 100\n assert upper_part.height_bytes == 100\n assert lower_part.height_bytes == 100\n\n assert upper_part.width_bytes == lower_part.width_bytes\n assert upper_part.height_bytes == lower_part.height_bytes\n\n assert upper_part.width_bytes == 100\n assert lower_part.width_bytes ==", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "b\"\\x1dv0\\x00\\x01\\x00\\x01\\x00\\x00\"", + "got": "b\"\\x1d\\x33\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00", + "got_raw": " b\"\\x1d\\x33\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00", + "exact_match": false, + "code_bleu": 0.01391004452078366, + "edit_similarity": 0.15763546798029557, + "n_retrieved": 10 + }, + { + "repo": "python-escpos/python-escpos", + "expected": "width_expected", + "got": "100", + "got_raw": "100\n assert im.height == 100\n assert im.width_bytes == 100\n assert im._im.mode == \"1\"\n assert im._im.size == (100, 100)\n assert im._im.format == \"L\"\n assert im._im.tobytes() == b\"\\x00\" * 10000\n\n assert im.to_raster_format() == raster_format_expected\n assert im.to_column_format() == column_format_expected\n\n assert im.to_column_format(high_density_vertical=False) == column_format_expected\n\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-jsonschema/jsonschema", + "expected": "\"anyOf\")", + "got": "\"type\")", + "got_raw": " \"type\")\n self.assertEqual(best.validator_value, \"array\")\n self.assertEqual(best.instance, [])\n self.assertEqual(best.schema, schema)\n self.assertEqual(best.schema_path, ())\n\n def test_no_oneOf_traversal_for_equally_relevant_errors(self):\n \"\"\"\n We don't traverse into an oneOf (as above) if all of its context errors\n seem to be equally \"wrong\" against the instance.\n \"\"\"\n\n schema = {\n \"oneOf\": [\n {\"type\": \"string\"},\n {\"type\": \"integer\"},\n {\"type\": \"object\"},\n ],\n }\n best = self", + "exact_match": false, + "code_bleu": 0.537284965911771, + "edit_similarity": 0.5333333333333333, + "n_retrieved": 10 + }, + { + "repo": "python-jsonschema/jsonschema", + "expected": "FormatError)", + "got": "BOOM):", + "got_raw": "BOOM):\n boom(\"boom\")\n\n with self.assertRaises(BANG):\n boom(\"bang\")\n\n def test_it_catches_unregistered_errors(self):\n checker = FormatChecker()\n checker.checks(\"boom\", raises=type(BOOM))(boom)\n\n with self.assertRaises(FormatError):\n boom(\"boom\")\n\n with self.assertRaises(FormatError):\n boom(\"bang\")\n\n def test_it_catches_multiple_errors(self):\n checker = FormatChecker()\n checker.checks(\"boom\", raises=(type(BOOM), type(BANG)))(boom)\n\n with self.assertRaises(BOOM):\n boom(\"boom", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.1111111111111111, + "n_retrieved": 10 + }, + { + "repo": "python-jsonschema/jsonschema", + "expected": "tree)", + "got": "tree)", + "got_raw": " tree)\n\n def test_it_does_not_contain_an_item_if_the_item_had_no_error(self):\n errors = [exceptions.ValidationError(\"a message\", path=[\"bar\"])]\n tree = exceptions.ErrorTree(errors)\n\n self.assertNotIn(\"foo\", tree)\n\n def test_it_can_be_indexed_to_get_the_child_tree(self):\n errors = [exceptions.ValidationError(\"a message\", path=[\"bar\"])]\n tree = exceptions.ErrorTree(errors)\n\n self.assertEqual(tree[\"bar\"], tree[0])\n\n def test_it_can_be_indexed_to_get_the_child_tree_if_the_index_is_not_in_the_instance(self):\n errors =", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-jsonschema/jsonschema", + "expected": "\"oneOf\")", + "got": "\"oneOf\")", + "got_raw": " \"oneOf\")\n self.assertEqual(best.validator_value, [])\n self.assertEqual(best.instance, [])\n self.assertEqual(best.schema, schema)\n self.assertEqual(best.schema_path, [])\n self.assertEqual(best.path, [])\n\n def test_no_oneOf_traversal_for_equally_relevant_errors_with_context(self):\n \"\"\"\n We don't traverse into an oneOf (as above) if all of its context errors\n seem to be equally \"wrong\" against the instance.\n \"\"\"\n\n schema = {\n \"oneOf\": [\n {\"type\": \"string\"},\n {\"type\": \"integer\"},\n {\"type", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-jsonschema/jsonschema", + "expected": "\"type\")", + "got": "", + "got_raw": " # type: ignore[union-attr]\n \"type\")\n self.assertEqual(error.validator_value, # type: ignore[union-attr]\n \"number\")\n self.assertEqual(error.instance, \"foo\")\n self.assertEqual(error.schema, {\"type\": \"number\"})\n self.assertEqual(error.path, ())\n self.assertEqual(error.schema_path, ())\n self.assertEqual(w.filename, __file__)\n self.assertEqual(w.lineno, 10)\n self.assertEqual(w.line, \" error, = validator.iter_errors('foo', {\\\"type\\\": \\\"number\\\"})\")\n self.assertEqual(w.message, \"Passing a schema to", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-jsonschema/jsonschema", + "expected": "ValidationError)", + "got": "ValidationError) as cm:", + "got_raw": "ValidationError) as cm:\n validator.validate(\"bang\")\n\n self.assertEqual(cm.exception.cause, BANG)\n\n def test_format_error_causes_are_not_validation_error_causes(self):\n checker = FormatChecker()\n checker.checks(\"boom\", raises=ValueError)(boom)\n validator = Draft4Validator({\"format\": \"boom\"}, format_checker=checker)\n\n\n with self.assertRaises(ValidationError) as cm:\n validator.validate(\"boom\")\n\n self.assertEqual(cm.exception.cause, BOOM)\n\n def test_format_error_causes_are_not_validation_error_causes_2(self):\n checker = FormatChecker()\n checker.checks(\"", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.8205128205128205, + "n_retrieved": 10 + }, + { + "repo": "python-jsonschema/jsonschema", + "expected": "stderr)", + "got": ".assertRegex(", + "got_raw": ".assertRegex(\n stderr,\n r\"FileNotFoundError: some_instance does not exist\\.\",\n )\n\n def test_instance_is_invalid_JSON_plain_output(self):\n stdout, stderr = self.run_cli(\n files=dict(\n some_schema=\"{}\",\n some_instance=\"not valid JSON!\",\n ),\n\n argv=[\"--output\", \"plain\", \"-i\", \"some_instance\", \"some_schema\"],\n\n exit_code=1,\n )\n self.assertFalse(stdout)\n\n self.assertRegex(\n stderr,\n r\"FileNotFoundError: some_instance does not exist\\.\",\n )\n\n def test_instance_is_invalid_JSON_plain_output_with", + "exact_match": false, + "code_bleu": 0.37991784282579627, + "edit_similarity": 0.3, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "[ test_cfg.strpath ]", + "got": "[tmpdir.strpath, test_cfg.strpath]", + "got_raw": " [tmpdir.strpath, test_cfg.strpath]\n assert _utils.find_parents(tmpdir.strpath, path.strpath, [\"test.cfg\", \"test2.cfg\"]) == [tmpdir.strpath, test_cfg.strpath, test2_cfg.strpath]\n assert _utils.find_parents(tmpdir.strpath, path.strpath, [\"test.cfg\", \"test2.cfg\", \"test3.cfg\"]) == [tmpdir.strpath, test_cfg.strpath, test2_cfg.strpath, test3_cfg.strpath]\n assert _utils.find_parents(tmpdir.strpath, path.strpath, [\"test.cfg\", \"", + "exact_match": false, + "code_bleu": 0.4111336169005197, + "edit_similarity": 0.7037037037037037, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "\"isabs\"", + "got": "\"isabs\"", + "got_raw": " \"isabs\"\n assert items[0][\"kind\"] == lsp.CompletionItemKind.Function\n assert items[0][\"insertText\"] == \"isabs\"\n assert items[0][\"sortText\"] == \"z0000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "expected_call_args)", + "got": "", + "got_raw": "\n\n\n# File: pylsp/plugins/pyflakes_lint.py\n# Copyright 2017-2020 Palantir Technologies, Inc.\n# Copyright 2021- Python Language Server Contributors.\n\nfrom pyflakes import api as pyflakes_api\nfrom pyflakes import messages\n\nfrom pylsp import hookimpl, lsp\n\n# Pyflakes messages that should be reported as Errors instead of Warns\nPYFLAKES_ERROR_MESSAGES = (\n messages.UndefinedName,\n messages.UndefinedExport,\n messages.UndefinedLocal,\n messages.DuplicateArgument,\n messages.Future", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "\"TEXT\"", + "got": "\"TEXT\"", + "got_raw": " \"TEXT\"\n\ndef test_get_document_not_found(pylsp) -> None:\n assert pylsp.workspace.get_document(DOC_URI) is None\n\ndef test_get_document_not_found_in_notebook(pylsp) -> None:\n pylsp.workspace.put_notebook_document(NOTEBOOK_URI, \"notebook_type\", [])\n\n assert pylsp.workspace.get_document(NOTEBOOK_URI) is None\n\ndef test_get_document_in_notebook(pylsp) -> None:\n pylsp.workspace.put_notebook_document(NOTEBOOK_URI, \"notebook_type\", [])\n\n assert pylsp.workspace.get_document(NOTEBOOK_URI) is None\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "\"a = 123\\n\\n\\ndef func():\\n pass\\n\"", + "got": "\"\"\"a = 123", + "got_raw": " \"\"\"a = 123\n\n\ndef func():\n pass\n\"\"\"\n\ndef test_format_range(config, workspace) -> None:\n doc = Document(DOC_URI, workspace, DOC)\n res = pylsp_format_range(config, workspace, doc, {\"start\": {\"line\": 0, \"character\": 0}, \"end\": {\"line\": 1, \"character\": 0}}, options=None)\n\n assert len(res) == 1\n\n assert res[0][\"newText\"] == \"\"\"a = 123\n\n\ndef func():\n pass\n\"\"\"\n\ndef test_format_range_with_indentation(config,", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "[ {\"range\": edit_range, \"newText\": \"import pathlib\\n\"} ]", + "got": "[{\"range\": edit_range, \"newText\": \"pathlib\\n\"}]", + "got_raw": " [{\"range\": edit_range, \"newText\": \"pathlib\\n\"}]\n\n@pytest.mark.parametrize(\"completions\", [(\"\"\"import\"\"\", 2)], indirect=True)\ndef test_autoimport_import(completions) -> None:\n assert completions[0][\"label\"] == \"import\"\n\n start = {\"line\": 0, \"character\": 0}\n edit_range = {\"start\": start, \"end\": start}\n\n assert completions[0][\"additionalTextEdits\"] == [{\"range\": edit_range, \"newText\": \"import\\n\"}]\n\n@pytest.mark.parametrize(\"completions\", [(\"\"\"", + "exact_match": false, + "code_bleu": 0.7691605673134586, + "edit_similarity": 0.912621359223301, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "pylsp_hover(doc._config, doc, numpy_sin_hov_position)[\"contents\"][ \"value\" ]", + "got": "in pylsp_hover(doc._config, doc, numpy_sin_hov_position)[\"contents\"][\"value\"]", + "got_raw": "<|fim_suffix|>\n in pylsp_hover(doc._config, doc, numpy_sin_hov_position)[\"contents\"][\"value\"]\n )\n\n # https://github.com/davidhalter/jedi/issues/1746\n import numpy as np\n\n if np.lib.NumpyVersion(np.__version__) < \"1.20.0\":\n contents = \"Trigonometric sine, element-wise.\\n\\n\"\n\n assert contents in pylsp_hover(doc._config, doc, numpy_sin_hov_position)[\"contents\"][\"value\"]\n\n\ndef test_numpy_hover_with_signature(workspace) -> None:\n # Over the blank line\n ", + "exact_match": false, + "code_bleu": 0.9391044157537525, + "edit_similarity": 0.9673202614379085, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "lsp.DiagnosticSeverity.Warning", + "got": "1", + "got_raw": "1\n\n assert unused_import[\"code\"] == \"E402\"\n\n assert unused_import[\"source\"] == \"pyflakes\"\n\n assert unused_import[\"tags\"] == [lsp.DiagnosticTag.Unnecessary]\n\n assert unused_import[\"message\"] == msg\n\n assert len(diags) == 1\n\ndef test_pyflakes_syntax_error(workspace) -> None:\n doc = Document(DOC_URI, workspace, DOC_SYNTAX_ERR)\n diags = pyflakes_lint.pylsp_lint(workspace, doc)\n\n assert len(diags) == 1\n\n msg = \"invalid syntax\"\n", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "{ \"code\": \"D100\", \"message\": \"D100: Missing docstring in public module\", \"severity\": lsp.DiagnosticSeverity.Warning, \"range\": { \"start\": {\"line\": 0, \"character\": 0}, \"end\": {\"line\": 0, \"character\": 11}, }, \"source\": \"pydocstyle\", }", + "got": "{", + "got_raw": " {\n \"source\": \"pydocstyle\",\n \"code\": \"D100\",\n \"message\": \"Module docstring missing\",\n \"range\": {\n \"start\": {\"line\": 0, \"character\": 0},\n \"end\": {\"line\": 0, \"character\": 0},\n },\n }\n\n # And one we're not expecting is:\n\n assert diags[1] == {\n \"source\": \"pydocstyle\",\n \"code\": \"D101\",\n \"message\": \"Class docstring missing\",\n \"range\": {\n \"start", + "exact_match": false, + "code_bleu": 0.011658893284340402, + "edit_similarity": 0.008620689655172414, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "True", + "got": "True", + "got_raw": " True\n assert rope_autoimport_settings.get(\"code_actions\", {}).get(\"enabled\", False) is True\n\n # We received autoimport suggestions for \"os\" in the first cell because\n # os is imported after that.\n assert contains_autoimport_completion(\n pylsp_autoimport_completions(\n server.workspace._config, server.workspace, server.workspace.get_document(\n uris.from_fs_path(__file__)\n ), position(0, 0), make_context(\"os\", 0, 0, 0)\n )[0],\n \"os\",\n )\n # We don't receive an", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "{\"line\": 5, \"character\": 1}", + "got": "10", + "got_raw": "10\n assert unused_var[\"range\"][\"end\"] == 10\n\ndef test_flake8_saved(workspace) -> None:\n name, doc = temp_document(DOC, workspace)\n diags = flake8_lint.pylsp_lint(workspace, doc)\n msg = \"F841 local variable 'a' is assigned to but never used\"\n unused_var = [d for d in diags if d[\"message\"] == msg][0]\n\n assert unused_var[\"source\"] == \"flake8\"\n assert unused_var[\"code\"] == \"F841\"\n\n assert unused", + "exact_match": false, + "code_bleu": 0.05555555555555555, + "edit_similarity": 0.06896551724137931, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "\"parameter docstring\"", + "got": "\" parameter docstring\"", + "got_raw": " \" parameter docstring\"\n\n@pytest.mark.parametrize(\n \"regex,doc\",\n [\n (signature.SPHINX, \" :param test: parameter docstring\"),\n (signature.EPYDOC, \" @param test: parameter docstring\"),\n (signature.GOOGLE, \" test (str): parameter docstring\"),\n ],\n)\ndef test_docstring_params(regex, doc) -> None:\n m = regex.match(doc)\n assert m.group(\"param\") == \"test\"\n\n assert m.group(\"doc\") == \" parameter docstring\"\n\n@pytest.mark.parametrize(\n \"regex,doc\",\n ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.9130434782608695, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "\"foo()\"", + "got": "\"foo\"", + "got_raw": " \"foo\"\n assert completions[0][\"kind\"] == lsp.CompletionItemKind.Function\n assert completions[0][\"insertText\"] == \"foo\"\n assert completions[0][\"insertTextFormat\"] == lsp.InsertTextFormat.PlainText\n assert completions[0][\"detail\"] == \"mymodule.foo\"\n assert completions[0][\"documentation\"] == \"Function documentation\"\n\n assert completions[1][\"label\"] == \"mymodule\"\n assert completions[1][\"kind\"] == lsp.CompletionItemKind.Module\n assert completions[1][\"insertText\"] ==", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.8333333333333334, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "pylsp_hover(doc._config, doc, numpy_hov_position_3)[\"contents\"][\"value\"]", + "got": "assert contents in pylsp_hover(doc._config, doc, numpy_sin_hov_position)[\"contents\"]contents in pylsp_hover(doc._config, doc, numpy_sin_hov_position)[\"contents\"]", + "got_raw": "<|fim_suffix|>\n assert contents in pylsp_hover(doc._config, doc, numpy_sin_hov_position)[\"contents\"]<|fim_middle|>contents in pylsp_hover(doc._config, doc, numpy_sin_hov_position)[\"contents\"]", + "exact_match": false, + "code_bleu": 0.3312824216936373, + "edit_similarity": 0.5665236051502146, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "None", + "got": "None", + "got_raw": " None\n\ndef test_put_document(pylsp) -> None:\n pylsp.workspace.put_document(DOC_URI, \"TEXT\")\n assert pylsp.workspace.get_document(DOC_URI).source == \"TEXT\"\n\ndef test_put_notebook_document(pylsp) -> None:\n pylsp.workspace.put_notebook_document(\n NOTEBOOK_URI,\n \"notebook_type\",\n [\n {\n \"uri\": path_as_uri(\"cell1\"),\n \"languageId\": \"python\",\n \"source\": \"cell1\",\n },\n {\n \"uri\": path_as_uri(\"cell2\"),\n \"languageId\": \"python", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "1", + "got": "1", + "got_raw": "1\n assert defns[0][\"uri\"] == uris.from_fs_path(\n os.path.join(os.path.dirname(__file__), \"builtins.pyi\")\n )\n assert defns[0][\"range\"][\"start\"][\"line\"] == 0\n assert defns[0][\"range\"][\"start\"][\"character\"] == 0\n assert defns[0][\"range\"][\"end\"][\"line\"] == 0\n assert defns[0][\"range\"][\"end\"][\"character\"] == 10\n\n # Check definition for `dict` goes to `builtins.pyi::dict` when\n # `", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "\"0Hello12345678901234567890123456789\"", + "got": "assert (", + "got_raw": "<|fim_suffix|>\n assert (\n apply_text_edits(\n test_doc,\n [\n {\n \"range\": {\n \"start\": {\"line\": 0, \"character\": 0},\n \"end\": {\"line\": 0, \"character\": 0},\n },\n \"newText\": \"Hello\",\n },\n {\n \"range\": {\n \"start\": {\"line\": 0, \"character\": 0},\n \"end\": {\"line\": 0, \"character\": 0},\n },\n \"newText\": \"World\",\n },\n ],\n )\n == \"HelloWorld", + "exact_match": false, + "code_bleu": 0.4518010018049224, + "edit_similarity": 0.044444444444444446, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "None", + "got": "assert changes[1][\"textDocument\"][\"version\"] == doc.version", + "got_raw": "<|fim_suffix|>\n assert changes[1][\"textDocument\"][\"version\"] == doc.version\n assert changes[1].get(\"edits\") == [\n {\n \"range\": {\n \"start\": {\"line\": 0, \"character\": 0},\n \"end\": {\"line\": 0, \"character\": 0},\n },\n \"newText\": \"foo = 123\",\n }\n ]\n\n assert changes[2][\"textDocument\"][\"uri\"] == doc.uri\n assert changes[2][\"textDocument\"][\"version\"] == doc.version\n assert changes[2].get(\"edits", + "exact_match": false, + "code_bleu": 0.06468490584192432, + "edit_similarity": 0.09523809523809523, + "n_retrieved": 10 + }, + { + "repo": "python-lsp/python-lsp-server", + "expected": "\"import sys\\n\"", + "got": "1", + "got_raw": "1\n assert doc.lines[1] == 2\n assert doc.lines[2] == 3\n assert doc.lines[3] == 4\n\n assert doc.line_count == 4\n\n assert doc.line(0) == 1\n assert doc.line(1) == 2\n assert doc.line(2) == 3\n assert doc.line(3) == 4\n\n assert doc.line_start(0) == 0\n assert doc.line_start(1) == 1\n assert doc.line_start(2) == 2\n assert doc.line", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "2", + "got": "0", + "got_raw": "0\n\n output.add_content(\"Hello\")\n output2.add_content(\"World\")\n\n assert len(sections) == 2\n\n assert output.content == \"Hello\\n\"\n assert output2.content == \"World\\n\"\n\n assert output.lines == 2\n assert output2.lines == 2\n\n assert output._lines == 2\n assert output2._lines == 2\n\n assert output._content == [\"Hello\\n\"]\n assert output2._content == [\"World\\n\"]\n\n assert output._section_outputs == [output, output2]\n assert output2._section_outputs == [output, output", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "\"black\"", + "got": "assert question.ask(io) == \"white\"", + "got_raw": "<|fim_suffix|>\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io) == \"white\"\n\n assert question.ask(io)", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.14634146341463414, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "1", + "got": "1", + "got_raw": "1\n assert len(dispatcher.get_listeners(POST_FOO)) == 1\n\n assert dispatcher.get_listeners(PRE_FOO)[0] == listener.pre_foo\n assert dispatcher.get_listeners(POST_FOO)[0] == listener.post_foo\n\ndef test_dispatch(dispatcher: EventDispatcher, listener: EventListener) -> None:\n dispatcher.add_listener(PRE_FOO, listener.pre_foo)\n dispatcher.add_listener(POST_FOO, listener.post_foo)\n\n event = Event()\n dispatcher.dispatch(event, PRE_FOO)\n dispatcher.dispatch(event, POST_FOO)\n\n assert event", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "\"Foo description\"", + "got": "\"Foo description\"", + "got_raw": " \"Foo description\"\n assert argument.default == \"bar\"\n\n assert repr(argument) == \"Argument('foo', required=False, is_list=False, description='Foo description', default='bar')\"\n\ndef test_required_non_list_argument() -> None:\n argument = Argument(\n \"foo\",\n required=True,\n is_list=False,\n description=\"Foo description\",\n default=\"bar\",\n )\n\n assert argument.name == \"foo\"\n assert argument.is_required()\n assert not argument.is_list()\n\n assert argument.description == \"Foo description\"\n assert argument.default == \"bar\"\n\n assert repr(argument) == \"Argument", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "None", + "got": "None", + "got_raw": " None\n assert e.__traceback__.tb_next is not None\n assert e.__traceback__.tb_next.tb_next is not None\n assert e.__traceback__.tb_next.tb_next.tb_next is not None\n assert e.__traceback__.tb_next.tb_next.tb_next.tb_next is not None\n assert e.__traceback__.tb_next.tb_next.tb_next.tb_next.tb_next is not None\n assert e.__traceback__.tb_next.tb_next.tb_next.tb_next.tb_next.tb_next is not None\n assert e.__traceback__.tb_next.tb_next.tb_next.tb_next.tb_next.tb", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "0", + "got": "0", + "got_raw": "0\n assert tester.io.fetch_output() == \"bar\\n\"\n\ndef test_execute_with_arguments(tester: CommandTester) -> None:\n\n assert tester.execute(\"foo bar\") == 0\n assert tester.io.fetch_output() == \"foo bar\\n\"\n\ndef test_execute_with_options(tester: CommandTester) -> None:\n\n assert tester.execute(\"foo --baz=qux\") == 0\n assert tester.io.fetch_output() == \"foo --baz=qux\\n\"\n\ndef test_execute_with_arguments_and_options(tester: CommandTester) -> None:\n\n assert tester.execute(\"foo bar --baz=qux", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "None", + "got": "self._io = io", + "got_raw": "<|fim_suffix|>\n self._io = io\n\n try:\n return self.handle()\n except KeyboardInterrupt:\n return 1\n\n def handle(self) -> int:\n \"\"\"\n Execute the command.\n \"\"\"\n raise NotImplementedError\n\n def call(self, name: str, args: str | None = None) -> int:\n \"\"\"\n Call another command.\n \"\"\"\n assert self.application is not None\n command = self.application.get(name)\n\n return self.application._run_command(\n command, self._io.with_input(StringInput(args or \"\"))\n )\n\n def call_silent(self, name: str, args:", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.11764705882352941, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "[]", + "got": "0", + "got_raw": "0\n\n with pytest.raises(CleoLogicError):\n opt.set_default(1)\n\n opt.set_default(1)\n\n assert opt.default == [1]\n\n opt = Option(\"option\", flag=False, is_list=True, requires_value=False)\n\n assert not opt.is_flag()\n assert not opt.accepts_value()\n assert not opt.requires_value()\n assert opt.is_list()\n\n assert opt.default == 0\n\n with pytest.raises(CleoLogicError):\n opt.set_default(1)\n\n opt.set_default(1)\n\n assert opt.default == [1]\n\n opt = Option(\"option\", flag=False,", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "\"Parent Command.\"", + "got": "\"Parent command\"", + "got_raw": " \"Parent command\"\n\n assert command.arguments == [\n argument(\"arg1\", required=True, description=\"First argument\"),\n argument(\"arg2\", required=False, description=\"Second argument\"),\n ]\n\n assert command.options == [\n argument(\"option1\", required=False, description=\"First option\"),\n argument(\"option2\", required=False, description=\"Second option\"),\n ]\n\n assert command.aliases == [\"parent\"]\n\n assert command.usages == [\"parent\", \"parent arg1\", \"parent arg1 arg2\"]\n\n assert command.hidden == False\n\n assert command.enabled == True\n\n assert command.help == \"Parent command", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.9090909090909091, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "None", + "got": "assert argument.default == \"bar\"", + "got_raw": "<|fim_suffix|>\n assert argument.default == \"bar\"\n\n with pytest.raises(CleoLogicError):\n argument.set_default(1)\n\n with pytest.raises(CleoLogicError):\n argument.set_default([\"foo\", \"bar\"])\n\n with pytest.raises(CleoLogicError):\n argument.set_default({\"foo\": \"bar\"})\n\n with pytest.raises(CleoLogicError):\n argument.set_default(1.0)\n\n with pytest.raises(CleoLogicError):\n argument.set_default(True)\n\n with pytest.raises(CleoLogicError):\n argument.set_default(None)\n\n with pytest.raises(CleoLogicError):\n argument.set_default([1", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.05555555555555555, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "[\"bar\"]", + "got": "[\"bar\"]", + "got_raw": " [\"bar\"]\n\ndef test_option() -> None:\n opt = option(\"foo\", \"f\", \"Foo\")\n\n assert opt.name == \"foo\"\n assert opt.shortcut == \"f\"\n assert opt.description == \"Foo\"\n assert opt.is_flag()\n assert opt.is_list()\n assert opt.requires_value()\n assert not opt.accepts_value()\n assert not opt.is_list()\n assert opt.default is None\n\n opt = option(\"foo\", \"f\", \"Foo\", multiple=True)\n\n assert opt.name == \"foo\"\n assert opt.shortcut == \"f\"\n assert opt.description == \"Foo", + "exact_match": true, + "code_bleu": 0.8408964152537145, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "None", + "got": "assert opt.requires_value is True", + "got_raw": "<|fim_suffix|>\n assert opt.requires_value is True\n assert opt.is_list is False\n assert opt.default is None\n\n with pytest.raises(CleoLogicError):\n Option(\"option\", flag=False, requires_value=False, is_list=True)\n\n with pytest.raises(CleoLogicError):\n Option(\"option\", flag=False, requires_value=True, is_list=True)\n\n with pytest.raises(CleoLogicError):\n Option(\"option\", flag=True, requires_value=True, is_list=True)\n\n with pytest.raises(CleoLogicError):\n Option(\"option\", flag=True, requires_value=False, is_list=True)\n\n with pytest", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.05405405405405406, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/cleo", + "expected": "\"Bar\"", + "got": "\"bar (foo)\"", + "got_raw": " \"bar (foo)\"\n\n assert app.version == \"foo\"\n\ndef test_application() -> None:\n app = app()\n\n assert app.name == \"console\"\n\n assert app.version == \"\"\n\n assert app.display_name == \"console\"\n\n assert app.catch_exceptions\n\n assert app.is_auto_exit_enabled()\n\n assert app.are_exceptions_caught()\n\n assert app.is_single_command() == False\n\n assert app._commands == {}\n\n assert app._running_command is None\n\n assert app._want_helps is False\n\n assert app._definition is None\n\n assert app._catch_exceptions\n\n assert app._auto_exit\n\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "\"Django\"", + "got": "dependency = Dependency(\"Django\", \">=1.11,<2.0\")", + "got_raw": "<|fim_suffix|>\n dependency = Dependency(\"Django\", \">=1.11,<2.0\")\n\n result = dependency.to_pep_508()\n\n assert result == \"Django>=1.11,<2.0\"\n\n\ndef test_to_pep_508_extras() -> None:\n dependency = Dependency(\"Django\", \">=1.11,<2.0\", extras=[\"dev\"])\n\n result = dependency.to_pep_508()\n\n assert result == \"Django[dev]>=1.11,<2.0\"\n\n\ndef test_to_pep_508", + "exact_match": false, + "code_bleu": 0.16036590969929357, + "edit_similarity": 0.2857142857142857, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "3", + "got": "1", + "got_raw": "1\n assert poetry.package.all_requires[0].name == \"foo\"\n assert poetry.package.all_requires[0].constraint == \"*\"\n\ndef test_create_poetry_with_nested_similar_dependencies_with_different_markers(\n temporary_directory: Path,\n) -> None:\n pyproject_toml = temporary_directory / \"pyproject.toml\"\n content = \"\"\"\\\n[project]\nname = \"my-package\"\nversion = \"1.2.3\"\n\n[tool.poetry.group.parent.dependencies]\nfoo = {version = \"*\", markers = \"python_version < 3.10\"}\n\n[tool.poetry.group.parent]\ninclude-groups =", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "[with_includes / \"bar/baz.py\"]", + "got": "1", + "got_raw": "1\n assert pkg_include.path == with_includes / \"bar\"\n assert pkg_include.format == \"sdist\"\n assert pkg_include.relative_path == \"bar\"\n assert pkg_include.relative_path_with_format == \"bar\"\n assert pkg_include.relative_path_with_format == \"bar\"\n assert pkg_include.relative_path_with_format == \"bar\"\n assert pkg_include.relative_path_with_format == \"bar\"\n assert pkg_include.relative_path_with_format == \"bar\"\n assert pkg_include.relative_path_with_format == \"bar\"\n assert pkg_include.relative_path_with_format == \"bar\"\n assert pkg_include.relative_path_with_format ==", + "exact_match": false, + "code_bleu": 0.1, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "\"MIT\"", + "got": "1", + "got_raw": "1\n assert license.name == \"MIT License\"\n assert license.url == \"https://spdx.org/licenses/MIT.html\"\n assert license.spdx_id == \"MIT\"\n assert license.spdx_url == \"https://spdx.org/licenses/MIT.html\"\n assert license.spdx_license_expression == \"MIT\"\n assert license.spdx_license_expression == \"MIT\"\n assert license.spdx_license_expression == \"MIT\"\n assert license.spdx_license_expression == \"MIT\"\n assert license.spdx_license_expression == \"MIT\"\n assert license.spdx_license_expression == \"MIT\"\n assert license.spdx_license_expression == \"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "\"foo\"", + "got": "\"foo>=1.2.3\"", + "got_raw": " \"foo>=1.2.3\"\n\n\ndef test_complete_name_with_extras() -> None:\n\n assert Dependency(\"foo\", \">=1.2.3\", extras=[\"bar\"]).complete_name == \"foo[bar]>=1.2.3\"\n\n\ndef test_complete_name_with_extras_and_version() -> None:\n\n assert Dependency(\"foo\", \">=1.2.3\", extras=[\"bar\"]).complete_name == \"foo[bar]>=1.2.3\"\n\n\ndef test_complete_name_with_extras_and_version() -> None:\n\n assert Dependency(\"foo\", \">=1.2.3\", extras=[\"", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5882352941176471, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "release1", + "got": "0", + "got_raw": "0\n assert release1 != 0\n else:\n # e.g. 1.2 != 1.2.3\n release2 = Release.from_parts(*range(1, precision1 + 1))\n assert release1 != release2\n\n assert release2 == 0\n assert release1 == 0\n\n\n@pytest.mark.parametrize(\"precision1\", range(1, 6))\n@pytest.mark.parametrize(\"precision2\", range(1, 6))\ndef test_release_equal_zero_padding_with_phase(precision1: int, precision2: int) -> None:\n release1 = Release.from", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "open", + "got": "assert a.intersect(b) == v124", + "got_raw": "<|fim_suffix|>\n assert a.intersect(b) == v124\n\n # with an open range\n open = VersionRange()\n a = VersionRange(v114, v124)\n\n assert open.intersect(open) == open\n assert open.intersect(a) == open\n assert open.intersect(b) == open\n assert a.intersect(open) == open\n assert b.intersect(open) == open\n\n # with a closed range\n a = VersionRange(v114, v124, include_max=True)\n b = VersionRange(v124", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.12121212121212122, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "parsed", + "got": "parsed[\"Metadata-Version\"]", + "got_raw": " parsed[\"Metadata-Version\"]\n\ndef test_make_pkg_info() -> None:\n poetry = Factory().create_poetry(project(\"module1\"))\n\n builder = SdistBuilder(poetry)\n pkg_info = builder.build_pkg_info()\n p = Parser()\n parsed = p.parsestr(pkg_info.decode())\n\n assert parsed[\"Requires-Python\"] == \">=3.6\"\n\ndef test_make_pkg_info_with_extras() -> None:\n poetry = Factory().create_poetry(project(\"module1\"))\n\n builder = SdistBuilder(poetry)\n pkg_info = builder.build_pkg_info()\n p = Parser()\n parsed = p.parse", + "exact_match": false, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.375, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "Path(path)", + "got": "Path(path)", + "got_raw": " Path(path)\n\n path = r\"C:\\tmp\\file\\subdir\"\n\n assert url_to_path(path_to_url(path)) == Path(path)\n\n path = r\"C:\\tmp\\file\\subdir\\subsubdir\"\n\n assert url_to_path(path_to_url(path)) == Path(path)\n\n path = r\"C:\\tmp\\file\\subdir\\subsubdir\\subsubsubdir\"\n\n assert url_to_path(path_to_url(path)) == Path(path)\n\n path = r\"C:\\tmp\\file\\subdir\\subsubdir\\subsubsubdir\\subsubsubsubdir\"\n\n", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "spec2", + "got": "spec2", + "got_raw": " spec2\n assert hash(spec1) == hash(spec2)\n\n\n@pytest.mark.parametrize(\n \"spec1, spec2\",\n [\n (\n # nothing except for name and features matters if no source\n PackageSpecification(\"a\", None, \"url1\", \"ref1\", \"resref1\", \"sub1\"),\n PackageSpecification(\"a\", None, \"url2\", \"ref2\", \"resref2\", \"sub2\"),\n ),\n (\n # ref does not matter if resolved ref is equal\n PackageSpecification(\"a\", \"type\", \"url\", \"ref1\", \"resref", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "\"*\"", + "got": "assert dep.marker is None", + "got_raw": "<|fim_suffix|>\n assert dep.marker is None\n\n dep = Dependency.create_from_pep_508(name, \">=1.0.0\")\n assert dep.name == name\n assert str(dep.constraint) == \">=1.0.0\"\n assert dep.marker is None\n\n dep = Dependency.create_from_pep_508(name, \">=1.0.0; python_version < 3.10\")\n assert dep.name == name\n assert str(dep.constraint) == \">=1.0.0\"\n assert str(dep.marker) == \"python_version < 3.1", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "\"demo-1.0.0.whl\"", + "got": "f\"https://files.pythonhosted.org/packages/16/52/dead/demo-1.0.0.whl", + "got_raw": " f\"https://files.pythonhosted.org/packages/16/52/dead/demo-1.0.0.whl#sha256={file_checksum}\"\n\ndef test_package_link_metadata(file_checksum: str) -> None:\n link = make_url(ext=\"whl\", metadata_checksum=file_checksum)\n assert link.metadata == f\"sha256={file_checksum}\"\n\n assert link.show_url == f\"https://files.pythonhosted.org/packages/16/52/dead/demo-1.0.0.whl#sha256={file_checksum}\"\n\ndef test_package_link_metadata_and_hash(file", + "exact_match": false, + "code_bleu": 0.03925345689749394, + "edit_similarity": 0.3614457831325301, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "expected", + "got": "assert subject == Version.parse(\"1.2.3.4\")", + "got_raw": "<|fim_suffix|>\n assert subject == Version.parse(\"1.2.3.4\")\n\n\ndef test_version_range() -> None:\n subject = VersionRange.parse(\"1.2.3\")\n\n assert subject == VersionRange.parse(\"1.2.3\")\n assert subject == VersionRange.parse(\"1.2.3.4\")\n assert subject == VersionRange.parse(\"1.2.3.*\")\n assert subject == VersionRange.parse(\"1.2.*\")\n assert subject == VersionRange.parse(\"1.*\")\n assert subject == VersionRange.parse(\"*\")\n\n\ndef test_version_range_invalid() -> None:\n with pytest", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.2, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "\"2.18.0\"", + "got": "t dep.marker == AnyMarker()", + "got_raw": "<|fim_suffix|>t dep.marker == AnyMarker()\n\n\ndef test_dependency_from_pep_508_with_extras() -> None:\n name = \"requests[security]==2.18.0\"\n dep = Dependency.create_from_pep_508(name)\n\n assert dep.name == \"requests\"\n\n assert str(dep.constraint) == \"==2.18.0\"\n assert dep.extras == [\"security\"]\n\n\ndef test_dependency_from_pep_508_with_extras_and_version() -> None:\n name = \"requests[security]==2.18.0\"\n dep = Dependency.create_from_pe", + "exact_match": false, + "code_bleu": 0.11868405219520975, + "edit_similarity": 0.05714285714285714, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "v124", + "got": "assert a.intersect(b) == VersionRange(v124, v200)", + "got_raw": "<|fim_suffix|>\n assert a.intersect(b) == VersionRange(v124, v200)\n\n # a range with a lower bound and an upper bound\n a = VersionRange(v114, v124)\n b = VersionRange(v124, v200)\n assert a.intersect(b) == VersionRange(v124, v124)\n\n # a range with a lower bound and an upper bound\n a = VersionRange(v114, v124)\n b = VersionRange(v124, v200)\n", + "exact_match": false, + "code_bleu": 0.08225964699966554, + "edit_similarity": 0.1509433962264151, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "{\"sha256\": file_checksum}", + "got": "{\"sha256\": file_checksum}", + "got_raw": " {\"sha256\": file_checksum}\n\ndef test_package_link_metadata(file_checksum: str) -> None:\n link = make_url(ext=\"whl\", metadata_checksum=file_checksum)\n\n assert link.metadata == {\"sha256\": file_checksum}\n\ndef test_package_link_metadata_and_hash(file_checksum: str) -> None:\n link = make_url(ext=\"whl\", metadata_checksum=file_checksum, file_checksum=file_checksum)\n\n assert link.hashes == {\"sha256\": file_checksum}\n assert link.metadata == {\"sha256\": file_checksum}\n\ndef test_package_link_metadata_and_hash_with_metadata(file_checksum:", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "\"WARNING\"", + "got": "\"ERROR\"", + "got_raw": " \"ERROR\"\n assert record.message == \"The file dependency 'demo' does not exist\"\n\n\ndef test_file_dependency_does_not_match(\n caplog: LogCaptureFixture, mocker: MockerFixture\n) -> None:\n mock_exists = mocker.patch.object(Path, \"exists\")\n mock_exists.return_value = True\n dep = FileDependency(\"demo\", DIST_PATH / TEST_FILE)\n assert len(caplog.records) == 1\n record = caplog.records[0]\n\n assert record.levelname == \"ERROR\"\n assert record.message == \"The file dependency 'demo' does not match the file\"\n\n\ndef", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.375, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "1", + "got": "0", + "got_raw": "0\n\n\ndef test_build_wheel_with_bad_path_dep_fails(caplog: LogCaptureFixture) -> None:\n with (\n TemporaryDirectory(ignore_cleanup_errors=True) as tmp_dir,\n cwd(fixtures / \"with_bad_path_dep\"),\n ):\n with pytest.raises(SystemExit):\n api.build_wheel(str(tmp_dir))\n\n assert len(caplog.records) == 1\n assert caplog.records[0].levelname == \"ERROR\"\n assert \"Failed to build wheel\" in caplog.records[0].message\n\n\ndef test_build_wheel_with_bad_path_dep_fails_with_no_build_backend(caplog: LogCaptureFixture)", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "name", + "got": "name", + "got_raw": " name\n assert \".pyc\" not in name\n\ndef test_wheel_does_not_include_pycache_and_pyc_files_with_pycache(\n complete_with_pycache_and_pyc_files: Path,\n) -> None:\n WheelBuilder.make_in(Factory().create_poetry(complete_with_pycache_and_pyc_files))\n\n whl = (\n complete_with_pycache_and_pyc_files / \"dist\"\n ) / \"my_package-1.2.3-py3-none-any.whl\"\n\n assert whl.exists()\n\n with zipfile.ZipFile(str(whl)) as z:\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "python-poetry/poetry-core", + "expected": "parsed.name", + "got": "assert result.branch == parsed.branch", + "got_raw": "<|fim_suffix|>\n assert result.branch == parsed.branch\n assert result.tag == parsed.tag\n assert result.rev == parsed.rev\n assert result.directory == parsed.directory\n assert result.groups == parsed.groups\n assert result.optional == parsed.optional\n assert result.develop == parsed.develop\n assert result.extras == parsed.extras\n\n\n@pytest.mark.parametrize(\n \"url, parsed\",\n [\n (\n \"git+ssh://user@hostname:project.git#commit\",\n ParsedUrl(\n \"ssh\", \"hostname\", \":project.git\", \"user\", None, \"project\", \"commit\"\n ),\n", + "exact_match": false, + "code_bleu": 0.18575057999133596, + "edit_similarity": 0.3333333333333333, + "n_retrieved": 10 + }, + { + "repo": "pytries/marisa-trie", + "expected": "trie", + "got": "trie", + "got_raw": " trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n assert missing_key not in trie\n\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pytries/marisa-trie", + "expected": "wo_trie", + "got": "123", + "got_raw": "123\n assert lo_trie != wo_trie\n assert wo_trie != lo_trie\n assert wo_trie != 123\n\n assert lo_trie != marisa_trie.Trie()\n assert lo_trie != marisa_trie.BytesTrie()\n assert lo_trie != marisa_trie.RecordTrie()\n\n assert lo_trie != marisa_trie.Trie(order=marisa_trie.WEIGHT_ORDER)\n assert lo_trie != marisa_trie.BytesTrie(order=marisa_trie.WEIGHT_ORDER)\n assert lo_trie", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "pytries/marisa-trie", + "expected": "0", + "got": "0", + "got_raw": "0\n\n for word in text:\n trie[word] = 1\n assert len(trie) == len(word) + 1\n\n assert len(trie) == len(text)\n\n\ndef test_getitem():\n trie = marisa_trie.Trie()\n\n for word in text:\n trie[word] = 1\n\n for word in text:\n assert trie[word] == 1\n\n with pytest.raises(KeyError):\n trie[\"spam\"]\n\n with pytest.raises(KeyError):\n trie[\"spam\"] = 1\n\n with pytest.raises(KeyError):\n del trie[\"spam\"]\n\n with pytest", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "pytries/marisa-trie", + "expected": "[]", + "got": "[b\"f\", b\"foo\", b\"foobar\", b\"bar\"]", + "got_raw": " [b\"f\", b\"foo\", b\"foobar\", b\"bar\"]\n assert trie.prefixes(b\"\") == [b\"f\", b\"foo\", b\"foobar\", b\"bar\"]\n\n assert trie.prefixes(b\"b\") == [b\"f\", b\"foo\", b\"foobar\", b\"bar\"]\n assert trie.prefixes(b\"\") == [b\"f\", b\"foo\", b\"foobar\", b\"bar\"]\n\n assert trie.prefixes(b\"b\") == [b\"f\", b\"foo\", b\"foobar\", b\"bar\"]\n assert trie.prefixes(b\"\")", + "exact_match": false, + "code_bleu": 0.10571070857151538, + "edit_similarity": 0.11428571428571428, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "1", + "got": "1", + "got_raw": "1\n\n # Test with a layout which doesn't support swap right now (TreeTab)\n manager.c.layout.next()\n manager.c.eval(f\"self.core.warp_pointer({coords[0]}, {coords[1]})\")\n manager.c.window.set_position(coords[0], coords[1])\n\n # Now they should be the same\n assert manager.c.layout.info()[\"clients\"] == [\"one\", \"two\"]\n\n # Now test with floating\n manager.c.window.enable_floating()\n manager.c.window.set_position(50, 50)\n info = manager.c.window.info()\n\n # Check if", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "i)", + "got": "i)", + "got_raw": " i)\n\n self.c.group.prev_window()\n\n assert_unfocused(self, i)\n\ndef assert_focus_path_fit(self, *names):\n \"\"\"\n Asserts that subsequent calls to next_window() focus the open windows in\n the given order (and prev_window() in the reverse order)\n \"\"\"\n for i in names:\n self.c.group.next_window()\n\n assert_focused(self, i)\n\n self.c.group.prev_window()\n\n assert_unfocused(self, i)\n\ndef assert_focus_path_fit_dimensions(self, *names):\n \"\"\"\n Asserts that subsequent calls to next_window() focus the open windows in\n ", + "exact_match": true, + "code_bleu": 0.7071067811865476, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "3", + "got": "3", + "got_raw": "3\n\n hook.unsubscribe(\"group_window_add\", test)\n hook.fire(\"group_window_add\", 4)\n\n assert test.val == 3\n\ndef test_can_subscribe_to_multiple_hooks():\n test = Call(0)\n\n hook.subscribe.group_window_add(test)\n hook.subscribe.client_new(test)\n hook.fire(\"group_window_add\", 3)\n hook.fire(\"client_new\", 4)\n\n assert test.val == 4\n\n hook.unsubscribe(\"group_window_add\", test)\n hook.fire(\"group_window_add\", 5)\n hook.fire(\"client_new\", 6)\n\n assert test.val == 6", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "0", + "got": "0, f\"Command failed: {argv}\\n{stdout}\\n{stderr}\"", + "got_raw": "0, f\"Command failed: {argv}\\n{stdout}\\n{stderr}\"\n\n return stdout.decode(\"utf-8\")\n\nif __name__ == \"__main__\":\n print(run_qtile(sys.argv[1:]))\n\n\n\n# File: docs/manual/commands/shell/qtile-shell.rst\n==================\nqtile shell\n==================\n\nRun a shell in a window.\n\n.. code-block:: bash\n\n # run a shell in a window\n qtile shell\n\n\n\n# File: docs/manual/commands/shell/qtile-start.rst\n==================\nqtile start\n==================\n\nStart Qtile.\n\n.. code", + "exact_match": true, + "code_bleu": 0.35930411196308426, + "edit_similarity": 0.04081632653061224, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "1", + "got": "1", + "got_raw": "1\n assert manager.c.windows()[0].name == \"one\"\n\n manager.c.window.focus(\"two\")\n manager.c.group.focus(\"one\")\n assert manager.c.group.info()[\"focus\"] == \"one\"\n assert manager.c.group.info()[\"windows\"] == [\"one\"]\n\n assert len(manager.c.windows()) == 1\n assert manager.c.windows()[0].name == \"one\"\n\n manager.c.group.focus(\"two\")\n assert manager.c.group.info()[\"focus\"] == \"two\"\n assert manager.c.group.info()[\"windows\"] == [\"two\"]\n\n assert len(manager.c.windows()) == 1\n assert", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "\"dd-a\"", + "got": "\"one\"", + "got_raw": " \"one\"\n\n # Second toggling: window is killed\n manager.c.group[\"SCRATCHPAD\"].dropdown_toggle(\"dd-a\")\n is_killed(manager, \"dd-a\")\n assert \"window\" not in manager.c.group[\"SCRATCHPAD\"].dropdown_info(\"dd-a\")\n\n # Third toggling: window is spawned again\n manager.c.group[\"SCRATCHPAD\"].dropdown_toggle(\"dd-a\")\n is_spawned(manager, \"dd-a\")\n assert_focused(manager, \"dd-a\")\n\n assert manager.c.group[\"SCRATCHPAD\"].dropdown_info(\"dd-a\")[\"window\"][\"name\"] == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.36363636363636365, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "\"a\"", + "got": "0", + "got_raw": "0\n manager.c.group.to_screen(1)\n assert manager.c.group.info()[\"name\"] == 1\n manager.c.group.to_screen(0)\n assert manager.c.group.info()[\"name\"] == 0\n\n@group_config\ndef test_toscreen_toggle_random(manager):\n\n assert manager.c.group.info()[\"name\"] == 0\n manager.c.group.to_screen(random.randint(0, 1))\n assert manager.c.group.info()[\"name\"] == random.randint(0, 1)\n\n@group_config\ndef test_toscreen_toggle_random(manager):\n\n assert manager.c.group.info()[\"name\"] == ", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "\"25\"", + "got": "10", + "got_raw": "10\n\ndef test_first_tag():\n widget = canto.Canto()\n display_text = widget.parse(OUTPUT, FIRST_TAG)\n\n assert display_text == 10\n\ndef test_second_tag():\n widget = canto.Canto()\n display_text = widget.parse(OUTPUT, SECOND_TAG)\n\n assert display_text == 9\n\ndef test_wrong_tag():\n widget = canto.Canto()\n display_text = widget.parse(OUTPUT, WRONG_TAG)\n\n assert display_text == 0\n\ndef test_no_tag():\n widget = canto.Canto()\n display_text = widget.parse(OUTPUT)\n\n assert display", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "[\"1\"]", + "got": "2", + "got_raw": "2\n assert columns[1][\"clients\"] == 2\n\n # test swap\n manager.c.layout.swap_column_left()\n\n # test postconditions\n columns = manager.c.layout.info()[\"columns\"]\n\n assert columns[0][\"clients\"] == 1\n assert columns[1][\"clients\"] == 3\n\n assert manager.c.layout.info()[\"current\"] == \"columns\"\n\n@columns_config\ndef test_columns_swap_column_right(manager):\n manager.test_window(\"1\")\n manager.test_window(\"2\")\n manager.test_window(\"3\")\n manager.test_window(\"4\")\n\n # test preconditions\n columns", + "exact_match": false, + "code_bleu": 0.16666666666666666, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "\"|\"", + "got": "assert text() == \"||\"", + "got_raw": "<|fim_suffix|>\n assert text() == \"||\"\n\n layout.mode_horizontal()\n\n assert text() == \"-\"\n\n layout.mode_vertical()\n\n assert text() == \"|\"\n\n layout.mode_horizontal()\n\n assert text() == \"-\"\n\n layout.mode_vertical()\n\n assert text() == \"|\"\n\n layout.mode_horizontal()\n\n assert text() == \"-\"\n\n layout.mode_vertical()\n\n assert text() == \"|\"\n\n layout.mode_horizontal()\n\n assert text() == \"-\"\n\n layout.mode_vertical()\n\n assert text() == \"|\"\n\n layout.mode_horizontal()\n\n assert text() == \"-\"\n\n layout.mode_vertical()\n\n assert text() ==", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.25, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "1", + "got": "1", + "got_raw": "1\n ver = ver_line[0].split()[1]\n return ver\n except Exception:\n return None\n\n\ndef test_get_cairo_surface():\n \"Test get_cairo_surface\"\n # test with a valid image\n bytes_img = open(\"tests/data/100x100.png\", \"rb\").read()\n surface = images.get_cairo_surface(bytes_img)\n assert surface.surface.get_width() == 100\n assert surface.surface.get_height() == 100\n assert surface.file_type == \"png\"\n\n # test with an invalid image\n bytes", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "\"\"", + "got": "0", + "got_raw": "0\n\n # Pressing the chord should change the text\n\n fake_qtile.command(\"key\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor\", \"testcolor", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "\"max\"", + "got": "\"screen_split\"", + "got_raw": " \"screen_split\"\n\n@ss_config(param=dict(\n split_ratio=0.5,\n split_ratio_horizontal=0.5,\n split_ratio_vertical=0.5,\n split_ratio_horizontal_min=0.5,\n split_ratio_vertical_min=0.5,\n split_ratio_horizontal_max=0.5,\n split_ratio_vertical_max=0.5,\n split_ratio_horizontal_step=0.5,\n split_ratio_vertical_step=0.5,\n split_ratio_horizontal_step_min=0.5,\n split_ratio_vertical_step_min=0.5,\n split_ratio_horizontal_step_max=0.5", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.21052631578947367, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "1", + "got": "1", + "got_raw": "1\n assert is_inhibited(manager)\n\n manager.add_window_inhibitor(2, \"open\")\n\n assert len(manager.inhibitors) == 2\n assert is_inhibited(manager)\n\n manager.remove_window_inhibitor(1)\n\n assert len(manager.inhibitors) == 1\n assert is_inhibited(manager)\n\n manager.remove_window_inhibitor(2)\n\n assert len(manager.inhibitors) == 0\n assert not is_inhibited(manager)\n\n manager.add_window_inhibitor(1, \"open\")\n\n assert len(manager.inhibitors) == 1\n assert is", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "\"b\"", + "got": "1", + "got_raw": "1\n\n manager.c.window.toggle_floating()\n assert manager.c.window.info()[\"x\"] == 500\n assert manager.c.window.info()[\"y\"] == 30\n\n assert manager.c.window.info()[\"group\"] == 0\n\n manager.c.window.toggle_floating()\n assert manager.c.window.info()[\"x\"] == 512\n assert manager.c.window.info()[\"y\"] == 30\n\n assert manager.c.window.info()[\"group\"] == 1\n\n manager.c.window.toggle_floating()\n assert manager.c.window.info()[\"x\"] == 500\n assert manager", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "0", + "got": "0", + "got_raw": "0\n assert manager.c.window.info()[\"y\"] == 0\n assert manager.c.window.info()[\"group\"] == \"a\"\n\n manager.c.window.toggle_maximize()\n assert manager.c.window.info()[\"width\"] == 1280\n assert manager.c.window.info()[\"height\"] == 720\n\n assert manager.c.window.info()[\"x\"] == 50\n assert manager.c.window.info()[\"y\"] == 20\n assert manager.c.window.info()[\"group\"] == \"a\"\n\n manager.c.window.toggle_maximize()\n assert manager.c.window.info()[\"width\"] == 1", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "3", + "got": "3", + "got_raw": "3\n\n # test that a custom function also fires the hook\n xmanager_nospawn.start(FuncConfig, no_spawn=True)\n\n xmanager_nospawn.test_window(\"one\")\n window_info = xmanager_nospawn.c.window.info()\n xmanager_nospawn.c.window.toscreen(1)\n\n # send activate window message\n ev = xcffib.xproto.ClientMessageEvent.synthetic(\n 32, window_info[\"id\"], conn.atoms[\"_NET_ACTIVE_WINDOW\"], data\n )\n conn.default_screen.root.send_event(ev, mask=xcffib.xproto.EventMask.Substructure", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "RED", + "got": "RED", + "got_raw": " RED\n assert chord.foreground == BLUE\n\n # Fire hook for testcolor chord\n hook.fire(\"leave_chord\", \"testcolor\")\n\n # Chord is no longer in chords_colors so check colours\n\n assert chord.background == BASE_BACKGROUND\n assert chord.foreground == BASE_FOREGROUND\n\n # Fire hook for testcolor chord\n hook.fire(\"enter_chord\", \"testcolor\")\n\n # Chord is in chords_colors so check colours\n\n assert chord.background == RED\n assert chord.foreground == BLUE\n\n # Fire hook for testcolor chord\n hook.fire(\"leave_chord", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "\"a\"", + "got": "\"a\"", + "got_raw": " \"a\"\n\n@scratchpad_config\ndef test_stepping_between_groups_should_skip_scratchpads(manager):\n # we are on a group\n manager.c.screen.next_group()\n # we are on b group\n manager.c.screen.next_group()\n # we should be on a group\n\n assert manager.c.group.info()[\"name\"] == \"a\"\n\n@scratchpad_config\ndef test_stepping_between_groups_should_skip_scratchpads(manager):\n # we are on a group\n manager.c.screen.next_group()\n # we are on b group\n manager.c.screen.next_group()\n # we should", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qtile/qtile", + "expected": "s", + "got": "0", + "got_raw": "0\n assert c.actual() == s\n assert c.complete(s) == 0\n assert c.actual() == s\n assert c.complete(s) == 0\n assert c.actual() == s\n assert c.complete(s) == 0\n assert c.actual() == s\n assert c.complete(s) == 0\n assert c.actual() == s\n assert c.complete(s) == 0\n assert c.actual() == s\n assert c.complete(s) == 0\n assert c.actual() == s\n assert c.complete(s) == 0\n", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "True", + "got": "tivity_type=ActivityType.LISTENING,", + "got_raw": "<|fim_suffix|>tivity_type=ActivityType.LISTENING,\n status_display_type=StatusDisplayType.DETAILS,\n state=\"test\",\n state_url=\"test\",\n details=\"test\",\n details_url=\"test\",\n name=\"test\",\n start=1,\n end=2,\n large_image=\"test\",\n large_text=\"test\",\n large_url=\"test\",\n small_image=\"test\",\n small_text=\"test\",\n small_url=\"test\",\n party_id=\"test\",\n party_size=[1, 2],\n join=\"test\",\n spectate=\"test\",\n match=\"test\",\n", + "exact_match": false, + "code_bleu": 0.18575057999133598, + "edit_similarity": 0.05128205128205128, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "[]", + "got": "0", + "got_raw": "0\n assert result[\"none\"] is None\n\n def test_removes_none_values(self):\n \"\"\"Test that None values are removed\"\"\"\n d = {\n \"zero\": 0,\n \"false\": False,\n \"empty_string\": \"\",\n \"empty_list\": [],\n \"none\": None,\n }\n result = remove_none(d, remove_none=True)\n\n assert result[\"zero\"] == 0\n assert result[\"false\"] is False\n assert result[\"empty_string\"] == \"\"\n assert result[\"empty_list\"] == 0\n assert result[\"none\"] is None\n\n def test", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "custom_pid", + "got": "12345", + "got_raw": "12345\n\n def test_set_activity_with_activity_type(self):\n \"\"\"Test activity with custom activity type\"\"\"\n custom_activity_type = ActivityType.LISTENING\n payload = Payload.set_activity(activity_type=custom_activity_type)\n\n\n assert payload.data[\"args\"][\"activity\"][\"type\"] == 2\n\n def test_set_activity_with_status_display_type(self):\n \"\"\"Test activity with custom status display type\"\"\"\n custom_status_display_type = StatusDisplayType.STATE\n payload = Payload.set_activity(status_display_type=custom_status_display_type)\n\n\n assert payload.data[\"args\"][\"activity\"][\"status_display_type\"] == 1", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "\"My Activity\"", + "got": "\"My Activity\"", + "got_raw": " \"My Activity\"\n assert payload[\"args\"][\"activity\"][\"details\"] == \"Working on something\"\n assert payload[\"args\"][\"activity\"][\"state\"] == \"In Progress\"\n\n @patch(\"pypresence.baseclient.BaseClient.read_output\")\n def test_update_with_name_details_and_state_async(self, mock_read_output, client_id):\n \"\"\"Test update with name, details, and state together\"\"\"\n presence = AioPresence(client_id)\n presence.sock_writer = Mock()\n\n async def mock_coro():\n return {}\n\n mock_read_output.return_value = mock_coro()\n\n await presence.update(\n name=\"My", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "True", + "got": "True", + "got_raw": " True\n\n def test_set_activity_activity_type(self):\n \"\"\"Test activity type\"\"\"\n payload = Payload.set_activity(activity_type=ActivityType.PLAYING)\n assert payload.data[\"args\"][\"activity\"][\"type\"] == ActivityType.PLAYING.value\n\n payload = Payload.set_activity(activity_type=ActivityType.LISTENING)\n assert payload.data[\"args\"][\"activity\"][\"type\"] == ActivityType.LISTENING.value\n\n payload = Payload.set_activity(activity_type=ActivityType.WATCHING)\n assert payload.data[\"args\"][\"activity\"][\"type\"] == ActivityType.WATCHING.value\n\n payload = Payload.set_activity(activity", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "10", + "got": "15", + "got_raw": "15\n assert presence.handshake_timeout == 15\n assert presence.handshake_loop_timeout == 15\n\n def test_presence_init_isasync(self, client_id):\n \"\"\"Test Presence initialization with isasync=True\"\"\"\n presence = Presence(client_id, isasync=True)\n\n assert presence.isasync is True\n\n def test_presence_init_connection_timeout(self, client_id):\n \"\"\"Test Presence initialization with connection_timeout\"\"\"\n presence = Presence(client_id, connection_timeout=10)\n\n assert presence.connection_timeout == 10\n\n def test_presence_init_response_timeout(self, client_id):\n \"\"\"Test Presence initialization", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.5, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "4000", + "got": "4000", + "got_raw": "4000\n assert exc.message == \"Invalid Client ID\"\n\n def test_discord_not_found_exception(self):\n \"\"\"Test DiscordNotFound exception\"\"\"\n exc = DiscordNotFound()\n\n\n assert str(exc) == \"Could not find Discord installed and running on this machine.\"\n\n def test_invalid_pipe_exception(self):\n \"\"\"Test InvalidPipe exception\"\"\"\n exc = InvalidPipe()\n\n\n assert str(exc) == \"Pipe Not Found - Is Discord Running?\"\n\n def test_invalid_argument_exception(self):\n \"\"\"Test InvalidArgument exception\"\"\"\n exc = InvalidArgument(\"expected\", \"received\")\n\n\n assert str(exc) == \"Bad argument passed", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "mock_response", + "got": "204", + "got_raw": "204\n assert presence.sock_writer.write.call_count == 1\n assert presence.sock_writer.write.call_args[0][0] == b\"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "qwertyquerty/pypresence", + "expected": "client_id", + "got": "client_id", + "got_raw": " client_id\n assert client.pipe is None\n assert client.isasync is False\n assert client.connection_timeout == 30\n assert client.response_timeout == 10\n assert client.sock_reader is None\n assert client.sock_writer is None\n assert client.loop is None\n assert client.handler is None\n assert client._closed is False\n assert client._events is None\n\n def test_init_pipe(self, client_id):\n \"\"\"Test initialization with pipe\"\"\"\n client = BaseClient(client_id, pipe=0)\n\n\n assert client.client_id == client_id\n assert client.pipe ==", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ramnes/notion-sdk-py", + "expected": "{}", + "got": "200", + "got_raw": "200\n mock_send.assert_called_once_with(\n method=\"POST\",\n url=\"https://api.notion.com/oauth/revoke\",\n auth={\"client_id\": \"test_client_id\", \"client_secret\": \"test_client_secret\"},\n body={\"token\": \"test_token\"},\n )\n\n\ndef test_oauth_revoke_with_bearer_auth(client, mocker):\n \"\"\"Test OAuth revoke with Bearer auth - exercises auth encoding path\"\"\"\n mock_response = {}\n\n mock_send = mocker.patch.object(\n client.client,\n \"send\",\n return_value=mocker.Mock(\n json=lambda: mock_response, raise_for_status=lambda", + "exact_match": false, + "code_bleu": 0.25, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "ramnes/notion-sdk-py", + "expected": "503", + "got": "503", + "got_raw": "503\n assert error.message == \"Request to Notion API failed with status: 503\"\n assert error.code == ClientErrorCode.ResponseError\n assert error.additional_data is None\n assert error.request_id is None\n assert error.headers == httpx.Headers()\n assert error.raw_body_text == \"\"\n\ndef test_unknown_http_response_error_custom_message():\n \"\"\"Test UnknownHTTPResponseError generates custom message.\"\"\"\n error = UnknownHTTPResponseError(\n status=503,\n message=\"Custom message\",\n )\n\n\n assert error.status == 503\n assert error.message == \"Custom message", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ramnes/notion-sdk-py", + "expected": "3", + "got": "3", + "got_raw": "3\n assert response[\"number_of_parts\"][\"completed\"] == 0\n assert response[\"number_of_parts\"][\"failed\"] == 0\n\n assert response[\"status\"] == \"pending\"\n\n file_upload_id = response[\"id\"]\n\n # Wait for file upload to complete\n _wait_for_upload_completion(file_upload_id)\n\n # Upload to the specified Notion database\n database_id = os.getenv(\"NOTION_DATABASE_ID\", \"\")\n\n notion.pages.create(\n parent={\"database_id\": database_id},\n properties={\n \"Name\": {\"title\": [{\"text\": {\"content\": \"large_file.pdf\"}}]},\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ramnes/notion-sdk-py", + "expected": "custom_message", + "got": "custom_message", + "got_raw": " custom_message\n\n assert error.message == custom_message\n\n assert error.code == ClientErrorCode.ResponseError\n\n assert error.additional_data is None\n\n assert error.request_id is None\n\n assert error.headers == httpx.Headers()\n\n assert error.raw_body_text == \"\"\n\n assert is_notion_client_error(error)\n\n assert is_http_response_error(error)\n\n assert is_unknown_http_response_error(error)\n\n assert not is_api_response_error(error)\n\n assert not is_request_timeout_error(error)\n\n assert not is_invalid_path_parameter_error(error)\n\n assert not is_api_error_code(error.code)\n\n assert not is_notion_client_error(error)\n\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "ramnes/notion-sdk-py", + "expected": "HTTPResponseError)", + "got": "NotionClientError) as exc_info:", + "got_raw": "NotionClientError) as exc_info:\n client._parse_response(mock_response)\n\n assert isinstance(exc_info.value, HTTPResponseError)\n assert exc_info.value.code == APIErrorCode.InternalServerError\n assert exc_info.value.status == 500\n assert exc_info.value.message == \"Internal Server Error\"\n assert exc_info.value.headers == {}\n assert exc_info.value.raw_body_text == \"Internal Server Error\"\n assert exc_info.value.additional_data is None\n assert exc_info.value.request_id is None\n\n\ndef test_parse_response_with_http_error_in_error_response():\n \"\"\"Test that HTTP errors in error responses are handled", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.3673469387755102, + "n_retrieved": 10 + }, + { + "repo": "rcmdnk/homebrew-file", + "expected": "b", + "got": "assert a == b", + "got_raw": "<|fim_suffix|>\n assert a == b\n\ndef test_proc(helper: BrewHelper) -> None:\n proc = subprocess.Popen(\n ['printf', 'abc\\n def \\n\\nghi'],\n stdout=subprocess.PIPE,\n stderr=None,\n text=True,\n )\n results = ['abc', ' def', 'ghi']\n for a, b in zip(helper.readstdout(proc), results):\n\n assert a == b\n\ndef test_proc_exit_on_err(helper: BrewHelper) -> None:\n proc = subprocess.Popen(\n ['printf', 'abc\\n def \\n\\nghi'],\n stdout=subprocess.PIPE,\n stderr=None,\n ", + "exact_match": false, + "code_bleu": 0.2730120862709067, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "rcmdnk/homebrew-file", + "expected": "'", + "got": "brew_info.helper.info = {", + "got_raw": "<|fim_suffix|>\n brew_info.helper.info = {\n 'formulae': {'golang': {'desc': 'golang is a go compiler'}},\n 'casks': {},\n }\n\n assert brew_info.desc_comment('golang', 'formulae') == ' # golang is a go compiler'\n\ndef test_desc_no_desc(brew_info: BrewInfo) -> None:\n brew_info.helper.opt['describe'] = True\n brew_info.helper.info = {\n 'formulae': {'golang': {'desc': ''}},\n 'casks': {},\n }\n\n assert brew_info.desc_comment('golang', '", + "exact_match": false, + "code_bleu": 0.1561969968460128, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "rcmdnk/homebrew-file", + "expected": "file", + "got": "Path(f'{Path(__file__).parent}/files/BrewfileMain')", + "got_raw": " Path(f'{Path(__file__).parent}/files/BrewfileMain')\n assert ret.brew_list == ['git', 'git-lfs', 'git-extras']\n assert ret.brew_opt_list == {'git': 'git-lfs', 'git-lfs': 'git-extras'}\n assert ret.tap_list == ['homebrew/core']\n assert ret.cask_list == ['alfred']\n assert ret.appstore_list == ['com.microsoft.VSCode']\n assert ret.whalebrew_list == ['whalebrew']\n assert ret.vscode_list == ['vscode']\n assert ret.cursor_list == ['cursor']\n ", + "exact_match": false, + "code_bleu": 0.2295748846661433, + "edit_similarity": 0.14545454545454545, + "n_retrieved": 10 + }, + { + "repo": "rcmdnk/homebrew-file", + "expected": "lines", + "got": "lines", + "got_raw": " lines\n assert 'libffi' in lines\n assert 'zlib' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in lines\n assert 'libressl' in", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "rcmdnk/homebrew-file", + "expected": "''", + "got": "\"\"\"git file://test/repo", + "got_raw": " \"\"\"git file://test/repo\ngit file://test_repo\n\"\"\"\n\n # Test set_repo with github repository\n bf = BrewFile(\n opt={'input': str(file), 'repo': 'https://github.com/rcmdnk/homebrew-file', 'yn': True}\n )\n bf.set_brewfile_repo()\n with Path(file).open() as f:\n assert f.read() == f'git https://github.com/rcmdnk/homebrew-file'\n with Path(repo / 'Brewfile').open() as f:\n assert f.read() == \"\"\"git https://github.com/rcmd", + "exact_match": false, + "code_bleu": 0.10600313379512592, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "readthedocs/sphinx-autoapi", + "expected": "name", + "got": "name", + "got_raw": " name\n assert data[\"value\"] == value\n\n def test_parses_dict(self):\n name = \"__all__\"\n value = \"{'a': 1, 'b': 2}\"\n source = f\"{name} = {value}\"\n data = self.parse(source)[0]\n\n assert data[\"name\"] == name\n assert data[\"value\"] == value\n\n def test_parses_tuple(self):\n name = \"__all__\"\n value = \"(1, 2, 3, 4)\"\n source = f\"{name} = {value}\"\n data = self.parse(source", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "readthedocs/sphinx-autoapi", + "expected": "\"Example module\"", + "got": "\"This is a submodule.\"", + "got_raw": " \"This is a submodule.\"\n\n\n# File: autoapi/_objects.py\n[-1]\n\n def output_dir(self, root):\n \"\"\"The directory to render this object.\"\"\"\n module = self.id[: -(len(\".\" + self.qual_name))]\n parts = [root] + module.split(\".\")\n return pathlib.PurePosixPath(*parts)\n\n def output_filename(self) -> str:\n \"\"\"The name of the file to render into, without a file suffix.\"\"\"\n filename = self.qual_name\n if filename == \"index\":\n filename = \".index\"\n\n return filename\n\n @property\n def include_path", + "exact_match": false, + "code_bleu": 0.5, + "edit_similarity": 0.47368421052631576, + "n_retrieved": 10 + }, + { + "repo": "readthedocs/sphinx-autoapi", + "expected": "\"foo\"", + "got": "\"foo\"", + "got_raw": " \"foo\"\n assert data[\"qual_name\"] == \"foo\"\n assert data[\"full_name\"] == \"foo\"\n assert data[\"doc\"] == \"\"\n assert data[\"from_line_no\"] == 1\n assert data[\"to_line_no\"] == 1\n assert data[\"children\"] == []\n\n def test_parses_basic_function(self):\n source = \"\"\"\n def foo(bar):\n pass\n \"\"\"\n data = self.parse(source)[0]\n\n assert data[\"name\"] == \"foo\"\n assert data[\"qual_name\"] == \"foo\"\n assert data[\"full_name\"] == \"", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "readthedocs/sphinx-autoapi", + "expected": "text", + "got": "text", + "got_raw": " text\n else:\n assert test_string in text\n\n def test_autoapi(self):\n self._run_test(\n \"autoapi\",\n \"autoapi.py\",\n \"autoapi\",\n confoverrides={\"autoapi_type\": \"python\"},\n )\n\n def test_autoapi_python(self):\n self._run_test(\n \"autoapi\",\n \"autoapi.py\",\n \"autoapi\",\n confoverrides={\"autoapi_type\": \"python\"},\n )\n\n def test_autoapi_python_class_content(self):\n self._run_test(\n \"autoapi\",\n \"autoapi.py\",\n", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"tab1\"})", + "got": "1, dialect=dialect)", + "got_raw": "1, dialect=dialect)\n\n\ndef test_select_with_table_name_in_backtick_with_schema():\n assert_table_lineage_equal(\n \"SELECT * FROM `db1.tab1`\", 1, dialect=\"hive\", default_schema=\"db1\"\n )\n\n\ndef test_select_with_table_name_in_backtick_with_schema_and_table_name():\n assert_table_lineage_equal(\n \"SELECT * FROM `db1.tab1`\", 1, dialect=\"hive\", default_schema=\"db1\"\n )\n\n\ndef test_select_with_table_name_in_backtick_with_schema_and_table_name_and_alias():\n assert_table_lineage_equal(\n \"SELECT", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.14285714285714285, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "\"DESC FUNCTION abs\")", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/parser/sqlparse/handlers/cte.py\nfrom sqlparse.sql import Comparison, Function, Identifier, Token\nfrom sqlparse.tokens import Literal, Number\n\nfrom sqllineage.core.holders import SubQueryLineageHolder\nfrom sqllineage.core.models import Path\nfrom sqllineage.core.parser.sqlparse.handlers.base import NextTokenBaseHandler\nfrom sqllineage.core.parser.sqlparse.models import SqlParseTable\nfrom sqllineage.exceptions import SQLLineageException\n\n\nclass CTEHandler(NextTokenBaseHandler):\n \"\"\"CTE Handler.\"\"\"\n\n ", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "SqlFluffColumn._extract_source_columns(segment_mock)", + "got": "find_from_expression_element(segment_mock, \"a\", \"b\")", + "got_raw": " find_from_expression_element(segment_mock, \"a\", \"b\")\n\n\ndef test_column_extract_source_columns_with_alias():\n segment_mock = Mock()\n segment_mock.type = \"\"\n segment_mock.get_child = Mock(return_value=Mock(raw=\"a AS b\"))\n\n assert [\"b\"] == find_from_expression_element(segment_mock, \"a\", \"b\")\n\n\ndef test_column_extract_source_columns_with_alias_and_table():\n segment_mock = Mock()\n segment_mock.type = \"\"\n segment_mock.get_child = Mock(return_value=Mock(raw=\"a AS b\"))\n\n assert [\"b\"] == find_from_expression_element(segment_mock, \"a\", \"b", + "exact_match": false, + "code_bleu": 0.22679164443904004, + "edit_similarity": 0.4230769230769231, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"host\"})", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/parser/sqlparse/handlers/cte.py\nfrom sqlparse.sql import Function, Identifier, Token\n\nfrom sqllineage.core.holders import SubQueryLineageHolder\nfrom sqllineage.core.parser.sqlparse.handlers.base import NextTokenBaseHandler\nfrom sqllineage.core.parser.sqlparse.models import SqlParseSubQuery\n\n\nclass CTEHandler(NextTokenBaseHandler):\n \"\"\"Common Table Expression (With Queries) Handler.\"\"\"\n\n CTE_TOKENS = (\"WITH\",)\n\n def _indicate(self, token: Token) -> bool:\n return token.normalized", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"tab1\"})", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/holders.py\n def __retrieve_tag_tables(self, tag: str) -> set[Table]:\n vertices: list[Table] = self.go.retrieve_vertices_by_props(**{tag: True})\n return {t for t in vertices}\n\n def __retrieve_tag_edges(self, tag: str) -> set[Edge]:\n edges: list[Edge] = self.go.retrieve_edges_by_props(**{tag: True})\n return {e for e in edges}\n\n def __retrieve_tag_vertices(self, tag: str) -> set[Vertex]:\n vertices: list[Vertex", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "[ ( ColumnQualifierTuple(\"col1\", \"dataset.tab1\"), ColumnQualifierTuple(\"col1\", \"dataset.target\"), ), ( ColumnQualifierTuple(\"col1\", \"dataset.tab2\"), ColumnQualifierTuple(\"col1\", \"dataset.target\"), ), ])", + "got": "assert_column_lineage_equal(", + "got_raw": "<|fim_suffix|>\n assert_column_lineage_equal(\n sql,\n [\n (\"dataset.tab1\", \"col1\"),\n (\"dataset.tab2\", \"col1\"),\n (\"dataset.target\", \"col1\"),\n ],\n )\n\n\ndef test_union_inside_cte_with_alias():\n sql = \"\"\"INSERT INTO dataset.target WITH temp_cte AS (SELECT col1 AS col1_alias FROM dataset.tab1 UNION ALL\nSELECT col1 AS col1_alias FROM dataset.tab2) SELECT col1_alias FROM temp_cte\"\"\"\n\n assert_column_lineage_equal(\n sql,\n [\n (\"dataset.tab1\", \"col1\"),\n ", + "exact_match": false, + "code_bleu": 0.02904243058982546, + "edit_similarity": 0.017391304347826087, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"Production.ScrapReason\"})", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/models.py\nfrom typing import List, Optional, Set, Tuple, Union\n\nfrom sqlparse.sql import Identifier, Token\n\nfrom sqllineage.core.constants import (\n COLUMN_ALIAS_REFERENCE,\n LATERAL_COLUMN_ALIAS_REFERENCE,\n LATERAL_COLUMN_REFERENCE,\n LATERAL_TABLE_REFERENCE,\n LATERAL_TABLE_REFERENCE_WITH_ALIAS,\n LATERAL_TABLE_REFERENCE_WITHOUT_ALIAS,\n LATERAL_TABLE_REFERENCE_WITHOUT_ALIAS_AND_ALIAS,\n LATERAL_TABLE_REFERENCE_WITHOUT_ALIAS_AND_ALIAS_AND_ALIAS,\n LATERAL_TABLE_REFERENCE_WITHOUT_ALIAS_AND_ALIAS_AND_ALIAS", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "[ ( ColumnQualifierTuple(\"col1\", \"tab2\"), ColumnQualifierTuple( \"CASE WHEN col1 = 1 THEN 'V1' WHEN col1 = 2 THEN 'V2' END\", \"tab1\" ), ), ])", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/parser/sqlparse/handlers/base.py\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nfrom sqlparse import tokens as T\nfrom sqlparse.sql import Comparison, Function, Identifier, Token\nfrom sqlparse.tokens import Keyword, Name, Punctuation, Whitespace\n\nfrom sqllineage.core.holders import SubQueryLineageHolder\nfrom sqllineage.core.models import Path, SubQuery, Table\nfrom sqllineage.core.parser import (\n ColumnQualifierTuple,\n EdgeTuple,\n SubQueryTuple,\n AnalyzerContext,\n)\nfrom", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "[ ( ColumnQualifierTuple(\"col1\", \"tab2\"), ColumnQualifierTuple(\"col1\", \"tab1\"), ), ( ColumnQualifierTuple(\"col2\", \"tab2\"), ColumnQualifierTuple(\"col1\", \"tab1\"), ), ( ColumnQualifierTuple(\"col3\", \"tab2\"), ColumnQualifierTuple(\"col1\", \"tab1\"), ), ])", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/parser/sqlparse/handlers/target.py\nfrom sqlparse.sql import Comparison, Function, Identifier, Token\nfrom sqlparse.tokens import Literal, Number\n\nfrom sqllineage.core.holders import SubQueryLineageHolder\nfrom sqllineage.core.models import Path\nfrom sqllineage.core.parser.sqlparse.handlers.base import NextTokenBaseHandler\nfrom sqllineage.core.parser.sqlparse.models import SqlParseTable\nfrom sqllineage.exceptions import SQLLineageException\n\n\nclass TargetHandler(NextTokenBaseHandler):\n \"\"\"Target Table Handler.\"\"\"\n\n TARGET_TABLE_TOKEN", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "[ ( ColumnQualifierTuple(\"*\", \"tab2\"), ColumnQualifierTuple(\"*\", \"tab3\"), ), ])", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/parser/sqlparse/handlers/target.py\nfrom sqlparse.sql import Comparison, Function, Identifier, Token\nfrom sqlparse.tokens import Literal, Number\n\nfrom sqllineage.core.holders import SubQueryLineageHolder\nfrom sqllineage.core.models import Path\nfrom sqllineage.core.parser.sqlparse.handlers.base import NextTokenBaseHandler\nfrom sqllineage.core.parser.sqlparse.models import SqlParseTable\nfrom sqllineage.exceptions import SQLLineageException\n\n\nclass TargetHandler(NextTokenBaseHandler):\n \"\"\"Target Table Handler.\"\"\"\n\n TARGET_TABLE_TOKEN", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"tgt\"})", + "got": "1, dialect=dialect)", + "got_raw": "1, dialect=dialect)\n\n\n@pytest.mark.parametrize(\"dialect\", [\"tsql\"])\ndef test_tsql_declare_with_alias(dialect: str):\n \"\"\"\n https://learn.microsoft.com/en-us/sql/t-sql/language-elements/declare-local-variable-transact-sql?view=sql-server-ver16\n \"\"\"\n sql = \"\"\"DECLARE @age int = 10;\nINSERT INTO tgt\nSELECT Name,@age AS age\nFROM People;\"\"\"\n\n assert_table_lineage_equal(sql, {\"People\"}, 1, dialect=dialect)\n\n\n@pytest.mark.parametrize(\"dialect\", [\"tsql\"])\ndef test_tsql_declare", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.2222222222222222, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"films_all\"})", + "got": "", + "got_raw": " # type: ignore\n sql,\n dialect=dialect,\n expected_lineage={\n \"films\": {\n \"films_all\": {\n \"source\": {\"films\": {\"read\": []}},\n \"target\": {\"films_all\": {\"write\": []}},\n }\n }\n },\n )\n\n\n@pytest.mark.parametrize(\"dialect\", [\"postgres\", \"tsql\"])\ndef test_select_into_with_union_all(dialect: str):\n sql = \"SELECT * INTO films_all FROM films UNION ALL SELECT * FROM films_backup\"\n\n assert_table_lineage_equal( # type: ignore\n sql,\n dialect=dialect", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "[ ( ColumnQualifierTuple(\"col1\", \"tab2\"), ColumnQualifierTuple(\"col2\", \"tab1\"), ), ( ColumnQualifierTuple(\"col1\", \"tab2\"), ColumnQualifierTuple(\"col3\", \"tab1\"), ), ])", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/models.py\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nfrom sqllineage.core.models import Column, Path, SubQuery, Table\nfrom sqllineage.exceptions import SQLLineageException\n\n\nclass AnalyzerContext(NamedTuple):\n # CTE queries that can be select from in current query context\n cte: set[SubQuery] | None = None\n # table that current top-level query is writing to, subquery in case of subquery context\n write: set[SubQuery | Table] | None = None\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"tab1\"})", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/holders.py\n def __init__(self, go: GraphOperator):\n \"\"\"\n The combined lineage result in representation of Directed Acyclic Graph.\n\n :param go: the Graph Operator holding all the combined lineage result.\n \"\"\"\n self.go = go\n self._selfloop_tables = self.__retrieve_tag_tables(NodeTag.SELFLOOP)\n self._sourceonly_tables = self.__retrieve_tag_tables(NodeTag.SOURCE_ONLY)\n self._targetonly_tables = self.__retrieve_tag_tables(NodeTag.TARGET_ONLY)\n\n @property\n def table_lineage_graph", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"dbname.dto.tablename\"})", + "got": "1, dialect=dialect)", + "got_raw": "1, dialect=dialect)\n\n\n@pytest.mark.parametrize(\"dialect\", [\"tsql\"])\ndef test_tsql_table_hints_with_alias(dialect: str):\n \"\"\"\n https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-ver16\n \"\"\"\n sql = \"select * from dbname.dto.tablename(NOLOCK) as t\"\n\n assert_table_lineage_equal(sql, 1, dialect=dialect)\n\n\n@pytest.mark.parametrize(\"dialect\", [\"tsql\"])\ndef test_tsql_table_hints_with_alias_and_column_alias(dialect: str):\n \"\"\"\n ", + "exact_match": false, + "code_bleu": 0.22089591134157885, + "edit_similarity": 0.3181818181818182, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "Schema(\"a\")", + "got": "Schema(\"a\")", + "got_raw": " Schema(\"a\")\n assert Schema(\"a\") != Schema(\"b\")\n assert Schema(\"a\") != \"a\"\n assert Schema(\"a\") != 1\n assert Schema(\"a\") != 1.0\n assert Schema(\"a\") != True\n assert Schema(\"a\") != False\n assert Schema(\"a\") != None\n assert Schema(\"a\") != []\n assert Schema(\"a\") != {}\n assert Schema(\"a\") != ()\n assert Schema(\"a\") != set()\n assert Schema(\"a\") != frozenset()\n assert Schema(\"a\") != object()\n ", + "exact_match": true, + "code_bleu": 1.0, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{\"tab_1\"})", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/parser/sqlparse/handlers/insert.py\nfrom sqlparse.sql import Comparison, Function, Identifier, Token\nfrom sqlparse.tokens import Literal, Number\n\nfrom sqllineage.core.holders import SubQueryLineageHolder\nfrom sqllineage.core.models import Path\nfrom sqllineage.core.parser.sqlparse.handlers.base import NextTokenBaseHandler\nfrom sqllineage.core.parser.sqlparse.models import SqlParseTable\nfrom sqllineage.exceptions import SQLLineageException\n\n\nclass InsertHandler(NextTokenBaseHandler):\n \"\"\"Insert Handler.\"\"\"\n\n INSERT_TOKENS", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "\"show create table tab1\")", + "got": "", + "got_raw": "\n\n\n# File: sqllineage/core/parser/sqlparse/handlers/target.py\nfrom sqlparse.sql import Comparison, Function, Identifier, Token\nfrom sqlparse.tokens import Literal, Number\n\nfrom sqllineage.core.holders import SubQueryLineageHolder\nfrom sqllineage.core.models import Path\nfrom sqllineage.core.parser.sqlparse.handlers.base import NextTokenBaseHandler\nfrom sqllineage.core.parser.sqlparse.models import SqlParseTable\nfrom sqllineage.exceptions import SQLLineageException\n\n\nclass TargetHandler(NextTokenBaseHandler):\n \"\"\"Target Table Handler.\"\"\"\n\n TARGET_TABLE_TOKEN", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "{Path(\"examples/src/main/resources/\")})", + "got": "", + "got_raw": "\n\n\n# File: docs/first_steps/first_steps.rst\n***************\nFirst Steps\n***********\n\n.. toctree::\n :maxdepth: 2\n\n first_steps/quick_start.rst\n first_steps/advanced_usage.rst\n first_steps/beyond_command_line.rst\n first_steps/behind_the_scene.rst\n first_steps/configuration.rst\n first_steps/metadata.rst\n first_steps/lineage_visualization.rst\n first_steps/lineage_lineage.rst\n first_steps/lineage_lineage_lineage.rst\n first_steps/line", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "reata/sqllineage", + "expected": "NetworkXGraphOperator", + "got": "NetworkXGraphOperator", + "got_raw": " NetworkXGraphOperator\n\ndef test_graph_operator_import_rustworkx():\n\n SQLLineageConfig.GRAPH_OPERATOR_CLASS = \"sqllineage.core.graph.rustworkx.RustworkXGraphOperator\"\n\n assert get_graph_operator_class() == RustworkXGraphOperator\n\n\n\n# File: sqllineage/core/parser/sqlfluff/analyzer.py\nfrom functools import reduce\nfrom operator import add\n\nimport sqlfluff\nfrom sqlfluff.core.parser import (\n AnyOf,\n AnyOfWithWhitespace,\n AnyOfWithWhitespaceAndComment,\n AnyOfWithWhitespaceAndCommentAndNewline,\n ", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "redimp/otterwiki", + "expected": "rv.status_code", + "got": "200 == rv.status_code", + "got_raw": "200 == rv.status_code\n assert \"You logged in successfully.\" == rv.data.decode(\"utf-8\")\n\n rv = test_client.get(\"/-/settings\")\n assert 200 == rv.status_code\n assert \"Settings\" == rv.data.decode(\"utf-8\")\n\n rv = test_client.post(\n \"/-/settings\",\n data={\n \"name\": \"New Name\",\n },\n follow_redirects=True,\n )\n\n assert 200 == rv.status_code\n assert \"You logged in successfully.\" == rv.data.decode(\"utf-8\")\n\n rv = test_client.get(\"/", + "exact_match": false, + "code_bleu": 0.4111336169005197, + "edit_similarity": 0.8, + "n_retrieved": 10 + }, + { + "repo": "redimp/otterwiki", + "expected": "302", + "got": "302", + "got_raw": "302\n assert rv.location == \"http://localhost/login\"\n\n def test_housekeeping_requires_admin(self, app_with_user, test_client):\n \"\"\"Test that housekeeping requires admin.\"\"\"\n rv = test_client.get(\"/-/housekeeping\", follow_redirects=False)\n # Should redirect to login\n\n assert rv.status_code == 302\n assert rv.location == \"http://localhost/login\"\n\n def test_housekeeping(self, app_with_user, test_client):\n \"\"\"Test that housekeeping works.\"\"\"\n # Create a page\n rv = test_client.post(\n \"/-/create\",\n data=dict", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "redimp/otterwiki", + "expected": "\"link\"", + "got": "\"link\"", + "got_raw": " \"link\"\n assert menu_data[\"items\"][0][\"text\"] == \"Home\"\n assert menu_data[\"items\"][0][\"href\"] == \"Home\"\n assert menu_data[\"items\"][0][\"html\"] == 'Home Page'\n\n assert menu_data[\"links\"] == [(\"Home\", \"Home\")]\n\ndef test_sidebar_custom_menu_with_links(create_app, test_client, req_ctx):\n from otterwiki.sidebar import SidebarMenu\n\n create_app.config[\"SIDEBAR_CUSTOM_MENU\"] = (\n \"\"\"[{\"link\": \"Home\",", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "redimp/otterwiki", + "expected": "diff", + "got": "diff", + "got_raw": " diff\n assert \"+bbb\" in diff\n # revert\n storage.revert(rev_b, author=author)\n # check content\n assert storage.load(filename) == content1\n # get log\n log = storage.log()\n # get revisions\n rev_b, rev_a = log[0][\"revision\"], log[1][\"revision\"]\n # get diff\n diff = storage.diff(rev_a, rev_b)\n # check -/+ strings\n assert \"-aaa\" in diff\n assert \"+bbb\" in diff\n # revert\n storage.revert(rev_a,", + "exact_match": true, + "code_bleu": 0.5946035575013605, + "edit_similarity": 1.0, + "n_retrieved": 10 + }, + { + "repo": "redimp/otterwiki", + "expected": "\"/home\"", + "got": "", + "got_raw": " # pyright: ignore never unbound\n \"/home.md\"\n\n name, path = auto_url(\"Home.md\")\n assert name == \"Home\"\n\n assert path == # pyright: ignore never unbound\n \"/Home.md\"\n\n name, path = auto_url(\"Home.md\", _external=True)\n assert name == \"Home\"\n\n assert path == # pyright: ignore never unbound\n \"/Home.md\"\n\n name, path = auto_url(\"home.md\", _external=True)\n assert name == \"home\"\n\n assert path == # pyright: ignore never unbound\n", + "exact_match": false, + "code_bleu": 0.0, + "edit_similarity": 0.0, + "n_retrieved": 10 + }, + { + "repo": "redimp/otterwiki", + "expected": "data['preview_content']", + "got": "data[\"htmlcontent\"]", + "got_raw": " data[\"htmlcontent\"]\n assert data[\"htmlcontent\"].count(\"

\") == 1\n assert data[\"htmlcontent\"].count(\"

\") == 1\n assert data[\"htmlcontent\"].count(\"

\") == 1\n assert data[\"htmlcontent\"].count(\"

\") == 1\n assert data[\"htmlcontent\"].count(\"

\") == 1\n assert data[\"htmlcontent\"].count(\"

\") == 1\n assert data[\"htmlcontent\"].count(\"
\") == 1\n assert data[\"htmlcontent\"].count(\"