diff --git "a/iterative__dvc-3677/docstore.json" "b/iterative__dvc-3677/docstore.json" new file mode 100644--- /dev/null +++ "b/iterative__dvc-3677/docstore.json" @@ -0,0 +1 @@ +{"docstore/metadata": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__main__.py__": {"doc_hash": "e31af0c8ed8cf737b18f8007d97c06eb7c8de8e12f98e39126e6b74e7a897913"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_get_parent_parser_get_parent_parser.return.parent_parser": {"doc_hash": "a3a93b40a457640a9ca17338ff20b2e554d08d5b4148db39e0ee061959ba649e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_parse_args_": {"doc_hash": "5ab8460a4185365e9d5c111557f1ed4132ac123c4cd6f618894d7db206d08f97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_CmdBase_": {"doc_hash": "6635eb816520d7040d02ef38f7c2e0ceeb9c4c7650426d7195d0e18ecb59fd42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_add_parser_": {"doc_hash": "a5169de767fd68494cefc5db38f9c21100e278772ae8ac560b337d0b26d9af22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_add_parser_": {"doc_hash": "95e65493dd2c90f4e32857ccc129c872483d0605dc16f2ffd82621a425d065ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_shared_parent_parser_shared_parent_parser.return.shared_parent_parser": {"doc_hash": "e9651f3e90dde7af52479878d2fa954acb7f1d316b86ecbfca1f66017aecdc65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_add_parser_": {"doc_hash": "2ce107d7fe9bb3dc44061eb3c99584b7e34936f0b6956dd32d6c3474512d75c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_add_parser_": {"doc_hash": "29917674e12570e8a290d20565a4667992f23848c4c6cc29d88473e232e0f771"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_add_parser_": {"doc_hash": "13517f4387d9e88582c4177f1f44105f4f1f868640275195496360848e777795"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_add_parser_": {"doc_hash": "0fb442aff36b0dc670a43939ff3ad1e33cd70f8f25ed8525719cf9cc0550b498"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_add_parser_": {"doc_hash": "381ed3f8bb4864325666f293c8a7387d9041b112d6bb0136b92bf55ec362d752"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_": {"doc_hash": "158f3f50c227c7e6a164e8cdd9e6fc41b2ff32331635160a7b83a6e5184c612e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_add_parser_": {"doc_hash": "30eed8165b687c1645140effe1038c394fc40e671a454efd0876336181c363f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_add_parser_": {"doc_hash": "701fb0b9dafc3329bf5ef0810570b707e4a2ebe8036a93461f51de8abefbf3b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_CmdRun._parsed_cmd_CmdRun._quote_argument.return._format_argument_": {"doc_hash": "05708adf070cc30ec8cf0d4c2190f31674cdf1429e14948691007a4d89b2b61b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser_": {"doc_hash": "95d70517dd63401d69ba3c7a1116ae70017743fe1b1738eef9c288002c14b1a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__Launch_dvc_daemon_co__spawn_windows.Popen_": {"doc_hash": "aeb3b7083ea9c6cfc78c30bf8f0a6bd95befc9d4d094e4a5d077f8c0b97c0ab2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_posix__spawn_posix._pylint_disable_protect": {"doc_hash": "f16630b99bcc29ba2b58caf22e73b901b343e43cac8ddbc7ef05a05f35fed9b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.point_AsciiCanvas.point.self_canvas_y_x_char": {"doc_hash": "69c563ebb4f803aeee7aa09beaab0b111a7c29979a696db61974273bc198e2bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.line_AsciiCanvas.line.if_dx_0_and_dy_0_.else_.for_y_in_range_y1_y0_1.self_point_x_y_char_": {"doc_hash": "77c41215300af920c49aaa6d3a8c5c309bca08a485791f9391b5028e1513b453"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.text_AsciiCanvas.box.None_3": {"doc_hash": "60b384e2767490c98d73588238e46c94183b0899823d6396b0b1146883563241"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__build_sugiyama_layout__build_sugiyama_layout.return.sug": {"doc_hash": "c89a02de60b926bb0adf1d56a9dc24314581afef5a220d200c52ed4f3ac39d43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_draw_": {"doc_hash": "78f77c70b8ef631075bab17ab9722bba2e530b69009a7558fd4065460fc6edef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/gs.py__": {"doc_hash": "9401a3bb74b54e8411449976c2f3adcee215bf178f996c1c6ada35b6b294caf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/hdfs.py__": {"doc_hash": "a750aaea4e138b1243a692a2206fa6d464dbf917c8e60c075dd8d925c7174575"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/local.py__": {"doc_hash": "0db8fec8693cc73c0765e9b36d0ffb7dcc866c613b6cb5c0dc63c7a560861051"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/s3.py__": {"doc_hash": "d31de58571d655dd968686a8fe7e5ea4409e66309474abbddccdc6c709956699"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/ssh.py__": {"doc_hash": "7388b1ec7f0996c5762005220fd4bbf4b8599e1b41c367c832cef60ab30d03aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loadd_from_": {"doc_hash": "75168802649637cc768df1e1e35032877cd543a4e7118b926c857b2703e8ff83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/gs.py__": {"doc_hash": "1221c34a05544b58ded170f5f1cd3d772b6710d3a0be0a138ef85d5670ffa430"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/prompt.py__Manages_user_prompts__": {"doc_hash": "fde2984f2e6310439ebf38c3bbb768880d1ea5f5da5e1ccc08458bb596f7ea1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.hadoop_fs_RemoteHDFS.hadoop_fs.return.out_decode_utf_8_": {"doc_hash": "f8bfc70675c17c587c2b3eb85962f3fbc8a9d8935ab2983fdc1e3039c9e96871"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.execute_SSHConnection.execute.return.b_join_stdout_chunks_d": {"doc_hash": "8c22cd64f04337cfdcdd7c7c1d8b64e0230f3b4f58d84c55dcdb182fc1060e4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.used_cache_Repo.used_cache.return.cache": {"doc_hash": "9f14c8ba521a518902740bcff6bbd054ba47158ad59d976b1bd7a1ef4f3eeb55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py__": {"doc_hash": "a75136cfb3a1223351a0df3ec851409c4fb12410563092fd4a7b67f99caa6613"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/destroy.py__": {"doc_hash": "76120f36b0445ec694284b8341db5fafe9220daf9231aaaf3e819987d1199a21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_gc_": {"doc_hash": "2356eb140d133d9c2d326972364d20b3b4f2d3d36c50f6fdc14c5da1c5bf1acf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_init_": {"doc_hash": "78cf881cb6bf8dae5aed828d9dbaa9cf8f335d445f6fe34665e9c276b231adbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/install.py__": {"doc_hash": "20806fd88a001bc9d41d62364614b77f8c6973a2473658fc9d0a7af78600c52e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/lock.py__": {"doc_hash": "72216f1e7bee1fe91b76ad2734a0cedf3b470c6566775e54bb9817da256ba1a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/__init__.py_Metrics_": {"doc_hash": "bafaac3accd59eca8f15e614c0ae030b5277e119c95b3b65fca8485a24cbad56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/add.py__": {"doc_hash": "6c340df87b711acd124e1ee0a7df964f8a629a2a21a76de4f369bdaa3fb43727"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/remove.py__": {"doc_hash": "2916b49dc071cb1c7df1a14213d572557779bb8643d1d4bf097d76709b6986ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/move.py_os_": {"doc_hash": "1a97e6f71800ae40f0af335a2cf3f843b03ba2f2cefce1eac68cc505b0667273"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/remove.py__": {"doc_hash": "35c7b66d376efdccf0b3ea223ff3879a6592fdb761936244b9525f5f3efd12d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__reproduce_stages_": {"doc_hash": "7200168cd1950fd8d49fe22c9e3f0afe487e0cdd7587aa1c617956e405d48575"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py__cloud_status__cloud_status.return.ret": {"doc_hash": "b2f791f04ecfd3102887f4e0ecc08c9638d873f143db798ce325ee56874927b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_status_": {"doc_hash": "469f458cfa4baebd3e9928e9938e2174305576818f6ec76ae75e404a3bc8d4c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/__init__.py__Manages_source_control_": {"doc_hash": "455ec4065ec09981702c4e00b56308e43647ada6e527b1b401f2909be884e884"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._prepare_db_State._prepare_db.None_4": {"doc_hash": "548ae1faad488ba3caa54c426e3f5c223f4aa18e87067ba703732b6c5335aa09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.load_State._vacuum.self.database.isolation_level_1._": {"doc_hash": "28071dab8b06a7c5cabab69f0f92b4e64f35101711b77e2505dfb06f36faae34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.dump_State.dump.self.inserts.0": {"doc_hash": "514dba861ea926e3ecef7d98faa4d4d5d4fbeb15c2cbd1c038946454ba0119b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_darwin_System._reflink_darwin.return.clonefile_": {"doc_hash": "69c002114c23f58f7fdab629910f90afaf241edafc62015d8aa286db4f5eaa42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret": {"doc_hash": "dd7fc757a506f747dde6a05d600956be5cc6418a01275367800c71883db2db3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli": {"doc_hash": "ae40e69eb1c52c02e2b49c8f54c3ffc0ddd058f0c2de5dc59811b2ff46812912"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.inode_System.inode.return.inode": {"doc_hash": "fdf43391e4beea1c303b93290a9195d743d0db57cf005103bd2e04f44afcf1c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._check_Updater._check.if_self__is_outdated_.self__notify_": {"doc_hash": "a1a9e380127f8dec539bb50bd14bcd0145116311724b12333a52451801960bc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.cloud.storage.py__": {"doc_hash": "256bfd168f99306f3d2eaaced6aa70d2d9b94fb8982b895ad1c77ce72200cf54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google_compute_engine.logger.py__": {"doc_hash": "da126273167e3367df6b4152ac179e4638b8dacd8c4935b9540a059fdb34a4d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__": {"doc_hash": "85c3c59e6b53d4a4751f24d6bb11f5f9d8c7b3396aa6bb06d03a2c7d1d96b184"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py_os_": {"doc_hash": "8127c35cf8fbb938c7c24d3fd3ba71e46c21daaa0798e9e23ed4b3b1dd67f862"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_StaticFileServer_": {"doc_hash": "4df95183178409d2d886ea34f6841beb07c3313191ead3d066b8e990b4487a82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__Helpers_for_other_modu_dos2unix.return.data_replace_b_r_n_b_": {"doc_hash": "f5e0eccdced113996ad6483f54a1a17d02757e030a5255e496487cf4fa3a6839"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_add_parser_": {"doc_hash": "a2b3d5c1161d5f2f91cd17f31f01ca8ac7bd64d998147a8eefdcc5960cf79fdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_add_parser_": {"doc_hash": "6567d6b4a2e624e37286178fc7495be46f80a470ace6a047a06f0021c8f49350"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._show_ascii_CmdPipelineShow._show_dependencies_tree.tree_show_": {"doc_hash": "1fe6d4b6bdc3eac33b8a8fde848df43ddb88c6ed7b773b8aacc2582b7771e6bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_add_parser_": {"doc_hash": "456548595c847509430dc4b2bc662510911249326285e9cf9acc80cc305f7c3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.OutputLOCAL_": {"doc_hash": "dbbb8c036fa09bc2775d22cfc82c132296aaa76ae9acdd56764d12fcf7624404"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_show_": {"doc_hash": "34103baffc16cab9daf74b94214f3dda6ae3be4b91bc21e41e8ce05bf14587a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/scm_context.py__": {"doc_hash": "b0cd46fc2d241be4e2eec1ed1422da99821bbe188c89e3eec97c6525c54e28c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/__init__.py_Tag_": {"doc_hash": "ba74dad76851f143f3201d93fbbc2485a596c32a51026c06a351642c03d22133"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/list.py__": {"doc_hash": "0dfbadb2ffa2a6014e977752b114b92242f07686b576d9a269c0a6b1bc99ae0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py_Base_": {"doc_hash": "c2b98ee53beb506c09881bf52f6ee362f1c57dd48c9421bacd7291b5673fe610"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_os_BaseTree.walk._Directory_tree_generat": {"doc_hash": "c5ece638f06d86e8b80761071cde6f7d11798c8a30cc01fdaef48cae033a97f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree_WorkingTree.isfile.return.os_path_isfile_path_": {"doc_hash": "ecbeec27b4eaba7ba0a406f2be61612331b4f62233e6529af4319ffb79532cbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree.walk_": {"doc_hash": "9e03ed8bef0179f4a8be68c6f3cbaf7a7fe10d1499cd98c28911e721cf0c891b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_gs.py__": {"doc_hash": "9f35cf5d9bd0cfe4395f8496e7d78908cdd2e04ea4eb244623cd3ecf33498815"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_hdfs.py__": {"doc_hash": "75cb652af8dbc61cdc4253334d3015893066b86092122b0485816037ba724f85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_http.py__": {"doc_hash": "d07fc8d2a9cbda313f49f3eac2f5be21555cb44a77b71beced19533ad806881d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_local.py_mock_": {"doc_hash": "870c674832e7b9a724053a8c41acf948e625b22ee0184287e57dab3bf012edbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_s3.py__": {"doc_hash": "1a1950314dc37fb5b3d3145e6ea671ae9100e4fc8a585e8f0ec8bbec1c2a7d1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_ssh.py__": {"doc_hash": "f071d6327edd6dc6967ae6683587b7d8b248cf72db24bbedcae943b2902de31f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_gs.py__": {"doc_hash": "919977e87887918fdff8016b6cd9d870e526fd8c9b9d5556aef47f31686368e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_hdfs.py__": {"doc_hash": "a82b110d0709468bba6d9ad07a608887e586597db8e76b08454f59a1784cd292"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_TestGetFilesNumber_": {"doc_hash": "dbd711694f4ab8ffabbe3b1c2b232113c904222115b5114b0ed741189b746440"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_s3.py__": {"doc_hash": "20b085d59016d7e434d8c25695229c68c6419feb7edb49f93254724f2da370c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_ssh.py__": {"doc_hash": "e3fd4b9968087bfb74f50cca1e07b32eb77de56ebdc46cbf5e91b2d3b3768ee8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_prompt.py__": {"doc_hash": "338bba00daa820a77f923d966146491ba9529c6e91f518434ad5dc942ff39a0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink_TestContainsLink.test_should_return_false_on_no_more_dirs_below_path.dirname_patch_assert_call": {"doc_hash": "e9fe11633bc2bcc6c24c3af8a1543381e6541560afc60f9f3eddb38dd3d7f04f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_add_parser_": {"doc_hash": "317e5754f1e37afbd61ca763fc12afa3935bacaedcf94c5db1449e7f56440d30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_logging_CmdTagList.run.return.0": {"doc_hash": "2aa199a2eff501d2e179826789236064f99161d1281954b2650791cba66aab32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_": {"doc_hash": "9743b0edf6b3fcf2fb02105fd62f50b9bf9df4988098d732db44125658c43778"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/env.py__": {"doc_hash": "3693bb3731f751f138e5d122aa394acb21de59ab705cad1e049496a68c553feb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_setup_": {"doc_hash": "ce3a46333b01b0bd32926602af0c933689278d6aa0f7c7aed52a948daf5d192a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.commit_OutputBase.dumpd.return.ret": {"doc_hash": "5fcfa0fb586df3e53be39bbc6936decd34f8d0f5b917b4e4f39ce04e9c949637"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_multipart_RemoteS3._copy_multipart.s3_complete_multipart_upl": {"doc_hash": "25dad20f9f620819d7429cb22d2489b9b3319a1c2f412ef8e79fd59b6ae0c766"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_RemoteS3._copy.if_etag_cached_etag_.raise_ETagMismatchError_e": {"doc_hash": "1695b8c216f11f24ac08f4f2994a7d3334346c7ad040aa381ff94728f34cc71b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_SSHConnection.walk.if_not_topdown_.yield_directory_dirs_no": {"doc_hash": "140d101335c5f15c02772d8ed8f2c995c129ac2e9495931e2e749faa16746a0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree._walk_": {"doc_hash": "24f0e569ab0dee6931bff00539cd2ffcab0691128d78ea890357a807825521b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._file_metadata_changed_State._update_state_for_path_changed.self__execute_": {"doc_hash": "8a0873685bed7b08f80a433195f38c76229c63cc4c6591b34b9939c16fe49a3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._insert_new_state_record_State.get_state_record_for_inode.return.None": {"doc_hash": "b46fc3bf0ab132fe9ee547415a192c5b8c7f543cd8bba734d1ce8001e215281f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_State.save.self__update_state_for_pa": {"doc_hash": "e8e02e1dbdc39ed575ab11338b12064d05fda75f5e4e00ac5447a488fea832dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_State.get.return.checksum": {"doc_hash": "672f95eb7b3a8a418744317b80de0182940c8af036080ad2f5575e4dfde74558"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._notify_Updater._notify.logger_info_boxify_messag": {"doc_hash": "0922f33855ba11ebeaa74e9527a6fdcd2a22a564357ddcd31df1db106c97d4b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_boxify_boxify.return.box_str": {"doc_hash": "53b8e5bb1187fae6f3bc1b06591fca1068704c81933c713deccfece5e4bbb7aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__Used_in_setup_py_so_do__generate_version.return._base_version_short_sh": {"doc_hash": "5e1a88c1a9ac0382d6d219890a35623eafc1bf13c5a72eb8578eb6aa7ab85248"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__is_git_repo_": {"doc_hash": "c5b7b18e96086b509550448c704023524767ad7ad260ae33978341fd888d04b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c": {"doc_hash": "f2142f640aa3a88a1272c7bb3d9f80564b3fbb13268cdd92cf989a9d4fd57349"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4": {"doc_hash": "eb73eda736e26c3aa35c0b06bd4827cd3456e7efd12b0f8a388e2ba0585c30f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestCmdAdd_TestDoubleAddUnchanged.test_dir.None_1": {"doc_hash": "5826619b9a822bd6c9b0db85665896b80e6bb879d2056d697f768d6f59623a17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_SymlinkAddTestBase_SymlinkAddTestBase._test.self_assertEqual_relative": {"doc_hash": "48c1a1598fdc2518d0b604765416a690385bb8205341ddb8f002a65a4bb9c3ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldAddDataFromExternalSymlink_TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test.with_patch_object_.self_assertTrue_os_path_e": {"doc_hash": "75449116f1000b0b8624457eadbadd0f4bfde167a05af69b1f64439f771f785c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.assert_expected_error_in_": {"doc_hash": "2495315ac7904a8c1ceaa67909f8ea9d00e9288ae5e031467e48d8410af3db60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddFilename_TestAddFilename.test.None_10": {"doc_hash": "a3629ac604b953a37dff765ca0777cfdd5df2d2750e492ae0a3e4e30c41d2223"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s": {"doc_hash": "e902ac203cdb6239b74316f24cfb4126b237a3c7e5c97645278d854135a31c4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test_remote_references.assert_self_dvc_cache_ssh": {"doc_hash": "474133e869b12bae9f11b5d808836366631505fbbf661ef43b2ce0dbaebad862"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestSharedCacheDir_TestSharedCacheDir.test.None_5": {"doc_hash": "71d23d378710c46eec5212c870c6829ab59067094a1c45f0b80eeb453098e88d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckout_TestCheckout._test_checkout.self_assertTrue_filecmp_c": {"doc_hash": "aadbd2c5a37caf4f7494c8949e61d3ea535d1f0bada4fbbadd4b98668a03e9d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSingleStage_TestCheckoutCorruptedCacheFile.test.None_2": {"doc_hash": "6194392792791757d6cb2464747ea897b7f17ab12afe2bad4ff5b97abdeeb746"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCorruptedCacheDir_TestCheckoutCorruptedCacheDir.test.self_assertFalse_os_path_": {"doc_hash": "79d20e18b3edda4cdbd38cc96c7d9baeef59be0229c9f76a138ed8d70bb2a852"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCmdCheckout_CheckoutBase.outs_info.return._": {"doc_hash": "e4f441a6ac75a5cd2c0209a3835bc567d81cea453ebf1481c51b98ccea715e49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestRemoveFilesWhenCheckout_TestRemoveFilesWhenCheckout.test.self_assertFalse_os_path_": {"doc_hash": "f22ebf106cec84e9982f621aac5edf678a11e8933d94c3782d45d5049c29f0de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir_TestCheckoutCleanWorkingDir.test.self_assertFalse_os_path_": {"doc_hash": "d017d0b1a56ec16037090cc79f8373bf24f4a28145e68a738ea5a2df452bb9e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir.test_force_TestCheckoutCleanWorkingDir.test_force.self_assertRaises_DvcExce": {"doc_hash": "3288548f7d9143dbffc713e86159c9f844ac12876bbd2af20e5bea7dfce1bc1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSelectiveRemove_TestCheckoutSelectiveRemove.test.None_7": {"doc_hash": "cb22ebba7b30ae0c033367e1cd08bb1fe2345a1ebf89e45e454df9564f23804c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreBasic_TestGitIgnoreBasic.test.None_9": {"doc_hash": "db0929b6be6c8e9dd7afbada9eb2fd2cda50031d14180d2cae3492285eb4a4cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreWhenCheckout_TestGitIgnoreWhenCheckout.test.None_12": {"doc_hash": "1a8f7704d6a7fa45f7e40be1759d6d6e8470dfc1a47743a5cc412605faa768b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMissingMd5InStageFile_TestCheckoutEmptyDir.test.self_assertEqual_len_os_l": {"doc_hash": "70820e909bb17092453a99d54eb896ca3617d47440f8109a2f34b3069cb325e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutNotCachedFile_TestCheckoutDirectory.test.self_assertTrue_os_path_e": {"doc_hash": "8b62866e74de69e2b298cfe267f51be70256431a1dfd3c1e2d9b746e03460fea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutHook_TestCheckoutHook.test.with_self_assertRaises_Co.self_dvc_checkout_": {"doc_hash": "ecac212801ab7329ce42c59a9143b851cbdae03611e47140f161d0721692b650"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_os_TestArgParse.test.self_assertIsInstance_arg": {"doc_hash": "896e80e8e39694ccf503cd333d96999d652512417d61791c84f12490bd675b1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestRun_TestRun.test.self_assertEqual_args_com": {"doc_hash": "88e7886b7107da741bc1ba7b98b6646dd4d8e07b7a4610b64292229d83276408"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestPull_": {"doc_hash": "086cc3727389af1ff8e9032a1f1a4f74d7ca9d45b98a0e1d68fac6ecd6c66c03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_": {"doc_hash": "29699b51f812da0318ebabdcb8198d2011a802218c56ab1e6fab292b4b323c45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel": {"doc_hash": "1ae39377e6d6a3ad94270f287a771fb4ea4b8c81d47b9d2931bd7b476c7ad67c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_": {"doc_hash": "5377fafc0df182277cb5a3904e05ab72279fd933e7ef727571042bd94359ec43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.self__test_": {"doc_hash": "633734be8b329e32a455e2cd3670c40ba7a199fe8605de70f30809e83dae7b66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5": {"doc_hash": "d101075e4a8baf0bf3e1451ebf118990d8194e7b58c4e2a4859d83888fcf1230"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull": {"doc_hash": "681d661dcd85c338d2b0de772252bde74de4a21d307c227b0a0dc38b0775f103"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCBranchesTags_TestGCBranchesTags.test.self__check_cache_1_": {"doc_hash": "3671358674156dc0beccdd6e5e7bdfce40e678a1d8580540d82479ed9f520139"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos_TestGCMultipleDvcRepos.setUp.self.additional_dvc_7.DvcRepo_self_additional_p": {"doc_hash": "ae64135efa5753a1d58a18f75b875be6b90237ce651cdb034b753a213fb9cd53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_os_TestMoveNotDataSource.test.self_assertNotEqual_ret_": {"doc_hash": "9412d5486aa18adb75e338fcdcedb8c88b8c28c4fc7f13ada2d0ce6ea278df98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileWithExtension_TestMoveFileWithExtension.test.None_7": {"doc_hash": "17f900b6fc674b75eeab0164f8a94f06e441f8943a1f65caf2b48bfbb03beadf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectory_TestMoveFileToDirectory.test.None_6": {"doc_hash": "9879d9d4f50831ea2419d074d04ce74e2b74e13496af6a441464d5cb1d8980cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectoryWithoutSpecifiedTargetName_TestMoveFileToDirectoryWithoutSpecifiedTargetName.test.self_assertEqual_self_FOO": {"doc_hash": "d3232f88e9417708441701c9c04d14cd419ca5730905c15ebc15bfc37ce3c6bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_set_os_l": {"doc_hash": "3ec6e9055c724021fd4ba2ffba5ea86bff24259eb8d34152fad46fd09c5989f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileBetweenDirectories_TestMoveFileBetweenDirectories.test.self_assertEqual_": {"doc_hash": "a2fb7c1e8299c93ea24dba59d562ba62688bc43714299f9b0add913fe009f0e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_output.py_pytest_": {"doc_hash": "205703e8e0a1fdae7cda7717c5875259d12efcb189a19e89cbce3984c9b4ff21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_logging_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "1fb43fde33ae9863afa9d73679619fae39e05dee3c5281ab48ee78aafd20f988"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5": {"doc_hash": "77ad0c66a6969567678d30a00065325fe844d92407162f6381ec0abb3e7e35f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_overwrite_TestRemote.test_referencing_other_remotes.assert_config_remote_ba": {"doc_hash": "5b828beaa8ff902b8f5ea10f9b82a62c3a209ff6a0c7682502c9c6711ba4fdf0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteRemove_TestRemoteDefault.test.None_4": {"doc_hash": "0109cb4965993ec3bb177b9db51f61728b6a77647b84da609791601242fef1c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_os_TestRemove.test.None_8": {"doc_hash": "9c5dc4039cab7eaacac0ca0b38081f324354f7f41f9b14eca868930b0956a675"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveNonExistentFile_TestRemoveBrokenSymlink.test.self_assertFalse_os_path_": {"doc_hash": "e60c4be9b9ca328fd232d449c1039f6d83759c778528f16f164862577e6dde02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveDirectory_TestCmdRemove.test.self_assertNotEqual_ret_": {"doc_hash": "6d45ad7cd8faee6663762118d10520645c6308acf979404dc249f17cdda78186"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemovePurge_": {"doc_hash": "ddd16381db0e1dd6c725c0e8462e0b3710563f1e4e841e6fa60e1e6510090cf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_": {"doc_hash": "c24523307f9d19a53ce9cc2e81acc22078a84ee63ea02a9524fbff2073bc4ab6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproCyclicGraph_TestReproCyclicGraph.test.with_self_assertRaises_Cy.self_dvc_reproduce_cycle": {"doc_hash": "b77b86960410a4345b215b601b598bd3b10a65e012885b448a9c81d706c6e58b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput_TestReproWorkingDirectoryAsOutput.test.with_self_assertRaises_St.self_dvc_reproduce_faulty": {"doc_hash": "a8df9fa2c51000d602f7b698288b540b9ef2bada042c7fe37d25e93068ee2899"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_similar_paths_TestReproWorkingDirectoryAsOutput.test_similar_paths.try_.except_StagePathAsOutputE.self_fail_should_not_rai": {"doc_hash": "a7cf78f3595b1f3719f48aff28e680c505d03c29370044512fbac24ca5450fd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepDirWithOutputsUnderIt_TestReproDepDirWithOutputsUnderIt.test.None_8": {"doc_hash": "37ead35c6ee2f5fcb81c5559b84a7b5fcb4ae70c69199bc52a308ce9afd22ea1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproNoDeps_TestReproNoDeps.test.self_assertEqual_len_stag": {"doc_hash": "a0d81435b6d986b3dab64173014df01fb8c76f85727ab5f90c02419091c2f715"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproForce_TestReproChangedCode.swap_code.self_create_self_CODE_ne": {"doc_hash": "578a23b1bbe820eaffc257c1f155b115788510460580dd6ece897f437359a102"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedData_TestReproUpToDate.test.self_assertEqual_ret_0_": {"doc_hash": "9f6fa906823fbe49167f0cacb5ac959e2289bd394603666d271c1b651e9e1129"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDryNoExec_TestReproDryNoExec.test.None_1": {"doc_hash": "f21583a9334d4203e8a188bca77260756f418e8a42ed5438fd99dc5382f44dc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDeepData_TestReproChangedDeepData.test.self_assertEqual_len_stag": {"doc_hash": "74d2b4be8dd109be9cda9534feb561b57c012133d11b28bff727cd5af1a48ca1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1": {"doc_hash": "be1c8777af498b0b47e27129490a2ac8d9db481c51168514eac81b26f6bc4048"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "b020651c7a57dd7b18524f7f9645e4cbf0b745c2e1d01548c4138b62a0d89d3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3": {"doc_hash": "2433bc5253c179579c9ec60f803fb29485e332abd454b0029a9b998ed7882e44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMetricsAddUnchanged_TestReproMetricsAddUnchanged.test.None_7": {"doc_hash": "de8ed754efb0a3fe91cc2aea9dafa6824f2a92c3bfa5377557c5a8c3b2d201ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPhony_TestReproDataSource.test.self_assertEqual_stages_0": {"doc_hash": "016cd70890cc40bcab04f65860bb5f5a4281ae593dc643ad386bd8451c4e0194"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDirData_TestReproChangedDirData.test.None_9": {"doc_hash": "cf53a4b9c45a0bb760e43ff8ad847fcfac0742b5cbc1c6c12f2bb2f9c2a63f6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMissingMd5InStageFile_TestCmdRepro.test.self_assertNotEqual_ret_": {"doc_hash": "a098b1ca729f6d55d70a639fdef7e905e06677115614d8c29391e2f245a2422f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestCmdReproChdir_TestCmdReproChdir.test.None_11": {"doc_hash": "2902ac1a9dddf588b5580a1fe5f08f2ac435ba5f0fa5d162df5de49615627707"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f": {"doc_hash": "0a9676676cf6bff1dcdc54b5b6069365072de0b91448d2b2046cfa27323cdec2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2": {"doc_hash": "b44cb5304e9450190cdaf9744b048c8221fb634ff50604ee798d204a40a4562c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_": {"doc_hash": "c6c6b6cf56d97b0cc3b09508b51d2800cc34046a92b6a899c64b6872693d0de9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_": {"doc_hash": "efcc2c6c2571f16f50585b640a3f478165984b508ba1623d2dbd33a8c6459109"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_": {"doc_hash": "f3744a1bfdc831935b42ed9786f7f4495dfd9f4d7baf9593f5d943bb19434cee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached.test_force_import_TestReproAlreadyCached.test_force_import.with_patch_download_as_mo.with_patch_checkout_as_mo.self_assertEqual_mock_che": {"doc_hash": "c5afaf2c64a2de4fcb3f80fc4ebc259450db471966b3ff82833da958797d14f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_TestShouldDisplayMetricsOnReproWithMetricsOption.test.self_assertIn_expected_me": {"doc_hash": "bb4b9296f0bab61b695808f55bdf3427b5e076c974102b341c4bdd26dc4190a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_dvc_formatting_retained_test_dvc_formatting_retained.assert__hide_md5_stage_te": {"doc_hash": "9533f34e32c62b1ef17a4491179fb6691bd5a71d7170644ca3f7b0ea7e07b3c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py__upload_multipart_": {"doc_hash": "a03abf65c88f4b15f41583cdeee59809fba1d2b736d5f4dfaabbad59d1b3da24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGit_TestSCMGit.test_is_tracked.None_10": {"doc_hash": "578326d63624d553f0e07a017766affe4468c324c83bbce9b25cadc0645700b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestReload_TestReload.test.self_assertEqual_d_stage_": {"doc_hash": "f9e483584eb7eb00f3a5e64090a8bc0dc996f0f1ec5e3426c6e4ed5e9edfec45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution_TestExternalRemoteResolution.test_remote_output.assert_os_path_exists_fil": {"doc_hash": "88dd8046377c1acf053525113dc3ce60cfa40e7bc6dfa661fd220659c346b515"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution.test_remote_dependency_TestExternalRemoteResolution.test_remote_dependency.assert_os_path_exists_mo": {"doc_hash": "0ca7f915891cef43072be5f63467ced9c884c5bc58da060682280d3dd1eb7e87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_system.py__": {"doc_hash": "78ae7a038b8effbc82837b4857fdb6a6f4aa346378e39c0045136d8f4287d48c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAddNoChecksumInfo_": {"doc_hash": "e1efe1fca5130cfc9abbd32afa9181517389cac46a07ae6e4d7e47bab498c0ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2": {"doc_hash": "6dc6117e991b9c66ef426918e76a9ec52ce93d131eb4341a6e2fe5de740bc8ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit_TestWalkInGit.test_nobranch.None_1": {"doc_hash": "e369897031c096ff957feda0ef98e33daf79185a7fdaf4357093075f6f440f10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit.test_branch_": {"doc_hash": "df1dd8db7103ca04a2f95e4922708cfda2e4d365c481f72f7bdaf88128ed896b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_unprotect.py_os_": {"doc_hash": "0d36ab4df0a011e350721e9d1c0c666383b4528249580acfdfc3cc605099c5bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_match_ignore_from_file_test_match_ignore_from_file.assert_": {"doc_hash": "7c7bb0d19bbeed66ca16c48db832a7aaf82000e30384a06c3ba46dadd1c627c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_should_ignore_dir_": {"doc_hash": "7dfa109c2ce129b9c4f9f3a7709e50f9d424f4200086a8e1a39f6938b2ba7f41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exception_under_verbose_TestColorFormatter.test_exception_under_verbose.with_caplog_at_level_logg.assert_expected_format": {"doc_hash": "b6ddbe83711f6b6a0cfb9d96f43ff01e0d688a1ad91c33012042afd99dafd17d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_collections.py_from_dvc_utils_collection_": {"doc_hash": "eb26b598ee88da6856afc08c8e1dfb8e1f0bd79bc3bbabebe32bc656ce4ba28d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py_os_": {"doc_hash": "b93f10454ada291c1fe8fccf91864333ab9a1c4e2deb9e0f6367611f952708c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/https.py__": {"doc_hash": "aa2064c8ad26ff11dd6d4c158dddc4ad83342799ea586e274ce68887157e1805"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_RemoteBASE.changed.return.False": {"doc_hash": "14ec5cd2d3593f4f381f0dd0693aa98e052cb49f46558dc2c1ef7ccc79dd4612"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_cache_file_RemoteBASE.changed_cache_file.return.True": {"doc_hash": "10a47a0795c75a85b99de776ecce76dad74d0134b720f5925f6c57485914398e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.already_cached_RemoteBASE.safe_remove.self_remove_path_info_": {"doc_hash": "03ce712eb8b02df7331588dbfcdf246be3ca7a00bd281d0fc8b79e557c6ffb16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/https.py__": {"doc_hash": "e3c03ff3161baa9e43016655e73e2c684db2a69436407b84f92ada00b755c0e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scheme.py__": {"doc_hash": "0896ebb77cfb5178a8bd6a0f52164d5c3f5be2ec2a9a17eab357ce9abf9a7cd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State_State._from_sqlite.return.num": {"doc_hash": "41de732b45e9ffc40bfc11ae1d11620291ae106c6a7186e1f2d459b5eb7937b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__encoding_utf_8_TestDirFixture.setUp.self_create_self_UNICODE_": {"doc_hash": "c061be5f2c9ac13b62180276c743d8150436b2bf9443a6daf42248df90792205"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDirFixture.tearDown_TestDirFixture.tearDown.try_.except_OSError_as_exc_.if_os_name_nt_and_ex.else_.raise": {"doc_hash": "fe096e421d2b3d8d78f2bfa968a6939b243dd1af0be253c5696b2255f2400b85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCmdDirectoryRecursive_TestAddCmdDirectoryRecursive.test_warn_about_large_directories.with_self__caplog_at_leve.assert_warning_in_self__c": {"doc_hash": "9c509ed9ff848d30f5d91f9bff9647b8a04571469df4022ffa7d75d6a764ade3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.self__test_": {"doc_hash": "c871e9aab52919a0f45d8fe8ba4d21d6c240b6534eab5b4b2a19b9ada786b4dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__format_dvc_line__hide_md5.return.re_sub_r_b_a_f0_9_32_b": {"doc_hash": "0dc2eba7eab04a24946f3ef1ad3983f36f474c2465991b47bd457746454dfbdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_parent_config_parser_parent_config_parser_set_": {"doc_hash": "d4976ef9ed966bd43ba2bea70cad42f445766c8f8e985bda4cf89bcfdf9245be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_add_parser_": {"doc_hash": "84f789d08501dc412b1ed7cbaf71058ae0299ffc5f8b26c5a346c9c6c9d71e97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py__": {"doc_hash": "a59361764a074518c8327a18fff0b90e9ade5706b0580408d22b25519dec841b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.changed_cache.return.self_cache_changed_cache_": {"doc_hash": "c5848576fab23856b39ff1abb61a0a95996f6d29da218bbd3ed620be951017cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.status_OutputBase.isfile.return.self_remote_isfile_self_p": {"doc_hash": "815853d5e09a87fbe239b069a8f0db7f3c505e323c28fd6b96d9e70c45f0f3e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py__": {"doc_hash": "7d0a0ba3954c04a70bdf4c7725fc585c629753a3a3a6573d17ff36b120dbf51c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.__str___": {"doc_hash": "c0261cba44401c1ba7d1ab35f5fb383e6096c1b02cad9cfab7e88d7a3af16904"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py__": {"doc_hash": "0cea49340988c6f31540f7859f36b833716d3159001c82f7df9d9a9c3a62fbc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py__": {"doc_hash": "62d73d3bfc6d290f22d93c3b2f503fe5b340793a4adfa6c1e062d528938723e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._changed_dir_cache_RemoteBASE.changed_cache.return.self_changed_cache_file_c": {"doc_hash": "b9a45a9ceff8d12f4681b12e3a4b6028046275360c339f1dadf7983252f9142c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_": {"doc_hash": "dcbd778c7e7805b6704387db7a0abc64829692e70e8f59de42e586b395d83b0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._ignored_Git.ignore.self_ignored_paths_append": {"doc_hash": "506ae4198f8ebd7d06013bf9b6ca4eed84af76d078bd1ff204bde305996f9b6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._add_entry_to_gitignore_Git._add_entry_to_gitignore.with_open_gitignore_a_.fobj_write_n_forma": {"doc_hash": "634707e11c7278df61f81e981ad0b659990c8dfc6d867b9f22d5a8d7005dce61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.ignore_remove_Git.add.try_.except_AssertionError_.logger_exception_msg_": {"doc_hash": "1848906b70c6e1ee80399ba711ce81fa3daa8f16d887aaf1e725fb96290805f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_tests_requirements_": {"doc_hash": "f6b9f7ccc9ad78c6df8922c7681b8820beeda6ba0e83baeec019466a3cd7df20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI._do_test_TestConfigCLI._do_test.None_7": {"doc_hash": "ca8283df833016c6cbc950bd88571ddb548ea1efa972f9590c6a03951566267a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._name_md5_forma": {"doc_hash": "c77b5f3d54e5b5f11e507847979acb1710ebee736819297a326c9c2d20d7ad5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_outside_of_repo_": {"doc_hash": "49b1f4580e556a245b99540e11d38b5a0bf6096630fe51fc099a3539b6f0a30b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_user_test_ssh_user.assert_remote_path_info_u": {"doc_hash": "8d393aee60a18bb510e83c1da10a5267f4884cdfd41ea77419555c8ac93b82bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_port_test_ssh_port.assert_remote_path_info_p": {"doc_hash": "edfc80169d397f9d967b603b1cf9109f9c011bf8f5a2805fea8be64ee5fd00db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_progress.py_logging_": {"doc_hash": "dfd7ccd002b2caf79cecd52eed9c9cdca333e44c345e3983524d97219f459a37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.get_used_cache_": {"doc_hash": "935ec9332f869e3d0df48437c009ecbf2b8cf590416fa352fb9b5c7f79cb318c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.remove_": {"doc_hash": "7d28cd63a9023630e5ea4bcd69b63cb7a91695bdd039ac9bab85448630f853c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.exists_GitTree._is_tree_and_contains.return.False": {"doc_hash": "a975ac9aef148afdaa51cde71ad303e1f02db8fed97cc06bdbda8c51d82ba5db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.git_object_by_path_GitTree.git_object_by_path.return.tree": {"doc_hash": "8bb1bf32e588a3f960838909675ea5d54779d7828882a10f240ea27af9015533"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_dir_checksum_should_be_key_order_agnostic_test_dir_checksum_should_be_key_order_agnostic.assert_checksum1_check": {"doc_hash": "a3e7f82ac08684763c24e3c0ce1a2ef08759f227a393baf2052f9e6f489d7ee8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_add_parser_": {"doc_hash": "68e4cee5bb73e989c9074e33abeb62aa15cc54c50ca62f5d1aa8baaa631133c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_add_parser_": {"doc_hash": "e6eea42d7336dbadc1f11c05c975b8706f4532a0668dbaa9d685fbe46384a7cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.exists_RemoteHTTP.get_file_checksum.return.etag": {"doc_hash": "7b1c1446e1d528756543b142a66127ba4330dfa8f8d799df88e110180a138ad3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.batch_exists_RemoteSSH.batch_exists.with_self_ssh_path_infos_.return.results": {"doc_hash": "73203ba6f86208103c4e04442dc22f240976ca6b7e9d195bbd74be8afb4a7389"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection_SSHConnection.islink.return.stat_S_ISLNK_self_st_mode": {"doc_hash": "ebb12661f0eeb790619efea36aba919b87b8d5fc56b275666dab6a95f79df8ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get_url.py__": {"doc_hash": "48d9c014e563f366e7c762f6ebdd5e5ae7eaa242c3ca19281b86cb8ce94773c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp.py__": {"doc_hash": "e8a47f88ad413bc11d8a5f363f2fa4c38838073ccfa7e87f4412f36f29ea71dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_link_State.save_link.self__execute_cmd_relat": {"doc_hash": "9eb43dc4654936b37f8c2bdf3bcff9c805174debff1e109d1a9e080c02a75e85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py_os_": {"doc_hash": "1c179c09f2c310e0515e414007001aea7f0e28e7938303fee9b9821722dfd1ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_": {"doc_hash": "f5ddf965e349450241577fdbe422a2a0863403d2a746b8142de9b9a3c95c646f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_external_test_open_external.assert_api_read_version_": {"doc_hash": "6e2c8ec920d8f30f7c692e78a60735878fb5d285ca4aca3c8dcd6b9cac082b39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_single_ascii_TestPipelineShow.test_dot_commands.self_assertEqual_ret_0_": {"doc_hash": "81222a2f0b2112a57bae9484b54d45baaa94122c7ea21d75e705bf8956ccc09b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_print_locked_stages_TestPipelineShowOuts.test_outs.self_assertEqual_ret_0_": {"doc_hash": "16474f98f886a4afca980b156bc57fc55ef86ab720787b30daaa875579d537a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_dot_outs.self_assertEqual_ret_0_": {"doc_hash": "10982f9fc5be4c0f35411d2cca524b3ee49173dcbbc4f5172997393bf8432bbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproShell_TestReproShell.test.None_2.self_assertEqual_os_geten": {"doc_hash": "a03bb9039dd061af66a497f2bb34d12a77d40e127ac85087710df02bc0f02919"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_state_overflow_mock_get_inode.return.get_inode_mocked": {"doc_hash": "483f136d7939a1545ce5c46a34a8e3ea37b9c0aebdfe350443da4f76b81cfeb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_state_record_for_inode_test_get_state_record_for_inode.with_state_.assert_ret_is_not_None": {"doc_hash": "2b5e9b0de4d32e38efc9a9d5f3ed0676ce52b4bb2eb42a13482457046ac5f514"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get_url.py__": {"doc_hash": "6b9c1cf96fe3d56e6758f28690849627b9d970781647becfa5d45f69fcd59ea6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp.py_from_dvc_cli_import_parse_": {"doc_hash": "d86d666e0ffb3be620a42684e1d908609531438bfe9dbacc99479d0e7e9678b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_from_dvc_cli_import_parse_test_run.m_assert_called_once_with": {"doc_hash": "32f8d881b2f03b96189f8160d2aa33009a856dbdb8f9d93b778ace404760a70e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_from_cli_test_run_args_from_cli.m_assert_called_once_with": {"doc_hash": "a9f8629bdd4edd30af5fdfaeab4f4eee3313abdaf282ce8a354f692636a48bff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_with_spaces_": {"doc_hash": "3894ff56302f4ef4d8f767e59c571e00fd11f25ec143aa68d19ee5658198987a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_WindowsPathInfo__URLPathParents.__repr__.return._parents_format_sel": {"doc_hash": "332ba15e6f5e1581bf4028acd410d775697682877dbb8391bd5fdca3fb4eecfa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/update.py__": {"doc_hash": "59656060995144c52af011689449322be3c2a6f9ee971a7bf02fbe223f97b083"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDownstream_TestReproDownstream.test.assert_evaluation_2_relp": {"doc_hash": "6a7d2a0cac82ef092171109ccfde640839a41a0efa9d7c4e78a50d080978da24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_ssh_dir_out_": {"doc_hash": "9535314c8920cac176536fd8025db9cd7d05a4eecdd7665e1692f686477c40b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_json_logger.logging_getLogger___name_": {"doc_hash": "6b28ec6458cdf1656adac07fdc0a8ddf358f3c3e35164b3cb8801bd5dd0bda3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_collect_and_send_report_collect_and_send_report.with_tempfile_NamedTempor.daemon_analytics_fobj": {"doc_hash": "cf8c729d8c2eba51c324cce283f9f78640ba0266025f4294058b54ce89308b55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__scm_in_use__runtime_info.return._": {"doc_hash": "c593991a0861596c6b9c8e9ef239a7a68025e8ecc9e7bdb8edc651fde4d1627c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__system_info__system_info.raise_NotImplementedError": {"doc_hash": "5fc3fcfdae2843b9175c21b79589d78a844abc96d9bfdc7b7389cf3e98218d52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__find_or_create_user_id_": {"doc_hash": "9a853b6311ab5823abf42065cf9e926a482bd52a7e9d41e4ddf327c3143e3da9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_os_get_url.with__make_repo_repo_rev.return.str_remote_obj_checksum_t": {"doc_hash": "a4ba5c28242b2d6502b245ee4470208b569ddfa8594a5120ab95ddcadaba8131"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_open_open.return._OpenContextManager__open": {"doc_hash": "0f69f670c94b4a41e7039983a45b6f115de491e28df5e1607c127010556d9db7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py__OpenContextManager__open.with__make_repo_repo_rev.with__repo_open_by_relpat.yield_fd": {"doc_hash": "f91faf95827c3a563be5bcb7a9982c389780fdd313ab7a37e288863a92aef84b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_read_": {"doc_hash": "9e909b6aab411d7f407f90605ad4f351757b8c2a517f4b591661cc5975c5fd03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py__Manages_cache_of_a_DVC__make_remote_property.return.cached_property_getter_": {"doc_hash": "2f4450bfd93cd266c6320e5ec48afa70b227cd3bc2335d16ef635e91fe8b632a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache_Cache.azure._make_remote_property_az": {"doc_hash": "455c317f73f068f77673fafd0f672b00c8ed187a95244bbb262d4cdfef56c32d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_NamedCache_": {"doc_hash": "8db1a159bd2582a1b048bdf5f926e14f4fb85df4afe61e2a1e50704bcf435a94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py__DVC_command_line_inter_VersionAction.__call__.sys_exit_0_": {"doc_hash": "d183391cfdec010a7b3a5d11d7fd75fec2c1abb14bcbf3e15061b0c82f400189"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_argparse_CmdAdd.run.return.0": {"doc_hash": "0d1d93ed7527901a88f48f2c983368a102895d1508a6e7a5c35c043137914a59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_logging_append_doc_link.return._message_nDocumentation": {"doc_hash": "361a27b8a3625e36c07c4e1ed6558004485b04f6f609a54d275c8b534669063f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/cache.py_argparse_": {"doc_hash": "5ac12305fd58440ded2e098e2e1e5c436cacdf7af30b64a9f7dd1bf26a1f5319"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_argparse_log_summary.logger_info__human_join_s": {"doc_hash": "da9ff8b7077027f4d43304641bcfc27bffe760b40063cf80fee259599f97d8a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_log_changes_log_changes.for_state_color_in_color.for_entry_in_entries_.logger_info_": {"doc_hash": "1e80fbb59355f1362789f96da5ee4d395abb5e6a1c23c6dde95460c854cdd684"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_CmdCheckout_CmdCheckout.run.return.0": {"doc_hash": "ada5e39db684dcfcf2f8cafe3ef18fd4ebfa27cf6c8f748c52f335a395a88ddf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_add_parser_": {"doc_hash": "3d6034abfb5f5d59e8884bcbdcdb8e28323a691f017b27ee64328056f0afbd64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_argparse_CmdCommit.run.return.0": {"doc_hash": "e288c66a3450196a1d39a6e5fd5daba150820b18734a83185d8988498fe8e202"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_argparse_CmdConfig._check.if_opt_and_opt_not_in_con.raise_ConfigError_msg_for": {"doc_hash": "a7f0b79f4f6dffe92d6f6aecccd0ab35cbc388c744fba960fa68f87cc160d562"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_from_dvc_command_base_imp_CmdDaemonAnalytics.run.return.0": {"doc_hash": "9c00a40fb44f54eca44ed4607596d662c3d33a75bdff7da97667b5060e6c89e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_argparse_CmdDataPull.run.return.0": {"doc_hash": "22653fcf5bb809e83852ad921b708ef0bd99c12abf3dc08b5f5de24819c30c44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataPush_CmdDataPush.run.return.0": {"doc_hash": "bcb0216a28ee3bac2e091d33cfdc199637dac1e920f870c7175059ffd4701942"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataFetch_CmdDataFetch.run.return.0": {"doc_hash": "e88d132bd84367d7dc224b16cf762dc24450b1b0c7bea27c2b2cd795f1463716"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_argparse_CmdDestroy.run.return.0": {"doc_hash": "7c24d2999559cc00170bc183a22a9967b7925a5d65f5a3113f0c4f8ad1ebba0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_argparse_CmdDiff.run.return.0": {"doc_hash": "bf2f6b2cffed7dbaed470df7e41a6a4da891892154609701f860edb70f680cfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_argparse_CmdGC.run.return.0": {"doc_hash": "cb5d0407e8489119eabfdba9228139f9330f81d194d87e354cb4d43e650c8883"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_argparse_CmdGet._get_file_from_repo.try_.except_DvcException_.return.1": {"doc_hash": "851a747350ac3266b1f1c08e0cf6321ff9b548654ec9a45059bfcd0cee89cd9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get_url.py_argparse_": {"doc_hash": "5364fd4664babe4a63ace94d7b537cc23ff0668bdc0ac86789d265170d65874b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_logging_CmdPreCommit._run.return.main_status_": {"doc_hash": "f1ed8c16d3d5583a210e5fed3aee8b4eb6456cd482dc81119d67505022eb4664"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_CmdPostCheckout_CmdPrePush.run.return.main_push_": {"doc_hash": "454f0851c5a75b07c45a423d945fe273f8a76bffae0a10b7985e2823f2314c19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_add_parser_": {"doc_hash": "c4359ca5740df2bc2165bac2ef6727cc4b05a62836c6351c459f050e077127e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_argparse_CmdImport.run.return.0": {"doc_hash": "8aab9511db0211cae4cd215f5a13bda7a6775b1b193552bb3dc10512fd5ed0e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_argparse_CmdImportUrl.run.return.0": {"doc_hash": "3d323ce143520cfca3c0140282a41b6f69a94f1e9c6656bc2b5bc5fe32ba19f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_argparse_CmdInit.run.return.0": {"doc_hash": "ca2d4e098910b82716a1be768cce7277fd772476ad58f80b2c590635c9894a1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/install.py_argparse_": {"doc_hash": "b40ea5ee54daff9ade15da93b4fe8d699a99c0581509fe8627124850ad36e0f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_argparse_CmdUnlock.run.return.self__run_True_": {"doc_hash": "c13747610da5855456ae007d141928dd7e76cc2823b153ecd68b189a68de9d3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_argparse_CmdList.run.try_.except_DvcException_.return.1": {"doc_hash": "3f151005b0b1610afdaeafce651d45b75933125f80dcffb86284167bcb60b41f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_add_parser_": {"doc_hash": "b438fe04a3d601fe88fda10d0242680f73c600029652b601fd4b7773ad5541d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/ls_colors.py_os_": {"doc_hash": "e7f39d512af63c2fd6cffcde6fa3917871a04d2e917041449a607a5560d71a48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_argparse_show_metrics.if_missing_.raise_BadMetricError_miss": {"doc_hash": "a9f83eb4b84ca94a2df51fdae1f48ad5ebb5aa47f2389dc68a7bd5d5f729a764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsDiff_CmdMetricsDiff.run.return.0": {"doc_hash": "6f43f850825b0b41475c317394ef4d766d7b865d52b3ff35b7828cc7e3d68607"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/move.py_argparse_": {"doc_hash": "9794124c27d8471d2b47429382baec77b98f37a7f1af2d31ad6823973e646259"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._build_graph_CmdPipelineShow._build_graph.return.list_nodes_edges_netwo": {"doc_hash": "78eb0708223f7b0bafbcd6842ee222525d38fd4833872f2c55353dcd52b774fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._write_dot_CmdPipelineList.run.return.0": {"doc_hash": "9113768f77742fc9209afe5009b09ebc466b416dabb12ba147b6ac626aff75f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_argparse_CmdRemote._check_exists.if_self_args_name_not_in_.raise_ConfigError_": {"doc_hash": "0ffef74fac04b2f9804f43c031d93ae47d9b9d7bc9c84a4bf6589e3d3bd3c0be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteAdd_CmdRemoteAdd.run.return.0": {"doc_hash": "206a1f7d105a39e3c812aba5ee33226e92a3270ff227f911a485ffa8e842fb75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteRemove_CmdRemoteRemove.run.return.0": {"doc_hash": "6539402ecaf894b138f21d113331da9f7685860b8023ef6d3171ccfb5c306987"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteModify_CmdRemoteList.run.return.0": {"doc_hash": "70a52722167b3121e88c7a0647f22110b27c37a6b49df60925af08ffc721685a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_argparse_CmdRemove.run.return.0": {"doc_hash": "9b61dcee55fbd6d89580e00861b8c7728dd226d0c9b2758cedc2a1a99b1039f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_argparse_CmdRepro.run.return.ret": {"doc_hash": "94aa8e842d20277628b0f438a890021cc1b4f4534cb3898a70967dd57b565a32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/root.py_argparse_": {"doc_hash": "2072ba07642567e34d6fcaaafc40a53862256390c7bd56dac8fadbac2e389fa1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_argparse_CmdRun.run.return.0": {"doc_hash": "361e73ff81e435fe6ff3d4dced4968372518aeae75f88259de71c923e964c2de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_logging_CmdDataStatus._show.for_key_value_in_status_.if_isinstance_value_str_.elif_value_.self__show_value_indent_": {"doc_hash": "1dfec9500d5189220c068a3b6c54ceb8c04bc8ab931148d532d4ceb1959a4be9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_CmdDataStatus.run_": {"doc_hash": "45ed5af03efe0757d9344d9d55a1f296cc863fcee91a0c74d328136d75aab402"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/unprotect.py_argparse_": {"doc_hash": "b6eeba70a1cb32708da1b7c2c07a6046287a7beabd6efb59998eb2d611c2c2e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/update.py_argparse_": {"doc_hash": "4a9f5c546c4f6d04429fc867496926a93f3e0432b5bb71e770f722ee2a51a589"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_argparse_logger.logging_getLogger___name_": {"doc_hash": "efecbe11e55731e89b6132ba54bda0f19d7717b0c5520037cd0fe923590387a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion_CmdVersion.run.return.0": {"doc_hash": "6f72435ffd32a0c2c4a7f7181290edc0b1162ba6d13294a2320f7c61ea27a2dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion.get_fs_type_CmdVersion.get_supported_remotes.return._join_supported_remot": {"doc_hash": "8d01679591e808052417469e2eb1409c04900cf98bf446daa0f70cdf97200dd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py__get_dvc_repo_info_": {"doc_hash": "055901d11bae941bef777092d7e9582e237485fe4da93a7c4ef421e1b5f0ea99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/compat.py__Python_version_compati_": {"doc_hash": "f077e518f571970f853e012bef7c93041275c8eea1d50425a50b91e945902658"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__NoRemoteError.pass": {"doc_hash": "1a00faa74cd098b883051166ab676de537af5e25d277a318a1dd3bf1ed680720"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_supported_cache_type_supported_cache_type.return.types": {"doc_hash": "f3dc543b7fcc73e9ab5f3583fe90215a514ccd26b33f2f33ccb50c3ec394840d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__Checks_that_value_is_ei_Choices.return.Any_choices_msg_expect": {"doc_hash": "a251475eebad59a5d2dc403bd9b8f3b8ccf4b6da8b0c6888867b332a46fec837"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_ByUrl_ByUrl.return.validate": {"doc_hash": "f099632159590462a9d1f3544bf4affc592dba66ea0629b9bd20d325bde1f8c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_RelPath_HTTP_COMMON._": {"doc_hash": "ba1c28e123e737c821e1d933560267b4d1477ed05c12f4b275221aeef59b0639"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_SCHEMA_COMPILED_SCHEMA.Schema_SCHEMA_": {"doc_hash": "0a8144a7108c09fb0b9d66c353cc0bc33af30f191257273790928f7e53dcceae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__load_config_": {"doc_hash": "86701d3a93e1e7db082d545cdbd680439190452decfbe77129b4db592ea83773"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__Draws_DAG_in_ASCII__make_pager.return.pager": {"doc_hash": "4478d1a733eb87ef84bc12d3fffdfd502af5cfcb116f65f554f5d174530c7215"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_find_pager_find_pager.return.pydoc_plainpager": {"doc_hash": "e3eb513f1e84c92c841d2934edfb53eafba6901a231a3081a38a5f645e82fe72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_VertexViewer_VertexViewer.w.return.self__w": {"doc_hash": "2d7ed539af25c266f57d38721254188994f85528eb4bc3f716d6c889fd851bb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas_AsciiCanvas.draw.pager_joined_lines_": {"doc_hash": "522b057a0bfd4ba94183ceee47d97df6c1c93e41a5a999647b72262334521306"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py__Manages_dvc_remotes_th_DataCloud.get_remote.raise_NoRemoteError_error": {"doc_hash": "8f5751dc68bff0b54a7c1d1e0d89ddefd50d0ecd73cada0016dc8c76793f2226"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_remote_DataCloud.push.return.self_repo_cache_local_pus": {"doc_hash": "a59204ec36ba93b3ef8fe6740ce8ed176b6f4e49b04016b14e64598cb924d066"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.pull_DataCloud.pull.return.downloaded_items_num": {"doc_hash": "8034fbea2dcd6147ecb18d191b598c66c0b2192ea41b98f872cfc3916b302088"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/base.py_from_dvc_exceptions_impor_": {"doc_hash": "2c5737a8fdffc759dd8da3d7cf9436a5317aa5daee141e924253f8040dcacf0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_os_": {"doc_hash": "b2f2a9990e93c21520ba1b12d03cb4db85fdc89af17591e33e4a6cbf502c3b69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py__Exceptions_raised_by_t_OutputDuplicationError.__init__.super___init___msg_": {"doc_hash": "4051451a2b1a6756edceb253a285d8b5220965766a97c87dda3fd276031eb9ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OutputNotFoundError_StagePathAsOutputError.__init__.super___init___": {"doc_hash": "edd6cf8ed807c7c606e4415187fd800201b3096d986ce5bdebe360e7812b9139"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_CircularDependencyError_ArgumentDuplicationError.__init__.super___init___file_": {"doc_hash": "b3f8d4443ae48724a50e02aa5f7ba16f0b97851f26f1b928ad0b8ae07703968c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_MoveNotDataSourceError_MoveNotDataSourceError.__init__.super___init___msg_form": {"doc_hash": "e5c4d0c66f8e2c24f3b41e89a1779f7bb85530d2b9ee6f37d66f2623b0766681"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_GitHookAlreadyExistsError.__init__.super___init___": {"doc_hash": "5f8d4e013ac63be610a240a0ae77bc88f1299028fc1fa05ca2a6c4f213e5cc2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_DownloadError_HTTPError.__init__.super___init___": {"doc_hash": "697b2d8e320815ed458342e1612508f5a1264784ba61cb1fcd023899c9061a46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_PathMissingError_PathMissingError.__init__.self.output_only.output_only": {"doc_hash": "01cc357965cbad4618350251be293051a5259056dfe68a77f75e81bb5f4f0969"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_RemoteCacheRequiredError_": {"doc_hash": "d69c65aa672c50a63758ee3e5f6038a608e70ad476ec3642c072b7cc8d376dba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_logging_logger.logging_getLogger___name_": {"doc_hash": "92966b225120d8f71bea3b4dacb834c1d73b4fe4718d66c33050be2760701491"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_external_repo_clean_repos.for_path_in_paths_._remove_path_": {"doc_hash": "9aa64aa6b8a247b9c589d9617d5d673f9577087d4b7afea61aa679f33f665553"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo_ExternalRepo.pull_to.try_.except_FileNotFoundError_.raise_PathMissingError_pa": {"doc_hash": "4bfd8ef81ac6faa91317cc61040d867ddbf0e325226dc7ba35b7c5fda87dce31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._pull_cached_ExternalRepo._set_cache_dir.self.cache.local.cache_dir.cache_dir": {"doc_hash": "36523f04ba8ebfff6bcef9fabc9f7f984bef5f833aacd5e45cd459d22e7361b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._fix_upstream_ExternalRepo._fix_upstream.None_1.finally_.src_repo_close_": {"doc_hash": "9c47459109c760caddead41b711464afc45f9e1fc6e896715fe07916c1419e15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._fix_local_remote_ExternalRepo._add_upstream.self_config_core_remo": {"doc_hash": "aeb5c57d781a9626826c4097350c62913fe88936a2cbbba459985158bfe9c688"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalGitRepo_ExternalGitRepo.open_by_relpath.try_.except_FileNotFoundError_.raise_PathMissingError_pa": {"doc_hash": "8ea0c9e7eafc90ad19a1c7bb1d284f492acf1a35bc40f9682c0907cc575565da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__cached_clone__cached_clone.return.repo_path": {"doc_hash": "8c10de2c225605b01cd26072bfca6561778f753d49d4c984bf3b2ff96dc89627"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__clone_default_branch__clone_default_branch.return.clone_path": {"doc_hash": "eb2924b84f032433d34b11064ff7c10cc44c0ae2c58cda16e3005dbf917a8878"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__git_checkout_": {"doc_hash": "44cbb28ed3a247fff3b6e23022d9757b58f32de295d60eb315e784a97b4524ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_logging_DvcIgnorePatterns.__eq__.return.self_ignore_file_path_": {"doc_hash": "7ddb43d48b0fd12f56c547c3438220f370a7c6735cce5b2ded802eff2d261638"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreDirs_DvcIgnoreRepo.__call__.return.dirs_files": {"doc_hash": "3dfb0ab767e79196ba62a8416f386c7f85d86778727f3b7e3fb8f5514e8985b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreFilter_DvcIgnoreFilter.__call__.return.dirs_files": {"doc_hash": "9014478d0afaae060eabc27d50ddc2b9f7460332a77ea76fb7cce6ea8d02ef21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree_": {"doc_hash": "8ebc7d1da425d8de74f79d5baecbcd60743d5e7ca012dca4af8e057e5477b97b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/istextfile.py__Use_heuristics_to_gues_": {"doc_hash": "b2df76ea908f85d821374f362b89d48e2856829d4ccf5c0c6c5852f25e046ab3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py__Manages_dvc_lock_file__LockError._Thrown_when_unable_to_": {"doc_hash": "f9a7d252be420f38a42c3aff1dbf2cb8355ea06b4add3c6801c2a9eb9ceb4980"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py_Lock_Lock.__exit__.self_unlock_": {"doc_hash": "79e23726180f6280a193899ea02f10034aa8d0054eadc462a2bdd434bbd395d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py_HardlinkLock_": {"doc_hash": "45174bd1efc8ef4ccb9ec2e45bc6dd6815d14fff44c343a5ea1f9ff29ce2140c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logging_config_ExcludeInfoFilter.filter.return.record_levelno_logging_": {"doc_hash": "67a5dd869dbee72de4890fef7a6a3b341a1445c91e37c16775d8ae14b4ebaff0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter_ColorFormatter.color_code._": {"doc_hash": "5e62095d629b3d20e5b765a6a1048a3d446cc59682f7a5633677588f7565945e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter.format_ColorFormatter.formatTime.return._green_date_nc_form": {"doc_hash": "88299c378246c5bfc6408dbdfd2c1b9a069b4729d49ee8c0bdd0103dc2af3116"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_LoggerHandler_disable_other_loggers.for_logger_name_logger_.if_logger_name_dvc_a.logger.disabled.True": {"doc_hash": "fa55c294952e78f5438386dfd8c092dda6cdb7dc3487001def80c227718168ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/main.py__Main_entry_point_for_d_logger.logging_getLogger_dvc_": {"doc_hash": "e4fcd2766dac57beeb9c5550df47a7be02f8ff0a9dd3cc724b76bd51c0481db8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/main.py_main_": {"doc_hash": "23c73461d5873d157580ab3d5cfa56be075f63b320889f99c7a7d4fe56047b97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_from_urllib_parse_import__SCHEMA_OutputBase_PARAM_P": {"doc_hash": "97571e12329e35e0911e4d61c89f9245873e60371be5c8c86ffb557df7ab52d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_logging_OutputIsStageFileError.__init__.super___init___Stage_f": {"doc_hash": "79d61a2ca1c4362ce8ad3f69e65768e3173ea3d1c714f2b3bcd239bbd2e5146c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.verify_metric_OutputBase.checkout.return.self_cache_checkout_": {"doc_hash": "b2808821bcf0dbc4cacf9178a4cc3d9dc2010a66812d324808f60bf4efea9099"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.remove_OutputBase.unprotect.if_self_exists_.self_remote_unprotect_sel": {"doc_hash": "7216744616e3f580d070c53c5bd569eefde2799c18b81b969ae8ce57e9cc0005"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase._collect_used_dir_cache_OutputBase._collect_used_dir_cache.return.cache": {"doc_hash": "f4ab9831670bec5c57fb877c3daff07dca287064a807c194ae8eadb3d53417d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_logging_OutputLOCAL._parse_path.return.self_REMOTE_path_cls_abs_": {"doc_hash": "5f700c9b70facce376591ff0a31db8abe0086a3828db18a963b7928852782140"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_os_PathInfo.isin.return.len_self__cparts_n_and": {"doc_hash": "8a4dfad7bbf22ec1c534a386dcd4ea3b74d95803cdcd5f1756897fff17fe8838"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo_URLInfo.from_parts.return.obj": {"doc_hash": "9aad3cbd3c9b6de51bac80b1db52fbd0625f43d671c4aee4fac027468e8d2abe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo._base_parts_URLInfo.isin.return.self__base_parts_other": {"doc_hash": "89fbedf388abbb9ee62c3d85d64203ed0dcec5af3fba099afb13207db43e02ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_CloudURLInfo_HTTPURLInfo.from_parts.return.obj": {"doc_hash": "dd374c30686305dec5e28f0630b52c7870ac1c1f14b390685352d4795a72fb97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_HTTPURLInfo._extra_parts_": {"doc_hash": "847becd68726ecd0b5a8a0ceee4ab98cff4ea9740aa975c04c3b2b19ad967f93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py__Manages_progress_bars__Tqdm.update_to.self_update_current_sel": {"doc_hash": "28222b864c8b3cadd603873c21b2abd050f2debee3bf238b54e3423c22511d6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py_posixpath_Remote.return._get_remote_conf_repo_r": {"doc_hash": "d4d952b0a68efe77ccfb158ffed60def148cd9dc77a14911b9f7dddeecd2a226"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py__resolve_remote_refs_": {"doc_hash": "e8604555f39068fcfa4186e2ce0e9dbe74d3a2e2c827dc07c18373beb1a9c93b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_logging_RemoteAZURE.__init__.self.path_info._": {"doc_hash": "29c1d911b69c05e78ca41a251efdeca5c79f92ba6837d6537eaa6e4ed9548d55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.blob_service_RemoteAZURE.blob_service.return.blob_service": {"doc_hash": "916593d120694bbe5412a13522adf40ae29c947eafb639660d5f70c29725914c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.remove_RemoteAZURE.exists.return.any_path_info_path_pat": {"doc_hash": "cf4571edd121cb21893ba95d6a979b0d4b7bbe2601fc8e6ef218b3daadd2fed7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE._generate_download_url_": {"doc_hash": "0da06fca47e0c5ce522dd68784bc9a46dfaeae0e49fccc686b322095563568a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE_RemoteBASE.get_missing_deps.return.missing": {"doc_hash": "36c6b370fb60a6ba884baafb87d005820c8262ccc66677e9de639f3e7d9e9e0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._check_requires_RemoteBASE._check_requires.raise_RemoteMissingDepsEr": {"doc_hash": "fc2b08e629306f58e0e9268093649d16ca8a3a3a61fff7ec6d9604266354b7ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._collect_dir_RemoteBASE._collect_dir.return.sorted_result_key_itemge": {"doc_hash": "d02bc442d166c754cfbc293e3933c57e1c1be604e75a023b01ff7337e4e99111"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.get_dir_checksum_RemoteBASE.get_dir_checksum.return.checksum": {"doc_hash": "71013840b86f4f78af93598a5cec2d6489261c53097e9b3400ca79d0da98f72e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._get_dir_info_checksum_RemoteBASE.get_dir_cache.return.dir_info": {"doc_hash": "46e416535613ccc6be8cd6a807f6a16b90ac496b80ce84fd92f462bf1eb41f2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.link_RemoteBASE._verify_link.self.cache_type_confirmed.True": {"doc_hash": "b51d4a31fb0efe004f8afc33175d61464110ecebbaec6b5fbc7c74670d3f5e3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._try_links_RemoteBASE._do_link.logger_debug_": {"doc_hash": "9af62d14d7f8423735c7de3822cc1d5125d2e0bd9f93f549353bcbbabe5d02d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_file_RemoteBASE._save_file.self_state_save_cache_inf": {"doc_hash": "bd4b13e4942b04808386d0f3399432564ea8a089bb0d81a71708129dc10955bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_is_copy_RemoteBASE._cache_is_copy.return.self_cache_types_0_c": {"doc_hash": "6cbbca7dc3f5c52ccf546b52758888e214f4ea7f1fb0c2bf707ab1fe41006a65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_dir_RemoteBASE._save_dir.self_state_save_path_info": {"doc_hash": "75dd72f59667e887aa85fc67fb4b9d19b69574ee0fc817f8b18fc6028d35cc5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_empty_RemoteBASE._handle_transfer_exception.return.1": {"doc_hash": "a2e283557e9df27d2e2f4aa2ef56ac78c29601260b8a4d5d89f716c42efa4c6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.upload_RemoteBASE.upload.return.0": {"doc_hash": "0408ff632f7b78cf6bda843c6f2934654ccdd1564f8ff6e21fa3367e0dab5476"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.download_RemoteBASE.download.return.self__download_file_": {"doc_hash": "a56649058fe3d2621eb4e744195e8e3cec3076050e0c603b7e7b1722e5c5affa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._download_file_RemoteBASE._download_file.return.0": {"doc_hash": "00607adcae3453816c86ba720040a13aa662ea06fe7b64a00f28aee0a696fc5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_file_RemoteBASE.makedirs._Optional_Implement_on": {"doc_hash": "786e916685810b8e18a44d68ac49f0c8b419ed0f5495cd581937dec2e90b41f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_dir_RemoteBASE._remove_redundant_files.return.bool_redundant_files_": {"doc_hash": "76911fc8aee4a09c7609f0452a1bf0a8897adc37a12a88422b9684c28fccbcb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.checkout_RemoteBASE.checkout.return.self__checkout_": {"doc_hash": "4ba08d13169367bb1fc5eee4479ceab7dc833aa9bec03724e3e03a4dcbbdabb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_logging_dynamic_chunk_size.return.wrapper": {"doc_hash": "53bb3e51e2b3920efdc6ec1bf0858060c7d64bb51535251b9d889bcdeea92de8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py__upload_to_bucket__upload_to_bucket.with_io_open_from_file_m.with_Tqdm_wrapattr_.blob_upload_from_file_wra": {"doc_hash": "48e0ef1dad1187bf1f9951613be3341c3fbec9c5f3890e1aaa92c38a3de52ca2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_io_RemoteHDFS.hdfs.return.get_connection_": {"doc_hash": "e2e66b984b1f0d5484bd23dc370cac44fef521510bfd90a1c4dead09ac4f27c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS._group_RemoteHDFS.get_file_checksum.return.self__group_regex_stdout": {"doc_hash": "f01cfefb05edf99541222621911a9c6fe908c01b01109226e1928bda526e81bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.copy_RemoteHDFS.copy.with_self_hdfs_to_info_a.with_hdfs_open_from_info_.try_.except_Exception_.raise": {"doc_hash": "717f5e082f1c5fd635f47f7f08c49fee07325f5c842c864e20fca36e7cb065b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.remove_RemoteHDFS._download.with_self_hdfs_from_info_.with_open_to_file_wb_.hdfs_download_from_info_p": {"doc_hash": "e6d7aa3dc9fd7ca59697f90cf9df6d8749f0b419cd35d62fc0f5184fdfac8941"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_logging_ask_password.return.prompt_password_": {"doc_hash": "0097390795ced138bdf9d46686a8280a8f147062b71e5a569015dea19e1d0829"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP_RemoteHTTP.__init__.self.headers._": {"doc_hash": "fda76689ab26f49694b92a05cfbdc47ed5d8ca8f7b7909f9ce5918eb18d8972f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.auth_method_RemoteHTTP._session.return.session": {"doc_hash": "34ee3090494a59b4d35f23f92a0d0054de988a2660e36354cbbb68b903c6429c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._request_": {"doc_hash": "625dbf32c5ecc7b1f46404c8f909c3d34c2a36599f95f1f177e66918a6a74e02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_errno_logger.logging_getLogger___name_": {"doc_hash": "8352b366f8bbc38f19f4e117511c36ef3bda5242efb0ca9b2a4eea994cb9316e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._fill_statuses_RemoteLOCAL._get_plans.return.from_infos_to_infos_nam": {"doc_hash": "898a2d42c9f8e5952bf620ef52dfaadb8ae7e80c955b2e556077b981a25a22dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_file_RemoteLOCAL._unprotect_file.os_chmod_path_self__file": {"doc_hash": "7c55ec3473bcb47bc550766c54e59177e8c3cf270b5415953ae87e1014ef3fff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._create_unpacked_dir_RemoteLOCAL._create_unpacked_dir.self_state_save_unpacked_": {"doc_hash": "36b52e83d638f8d187cd6b96300540f83aea682d8f1254d9abbabe7af7e5c7d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._changed_unpacked_dir_": {"doc_hash": "7d32aeeb0d0d0b3d81e4a5f5c90be17f16d0f1b876fc457d61221e320d9dc069"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_logging_RemoteOSS.__init__.self.key_secret._": {"doc_hash": "949a2f1b2013e6e89ad45e2f3b38520b10f3b562939a9737f58dc3e523844ce3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.oss_service_RemoteOSS.oss_service.return.bucket": {"doc_hash": "1df1f111ebf693e5cc31c888d133566476d9553a7cfa85dc973969a558217e4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/pool.py_from_collections_import_d_close_pools.get_pool_memory_clear_": {"doc_hash": "5dc4059b8f43184f952c7f2e9693821b8fbcbee54da0b1a87901cb1992fdb06e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/pool.py_Pool_": {"doc_hash": "f275421cd2f584dc2ecedeb9335e059c9e0391d2e7aaf7abd1530f5f18067fa4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py__coding_utf_8__RemoteS3.get_head_object.return.obj": {"doc_hash": "451bfbb3663de0cce0e5dd3cdf13b3931a15b3121d2506b9a811f7113911f70e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.isdir_RemoteS3.isdir.return.bool_list_self__list_path": {"doc_hash": "7b28c348f3cd5bd69b42790e434ed2928d639b209c8d2984bc07e9099f6a2708"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._upload_RemoteS3.walk_files.for_fname_in_self__list_p.yield_path_info_replace_p": {"doc_hash": "b33340faec0f1a9eab31daa112a6b06f34e31f450957119b7dcbe1e41ef0e246"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._append_aws_grants_to_extra_args_": {"doc_hash": "3a123799ff2f90a49bf968e00c615ee7f556e103f47d548788a7834f47ff9b51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/slow_link_detection.py_logging_this.message._": {"doc_hash": "fdd58f560625c82d435b192db511a585ed7dd2b4fceb55c855152e9e0a2afe2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/slow_link_detection.py_slow_link_guard_": {"doc_hash": "5cd8ea6fd7d78e7728ce5d2d85a0ba2a0cb4d3cc95eec0130d7bccbd41e30a5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_errno_ask_password.return.prompt_password_": {"doc_hash": "1be6a29f09d9939cacd8a99e2e3173dc543b63e7aa644df12b914e469e9d3e94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.hardlink_RemoteSSH.hardlink.with_self_ssh_from_info_.ssh_hardlink_from_info_pa": {"doc_hash": "049ea2d2cfd913d0c095aa50d919a6b372035482c1a6919e7257276ae79aea89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.reflink_RemoteSSH.makedirs.with_self_ssh_path_info_.ssh_makedirs_path_info_pa": {"doc_hash": "996d365ec25c1aaac0f85dac933854720b2941007530d1577cef4913798042fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.cache_exists_": {"doc_hash": "a42bbfbddc7174fb6de5b39ea9e3800acd7df796071ba4cabdd6be61db871ff5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_errno_sizeof_fmt.return._1f_s_s_num_Y_s": {"doc_hash": "69764b766c6f9f7ec4881637c1683e5a0b5fb28b82a5a01a1a3121b211796fd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.makedirs_SSHConnection.makedirs.if_tail_.try_.except_IOError_as_exc_.if_exc_errno_errno_EAC.raise_DvcException_": {"doc_hash": "113e2b48396fbc518ae145372054f49847123adf3785ac5a64375b943ed25614"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_files_SSHConnection.upload.self_sftp_rename_tmp_file": {"doc_hash": "4d9202b2ca6841ef5f5392fe51c23509de87f1d3231b0babffffe08c23f2daa3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.uname_SSHConnection.md5.return.md5": {"doc_hash": "d163a0797f976299a6ebe67696d51445166194349b0d79db55aae3047749fb11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.copy_": {"doc_hash": "0a5f026e88f759e62d4c29ce8fa6c142aaf00d90f6b6bb3b14c10b5132ef0734"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_os_locked.return.wrapper": {"doc_hash": "fef11c627ed31a47840f84ce73dd6225bdcff763b1f114ac6dcf7779ddedb7a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo_Repo.__repr__.return._format_self___": {"doc_hash": "9ca39c07338c06cf05d8435f98f3ece92d9e3bed7febb8c1286795d21d848ef0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_root_Repo.find_root.raise_NotDvcRepoError_mes": {"doc_hash": "6821b58881119adf913a1062e2783ef1211ef907fa969a1a1cbe278b106c53a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.collect_Repo.collect.return.list_nx_dfs_postorder_nod": {"doc_hash": "ffbb7388562f50aa5a89fa58038f4ce92725d9024e389d0eabea485d31bdf463"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.collect_granular_Repo.collect_granular.try_.except_OutputNotFoundErro.return._stage_None_for_stage_": {"doc_hash": "3d9ea72318b2d72833ea522bc3438c5a7c59c068c987f348bf0d61aca041d532"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_graph_Repo._collect_graph.return.G": {"doc_hash": "6f8120ae274a42771c85eafefaaa522f6dcdb49a78c3cc3730a496d6f0f00bcf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_outs_by_path_Repo.is_dvc_internal.return.self_DVC_DIR_in_path_part": {"doc_hash": "e6f95452dd5f701e274892ffbdc7eba12bf64b83565f4abfc6c134f63141af67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.open_by_relpath_Repo.open_by_relpath.raise_FileMissingError_pa": {"doc_hash": "fd7e478b9f1af853c426e1fa0dd2335c474f4e32d9c5a106b077b1150dbf43f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._open_cached_Repo._open_cached.try_.except_RemoteActionNotImp.return.open_cache_file_mode_mod": {"doc_hash": "1251227406d7e2f117c8f0c2bdef3bbf2956936fcd66bf5120ef4e3de898c74a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.close_": {"doc_hash": "2353a03c213c82c6c74286beebc3e8f24161917904f013ce12217446529e6b96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py_logging_add.return.stages_list": {"doc_hash": "ad752d9846b20370acbb6823b5801945bab1ca995fe819be97af1532a8104850"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__find_all_targets__find_all_targets.return._target_": {"doc_hash": "81ee468c59f2ab286a921a5dd2066a631c75af4cce379752b77b4d5766e82eb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__create_stages_": {"doc_hash": "ffffdd3222980a57d3bd45d93fd7afe9840f30b237e723754f6f1ad88c9eccbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/brancher.py_from_funcy_import_group_b_": {"doc_hash": "c44ec04d04d4b29f0c57c909afa6a272d2eebccf50c88f97591239cd860989b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py_logging_get_all_files_numbers.return.sum_": {"doc_hash": "24ebf812dd4a63f856ce40601a0f462452e8a2867c6adc601e24f74eb34e8e4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py__checkout_": {"doc_hash": "60421614b483958ee887419064d9170e16bdaa9250ad9cf8f785945d0fb8d14c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_os_diff._paths_checksums.return._": {"doc_hash": "68b5477a4f86eca7bf38a2d0ad65674e5acba39cc8ce32def008422b059549c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_diff.working_tree_": {"doc_hash": "5c5047728c791bf7b153475f71eefaed14204262937d78b1efcbbab26a041bb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py_logging__fetch.return.downloaded": {"doc_hash": "5745b3d331f7eee4805d0341055d0f63ce98144daa06560871f89c4762b7d8e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_logging__raise_error_if_all_disabled.if_not_any_kwargs_values_.raise_InvalidArgumentErro": {"doc_hash": "e83597bc4d082713535a5fef787b962579ac05de349cc0e8f5859a4530eb7532"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get.py_logging_": {"doc_hash": "28518e1a97a7721a1d7aefa7d127350d897bc868549164fa7c954015a1ef4d1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/graph.py_check_acyclic_": {"doc_hash": "04f75e41ea2b64c0bedf018b39f94be0e3493719d1232b58a33d7bd4f8a811e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_logging__welcome_message.logger_info_msg_": {"doc_hash": "59fdeaac53f5a5dc00fb968c1205ea9ddd1b39572c2de4136a823586432508f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pull.py_logging_": {"doc_hash": "754614ad42b78caffb51dcf40b29a0ae885e86790e2f6d685eb0b002fd6f8209"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/push.py_locked_": {"doc_hash": "593539143637f86882880a6bc8bd6db0636d540e38e0941aa30690ef8b1ef141"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_logging__reproduce_stage.return._stage_": {"doc_hash": "cf493c903aa2d8ca73d0e1e098b26aeb7a9eb28195d9742a13effbb818255721"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__get_active_graph__get_active_graph.return.active": {"doc_hash": "67b47c03c4f3dfd80ab80b6881717ce11a3b701b958bbf0e289165786e61d759"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_logging__local_status.return._joint_status_stages_": {"doc_hash": "42210ba73c041cf30ee0becb9fd6906bce35e7971c8ab05a3d5efae18a8b2432"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/add.py_logging_": {"doc_hash": "4b003cfbec3393cc7edc6f29b189a311119223b692c458134a4213c2d0a2259d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/remove.py_logging_": {"doc_hash": "43ec2f2ad5b2871b1d20a9d06beafd65a9b1964b81fe29f8261babdc2fac4499"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py_os_RWLockFileFormatError.__init__.super___init___": {"doc_hash": "a0dd2d51949c28774cda7f27284a56181b9d2c4a306c50fc80e5377d43ac8d81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__edit_rwlock__infos_to_str.return._n_join_": {"doc_hash": "c4d755c92d9547d37c9b6a11bd279ee57c643ff4710463583bdbc194e1b42c4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__check_blockers__check_blockers.for_path_info_in_waiters_.raise_LockError_": {"doc_hash": "88a743add35d0f1e8d4f255ab9a27d63f462c61b0b4274e2beba7fce4557c05f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__acquire_read__release_read.for_url_in_changes_.if_not_lock_read_.del_lock_read_": {"doc_hash": "5684702434b0b7782c3fb9a01c2684b8bf3c69ef5b433af9ff8ca1d593879d72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py_rwlock_": {"doc_hash": "17461db65c5218da660b6d0506980f5e3c4236402cd15b46553d416db5c2a632"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py__Manages_Git__logger.logging_getLogger___name_": {"doc_hash": "5e3b6f453fcfee804012aadf9c230675bf09db320c666975295ab7c096455382"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git_Git.root_dir.return.self_repo_working_tree_di": {"doc_hash": "d62ac0d0a69bb8cdce42066473862953c5d721a4bc79e0fe74ad07f45f5ccd1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.clone_Git.clone.return.repo": {"doc_hash": "bbffc717a148262147889f57513e4bc9418a26845d7ffc9089e7a32ec649b049"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.is_sha_Git._get_gitignore.return.entry_gitignore": {"doc_hash": "f3aa62354615dffa2be4a689545f0a7c89b831504ba6d892c16af092e0c75511"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.commit_Git._install_hook.os_chmod_hook_0o777_": {"doc_hash": "94d3cdc484fbb0c84e67375335cb5e77995ee6fa8515a24dfaa4b5118c5021b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.install_Git.install.with_open_config_path_w.yaml_dump_config_fobj_": {"doc_hash": "d07b16450b0676947256f3278606014ce33b2fac73d2fbd5f5211d2706095357"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.cleanup_ignores_Git.get_rev.return.self_repo_rev_parse_HEAD": {"doc_hash": "481abb043ddc033efc86eb378476740208d4a30e092ab61298418917da14cdff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.resolve_rev_Git.resolve_rev.raise_RevError_unknown_G": {"doc_hash": "a8293af2f94d82e08f24a742d42eae5b47a1f9ee07a5e0e1091e88cb7a58ecc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.has_rev_": {"doc_hash": "e31dd6de816bc66673ec120bc9128aced443673637f58bd768942ebcd70eb883"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_io__item_basename.return.os_path_basename_item_pat": {"doc_hash": "4f24b90c86c52f987db171d9034743783faa589f983cb57e44ee83bcb4282d39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree_GitTree.open.return.io_StringIO_data_decode_e": {"doc_hash": "c518d88260dd632fe9274e5a35402e4bd097d01090a3cc0c76d7ec4cbba6bf4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database_logger.logging_getLogger___name_": {"doc_hash": "60720b7d03ae4c0c38f345f9e1e6795477fe400cdfce1ed13e7c05a81c84a2fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_StateVersionTooNewError_StateNoop.__exit__.pass": {"doc_hash": "f615145c8a465661521917528802a13c4d862294c913e0a6f49ae380ca447fc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_unused_links_State.remove_links.for_chunk_unused_in_to_ch.self__execute_cmd_tuple_": {"doc_hash": "d2314cf875b2e069e850b10c70b5df480ec1f6ffaaa077191f36653c4f80819d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__connect_sqlite_": {"doc_hash": "ed3dbfd8cb80eaa88dd3832134c905d9b50d784976779617e431b9576abc627c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_errno_System.symlink.try_.except_OSError_as_exc_.raise_DvcException_faile": {"doc_hash": "0f37d8fa571e224ca50150ac25b7c380a19c33744d5ae79dba53789069e869dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._getdirinfo_System._getdirinfo.return.Info_GetFileInformationB": {"doc_hash": "17adbb4c2361f8e5e8e0535338dd38dc4293f14374dc0f82e0cf849b313e382b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.is_symlink_": {"doc_hash": "57602b6974f107a8875b7efddeb59f610ba4f0c8ec0335232f17553828115533"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_logging_Updater.check.self__with_lock_self__che": {"doc_hash": "77be5ed8f6b1109a4117ddc6bbf605de45c6ee32316632ec2d96b25ac2cb3408"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.version_parse_self_curren": {"doc_hash": "33cb66f9d2e1d894ba7124210cd47176ce3a4395630dd04f0aa69818e370c068"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_update_instructions_": {"doc_hash": "896e588a9cbbfc1e8271216ced9bf7365c0090ae50f1c08a467d6253c3951b96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_file_md5_file_md5.return._None_None_": {"doc_hash": "97bb6c28856b6070d2a55af7c25a7363e566f3bfc0b09bac8e630b1ee285301c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_bytes_md5_is_binary.return.getattr_sys_frozen_Fa": {"doc_hash": "ef326e9504334aabd7487193c2d810574c223c0b4e6d37869022b0a65028d873"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_fix_env_fix_env.return.env": {"doc_hash": "df1fb2b7ff45e5da0cd32793893e3c9e4b6019842cc50f8c9f76e2daa214aacf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_tmp_fname_colorize.return._color_message_nc_fo": {"doc_hash": "80aefc3a3bded9645caf0addf60535dbb68284b772d26def7fa2bced3529f168"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/collections.py_from_collections_abc_impo_": {"doc_hash": "966d54315735905301074180ee2305789e275df381cd44163184619d3b9471cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_get_mtime_and_size_get_mtime_and_size.return.str_mtime_str_size_": {"doc_hash": "a3aa4e43be6aadb3937fdf5e6b4a549e57b9b848f80b46a4fa98934c8fbd0331"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_BasePathNotInCheckedPathException_contains_symlink_up_to.return.contains_symlink_up_to_os": {"doc_hash": "22e654edb192c59a99998b68d4457ffe04ea60afe2ebaae7534a6af1c32d5316"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_move_move.shutil_move_tmp_dst_": {"doc_hash": "f7fec782fd3984e8b46ded898129803f97f2707802c58c863ed657466b875470"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py__chmod_path_isin.return.child_parent_and_child": {"doc_hash": "0d24aaa0bf035a43e27bd7ff4382d021a18b69bfc75e656d2b45742b461f75c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_makedirs_makedirs.try_.finally_.os_umask_umask_": {"doc_hash": "e01c36a846c53e32d988ad6f9d864d63eb31bf6cfaa510124d46761bc1ddcf3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_copyfile_": {"doc_hash": "0a4dab7d96320a089896af30cbf7b54d53e3d55db95bcdfad57e465f384de3ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_io_open_url.with_iter_url_url_as_re.if_mode_rb_.else_.yield_io_TextIOWrapper_by": {"doc_hash": "82ee923197c745da8cb86726609b5c60a7596a997867878a5ab8e4737355ca40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_iter_url_iter_url.try_.finally_.it_close_": {"doc_hash": "9fd4d918d0e645c619288cae6ad3fd760e806fb4d9a1b90d68336a9bf412325c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_IterStream_": {"doc_hash": "b69b4d7f3cebdbe0f780afd90ed43d33068494aae541d3d98d0884fc01238108"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/pkg.py__": {"doc_hash": "d1fa784938e5b41558520862b545ce2319a7726b0c93aa8e83c5c9dc4aba13d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_yaml_parse_stage.try_.except_yaml_error_YAMLErr.raise_StageFileCorruptedE": {"doc_hash": "e4ef6e10f4c19b36a8a9d1f168773eb152a81286220ba7253e9f17fd3139d3b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_parse_stage_for_update_": {"doc_hash": "734a46bc4aefff7073294cf69c713bd6985b56bf458005d3a6d0718762edb9e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py__noqa_D300_D400_TEMPLATE.r_": {"doc_hash": "23a3e55edea627fa51156db7dd2d9ecdc71e00ac7776487929aaf799d967f78d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py_get_args_easy_install.ScriptWriter.get_args.get_args": {"doc_hash": "74b279ab8993c14c3ff64301d4b649e39142f3d32974d024fc4f593a1e089782"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py_main_": {"doc_hash": "d27ac2e39ee727060d7f5ca1a32a129d741e15973eec054492d9be8926adf6e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-dvc.system.py__": {"doc_hash": "18ee1d91b261e82a9c4330a2513dc39548bb4e56cabdf5f9711310a477140fc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-win32file.py__": {"doc_hash": "fd5844718b1a0d95f2aa9ba55e3947d23fdcd0a285255da7f92fccf30d4fdd6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_importlib.util_build_py.run._build_py_run_self_": {"doc_hash": "4d749573a5f3760a5ec9b203403e65d549007c398c6f908d8985c37466ca35b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_install_requires__Extra_dependecies_to_ru": {"doc_hash": "45aa4143a6012c47fc7ddfa77a9793b089eba53c9c696bc54ef876789c71111e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitFixture_TestGitFixture.tearDown.super_tearDown_": {"doc_hash": "db74657a13dd90df8e41fbe220af285c4b63bdec03a89c4af4f91a169e528908"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_os_": {"doc_hash": "52bb6fb03c57359e01267017b87da098a4635138a7c635e7dae5a1c8857c909a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py___disable_other_loggers_": {"doc_hash": "345a6ced7e8edeb00f5e145d3f94b8180c20f0a963d3043d22c4b84c234e6f35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir_TmpDir.__fspath__.return.str_self_": {"doc_hash": "ea9e07eab8c27f434302ac159e54ad90fa31631ca66bbe7d686bde77956674b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.init_TmpDir.init.if_dvc_and_hasattr_self_.self_scm_commit_init_dvc": {"doc_hash": "1886a93d649d928382b8ba1e7cf925999428038677f31cf8a834b0829dda44a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.close_TmpDir.scm_gen.return.self_scm_add_paths_commi": {"doc_hash": "af33e02e6ea63eb17c226afb0df5e30d1907ebf921cb72fdd8dd5f915f7e78d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.dvc_add_TmpDir.dvc_add.return.stages": {"doc_hash": "da2235989359c7952df6b68583c1690cbc98db2c1455b46034d4d2c9526033f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.scm_add_TmpDir.branch.try_.finally_.self_scm_checkout_old_": {"doc_hash": "b6bdbca2c65eaaa2d342b314d0c52ba8b0a2d7518ddde5fae9aac0e4c5026b9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py__coerce_filenames_run_copy.return.run_copy": {"doc_hash": "4c93cdd8c69fd092a0f3ee203e971aad39e68100855566e40320b772b6271c0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_erepo_dir_": {"doc_hash": "e3f7293672bca97fbef6a35a409dfc23936486bff4bff179de1c582969b655c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_os_test_dont_fail_on_unpacked_create_fail.assert_unpacked_create_sp": {"doc_hash": "204a87d1ee118114eb33bb4ee06fee3a70f75c215805891952e47f01c7fb52df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_test_remove_unpacked_on_create_fail_test_create_unpacked_on_status.trees_equal_dir_unpack": {"doc_hash": "ef8f9d85b05d6ae9969a1f85f8e87b694c8b82da0d37ec66a30d93f1a6bb4120"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_test_dir_cache_changed_on_single_cache_file_modification_": {"doc_hash": "a001988b0ceb84cc001773c8b8a5fe1a787728d1f0571729da727b2a210e20b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_filecmp_from_tests_utils_import_g": {"doc_hash": "e5718ca8d6bb567bd32505f7db690ec7d3547783f0fc27e60e77cf3cb601d350"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_test_add.assert_stage_md5_ee34": {"doc_hash": "72bc0cd2c7af0475a04045133a010bb12fc12b341521fb9df3349ce464a98b0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_unicode_TestAddDirectoryRecursive.test.self_assertEqual_len_stag": {"doc_hash": "6452cadfbe3248c52c2496d46a2a4fd18227162faaa7ee10ad29300882147610"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirectoryWithForwardSlash_test_add_tracked_file.with_pytest_raises_Output.dvc_add_tracked_file_": {"doc_hash": "1a762d10a7348eb1da98c4baa91f5f245bc112593f583beccee47541da6021ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirWithExistingCache_TestAddModifiedDir.test.None_5": {"doc_hash": "6f600409204d101804ff118e3663b459fc1d2aadc8cf6781a3898b48dbf8829f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_file_in_dir_test_add_file_in_dir.assert_stage_outs_0_def_": {"doc_hash": "d40ba8cb8d1f82a1dfff8883f46a9bf1a195d6328d2146cc680996d7a5393e9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_update_state_entry_for_file_after_add_test_should_update_state_entry_for_file_after_add.None_10": {"doc_hash": "a98cee52fef9d4ede0142b62263f213eb33d903c19e89942da2bf97c92e73e05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_update_state_entry_for_directory_after_add_test_should_update_state_entry_for_directory_after_add.None_10": {"doc_hash": "69e3a6af1df351cc37dfec58fc05c13ec5a28e5b2563fce4ae1054c42556779f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCommit_test_should_collect_dir_cache_only_once.assert_get_dir_checksum_c": {"doc_hash": "d8ebc2c5fbaa2710d9c56e0992f127b8f0cfb8aca0f292747621e02c0f64f747"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_failed_add_cleanup_test_should_not_track_git_internal_files.for_fname_in_created_stag.assert_git_not_in_fnam": {"doc_hash": "e962cce96e2aa0dccb67b46f7cb48a9e18b06b007f79d4d4fb387ad54131db56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddUnprotected_TestAddUnprotected.test.None_7": {"doc_hash": "c7ebe7750f51dad9f44616bf97a5de63190a438f6c19a2f2b893728e9e85a56e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_temporary_windows_drive_temporary_windows_drive.if_tear_down_result_0_.raise_RuntimeError_Could": {"doc_hash": "029f2909933e1ec4a735bf99e2c9fb9effea39fd05db552833e5fd4b3388031f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_windows_should_add_when_cache_on_different_drive_test_windows_should_add_when_cache_on_different_drive.filecmp_cmp_file_cache": {"doc_hash": "4c3d8584099946ae95a128ba823c5b46c08b23844b43ae1942ba6e0dbb46c5cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_readding_dir_should_not_unprotect_all_test_should_not_checkout_when_adding_cached_copy.assert_copy_spy_mock_call": {"doc_hash": "7c3351de784c28a24b3dd76699922f729b43e94e5e51720cd3f7e4cead1f2881"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_relink_on_repeated_add_test_should_relink_on_repeated_add.assert_link_test_func_fo": {"doc_hash": "82f3cabfe7b18c27bc9ebee6ce5033389d2b53b944cebcd095102751ddb9d826"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_protect_on_repeated_add_test_should_protect_on_repeated_add.if_link_copy_or_lin.else_.assert_not_os_access_foo": {"doc_hash": "fd30201fb3d2e008c43458ee5f3d474fb5164afef2bc0adf7098a175b02a3e1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_escape_gitignore_entries_test_escape_gitignore_entries.assert_ignored_fname_in_g": {"doc_hash": "55a316496df3a7ced32e8ebd55b8b72aaafb4d5fc41dda033ef5ec34fae8021a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_from_data_dir_test_add_from_data_dir.assert_str_e_value_": {"doc_hash": "668f4855e4b885bdf5963c98bb632cee28c0b2f51a31708c8a42c35c34f456d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_not_raises_on_re_add_test_add_empty_files.assert_os_path_exists_sta": {"doc_hash": "edb43741f5370f8e952d09856891e1da2eb1b81d2b34bd4de7ef305046b6f885"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_optimization_for_hardlink_on_empty_files_": {"doc_hash": "874958f55cda8df27f6be021286169dad62eefc0ac6f52f7ecebe436f04167e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_mock_": {"doc_hash": "3d2a2cb4f0bd84c7102eeec1da45d313799f7fffbf6c040789f97661e03e2901"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_os_test_get_url.assert_api_get_url_foo_": {"doc_hash": "f9af5c52a7e4f828007c0837b885a33c2668b959d915e54dd30a56ba134ddc63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_external_test_get_url_external.assert_api_get_url_foo_": {"doc_hash": "85927971e875f6fa5c20bb12bb5b9d480c81a3a987b486cd5d650a39b7d6c009"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_requires_dvc_test_open.with_api_open_foo_as_f.assert_fd_read_foo_": {"doc_hash": "6e9ed69f697874047a8446dcb82bb7697fe4435accbfd1f3e23b907461b42109"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_missing_test_open_scm_controlled.with_api_open_scm_contro.assert_fd_read_file": {"doc_hash": "5250f7ab0c91704c9486557ba85fa4807d7cd5db1d3aed171a0d0b9198af1bed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_not_cached_": {"doc_hash": "e59bd016244dacdbf40e659ed0f15f78e6b9dd123fac4b5678bbb84f556a80e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLoadBadDirCache_TestCacheLoadBadDirCache.test.self__do_test_self_dvc_ca": {"doc_hash": "81f05295bbaa5b41e6606fb3036e8e10b89d12bd7b411b91496fd59564fd7a34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLinkType_TestCmdCacheDir.test_relative_path.self_assertEqual_len_file": {"doc_hash": "f4c5ad4b65a68aec32394b705156fd11d9400683ed8b5ac717a8993d2f2bb9c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_test_default_cache_type_": {"doc_hash": "df254f86f06c3da6911926f39fbdc9e78bad6e5b623d378877babd8d4b3a01e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_collections_logger.logging_getLogger_dvc_": {"doc_hash": "eaa1c73fd88a7f71e481f9ab4a39443f2c7b5e1504721204a3788899f6ec769a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_1.except_DvcException_as_ex.self_assertIsNone_exc___c": {"doc_hash": "db6e4fcc3d4877cc554403d2949a5c59f5292f16f4110840eac7f51d002dd7bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_TestCheckoutRecursiveNotDirectory.test.assert_stats_added_": {"doc_hash": "d4647448b3141d74277657364527232a25e105f5ce0dc3d0bd5b9b04d68c630a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMovedCacheDirWithSymlinks_TestCheckoutMovedCacheDirWithSymlinks.test.None_11": {"doc_hash": "588aafd2d687afee215577d1ebf36fe97b55aa6b7f2830c5fa19541ce70bb81c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_no_checksum_test_checkout_relink.assert_link_test_func_di": {"doc_hash": "04524e500781c3a8589498c7e4cec6bb7b4d386453e253221277d7be6dc2ca13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_relink_protected_test_checkout_relink_protected.if_link_copy_or_lin.else_.assert_not_os_access_foo": {"doc_hash": "52ad95b2b36e77fb24a075e1d6d125b5820976f4af1901d4f72afbe267823625"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_partial_checkout_test_stats_on_empty_checkout.None_1": {"doc_hash": "02cea888cd910f705c998a0edae20f5748adcf17cce2395f38e74f99c4a21a03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_checkout_test_stats_on_checkout.None_7": {"doc_hash": "c2c52053305a6c1013590757d08282642b23fb70898ec67b0a65658ef4e5c9ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_stats_on_failure_test_checkout_stats_on_failure.assert_exc_value_stats_": {"doc_hash": "2b57a779a16551787b92e6e4292a9d6d940d4bf1d0419bb191ec6f1b9b4ff357"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_added_file_from_tracked_dir_test_stats_on_added_file_from_tracked_dir.None_3": {"doc_hash": "a7000d3f042fb5adc10859d330f58f41dcc234b976689c254a106b2060bd086f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_updated_file_from_tracked_dir_test_stats_on_updated_file_from_tracked_dir.None_3": {"doc_hash": "7bebf7fd50e5cd8f23ea35ad5019e591bcdbd3bdf84e070b560b325a01e6063b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_removed_file_from_tracked_dir_test_stats_on_removed_file_from_tracked_dir.None_3": {"doc_hash": "0d5518ea53b5fc47262b4faaa9c1d17862fceeb089eed357f1f45d3c2d1b710f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_show_changes_does_not_show_summary_test_stats_on_show_changes_does_not_show_summary.with_caplog_at_level_logg.assert_added_not_in_cap": {"doc_hash": "0215fc0cdc0677cf453840b6d80e4f55d06ab81693e4ec37ad940a714dc11aac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_does_not_show_changes_by_default_test_checkout_with_relink_existing.assert_stats_empty_": {"doc_hash": "3de6606bead79ceee82610cf2e4dff53ee2859745640fe08e2af63c1dbcd85f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_with_deps_test_checkout_with_deps.assert_set_stats_added_": {"doc_hash": "2c3be99ba09d4edcf4025abcf697a4a04859f1c9c4f7737a88181c3151c19104"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_recursive_test_checkout_recursive.assert_set_stats_added_": {"doc_hash": "08fc473c461e71c47c888ba752a902d529b02255d9540e60813915139165b562"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_for_external_outputs_": {"doc_hash": "140b085479cbc77eb19f333559473ae402ffccf9b66395ff941484f2fe22c939"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_pytest_test_commit_recursive.None_2": {"doc_hash": "d077303b81ab5ce3010b675b71c9b0800e55f3d37e880ad6b4e66dbe2d81e80e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_force_test_commit_force.assert_dvc_status_stage_": {"doc_hash": "e1c60dfc836e278243ed2e699b7d994b8483e1b681d660f593fdcb8e0e11f599"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_with_deps_": {"doc_hash": "0d596abb9b84955c5e6fd0dd96cabe0ddd71d478684823160dbec68ff516a741"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_pytest_TestConfigCLI.test_root.None_1": {"doc_hash": "75b013c90d752a09a770f0b2c1e5e769dec0054351aa7eda32c6da28477504e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_copy_from_tests_remotes_import": {"doc_hash": "01d49c0db32d02c6fb018ebe19af686adfeec6fbd28d2d2c88bd7d5bf55b73b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGDrive_TestRemoteLOCAL._get_cloud_class.return.RemoteLOCAL": {"doc_hash": "7f15c6f17b8e84ddc3edd3941c4f6f741600ce9b8fb28b83424ab2f93459849c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteSSHMocked_TestRemoteSSHMocked._get_cloud_class.return.RemoteSSH": {"doc_hash": "998ce7399d600cbbde8a098908733ec3ac870490fb356d25f8b1ff41366b1489"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteHDFS_TestRemoteHTTP._get_cloud_class.return.RemoteHTTP": {"doc_hash": "15c061b7aa2ae1e000cbd340594d078c9baa5deef8278a6ae7696f5e0301e106"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteLOCALCLI_TestRemoteS3CLI._test.self__test_cloud_TEST_REM": {"doc_hash": "f601a74f658da33dd5ffd6ae6407059834e80ad74cea455c258ec80d50d290ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGDriveCLI_TestRemoteGDriveCLI._test.self__test_cloud_TEST_REM": {"doc_hash": "9332bf91817aa006cdf66ba4e639016459291a8b2cd57e7afafd41993e73cd51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGSCLI_TestDataCloudErrorCLI.test_error.self_main_fail_fetch_": {"doc_hash": "6e266010f543fc923d929c158d959257ec1f92260853d526ef830fe3a2910622"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations_TestRecursiveSyncOperations._clear_local_cache.remove_self_dvc_cache_loc": {"doc_hash": "763f2104ba9da0a36de63ba0a4c7cc6e3ecf7e0f1545be3615fa1589aaee61b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_checksum_recalculation_test_checksum_recalculation.assert_test_get_file_chec": {"doc_hash": "3f50f8f182df2ce91fc1186c740525baf09de60de3f066ef6cbbba42a9f54c68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test.None_8": {"doc_hash": "165df387d455f1f2612b5535f98b0df17ce8afc048843be53b2d3f19e8f033f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dependency.py_copy_": {"doc_hash": "8aacf07d2566f57ccb8c4b5601221841795b6bc71fe658159369f821a1e6dc83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_hashlib_test_added.assert_dvc_diff_": {"doc_hash": "0eab484a564edd54349bd844f42a9c686b6e3be9228e295247d110967d43fe33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_no_cache_entry_test_no_cache_entry.assert_dvc_diff_": {"doc_hash": "e391735a9a0b277272ed996e615407a64dfaf62e4700980a1685a462cb6bc380"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_deleted_test_modified.assert_dvc_diff_": {"doc_hash": "f5435901f60c79a76974fbc50bb5fbf7bf417102dd14654ee09fabd817fb2646"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_refs_test_refs.with_pytest_raises_DvcExc.dvc_diff_missing_": {"doc_hash": "cf430b796c87284d8314dc5ac78830eaaf7a441b02fa7efe1d1818a0ccc8437f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_directories_test_directories.assert_dvc_diff_modify": {"doc_hash": "5ef12025faf1d3eb31525901da388c83760199df24fbc0be8b263b1c4692116e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_os_test_external_repo.with_patch_object_Git_c.assert_mock_call_count_": {"doc_hash": "2d49f5cb6f50f8d45abb7e7cdd1d50d557dcef90b478556e7b6a338bfc70439c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_source_change_test_cache_reused.with_external_repo_url_.assert_download_spy_mock_": {"doc_hash": "3125178d0081ae0324c30b66a5396c09707b24bc9e66d38a7ca1d6d69cb9a0bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_known_sha_test_pull_subdir_file.assert_dest_read_text_": {"doc_hash": "e0756cdefd32ae2ce9165eb343ad936759e890059b057a05498bfb7bba864b13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_relative_remote_": {"doc_hash": "5602e56a506d7aefdd4e4b1b966cca6ff07d36bfcc6239d42b56c3c3378b390e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_fs.py_os_": {"doc_hash": "ba3c46554a081b97a859716a05993896fc8ead87397b9c91d354a751d4721c1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_logging_TestGC._test_gc.for_c_in_self_good_cache_.self_assertTrue_os_path_e": {"doc_hash": "c81ace94022d6f0d252e73737b1e1522aed9fb64c67deefdd5bf1fcc2360e191"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos.test_TestGCMultipleDvcRepos.test.self__check_cache_2_": {"doc_hash": "f1247b3f675bbd934e4f4b0ea3825fd290c6f765189c7314d9c29d0f753bb580"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_all_commits_test_all_commits.assert__count_files_dvc_c": {"doc_hash": "959894351f63f645f0e92865445a3764d8f8849ef3bdd04a535100566ffd403b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_no_dir_cache_test_gc_no_dir_cache.None_2": {"doc_hash": "b51bfd1c9aeb2dacc276e9ff9a15e2e61589031107da3fb13a68659e55731e6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py__count_files_test_gc_without_workspace_raises_error.None_1.dvc_gc_force_True_worksp": {"doc_hash": "65068967fcc4ecf1664b046bbda4a1b38abaa98c5115db1d3d0e3d29391aeb87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_with_or_without_specifier_test_gc_cloud_with_or_without_specifier.with_erepo_dir_chdir_.None_3": {"doc_hash": "83b894c6596745a8effea49d021d0c116df8671d401ccf2814235e807206f75e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_without_workspace_on_tags_branches_commits_test_gc_with_possible_args_positive.for_flag_in_.assert_main_gc_vf_": {"doc_hash": "978ae859f3347d67083ebcfcc74f7573bbdbe71dc3cc8764b467ced162a8e669"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_logging_test_get_git_dir.trees_equal_fspath_erepo_": {"doc_hash": "3b2cd56afce8a3d5dfef9acb3606d7cb652ef20f7d0350178ffe68b3370e2e23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_cache_type_is_properly_overridden_test_cache_type_is_properly_overridden.assert_tmp_dir_file_i": {"doc_hash": "83981f8023e67488ce95469a11590c8c82da67fc118234dac4efa0ba2c183c1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_repo_rev_test_get_a_dvc_file.with_pytest_raises_GetDVC.Repo_get_fspath_erepo_dir": {"doc_hash": "05e7370cceaa3e97f8cb8833bb97714af53dd4b2cffd60d5bcc7d581ada8db6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py__https_github_com_iter_test_get_full_dvc_path.assert_tmp_dir_ext_da": {"doc_hash": "1a248d0dfce40a1ddd91220daac6b81ccef7d458ae234845af81670e3c5c3be8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_non_cached_output_test_non_cached_output.assert_tmp_dir_dst_re": {"doc_hash": "06311506e9d43de5543e02a60a09149b04b218b67ed7c694f5c32a42720f47c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_None_1_test_unknown_path.with_pytest_raises_PathMi.Repo_get_fspath_erepo_dir": {"doc_hash": "9e45bf9dfed076c32fde2597262f0b7d394a7e0a4e36ad7b003ad48e52a3a923"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_to_dir_test_get_to_dir.None_1": {"doc_hash": "ecae3d09529bb981814cd0382ffeee98b9d10bc748401393c76139de8a2526ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_from_non_dvc_master_test_get_from_non_dvc_master.assert_tmp_dir_some_d": {"doc_hash": "e0eea038ebced1316eb28267c5a952cdd1cbf7d91aaa6777e59a952670c5d62e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_file_from_dir_test_get_file_from_dir.assert_tmp_dir_X_re": {"doc_hash": "af1e6b61c4b9eeb8e2a8c64e18f2b540f58e2b91ab2cbcf4498a1509f31abb6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_url_positive_": {"doc_hash": "0b0b3fcc0e1d193658cb252130a3f46384b8beeca91f21e69cd51dc6631e0aa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get_url.py_pytest_": {"doc_hash": "1140e79eca67fdc506fd1041723e816d4e1efa5b4a3ba0cb13568897bc4b26b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py__encoding_utf_8_test_ignore_unicode.assert__files_set_dir_": {"doc_hash": "51a3fb594ae4d909a4e333442fca82be996c7dae9c67848eda81fdd8ec9f0df7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_rename_ignored_file_test_rename_ignored_file.assert_new_mtime_mtime": {"doc_hash": "0342c015ce8428b98abff27580a174c2afd9affb35090902f0a8b36db5e6eabf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_rename_file_test_dvcignore_in_out_dir.with_pytest_raises_DvcIgn.dvc_add_dir_": {"doc_hash": "0ca3dfec9669bb04b665771f3d019d8e79188ec09498c85cc980f7238aa77630"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_collecting_dvcignores_test_ignore_collecting_dvcignores.assert_any_": {"doc_hash": "acddd460106d08550cef4deac2bda2e6a884e3b384730638c642b16424414d14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_on_branch_test_ignore_on_branch.None_1": {"doc_hash": "d3cb77e1b8bc2bc3673f7392b92ffd9e903c8faa934dc80b63550f29389bf0fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py__files_set_test_match_nested.assert_result_dvcig": {"doc_hash": "2aa4d6f6ead82d5cd4e0551fae7d5a0fa9792e3e80701245dcaf8518ec00f5a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_external_": {"doc_hash": "a7ea0cca9bbedd60ecda718c2c1cf637d1fd398f9ae200e001b2844c785ef641"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_filecmp_test_import.assert_stage_deps_0_def_": {"doc_hash": "e886fb506199c62693418ace2c44b033c825b87445250be47dedd63743db5eea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_git_file_test_import_git_file.assert_stage_deps_0_def_": {"doc_hash": "3bfb466ad71ba3f6d2dcd3cb09b1942716f1489a7498ee475a3b54084ea8a751"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_cached_file_test_import_cached_file.assert_filecmp_cmp_": {"doc_hash": "5c55e45ab6727394c23aa179935797049f9e21251fe37b9354df92911b351e2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_git_dir_test_import_git_dir.assert_stage_deps_0_def_": {"doc_hash": "7b7197fa672640c1e0c94972db50dddf1b0601a82bb1d5e3a7c838411f255604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_dir_test_import_dir.assert_stage_deps_0_def_": {"doc_hash": "23563babeefef09e5b0c508f82217fb3790a488616e746de6ed99eb8f49b8ac6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_file_from_dir_test_import_file_from_dir.assert_tmp_dir_X_dvc_": {"doc_hash": "e767fc7952be5859e91e14fae21002723f621ae018edca6d7fc2913ec05fb16b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_non_cached_test_import_non_cached.assert_stage_deps_0_def_": {"doc_hash": "576748ff75d7d20047ca7ae539252a5a010bb93d85f64193bf33d84a03a592af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_rev_test_import_rev.assert_stage_deps_0_def_": {"doc_hash": "37eef13e13f05c2e8647462965511a3c094e7f56927ebed57435a5ee5783e1c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_imported_stage_test_pull_imported_stage.assert_os_path_isfile_dst": {"doc_hash": "68640153fde7519905453f1fccfd848f430b74e033915bd7e100de54e6287a50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_cache_type_is_properly_overridden_test_cache_type_is_properly_overridden.assert_scm_repo_git_check": {"doc_hash": "445fd1adff38790d2c29c77b3ea6973e46bcc107c761d3b3baa332d4293bc995"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_imported_directory_stage_test_pull_imported_directory_stage.trees_equal_fspath_erepo_": {"doc_hash": "8298261b7586dd17909621076e8ddc4b41dca788d36ac16f47361009a0a22d28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_download_error_pulling_imported_stage_test_download_error_pulling_imported_stage.with_patch_.dvc_pull_foo_imported_d": {"doc_hash": "0163d6ee4744935e503d374bcbfd22279081abe0ebc52db039e3aa5cf0b54c38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_to_dir_test_import_to_dir.assert_tmp_dir_dst_re": {"doc_hash": "4489e4755ca7862f39b3ace510e0b5e1ced2e50084f7cf11c8a0d9d9d4215b28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_non_workspace_test_pull_non_workspace.assert_os_path_exists_sta": {"doc_hash": "a88777fd81e7606bf4f73887324de05fcfa72a27d7f2e78687f2b6b3a128b03b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_non_existing_test_pull_no_rev_lock.None_2": {"doc_hash": "0c587d4896e7a002fece65b8f588d2e030ee7e3108b3a35e1073dd69765bb894"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_from_bare_git_repo_": {"doc_hash": "cefccb5bb776ff347686816b2ecbbe5c03e609e23b156ca1378c10c8b981d38e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_os_test_should_remove_outs_before_import.assert_remove_outs_call_c": {"doc_hash": "2d5b3945bf3fe413bd2b88b5a6959490df6f4c3e4f3de4d4447f96459eb61875"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestImportFilename_TestImportFilename.test.None_8": {"doc_hash": "d3cc59dcfba2cc5712b69141eaff28430be975686f081c7402dc6af2e773b825"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_url_to_dir_test_import_url_to_dir.assert_dst_read_text_": {"doc_hash": "9d9f4b57ff6b848e7abfd7774d1e0f1f64590fc734a32f4e0d7a425c68704d09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_stage_accompanies_target_": {"doc_hash": "f3455fc6539eb2179829a10b669b4a9433123c3d41fe1769b59b5c96f173e663"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_init.py_logging_test_allow_init_dvc_subdir.assert_repo_scm_root_dir_": {"doc_hash": "612579548fbe8bf87c5e1687bc3a6eb2fa11d416103ce2b1d8deca081ee06304"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_init.py_test_subdir_init_no_option_": {"doc_hash": "f758e22bb72834a5e74eb849214facf7a52af36da2ca25816ba806c650ebe7c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_os_TestInstall.test_post_checkout.assert_os_path_isfile_fi": {"doc_hash": "1c41b339747a9fc730a2435c328f82be668a127bc16b108bcaa3da150692d040"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_pre_push_hook_": {"doc_hash": "9a032ebd2785eadac187e47c0eb6e8e75f59ca073cb2b286641df0c7a393bf9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lock.py_os_": {"doc_hash": "7dad9ecb703a35866134fbeb463212450d1d0ffc69ef737fba2daea8823f0685"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_os_match_files.assert_left_right": {"doc_hash": "5428236d34d51496c79e7c156e655a4a90356ef743f8ea9a71d12e2150322bac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_create_dvc_pipeline_create_dvc_pipeline.shutil_rmtree_out_": {"doc_hash": "1ccfd2f988e2b1cad46b1049aa3dffdce8e8af67860ea7d7cddc13b195ff318a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_test_ls_repo.match_files_": {"doc_hash": "80d3bd79c1d20cfbee75b82fe112020d984210de8af2e53472f966dea4f17fb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_color_test_ls_repo_with_color.assert_caplog_records_1_": {"doc_hash": "2a027aa549b6f272b44929584539fc71680d27e32a764aae6ea64c98b4e611ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_recursive_test_ls_repo_recursive.match_files_": {"doc_hash": "013894f85bef505e95f14a1f275209b8bc752bc2806d451c7fef3c72ccb60a7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_outs_only_recursive_test_ls_repo_outs_only_recursive.match_files_": {"doc_hash": "fb934899ab946c74dd241e246b5093249b1d4aa7c66e839aee0d4a15ff87cb2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_dir_test_ls_repo_with_path_dir_outs_only_empty.with_pytest_raises_PathMi.Repo_ls_fspath_tmp_dir_": {"doc_hash": "769c648dd33dff3b9c436dc9b72f31b4a569e7eba2f6efc627e805169a94de47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_subdir_test_ls_repo_with_path_subdir.match_files_": {"doc_hash": "e78341d121e303991dadb826013ae777b806b0a9d76bc49618d2bbc722d24f22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_subdir_outs_only_test_ls_repo_with_path_subdir_outs_only_recursive.match_files_": {"doc_hash": "8526ad47d7ec0475d3a2ffb02f2e639a7605ea49ff16c47c1545791b11189c55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_file_out_test_ls_repo_with_removed_dvc_dir.match_files_": {"doc_hash": "97d52753c4dea226f4b30a2d7203b956b60c241745a76d3b7b4bb1645a34ab8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_removed_dvc_dir_recursive_test_ls_repo_with_removed_dvc_dir_recursive.match_files_": {"doc_hash": "9ddf6435131a9131beacf57112455466067d56b4481b78f0f8bf5df0e7964988"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_removed_dvc_dir_with_path_dir_test_ls_repo_with_removed_dvc_dir_with_path_file.match_files_files_fi": {"doc_hash": "26e6d3ff2cccd3d6f87a2e14a7ed19bb73c42c003334c3e76177ee34a3011fab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_test_ls_remote_repo.match_files_": {"doc_hash": "49ec672e7dabfcee9a451413001b39acba80b4a6e3f9bb48392c9268ff74f678"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_recursive_test_ls_remote_repo_recursive.match_files_": {"doc_hash": "2920810e0eb8c702355e830fd4ea4336bb5f9efdb902a70c58cc39c6af2f0790"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_git_only_repo_recursive_test_ls_remote_repo_with_path_dir.match_files_": {"doc_hash": "c81da532c65396b50c32543ce84481f0990ec80d34a6f804d60d406cbb5082c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_with_rev_test_ls_remote_repo_with_rev.match_files_": {"doc_hash": "dfa87e7cce40a530add63bd8d094da919f53c7ffe25d5e1f207b64dfabf60ec2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_with_rev_recursive_": {"doc_hash": "d227ac042a69cf94a4cb022f6ebc6d85a94e516b186bd7f3b10180ce016631f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileInsideDirectory_TestMoveFileInsideDirectory.test.None_3": {"doc_hash": "4b732651b595ff5d1e3a16597e12cea76cc2253c428df2a8cdedcbc162285204"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_test_move_should_save_stage_info_": {"doc_hash": "b24c0426bd47c32815c84170bf25ca45122e735f8edaadb553332c7aa7453835"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_disconnected_stage_test_disconnected_stage.assert_is_tree_is_True": {"doc_hash": "fa3fe2cbb89dfce648a89cd0b57cfb74bbbd2a8e971be0df828196787ac00121"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_TestDvcRepoPipeline.locked_stage.self_assertEqual_len_pipe": {"doc_hash": "bcb53d7b22eab3836536f13346809a380f8fc37fac4dcae9e91ffdedf6847c44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_errno_TestRemote.test.None_5": {"doc_hash": "497c59376fcde6344828ec0188b907b30411658cc2dbf7cb212c191746930dc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remove_default_test_remove_default.assert_local_config_get_": {"doc_hash": "d27022d534d06a0f578a6822d01886870cd85033b81bda2b6734c916aa007b00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_show_default_TestRemoteShouldHandleUppercaseRemoteName.test.None_2": {"doc_hash": "5cf959438bfcbc41083939572462b99514190fbf8521676664504a3b1174a35b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_partial_push_n_pull_test_partial_push_n_pull.None_1.assert_download_error_inf": {"doc_hash": "a0d62ed5bc8c4eb2a1ce8432811a49c7c93b78ede5887ae9681e996305c0b4c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_raise_on_too_many_open_files_test_raise_on_too_many_open_files.with_pytest_raises_OSErro.assert_e_errno_errno_E": {"doc_hash": "08521ae671887bea86255ec0c16a4824b5c61fc4a7cac6163694061ba6761e02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_os_test_destroy.None_2.assert_not_System_is_syml": {"doc_hash": "9b03d21cfa89f0627f1bf201c5945b8a13e9bba464656c92855f9e4a3a119ec3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_test_collect.None_2": {"doc_hash": "cf5875fc0904c09c5fa872b1b9e48dd3badd5858887d0327f22cf1881e9cf3d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_stages_": {"doc_hash": "1d8c216cd49eacfc45d78b442147c0eb04346d1788e05668444ca6990ab16282"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_nested_TestReproWorkingDirectoryAsOutput.test_nested.with_patch_object_self_dv.with_self_assertRaises_St.self_dvc_reproduce_error_": {"doc_hash": "dbd4116a4be74427560bb8dc24606351482a86089511d9e42e6c18ea036ac21a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalBase_TestReproExternalBase.check_already_cached.with_self_dvc_lock_self_.with_patch_download_as_mo.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_call": {"doc_hash": "4a596d4306ba339a4261ceb6d9a65403cc2581daab285e46b64f590c4afa4c41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.None_28": {"doc_hash": "cd5a0fd90179fa0aaef354b4acc33fb2b116ca0a3fd131b3aae39da53387dc2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHTTP_TestReproExternalHTTP.test.None_2.None_9": {"doc_hash": "c48ad316449fb4e359693e4159119a7e3e5656f20ec9ab73014686b723970554"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_repro_dir_repro_dir.yield_stages": {"doc_hash": "da02c243ca715c32246c5d9bda015f00997ccc646dbe94291845e456c312b484"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__rewrite_file_test_recursive_repro_default.None_2": {"doc_hash": "eed98830489ac4a1a81d94db17cd1d7e6a7da0ce18104bff714eb92f674a7c80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_test_recursive_repro_single.assert__read_out_repro_di": {"doc_hash": "15254d1bf1d259c9fc8bfe11ef0a51d22f5005e0ae4a6817a9aaa60389bdc79f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_force_test_recursive_repro_single_force.None_3": {"doc_hash": "383ff37a1ae5cf4732cf642fdd0054b7d3397ec6d9d1ebdb2022408976e6df9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_empty_dir_test_recursive_repro_on_stage_file.assert_stages_repro_d": {"doc_hash": "e445b7e579c6df55ae4feee39aff6b2f48c346f7ffba873b4e07c88c0aaafc37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py_from_functools_import_wra_test_copy_singlepart_preserve_etag.RemoteS3__copy_s3_from_i": {"doc_hash": "06e483210e3fd9efe05bbee8b5694ce503a7695f5cc18d2b3c6593d24252ab20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_os_test_init_sub_dir.assert_scm_root_dir_fs": {"doc_hash": "4b6dc5ae82558cc73224198c4f1bd7ca7d9fea06ba61c6faa03b5a8d2979ca7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGitSubmodule_test_ignored.assert_not_scm__ignored_f": {"doc_hash": "865cb55d7bc64ef38d1726de497709791f88a098e8f5c4ad4a05e2696bdc1167"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_get_gitignore_test_get_gitignore_symlink.assert_gitignore_fspat": {"doc_hash": "7da3e4795fd98f9fbacc0af47d93cc94f434b6cff56c133ee354a1ecfe0b034f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_get_gitignore_subdir_test_get_gitignore_subdir.None_5": {"doc_hash": "4c1d43e545add345e718b4937f48da0665a63bc0f94294bd39478517e1415fcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_gitignore_should_end_with_newline_": {"doc_hash": "272bec370c21ee91e4a742a1efd804085ef71de16f370f9a2d91746e65527dbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestDefaultWorkingDirectory_TestDefaultWorkingDirectory.test_ignored_in_checksum.with_self_dvc_lock_self_.self_assertFalse_stage_ch": {"doc_hash": "6d379ecddfb088bc155f046ffd9f7a87e0763fa075d5308eec5f85da396083f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_md5_ignores_comments_test_meta_is_preserved.assert_new_data_meta_": {"doc_hash": "a63d2af44edeb6fc2f9cf8ed4f5d2a03472b004f2112b76a8afe10cf7682941c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_parent_repo_collect_stages_": {"doc_hash": "fc20d18354fc5d6d8d830157302f3241351af7c40018806c34c24cb31507c9ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_mock_test_state.with_state_.None_2": {"doc_hash": "901b94ce505db0501a744405f00dc86ab3068525ca7047c9053f265c54eecbe3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_remove_links_test_remove_links.with_dvc_state_.assert_result_0": {"doc_hash": "3fdd1d202da80fea7a5bd2ff8ca7b8d56dea69cccf1bd2a3400fb550bbfb7ae7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_unused_links_": {"doc_hash": "1b6e2e87e1299deed9607cd1650a32c767aa8a63ac804ca32b2b654262b04ff5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_os_TestStatus.test_implied_cloud.mock_status_assert_called": {"doc_hash": "5bdffab1d835a83132e917cfb60296b21b15af3fdb8904db46e235b1f19c8219"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_non_dvc_repo_import_test_status_non_dvc_repo_import.assert_status_": {"doc_hash": "fc7ddccaec2f7a51adef76b55c0cbd54c03ae0d4835176464eb4702156717ae1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_before_and_after_dvc_init_": {"doc_hash": "f606ab15bd5f855a4a460511779a60e655f9232ed40bd732b476364d8e2806d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_filecmp_TestTag.test.None_12": {"doc_hash": "521cae3931875e988f64fd724a6be886b5aead49bb734a3a67dfd91ae9d34ad7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAll_TestTagAll.test.with_self__caplog_at_leve.None_10": {"doc_hash": "5bb51b44b9db54310c5db426f83398a25aee6139cf2620bbc7ee019ab5d28a0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_GitTreeTests_GitTreeTests.test_isfile.None_4": {"doc_hash": "5ce51c94c18eb004101c91898e684db875cc2d4d468397e90fa595dba0e48f5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestGitTree_AssertWalkEqualMixin.assertWalkEqual.self_assertEqual_": {"doc_hash": "05c8dc7ea31eee08722779b43a7ff962e6e4411470131505552b03c46d732001"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInNoSCM_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_": {"doc_hash": "e1fedffd5fcd207b79f9469016e2f0438365120ac7cbe620c088889452eadb4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_pytest_test_update_import.None_4": {"doc_hash": "7a194ca236290b1be150af741c187cc1754ad2b4401bbe5d9a064666d0cff3c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_import_after_remote_updates_to_dvc_test_update_import_after_remote_updates_to_dvc.None_11": {"doc_hash": "187845fd627ea89b2635035fe79e4669c8451032b6fbab6750820b1a2aff3f15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_before_and_after_dvc_init_test_update_before_and_after_dvc_init.None_3": {"doc_hash": "7dbda4021de6f409b6c574e58f5d5198a0361c1d104e9bdf767fb225220bad4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_import_url_test_update_import_url.None_5": {"doc_hash": "cb4b366081c11c5d65681cee0f24b8a6f0f794e1251331f67df3e17769d5ca08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_rev_": {"doc_hash": "a78b8d4b5a7ba0cb989f92f19cfe86fdd3085adeb47c552a7ef6c1acda09fa19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_utils.py__encoding_utf_8_": {"doc_hash": "03e548b3e9823344fa7b0ff3b0b67a2e311d5a1fdf9c3cd5fe0f59cee03b72fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_os_test_info_in_repo.if_scm_init_.else_.assert_Repo_dvc_no_scm": {"doc_hash": "a93d5df4c134616d45308f0809c2d452bc43105442ff56755c868fa515aa4396"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_in_subdir_test_fs_info_in_repo.None_2": {"doc_hash": "300c21f21c36b3a63f0d13953cc43921bb37523a7a73b51014911bcb5d4e1ade"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_os_Local.get_url.return.Local_get_storagepath_": {"doc_hash": "f930f51b10a86fa15d8bb4c9b8525dc37e4e8dc173155142c8de1e1e835c9805"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_S3_S3.get_url.return._s3_S3_get_storagep": {"doc_hash": "0d8ea8b5d2bec293d039fc743faca425b5d90dec7d4d92edaef12da2ad5f024e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_S3Mocked_S3Mocked.put_objects.for_key_body_in_objects_.s3_put_object_": {"doc_hash": "4703610eb4fa5f50d278be01279ffca42d19812b0788614f7cd80d87c7e7e84c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_GCP_GCP.put_objects.for_key_body_in_objects_.bucket_blob_remote_path_": {"doc_hash": "f05287e20b9d5ab93d168d2fc440cafb069697020e2ce80916173e6491bee7b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_GDrive_Azure.get_url.return._azure_format_co": {"doc_hash": "9b653a93167af7e281ddf77720435f0c81e4cfc108b01dba3baa38908a25cc02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_OSS_OSS.get_url.return._oss_format_OSS_get": {"doc_hash": "e78461469ab5cc47b4a5f7415926a3a0feca6ae4fab1c09b5fffd09269637576"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_SSH_SSH.get_url.return._ssh_127_0_0_1_22_": {"doc_hash": "0066f6a9ccd7bb26f9fdd2fabd1627d347e8ba221f5e24c4f6ee0366279b9b9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_SSHMocked_SSHMocked.get_url.return.url": {"doc_hash": "79952adfbed183f55cae6b04224215cc62c47d682c984dd8710c68c8fb8d43bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_HDFS_": {"doc_hash": "5b264376288245dc84e87faceced5ae441adf588af132c994c276aa1138e9675"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/ls/test_ls.py_from_dvc_cli_import_parse_": {"doc_hash": "dbb82c6839e579a3e50340042a92f0776a5f0533dd6b5b118131aad61943a115"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/ls/test_ls_colors.py_from_dvc_command_ls_ls_co_": {"doc_hash": "922a43170c056d753c0adda9cfa6bda33f169aa5807ff7828219e10b71dc787a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_logging_test_checkout.m_assert_called_once_with": {"doc_hash": "6ba015635b31d57ea021336c3d19751da66af9b4480171ec6c0f92d052ef8af6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_test_log_changes_": {"doc_hash": "123fd22a943d8066198eea5aec914f02b7c5be910bc37f891e75e6d33beed911"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_collections_test_default.assert_": {"doc_hash": "a1197627d34a4a90f3f789a22f74257edbded88e391f59f90b21d9eeb501b910"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_hash_test_show_hash.assert_": {"doc_hash": "c524a9eed052d5796b5c95913989428ba3088cfb85ae704a5e85a7256ec78636"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_json_test_show_json.assert_modified_i": {"doc_hash": "8d901aa9dc34d4aef8a86af46aa91d7c7ba5e7f4b38aaaa8950ef61bdc22985a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_json_and_hash_": {"doc_hash": "645bf4e3079c15b3e72e345770b418275986c209a0a5d418f08a1bea796712db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_from_dvc_cli_import_parse_test_get.m_assert_called_once_with": {"doc_hash": "dd25305510a5b9502ec6797df66577d2a52182da451669b2fd6d05f3af097d8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_test_get_url_": {"doc_hash": "e6a5e969771d7eaa333eec20a8587a6a40996a7ffb9c5ab88b9c6c3c476aa2c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_logging_test_import_url.m_assert_called_once_with": {"doc_hash": "c9b6150f43dbdab13523260b9d7757299e22c15fde064f484cae195648f7f313"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_test_failed_import_url_": {"doc_hash": "58fa7c57894ed853bf25666eb01ff36eb5234d302cc1a214a8f0c27bc982ad85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_from_dvc_cli_import_parse_test_metrics_diff.m_assert_called_once_with": {"doc_hash": "b649d95c57c7b045c7a017c5daf8ec8af7aa5294cc48697c1b5078bb32501a78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_repro.py_from_dvc_cli_import_parse_": {"doc_hash": "214654acdbd35e70269a7b6534bf958d1c247578b61d5ff779ea30743cbc06c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_update.py_pytest_": {"doc_hash": "9e884fe4f9b0dddc84578e8732743bd572ace83e05e98a658dfdeb117e173429"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_os_test_str_on_external_absolute_path.assert_str_output_abs": {"doc_hash": "58b84bc52031d38fe66d1d3e756f2cd338a94ec83c38b1a31afa88b0c2b4e4f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_output.py_logging_test_checksum_schema.assert_Schema_CHECKSUM_SC": {"doc_hash": "27269e83ecd3746b7467190b3b80c94ab8cb173f358d2441d456e0b6139d2320"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_output.py_test_checksum_schema_fail_": {"doc_hash": "96da171df74902b5d793586418e1d2d0792dfbe1a9ab82495e8677495d8eb077"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_filecmp_test_remove_dir.assert_not_dpath_exists_": {"doc_hash": "2c205d7e7beddb319f2344cb79983c6184a47e3250c836a19b7c7405714ba1dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_walk_test_walk.assert_paths_expected": {"doc_hash": "fbda58f2b76f752f91da3f9c67c962f5998420f677faf29cf3ef1132d25f450a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_reflink_test_reflink.assert_not_System_is_hard": {"doc_hash": "c824f900ff18b7c1da0f7a646ee1b9269786d8c28ba0451f5c2889bd57b61c50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_symlink_": {"doc_hash": "bcc7080b038cf06985dd6579e33c1d17ea4d8e19025f21fea5c07f41b87d33cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_pool.py__": {"doc_hash": "a6151ca242f24ce8b2143f8400b8df16d0a5a3ff24a836aad18137b2977f5077"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_keyfile_test_ssh_keyfile.assert_remote_keyfile_": {"doc_hash": "fc6d541e04569406c0ba6a6dba99ab59c5139b14dd6ea4d20b64f10be3cc1d3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_gss_auth_test_ssh_gss_auth.assert_remote_gss_auth_": {"doc_hash": "f122dc0ed9a4c442192802a1ef147df7a1d1ca624a67b50d567abecba1c19638"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_hardlink_optimization_": {"doc_hash": "b15f977cdaa84f7db23aba719739565a9ffcbc848026914defe58f35fa5e89e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gdrive.py_TestRemoteGDrive_": {"doc_hash": "a59da89ac11a4a978512674a4f0d2386deb260d95ed1b52dbf4ee4e402071281"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_pytest_test_public_auth_method.assert_remote_auth_method": {"doc_hash": "9b63667e67a9419f57eced5aa2b4272dabd39d46e45f00c8e80c9ea47650eb2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_test_basic_auth_method_test_basic_auth_method.assert_isinstance_remote_": {"doc_hash": "91a6d2c3b47dede5ffc9a2bb50b1a570d60e00f1d774e7c4accdf4c3de13b5ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_test_digest_auth_method_": {"doc_hash": "acd19244042f3a34965049bf2abe0c5705bd1f4acd14ba2a6fbfee4f418981c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_os_test_status_download_optimization.assert_other_remote_cache": {"doc_hash": "9fe43e9738ba1753fcae4d364bad4251a6f2a31d570acf6c1ac10d41d65df4b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py__coding_utf_8__remote.with_request_param_remote.yield_remote": {"doc_hash": "ddc445ce2373a24013fedeb56bc335c164dc1ad06e8685a5ff54363506d4f8e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_isdir_test_isdir.for_expected_path_in_tes.assert_remote_isdir_remot": {"doc_hash": "15d177c409646da2a834e5f6c364c237c1d296c4f4dbfc11762a75e0abdc40c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_exists_test_exists.for_expected_path_in_tes.assert_remote_exists_remo": {"doc_hash": "d8ac7d1e79f72b685ee60c86fcb2e77cbe6c2d7746f602e49fbae67c23944f7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_walk_files_test_walk_files.assert_list_remote_walk_f": {"doc_hash": "4ce38d24bcd4d05c4a31aa955b6a2e18b63e5554d443a4a60cbe5852bfdc49ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_copy_preserve_etag_across_buckets_test_makedirs.assert_remote_isdir_empty": {"doc_hash": "1d150d3ca282bf812fd55c2231bc8ad7064c0f95a400b895aa76947e225fa6c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_isfile_test_isfile.for_expected_path_in_tes.assert_remote_isfile_remo": {"doc_hash": "444fa4a237966286fc47e234e6ccf0499b5b862a9e1ead306f25ce43a8ccfd3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_download_dir_": {"doc_hash": "841a283395ff92aa683c9b8849ae5657d4588e92900757fed6bb3ef95dfc3d3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_s3.py_pytest_test_init.assert_remote_path_info_": {"doc_hash": "4208ab19ab0ca10eab7f4415bd97885600efaa928939109f084908830c51ad7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_s3.py_test_grants_": {"doc_hash": "1b2e2ec504c42e745e11b133faf2951c9350a5237718f00915a9ad67e4d5b763"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_mock_": {"doc_hash": "eab86c0a8c25c4dee3e71127f154797aa14c5a91c0a920efa68288c597828e26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_os_test_find_outs_by_path.assert_outs_0_path_info_": {"doc_hash": "1fc26320c4968c0f48f31188a6501485a51203e6faa1ee153c5d2d0bf43dc224"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_used_cache_test_used_cache.with_dvc_state_.assert_": {"doc_hash": "066e21282a58b55682b55f5c286a7e57476539285c878f912ba8f31639a3f7e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_os_TestGit.test_belongs_to_scm_false.self_assertFalse_self_dvc": {"doc_hash": "0a30ae08877d84c0fa46e89e3e45c2a944a35792cffd841d169ba2bfcc954769"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_test_walk_with_submodules_": {"doc_hash": "cdefc24a64c627ec035c243ab8e9ce8e7a4800aceb27743a2db02fb314d8324b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_scm.py_from_unittest_import_Test_": {"doc_hash": "9dc04d72d859d00088ca63300999a4771bb190d9a572f451380298db0cf7375f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_pytest_test_collect_and_send_report.assert_mock_daemon_call_c": {"doc_hash": "b6a51f0a4900af4614d7ffe55bc3c3f0e6f0236620dcc0f52c413f59d1b14d13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_runtime_info_test_send.assert_not_report_file_ex": {"doc_hash": "c9210b0df900edaed158adac21162e5d0d6b9beea58b56597dc31862e1f67c5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_is_enabled_test_is_enabled.assert_result_analytic": {"doc_hash": "dd6a509fd04226c9bd91e6e32acfbd3ca578fa8a951421ac1b4dd76931f8190d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_system_info_": {"doc_hash": "9a309b7d9eb9bdf787528d26ef89c51d39b9675fa73ba997e90f3fc830531afb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_daemon.py_inspect_": {"doc_hash": "dd8af8584edce15a6f277ed2670acd7c141e151f9275db6bd255ac3ef0fd716b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_dagascii.py_from_dvc_import_dagascii_": {"doc_hash": "56ec14a7e38bdbb1f1bb64d7d9077a32b64978d2c41650ae3797b22acfc142b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_os_test_ignore_from_file_should_filter_dirs_and_files.assert_file1_file2_": {"doc_hash": "09b0c40774022fc3c955d875decca3d025c34a68d5a9c1c482067c4b5d338431"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_imports.py_subprocess_": {"doc_hash": "522592b435b57ec5c76b9475ea0c3784d4be913ce176d3999e7c7c7b79fd48bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_logging_dt.yield_2020_02_02_00_00_0": {"doc_hash": "f966f4480120fe71dd78f2ac2fe5d992099e81271a44580dfe6a22900fab642d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter_TestColorFormatter.test_exception_with_description_and_message.with_caplog_at_level_logg.assert_expected_format": {"doc_hash": "58a6a2c8221a67d7a02a5e2e948ca912edf5f93045b0c0a6be9b7888d1b0c618"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exc_info_on_other_record_types_TestColorFormatter.test_exc_info_on_other_record_types.with_caplog_at_level_logg.assert_expected_format": {"doc_hash": "5f53f1d79168995bda59b285a965066e1b906cd7b0f9fa5c80ad7ec9b6d6a41c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_tb_only_TestColorFormatter.test_tb_only.with_caplog_at_level_logg.assert_expected_format": {"doc_hash": "f694b298852d2329ead4f69ca192391b250479c97980a5efefeaa584e8b22950"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_nested_exceptions_TestColorFormatter.test_nested_exceptions.with_caplog_at_level_logg.assert_dvc_exceptions_Dv": {"doc_hash": "2728e8f1dbbc8d6e24230573953ad2f97d02f87c2f568aeeb168331f885070bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_progress_awareness_TestColorFormatter.test_progress_awareness.with_Tqdm_total_100_desc.None_1.assert_captured_out_": {"doc_hash": "ef1fa710ef89eb1462aa83be25d938876b37ecb559df9af50a48631dede3b70d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_test_handlers_": {"doc_hash": "301d3032fdd6f45b47acf0670e77d81794b5eeaa9ae0f786ed6538e72fef64ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_copy_test_https_url_info_str.assert_u_fragment_fra": {"doc_hash": "f4fc09602ba9016b38cf7a9425e9da942e8414be687b921ba1f7abb1128268b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_test_path_info_as_posix_": {"doc_hash": "34cce92f4c7f0a4dabb06101571a025ace9b2490b1eeeee976c5da840cebe3a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_os_test_rwlock.None_2.with_pytest_raises_LockEr.with_rwlock_path_cmd2_.pass": {"doc_hash": "ea34ca474aaa99bf0d687ab84401085e57eb562669e0c5cbde019cca3a641d44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_test_rwlock_reentrant_test_rwlock_reentrant.with_rwlock_path_cmd_.with__edit_rwlock_path_a.assert_lock_": {"doc_hash": "68a5e44eab7eade492d3b9b422a29c91c6701d100bad3515a2f859c00dda795c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_test_rwlock_subdirs_": {"doc_hash": "12da5c7e965491f73931862189475575ab099251977f18e75de39c117f39c967"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_test_stage_update_test_stage_update.with_pytest_raises_StageU.stage_update_": {"doc_hash": "ca5eec64195705ff9ea2cad32b6ec7182e48cd93f29f2ad5d697edfa67d197ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_test_stage_run_ignore_sigint_": {"doc_hash": "3df857c4d8771145d0dda83ddc355743dc74c8b4947c1fc0b5d5bc67d642d493"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_state.py_pytest_": {"doc_hash": "162a5880b1e0680741f96a15616cc713a6e89552217dfbec31f4b56a2b24fce6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_json_test_fetch.assert_info_version_": {"doc_hash": "0453bd616fbea40aaa68833917a58ef796910b54a5b1e0d3126b26d108608f2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_is_outdated_test_is_outdated.assert_updater__is_outdat": {"doc_hash": "14ec43f88342d55f5f08a3e5d1d43eac3af85b422f4c302071c1abb6f156f050"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_": {"doc_hash": "07aac19ea10fe288d7e9f4359b2c9af8be1e6a542dce0ba1e73512fd22e4b293"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_version.py_subprocess_": {"doc_hash": "6e40d04afad79954e2177ecd94e4f1e33e32048cbacf0a26b53e18d46c0061aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_filecmp_from_tests_basic_env_impo": {"doc_hash": "39ca494cd7c6e0be5053abd2a788ac8ce461a9336e291b84a9c89ea8fcc671a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestMtimeAndSize_TestMtimeAndSize.test.self_assertEqual_dir_size": {"doc_hash": "b9e7529fba738e1f8a3e42cf9f60f3f1491b3c789cf75e8f9b83959ad0d7f056"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink.test_should_return_false_when_base_path_is_symlink_TestContainsLink.test_path_object_and_str_are_valid_arg_types.self_assertFalse_": {"doc_hash": "32519e747092f899f2d506eb18ff8a37f6bdaccc2590be8e446fc0f09f6bd774"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_should_call_recursive_on_no_condition_matched_test_should_call_recursive_on_no_condition_matched.assert_contains_symlink_s": {"doc_hash": "8741a6a0cbc2274505ec6beeebbe6da0b46c479050135ca542670b8408c36323"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_relpath_windows_different_drives_test_get_inode.assert_get_inode_foo_": {"doc_hash": "016a0db7a92d34a330446ebbd145ec58836410b0372e27c354d350477964442e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_path_object_and_str_are_valid_types_get_mtime_and_size_test_path_object_and_str_are_valid_types_get_mtime_and_size.None_7": {"doc_hash": "09f42d0141a1e52b9855b7d12a9e94fdfa60f0bf36ab02afc191de8a065c5591"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_move_test_move.None_5": {"doc_hash": "d1efcc166aea84aa931d8ef976d54b74b0c2a1e73a0b573be4cec6b701bc525c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_remove_test_makedirs.None_1": {"doc_hash": "9448e76d1b844d63342d7fb17ec5fe2e5b01cd55381226f139dc2bc5a94e9784"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_copyfile_": {"doc_hash": "e539f42201a58f1cd01e4c4ad985176c51138b276103d0e04519bcb6c900e1c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_http.py_io_": {"doc_hash": "299ca607bf9c55e18b6d1feae418e47e1d0c02c3b0f513da92d6baff89dee8cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_re_test_to_chunks_chunk_size.assert_result_expected": {"doc_hash": "cd140e7a2738ac9b83595bf2fe4140fed0df96e99b89bf70379d164ea32154c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_to_chunks_should_raise_test_to_chunks_num_chunks.assert_result_expected": {"doc_hash": "4997e44eed1f1526e9466d26fbeffebdeba421f0a2435b22b319f24cdfe90493"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_fix_env_pyenv_test_fix_env_pyenv.assert_fix_env_env_PATH": {"doc_hash": "6f37b34170ba2de5de369eb4d477cb4273153d68e915cabad3040f49b4d0a5d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_file_md5_test_relpath.assert_relpath_path_r": {"doc_hash": "31725b3023daeeb41628f32fd4424b35b063a9c104580d87e9048e7cfc20e4fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_resolve_output_": {"doc_hash": "62020587abc59639de58754cd051736ebe078f28aa1507110a120e5694309f75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_hashlib_ContentMD5Handler.checksum_header._Content_MD5_": {"doc_hash": "99420bb64385d97c71fddd079c644e54690f6e0fd4f97b264364ddfb5123a910"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_PushRequestHandler_PushRequestHandler.do_POST.self_end_headers_": {"doc_hash": "7169eaf6f0851b7ff29bdb36a26931026ca9743c7c65070434a2030853b662e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_from_urllib_parse_import__SCHEMA_update_DependencyP": {"doc_hash": "611f86f4fdb857ec833a10c6aa76c12652e0f45c0c71fe93d6ada2202590ef26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__get__get.return.DependencyLOCAL_stage_p_": {"doc_hash": "b23df31d13d62275cb7c72bd3267634cf85ac38ffb96e4df3c286c900402eacc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_loadd_from__parse_params.return.path_params": {"doc_hash": "496d11acfc18fb30a6ab9a0ca441cf3a23eb9c946fc4f8decc5814bc8dc3534f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_loads_params_": {"doc_hash": "418a7a441818582c4fefe5e77eb2c274c315709364286907e778060b26a235d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.save_OutputBase.save.self.info.self_save_info_": {"doc_hash": "c49d9e56c5660a09f2376d1ef3a2125af043baa7a74b2c718dad8fd6eaf53510"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_object_exists_RemoteBASE._cache_object_exists.with_Tqdm_.with_ThreadPoolExecutor_m.return.ret": {"doc_hash": "ee5ca2082070c5424474e423b2f1398f3fb382561d9388ea8eaf2bac10e88997"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive_RemoteGDrive.__init__.self._gdrive_user_credentials_path._": {"doc_hash": "11b6a1055f40411b6243a8e61e80dd07f9e37b4b96aff2535f689f53ac13343b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive.list_cache_paths_": {"doc_hash": "e573f642d9cf72df658f807cd83ce210c4bb87989ff5e454ae5e32e7d98a4854"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.open_RemoteHDFS.open.try_.except_IOError_as_e_.raise": {"doc_hash": "f60501aff4874dd9884116528c7db4b9cbddd9ef9b30e4ca70e83319fd2f18d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.list_cache_paths_": {"doc_hash": "c8d0f9c3d679e12db752f84fa925c36e26cc17b35143dfb140e960aa1683c1b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL_RemoteLOCAL.move.move_from_info_to_info_": {"doc_hash": "8fade42ea6897836073e5df067c6410f32cb2f41d763b3ba7ff0b13fa7a185dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.copy_RemoteLOCAL.is_symlink.return.System_is_symlink_path_in": {"doc_hash": "1bebb44bd6f81d64ced3e8322d09ac4310b2e4a1396866aaafd73cb31c5a27d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.hardlink_RemoteLOCAL.hardlink.System_hardlink_from_info": {"doc_hash": "9a21ea07d2937e45b29283690207d5ffd9a8845c21b6d50ea038c54a0e59437f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._list_paths_RemoteS3.makedirs.self_s3_put_object_Bucket": {"doc_hash": "fd709784c39e458c6249df673ffab12ac2cc76fdde16f7227497dd0f4f42b0c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_dvc_dir_Repo._ignore.self_scm_ignore_list_flis": {"doc_hash": "a44a6199008240d822ad5a5e226cf1d411f66517e5c4851972d71e3aebb124d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py__fetch_external__fetch_external.return.downloaded_failed": {"doc_hash": "4445c1ac6565070a249de5739f2db79d34f6fd3ac2725c74d2cca44b42101068"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py__git_to_cache_": {"doc_hash": "8eae4086c95d0036abbc4a7deb23d515e6d5e7c992f3cc02ff0bda4e2faec6d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_verify_checksums_test_verify_checksums.None_4": {"doc_hash": "736b8923561f36262a124884b3a0b31382d1378ac25326ef8966112f87ededde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pull_git_imports_test_pull_git_imports.None_5": {"doc_hash": "44afc294f02b180f3060c81f1955f505ae44c4284a58aaf4544a2b15b0fb5317"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pull_external_dvc_imports_": {"doc_hash": "18742d8626024f8b8e79d782a8ac7fe8b28f2cc397a0eab01f1cd8c41ccde117"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_test_log_summary_test_log_summary._assert_output_No_ch": {"doc_hash": "9ef715ce72bc649418bd541850743e2ac4a76091ca5faa16764da03550cd6c5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_yaml_test_loads_params.assert_deps_1_info_": {"doc_hash": "9e8de5a601060ebf9206b693703aae20db549083c22f7a2d4709ab492c2035e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_test_loadd_from_": {"doc_hash": "a861946ce2d1593b1a7d2377a3b4316ab17549aed05ec6ccacc143754eaee70e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_locked_test_collect_optimization.dvc_collect_granular_stag": {"doc_hash": "df2263f6684fd2a5d841902a33b612d6a589baf3cf35b783f685e86069d17cb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_skip_graph_checks_": {"doc_hash": "5eff79285ab8b92a47d36d46a72f67c179721b879ab9a99f73c55ef7388a03b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo._fill_parts_URLInfo._fill_parts.if_isinstance_path__URLP.else_.self._spath.path": {"doc_hash": "7700288a719568f50f8affca2cb3c074ea5764db3649443d2795fcec069e82d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Tqdm.wrap_fn_Tqdm.close.super_close_": {"doc_hash": "32756704f3a986cb5eb5e0a92c6ae863396c3218ac939b024acde836404d3e6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Tqdm.format_dict_": {"doc_hash": "7f54d4ab08cb27f826f29f4bd725ddd0f373a274058c6723779f6507e2c5ab55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.__repr___RemoteBASE.get_file_checksum.raise_NotImplementedError": {"doc_hash": "a5a1c03b7b87c435e8060fd7473069d318f65b802737c1f7f92c752d16f0eaf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._calculate_checksums_RemoteBASE._calculate_checksums.return.checksums": {"doc_hash": "ed39013925314b1ac04cecbecf58e06be58ae92fe8620f6d38f3572864cd3507"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._download_dir_RemoteBASE._download_dir.with_Tqdm_.with_ThreadPoolExecutor_m.return.sum_futures_": {"doc_hash": "917b506a40672b00328afeb3ef5c1b97cb6bfa721ac6cc41c2ac8e5771dd5c5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.open_RemoteBASE.cache_checksums.for_path_in_self_list_cac.try_.except_ValueError_.logger_debug_": {"doc_hash": "c427ff52770dae0c85f833c2bbb639c27800d41fb5798f13436249a53571ff9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.all_RemoteBASE.all.return.self__cache_checksums_tra": {"doc_hash": "3da274ac8784d02bf6b284b762f6f98b4632f438743a3108d8385bb8966c42ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.gc_RemoteBASE.is_protected.return.False": {"doc_hash": "50be33a69e4077531f5db0afd79d275a99d4c50ae6f67134c58481c101901b3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checksums_with_limit_RemoteBASE._max_estimation_size.return.max_": {"doc_hash": "cebbbcf9142600ecc77503291c99f1d13b91d4e51a97e295e523cbe906799b8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._estimate_cache_size_RemoteBASE._estimate_cache_size.return.remote_size_remote_check": {"doc_hash": "b50975ab92707ced88fff681955f9054b726f30d1b222bd250acc57e55b0c7ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_checksums_traverse_RemoteBASE._cache_checksums_traverse.with_Tqdm_.with_ThreadPoolExecutor_m.yield_from_itertools_chai": {"doc_hash": "4e448c745852f2b837511d1e8375c295d08115e890170911eb53210fedc65ee8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py__gdrive_retry__gdrive_retry.return.retry_": {"doc_hash": "8f615a3bc8087cf76afdb97c7a1c41062edfa4a5d62b5265f1b96497e908009f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._validate_config_RemoteGDrive._validate_config.if_not_self__use_service_.if_bool_self__client_id_.raise_DvcException_": {"doc_hash": "94847ce544c020eeab6ea58729d3fac8d6d55f9cda23540abf157737f90b2661"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._drive_RemoteGDrive._drive.return.GoogleDrive_gauth_": {"doc_hash": "d8bf613e54de1f5afa21aa48f05ba26005c38ff4989df5cb070346699ad4bd98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._ids_cache_RemoteGDrive._ids_cache.return.cache": {"doc_hash": "5e79487b8668c2c2ecdd2dfc4ac65df93c35e6521339584a49dbc9d3bc2f10dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._cache_path_id_RemoteGDrive._gdrive_shared_drive_id.return.item_get_driveId_None_": {"doc_hash": "8ee96b9f082295b6630d554660f760fda5aba7fc3386b0bc73e123806d414b3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_upload_file_RemoteGDrive._gdrive_upload_file.return.item": {"doc_hash": "72765dc843944b68bab035b696951815c4e530380847494cea7d1cc4627b7085"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_download_file_RemoteGDrive._gdrive_download_file.with_Tqdm_.gdrive_file_GetContentFil": {"doc_hash": "4dec291bfd2ba9aa13110c3180b2ff7ba47ce7ee85a45e60c01c545ff1cf39b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_delete_file_RemoteGDrive._gdrive_delete_file.try_.except_ApiRequestError_as.raise": {"doc_hash": "603d1dfad2566dd6b202168538c9c8cb787af968eec3a2884838d08eb954144b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_list_RemoteGDrive._create_dir.return.item_id_": {"doc_hash": "5c4e975f6998cafa80fefb3a616bac7d1880f95fad5fc8a854f467ed2c9b8407"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_remote_item_ids_RemoteGDrive._get_remote_item_ids.return._": {"doc_hash": "8bcc7ebc21b0a173d0d93d17cbd1d988d3f82d331cef8a268321e7080ea29dc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_cached_item_ids_RemoteGDrive._path_to_item_ids.return._": {"doc_hash": "6f20bc946ad7528df8eb4a144a8515a7987ab5101bf3c299dcdff15d0a7ed9c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_item_id_RemoteGDrive._download.self__gdrive_download_fil": {"doc_hash": "62010f3877ce8ac8fb388859ad1a2f3ac9646f4d44e2cd0ba7a07d665ac1b4ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS_RemoteGS.exists.return.self_isfile_path_info_or": {"doc_hash": "dc6e3ab4d8f104e1788c87b06d4fbe8644242f8a44e8e7684676856a8379f81f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS._upload_": {"doc_hash": "07ec2ea792a10a6af78cf0921eeed1d4b6da4e03505f7cf375b790760cfe36ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._download_RemoteHTTP._download.with_open_to_file_wb_.with_Tqdm_wrapattr_.for_chunk_in_response_ite.fd_wrapped_write_chunk_": {"doc_hash": "1fa200acfddaaa6d9f3034d351788c06a6bfc1564c0fe4862567166c604e7cdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._upload_RemoteHTTP._upload.if_response_status_code_n.raise_HTTPError_response_": {"doc_hash": "237e352a26b1e7166018ff8873466b8eb182d94e841c4401bb118d2bc9d81fb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_dir_RemoteLOCAL.protect.try_.except_OSError_as_exc_.if_actual_mode_.raise": {"doc_hash": "0fa4555719270ea0f9a3a5f7e3ae6684dd665b49b7e7d7c69839830527d4560e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._get_unpacked_dir_path_info_RemoteLOCAL._update_unpacked_dir.try_.except_DvcException_.self_remove_unpacked_dir_": {"doc_hash": "ca3692b34ecf8662002b5c24bf9af4476efa7e318967b78848b4381c47d12ddd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.copy_RemoteS3._list_objects.for_page_in_paginator_pag.if_progress_callback_.else_.yield_from_contents": {"doc_hash": "9239bb1d466103c06c7d968f1bc02dda1fbb38129db1357e9bcbbc3af451a5da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH_RemoteSSH.exists.with_self_ssh_path_info_.return.ssh_exists_path_info_path": {"doc_hash": "c7d4d44f8e91a14f843017f19409a3b0c84822bc15b0225ce81e83ce45573652"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.get_file_checksum_RemoteSSH.symlink.with_self_ssh_from_info_.ssh_symlink_from_info_pat": {"doc_hash": "2d19872b74ef8cfab49b8162c0295d82a7914b9fccfb24094183c0120a5f1c64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteS3_setup_gdrive_cloud.remote__gdrive_create_dir": {"doc_hash": "6712c41a26764fd2109acf40ae58139d4c8a07c572f277642e0c4c5d5e0ab426"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_diff_no_cache_test_diff_no_cache.assert_first_diff_modifi": {"doc_hash": "27243824020fd77173590c6b3f947196b75f7b9c0f7ff77bc959670de817eda2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_diff_dirty_": {"doc_hash": "c0b64500e7a55190e8f82125a685e791efd21b6cbf3587379c81573fed524ed1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py_test_link_created_on_non_nested_path_test_makedirs_doesnot_try_on_top_level_paths.remote_makedirs_base_info": {"doc_hash": "a86458da30fa6d8f5e7ae5d57727dddbbc9cf9b5c8f2e4e44b9da96d0a4f54ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_cache_exists_test_cache_exists.None_2.traverse_assert_called_wi": {"doc_hash": "0d7faff2f0685820599cac7596f32401f31cc1df260ccd87470c59d1a985faf9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_cache_checksums_traverse_": {"doc_hash": "c6d63c296581db367938f9295c1528b8101272b7b3724c5c77c849fcd2835065"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_test_protect_ignore_errors_": {"doc_hash": "89267b49f4f9d3ec190b4c9443e2617d5d7e3fda1f7625599aa103e32239d4fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote.py_pytest_test_remote_without_checksum_jobs_default.assert_remote_checksum_jo": {"doc_hash": "318a927a44a1ead844bf699613228c60ce07c4553cf8e784a76cdf32ccab1e8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote.py_test_makedirs_not_create_for_top_level_path_": {"doc_hash": "9ad8058629c9f98c8068aa079fef5d876c4d68514182b79338e05f73b6370964"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py__": {"doc_hash": "3d4149844a6fc8234a85314ce7691eae7b572f4159b912e459e94e9b0742a6cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_is_enabled_send.os_remove_path_": {"doc_hash": "0622309089ae1fab12ce7111d750a4471836c0a22042e85cad3f6284dc4de847"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsShow_CmdMetricsShow.run.return.0": {"doc_hash": "f5be3c4e7cc65e182d0a84bc3087ab08cc1a5722de8cf460d514c106a6700f4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_argparse_CmdParamsDiff.run.return.0": {"doc_hash": "934ffc37a4216fea1473d72de94207ca94d86814bfbcdbb91e6ca2717c7c5f39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_add_parser_": {"doc_hash": "1d606f9f0fc12d7abc9d90c601fdc1ce185c11b57f704ffa7a9425627c7a9063"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/param.py_os_DependencyPARAMS.dumpd.return._": {"doc_hash": "53884a836b1f299602d826eef8a332770ca9d1801cce9ace888497717b9467db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/param.py_DependencyPARAMS.read_params_": {"doc_hash": "531aa31714f78b39e240706e28dcc28dda54b54bbe15f7743f7d1eda5ac00c16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_from_collections_import_d__extract.return._": {"doc_hash": "aa19dee38e28e3c90dddbdc54a40e19e58baf284f2671ef0c47d1be51c6bccf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveURLInfo_GDriveURLInfo.__init__.self._spath.re_sub_2_self": {"doc_hash": "ab856d96443a8674bea6c0a2744a55149eb43665e1c9a44e3d1ac47f66edae21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/__init__.py__": {"doc_hash": "ca14d4dc2fe9ba00a50b7fc139bf1554eef8000f07b64fe5c51fa8a8d9e4faf2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/show.py_show_": {"doc_hash": "c41f7d4da8225d812e67480a73904bfa077bdba1f4caf16726bf0b05bcf075c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_no_params_test_diff.assert_dvc_params_diff_a_": {"doc_hash": "f84f841332d3bd939197b875563804078955afd3e497f20271c53ea579afdd91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_new_test_diff_deleted_config.assert_dvc_params_diff_": {"doc_hash": "d07279c5915adaa95e265ce77f919abfb80f6bafcad93b581bc151c7425852e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_list_test_diff_list.assert_dvc_params_diff_": {"doc_hash": "cadea11c2e64e0f14e38f9b03738a30a05c88e325f4c76d5de237d17e6a7d9ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_pytest_test_show_list.assert_dvc_params_show_": {"doc_hash": "887ff01516cc75b205b68548c2522fc0400b4d714a1d6fb8b3a22c68e40bac8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_test_show_branch_": {"doc_hash": "b9bccd03b2eef614fc422c917bb8e925ad13f64b95ec50353af37dde2ba02cf9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_from_dvc_cli_import_parse_test_fetch.m_assert_called_once_with": {"doc_hash": "a37a4b877704954658601a6d2ad19bf0f967a08b7fbe14edc0bbb2cd53d1da43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_test_pull_test_pull.m_assert_called_once_with": {"doc_hash": "665de0835e2836f8e2fc5e8e2e2e60cb4ed9a726127fb82e3ee103739aa5fd9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_test_push_": {"doc_hash": "f02715813de1ef2959b6bade631254a68a2503d85856dabed8c2b22580931d8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_show_json_diff_test_metrics_diff_deleted_metric.assert__show_diff_": {"doc_hash": "338744638137d1651c65a80fcd8a7ad2fa9446e1419973d239774950e2b6561e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_logging_test_params_diff.m_assert_called_once_with": {"doc_hash": "144831710df6b4e6261ad495bc98fa0b6495975f72145e5a7b2e3af1c3d2dead"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_changed_test_params_diff_prec.assert__show_diff_": {"doc_hash": "b5a3f36c627a33b59dd82cba602381ee42320ac73b7841c08f30691946430b2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_show_json_test_params_diff_show_json.with_caplog_at_level_logg.assert_params_yaml_": {"doc_hash": "3fad233c735b5270d7092ba9e9d3c7fa355f02e1841342b6e15c35e572b7fb1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_sorted_": {"doc_hash": "8f450123847a842a8870fa15643a0a266180b89769c21b64fa97b42960ecccb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_status.py_from_dvc_cli_import_parse_": {"doc_hash": "bd3ec219ed69a1647913b1739b6e316f08529656f41b1fa97031460ee581645d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_getpass_test_url.None_1": {"doc_hash": "e6dd11ef3dcc93604f22591781703c9ba7d55aae0ce01f744e4137dd546a4fa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_no_path_if_sys_version_info_major.else_.builtin_module_name.___builtin___": {"doc_hash": "0fc7b557f42f8d20286284e0024be0fee01b8e156c5e580342190f69b3fc4ede"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_host_override_from_config_test_ssh_host_override_from_config.assert_remote_path_info_h": {"doc_hash": "25e7ff6bdb73f02fb85ccf65896632a635f032a307acbed4469362a00f9e5666"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_azure.py_from_dvc_remote_azure_imp_": {"doc_hash": "1e157bd23ada0fee9259df106884d76245fa18ca8e2a9aa47d1f9c20c247e29a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_math_test_cmd_error.with_mock_patch_object_.with_pytest_raises_Remote.REMOTE_CLS_dvc_config_r": {"doc_hash": "b6f65d78cf7eb6b0fdd9e6e08521af5018b7d7946ed4405736bc1183182d1b45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gdrive.py_pytest_USER_CREDS_MISSED_KEY_ERROR._": {"doc_hash": "738ea79ac6d54c9a7005ce4c6a864f95d877f054a9e0b540391f81622ac41bf0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gs.py_mock_": {"doc_hash": "a89ab6b54dcee2c50849640e7f2e17c10a44471d86c67110a48b3f9770a51ec4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_oss.py_from_dvc_remote_oss_impor_": {"doc_hash": "1f2932f2ae765e12930f6cfb0f8a0e18b60fe083a9c7f76913486af9117e9d32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_NamedCacheItem_NamedCacheItem.update.for_checksum_child_item_.self_children_checksum_u": {"doc_hash": "e457bd3c1bda87ab8fe140cbcaf666d1f751c9c69f419f318efb840da3c08cbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser_add_parser.fetch_parser_add_argument": {"doc_hash": "8b22ad8215d99ba320ce5178fe08fa143ecf5c6fba37b887cb40a48d8f12e4b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser.None_16_": {"doc_hash": "46d03ed0c82a37990f4e3b40fb75a075c3deae68b5a5ddace2ec848c3d6f6eb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsAdd__show_diff.return.table_Path_Metric_": {"doc_hash": "7046e695cda8ffb1954133f8a4913e0db567fc0d0afa46190ed7660c2fee7a05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_add_parser.None_12": {"doc_hash": "00cbaac34d71057ba2457f0fd9707a101529a02abd410adc6e9633704568550b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser.None_13_": {"doc_hash": "a49f7ed4cabc4cbb5c3342e0401020eb9b00163b114e38e160db5a07a146797e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_argparse_CmdPipelineShow._show.for_stage_in_stages_.if_commands_.else_.logger_info__stage_repr_s": {"doc_hash": "aa0e150231c9827f5a2391d6ebd5f6bc93f898c09e0eb5db3b3d54371246e197"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._save_paths_Config.validate.try_.except_Invalid_as_exc_.raise_ConfigError_str_exc": {"doc_hash": "e1c9c484057d7b1f8d7850fcfe31f77cd411f8cb8ffef8c84a0ed8334ce4e77d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._save_pulled_checksums_DataCloud._save_pulled_checksums.for_checksum_in_cache_sch.if_self_repo_cache_local_.self_repo_state_save_cach": {"doc_hash": "3f5a7803be5eb4c1d1eaa67648007c6f08b9c0da49055f438b57b949a629e76d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.status_": {"doc_hash": "682ee3b8b0a13882146d636b5fae9096f111cff4c9b4e1a471e645505baa48e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_os_MultiStageFileLoadError.__init__.super___init___Cannot_": {"doc_hash": "93341d5afb67b1d690e802019f13712efefe0ef58aeaadce516dca3bb7e3364a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile_Dvcfile._get_path_tag.return.match_group_path_matc": {"doc_hash": "1a29a745cb0374476a3330c3494e427a03203398f2af5ba6a840b139c45bce01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_Dvcfile.dump.for_out_in_filter_lambda_.Dvcfile_s_repo_s_path_d": {"doc_hash": "26112947bcf54e88ac605ad087c16f480e346814020a3a10ccff93524a85c93f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_lockfile_Dvcfile.dump_multistage_dvcfile.self_repo_scm_track_file_": {"doc_hash": "80ee58ee152c183dcd81d3c89df242e1139ea59ed054052a10a49b38c4a39773"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_single_stage_": {"doc_hash": "dfdd23988340a49007ba794544dc00a76e04d23ad474bd4b5ea3464c8b28cf1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_collections_resolve_paths.return.path_wdir": {"doc_hash": "36b05f1ac751c714674c16150c136cb549a12f797ef6f70862a1b36514fdbbd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader_StageLoader._fill_lock_checksums.for_key_item_in_items_.item.checksum.lock_data_get_key_ge": {"doc_hash": "bded757a69e000cfa186fd4bf07b822f34f28b1e26aea48657a228c77dc68e3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader.load_stage_StageLoader.load_stage.return.stage": {"doc_hash": "d7f0ac9409bf9c1f41909e22a425aaaa22c09596fa4a17889f0bd3593f05a173"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader.__getitem___StageLoader.__contains__.return.name_in_self_stages_data": {"doc_hash": "ced7a8e60833ea0b0f34ade21e8f177b8929adc84f2057936bb7fd1459bc6007"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_SingleStageLoader_SingleStageLoader.__getitem__.return.self_load_stage_": {"doc_hash": "7ee5112cca1d1961fddafa8a176a153870d07651badff5eab63907e2f2926258"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_SingleStageLoader.load_stage_": {"doc_hash": "5712489708d48a7fe172442b513ae12b37accefb5608d8255c399c7b9c5cec73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lockfile.py_json_": {"doc_hash": "62a450e09d84fd04961e94dd9fac38a86541319e6beaa432d04a7ad6393ae492"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_errno_index_locked.return.wrapper": {"doc_hash": "846f72a54bbbe3e1eafa501f3c9d15ad1064b729629509924a3cdba9588520c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.load_dir_cache_RemoteBASE.load_dir_cache.return.d": {"doc_hash": "e520ea9cd720d6240e1300d36bcdd865f00f2edd6c47a50fa0d61f780e23e322"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_dir_checksum_RemoteBASE.save_info.return._self_PARAM_CHECKSUM_sel": {"doc_hash": "1d3ba2e28246c59fc752cad54d4a4b02b60e8bd59e8e7c93d1877d098dcf37c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.cache_exists_RemoteBASE.cache_exists.return.list_indexed_checksums_": {"doc_hash": "91107984f1ffc39330cd8e7bdac2ebcd03bb9a46206e1cdcfd8d42d733589753"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_logging_RemoteIndexNoop.intersection.return._": {"doc_hash": "1647d22c55fa8246e4f2255c48007f762b06ca2a4935b7526b636ab77b86e37c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex_RemoteIndex._executemany.return.self_cursor_executemany_c": {"doc_hash": "1ac6c40cb974a64d64a905417dbe7971257a24cf29a8e9f6ffb8053ded77af81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex._prepare_db_RemoteIndex._prepare_db.None_1": {"doc_hash": "fb6dcca99fecc0b049a2f2d3490a60f7e1b40016f68f79a5ca0fa384b7f6aaaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.load_RemoteIndex.load.while_True_.try_.except_sqlite3_DatabaseEr.if_retries_0_.else_.raise": {"doc_hash": "f0efaf0c0b4b09065437a10931308653bfbc8fb76fe8d29bdccd4905cee34b8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.dump_RemoteIndex.update.None_1": {"doc_hash": "45f268f43549d2059fe70fe9a852b6ae1f3450b534d23540b947de1fedb0d9a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.intersection_": {"doc_hash": "648068bfec7b994cbcc4e4a24f9d2e06504f28711529bc7b37566b67e36f3b6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.is_hardlink_RemoteLOCAL.status.return.dict_dir_status_file_s": {"doc_hash": "9d5411a5db7a34dc8f36dd864b288dd35675a5be0d852b847b9857110f840586"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._status_RemoteLOCAL._status.return.self__make_status_": {"doc_hash": "c012250fe9c516969f02c3bd003f1a7a2442c556a3c38dee8cb7fcbd86194e68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._make_status_RemoteLOCAL._make_status.return.dir_status_file_status_": {"doc_hash": "05da21c11f754ad1e8f640f9a458edb28ef1a08ac1353e87f6e7e56b107c0788"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._indexed_dir_checksums_RemoteLOCAL._indexed_dir_checksums.for_dir_checksum_in_dir_e.yield_from_file_checksums": {"doc_hash": "1787627a62546dd01061bf47c47b9d312088fb56f8559fa7e382a65c143dcaee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_dir_plans_0_len_f": {"doc_hash": "f6675744563655997b98d21f83132bfd305dd5fe9be5b861fedf250a3eddda9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._dir_upload_RemoteLOCAL._dir_upload.return.func_from_info_to_info_": {"doc_hash": "7d5c668f4effa6f72a290d09e1b5f44c2829ec90c347ddd5705f710724d8463e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.push_RemoteLOCAL.pull.return.self__process_": {"doc_hash": "149f6da9086dd1e7340143f16dd67883c81e592b99976432e17f8263ca33ac3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._log_missing_caches_RemoteLOCAL._log_missing_caches.if_missing_caches_.logger_warning_msg_": {"doc_hash": "85564bc0b84a8c1c1e311dbd1f3e382ff6f1bec286002b33803bb8b6abb5437e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.check_modified_graph_Repo.check_modified_graph.if_not_getattr_self__sk.self__collect_graph_old_": {"doc_hash": "8a2d5d34ecd2c2811808047711ae39ff193cfe9292511a65a6e5821aaf53a173"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_inside_Repo.collect_for_pipelines.return._dvcfile_stages_name_": {"doc_hash": "827e78650637847bbaa6a8af0478a746f0bf2306eb50d34603d88de15be2b3f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.graph_Repo.pipeline_graph.return.self__collect_graph_self_": {"doc_hash": "deca1e1bb815459735db7baade0b7591a7cdf8c179738af6080f342ed152ae91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_stages_Repo._collect_stages.return.output_stages_pipeline_s": {"doc_hash": "71c46c9dce179d1dfcf55de4c7ea4ab68044e62a479dff0ab9fd796987a960cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp_url.py_os_": {"doc_hash": "34cb0edcac4884a28fe38b80927fbfffca02e36ebf05e9b6235671afbac0348d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/ls.py_from_dvc_path_info_import_ls.with_external_repo_url_r.return.ret_list": {"doc_hash": "fcd0c8f65030e0bcf424f50f7a112c41826f6b8bb6d52400d2e07fc047db4282"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/ls.py__ls_": {"doc_hash": "3c27449715b2524e161f776cf4a91e6e4ed677e10daea76c950fd1f94ba5cd83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/diff.py_from_dvc_utils_diff_impor_": {"doc_hash": "3bb1f4ed2efd892e323a10a3d37b80676eb0e802a2fa3dce4b6d330546541371"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/modify.py_from_dvc_dvcfile_import_D_": {"doc_hash": "7dce7c550202a4e7cba80d840892e0a91d4384e50457f7be549991208dbc85bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_yaml__collect_metrics.return.list_filter__filter_metr": {"doc_hash": "a884fa1ba79f7e8c05c557aafb603be1acbb893085c18dcff889e88ed41e221b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__extract_metrics__read_metrics.return.res": {"doc_hash": "51603469d88ba24a75454cdef53552f8f557dae2a0c1d6163a533d09c5565df8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/diff.py_from_dvc_utils_diff_impor_": {"doc_hash": "84a24a7e7a432d12b76da4e87f9c98e0c6d2899da841eadc8cb5b0fe002370dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/show.py_yaml__read_params.return.res": {"doc_hash": "ba529f48c40a31f3f804a66618a12cbc65d58f2b4fc9ca218dcf87e9abac478b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_reproduce_reproduce.return._reproduce_stages_active_": {"doc_hash": "c7ce5d8b9f4cc930894e430aad7e7e4b65962ba3cff3af3ac9590ad3f6149b61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_os__get_file_path.return._": {"doc_hash": "d00555752ba7e8fae909b356f929a8044ce611ab6b1427722f3c6977934d2846"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_run_": {"doc_hash": "f69a2fc5a7a209878e67beaeb7df482e7540d23aa1f8cc8acb22496230e4319f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_os_DvcTree.open.return.open_out_cache_path_mode": {"doc_hash": "a7571d573c3efbac844d0f348e67f5580edb934eccead6fe326a1e472029ec52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.exists_DvcTree.isfile.return.not_self_isdir_path_": {"doc_hash": "e09b45dc182dc083fe3347e33746b6c332191fdaf44dfdf08d0984c318f7cd18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree._walk_DvcTree._walk.if_topdown_.else_.assert_False": {"doc_hash": "1462d741bc6da094215c25656db0a95679a7e1b9232c53e49aa12cd8963f7591"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.walk_": {"doc_hash": "68b8f436949d10d9e6f89be8fad14e2a7c8bc74ccb68650f6df277111f84c273"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/schema.py_from_dvc_stage_params_imp_": {"doc_hash": "a13f665855daff685b23876584faf5811417946e9a72f063ef51d366928abcf8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py__Manages_source_control_NoSCMError.__init__.super___init___msg_": {"doc_hash": "e5c22137d86078992816b08c266e8ccf8a2c2e7e5cd1cfb49eca8fcf45896ec4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_TqdmGit_TqdmGit.code2desc.return.ops_get_op_code_OP_OP_M": {"doc_hash": "a923344a55140d8667d513344cad6e7bc23e9c68c7a1ea0d6ca55834b5f5dc2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_from_collections_import_O__get_outs.return.outs_bucket": {"doc_hash": "cf2ec08fb04718cb06d5da1e29bced966950d293a4f091af480d6b3680f15a9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_dvcfile_to_dvcfile.return._": {"doc_hash": "5c21d4bd890b1c13aa7cd3403fb2423b4e1570319c5d63830497d473afc66239"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_lockfile_to_lockfile.return.OrderedDict_": {"doc_hash": "d0635303227af9607a25e6446f6d28e3099dfc8043eea6125814da38c3f403db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_single_stage_file_": {"doc_hash": "887916842283ec291cf8c0ae90b84fc26386427526d0433dfdb36d290bd0be29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_pathlib_loads_from.return.cls_kw_": {"doc_hash": "02069e42a789fb7999686f5efe82f6c0872170220bdb471c44cb95a214f4026b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_create_stage_create_stage.return.stage": {"doc_hash": "b708047a5005c6b58d7504761ef41b7be691857a80ae575b02e99af3fc60715b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage_Stage.is_repo_import.return.isinstance_self_deps_0_": {"doc_hash": "7d1cba2edfc0844100e0fe3d4240cc7c4ccd675d5bb67303a274aae6756b367a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._changed_deps_Stage._changed_deps.return.False": {"doc_hash": "deffed3c098b012e69a704cc4fff7918da9a133f183e85a4f80fe7ad8fd31c34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._changed_outs_Stage.remove.os_unlink_self_path_": {"doc_hash": "7aa0581ecf1972486bda0e9fabf7c188497b80a9cc14c0a0f816f19c3275cd87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.reproduce_Stage.update.try_.finally_.self.locked.locked": {"doc_hash": "70d62d7b7c6fce08a8796c34bda81a5dde185cc4a15015d8f291c08545750071"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._check_stage_path_Stage.reload.return.self_dvcfile_stage": {"doc_hash": "21336ed161e21e21c65df35c595918b604786a461438de1f7c6fb6e52798c690"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.is_cached_Stage.is_cached.return.True": {"doc_hash": "67330998b644ddfc071ae8c97d60de9eb1f83f5d6c1708508dfe1fe989440e11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._fill_stage_outputs_Stage.resolve_wdir.return._": {"doc_hash": "68b982fc21991f8f53fbf48645bf8943bd55d004236f5fd5faf46a4922890057"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.dumpd_Stage.dumpd.return._": {"doc_hash": "f500582cc3378c4893c7e226a4d755e312d1ecd35a1564eee5c23a32a491a6ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._compute_md5_Stage._compute_md5.return.m": {"doc_hash": "840b84e4245874672aac35b1c356b836f6fbaa0278f94e6783a2addb18a7a0f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.save_Stage.check_can_commit.if_changed_deps_or_change.self_save_": {"doc_hash": "9630c1663d4780f17984cefb8f8336c6e84e70d6ee10a18cee498bff7b38ca54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.commit_Stage._warn_if_fish.logger_warning_": {"doc_hash": "9d01c113a13dad6cb0028e71b7802765e514b23080c86c76e9801fc18bb1a134"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._check_circular_dependency_Stage._check_duplicated_arguments.for_path_occurrence_in_p.if_occurrence_1_.raise_ArgumentDuplication": {"doc_hash": "d55b8f3d301d94e93a2fb54fa492d5cb6370e7db8daefc5767d2896681598a62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._run_Stage._run.if_p_is_None_or_p_retu.raise_StageCmdFailedError": {"doc_hash": "3accfbb7f5c8adeb876ccc533e13ce6ea928081a0fa5a082b6b0278e9ee9f601"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.run_Stage.run.if_not_dry_.if_not_no_commit_.self_commit_": {"doc_hash": "690cfee8b8b793766edafdeeaeab47101498b3361dc33439929934efe50300b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.check_missing_outputs_Stage.checkout.return.checkouts": {"doc_hash": "4ed73ad466c0bd8f90b96f0822a9d7b2ecfe4c9886888751921fdd2167e9ccfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._status_Stage.status.return._": {"doc_hash": "e9e0931c58e861b86cd277b9ab20a124cf9daf2aa5b82752fb0c916375146239"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._already_cached_Stage.get_used_cache.return.cache": {"doc_hash": "9aacaa3d89bd0b335b0b3a4a38e0d75340088eaf300768b2698c2e5d0d334728"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_PipelineStage_": {"doc_hash": "79b5350054450db15ab9ebcf9085b37b76e3b2c7e388a1d5aca6d8972bd9f950"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/decorators.py_from_funcy_import_decorat_": {"doc_hash": "8824a4a9450f06fe9c06750b8ba17af2057c862ed65ac2304bfa834ea0c9e785"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/exceptions.py_from_dvc_exceptions_impor_": {"doc_hash": "b43912259f1a3d79277404b916422c8590ec72fc99ce58fc199b8d53c5e915d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/params.py_from_enum_import_Enum_": {"doc_hash": "875dba2cfa0b4893b7132bdccf63e8a7c25a3be90dcd0b000b5c6b8bf2087ca9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__visual_width_resolve_output.return.out": {"doc_hash": "c72f01728e228ddf086e4d72f6fc2ad3b4d08c476d986ff107ca3ddeb38fbe73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_resolve_paths_resolve_paths.return._path_wdir_out_": {"doc_hash": "27b4b87f11b032720178f57d095eaef136ecb03ed0f39d862ff987343d2a06e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_format_link_": {"doc_hash": "30843f720bb38c651edd6a86dd339afbf49bf180ba528093a0eddbfd15e5783f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/diff.py_json__diff_vals.return.res": {"doc_hash": "65b008588f0f41ed990351fea33270ffad506ae2a69de512e887c6a899e0037f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/diff.py__flatten_": {"doc_hash": "8e21e56d82da62b77b561fdc4da1567a8e7c6f426682bd03d85ab5e07f08cacf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_sys_get_inode.return.inode": {"doc_hash": "96f7d842395a3b56493a1faf7847d33e452eebe4b76709a31ee14098dfe8d422"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_json_test_metrics_diff_simple.assert_dvc_metrics_diff_a": {"doc_hash": "61d55447fb5fc371bb1c383a461afefa3649d54eb8bc044712db62a99866c287"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_yaml_test_metrics_diff_yaml.assert_dvc_metrics_diff_a": {"doc_hash": "ba3287333a472cbd34a9491086ea5b104d9d299b2fddb2deed5ee468e070e9cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_json_test_metrics_diff_json.assert_dvc_metrics_diff_a": {"doc_hash": "cc19cd51f60e88ea2be62d57d76179f4683a2b4911843dc8c39eb54d1da77327"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_json_unchanged_test_metrics_diff_json_unchanged.assert_dvc_metrics_diff_a": {"doc_hash": "a1460b3b12287c296f77c62c4fa4361241bf3627d34a8e470bd71d25f3ba5a9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_broken_json_test_metrics_diff_broken_json.assert_dvc_metrics_diff_": {"doc_hash": "ce7fe159344328fdd399c46126d053d4a8187991bac922caaa743492f3da912a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_no_metrics_test_metrics_diff_new_metric.assert_dvc_metrics_diff_": {"doc_hash": "71d9ff6d4cf7fab2681ffe4c646aac46f16d983464975ee788caf0c3f03c6e1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_deleted_metric_test_metrics_diff_deleted_metric.assert_dvc_metrics_diff_": {"doc_hash": "a5be50cae800f5573e2cb37f06caba37ce90d37a103d007668ca6efa85532d05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_with_unchanged_": {"doc_hash": "f98986d30c9c5802cec2e071a11a3e622a069ea11266fd6869d52ea03fed5e06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_pytest_test_show_invalid_metric.with_pytest_raises_NoMetr.dvc_metrics_show_": {"doc_hash": "1a88dddea9cb732f19326002d97ccff8b713fabc8d81b2ad296bed0a1b4fe127"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_test_show_branch_": {"doc_hash": "c9b710da384002e2ee03f6f90b11b89026982e5ccbf86e2f079a4ccea2a2f66d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_dict_test_diff_dict.assert_dvc_params_diff_": {"doc_hash": "d02415727819ef85210dbd210ac80e7627782429b1aa1cda028d52489e76a40c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_with_unchanged_": {"doc_hash": "23ec6c2305d5025b3ed417f3566e10416fc08d423141fc138eafc3700e4e2100"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_pytest_remote.return.dvc_cloud_get_remote_ups": {"doc_hash": "bd07650ebe278d1108198607e6b7538f8c3f86ce112aaea38f9c37417b44cc3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_on_status_test_indexed_on_status.None_1.assert_foo_checksum_not_i": {"doc_hash": "6f20cfb0786013391e1278996143a1a016b3b0a72cab873bfbb4338dcc11540e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_on_push_test_indexed_on_push.with_remote_index_.assert_foo_checksum_not_i": {"doc_hash": "826918ac6ebc0387256def4c2d9e8accf6979a6d09a544bdebdd126e28a6be81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_dir_missing_test_clear_on_download_err.mocked_clear_assert_calle": {"doc_hash": "4782107e65cb8d301303bd57b5440b7c9af5421c879b4be9718064a40d716a0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_partial_upload_": {"doc_hash": "6330ac77c92f12e7b914f0c24b7b5b3c9f80c0ba39111abea4ad26744c66be08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI.test_test_set_invalid_key.with_pytest_raises_Config.with_dvc_config_edit_as.conf_core_invalid_key": {"doc_hash": "4de6dc02b5ecfe69b6a0b5c41097df15636eb39e59b60b5afc4a621e40b2f680"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_test_merging_two_levels_": {"doc_hash": "b132433f768bfef04936e8084b1422febfaceec5dcc9b6bc575dae5e8baa2c09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_pytest_test_run_load_one_for_multistage.assert_dvc_reproduce_co": {"doc_hash": "cc102a73068e4d49faee3b1209975d0473333e4595df4dd6a23cc716d4fd3037"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_run_load_one_for_multistage_non_existing_test_run_load_one_on_single_stage.None_1": {"doc_hash": "d9336ccc9585da64831aad25074378348f9c432cf4ce04ab9e72661e793124d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_has_stage_with_name_test_has_stage_with_name.assert_copy_not_in_dvcf": {"doc_hash": "edf36d10cde98c2b1e1e17f1f213ba8e3df4861b8ec1be2338369e5d6ac3ba13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_load_all_multistage_test_load_all_multistage.assert_set_Dvcfile_dvc_": {"doc_hash": "a2d629b9cdbeefb05f37f1c53fb6eda9d32bafa30ed6a0e147e759c1152c0ef3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_load_all_singlestage_test_load_multistage.with_pytest_raises_MultiS.Dvcfile_dvc_Dvcfile_s": {"doc_hash": "c9a0dc0c595db92821b48546c04853e5e5950f13f427029c524ed80b4b23d7e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_is_multistage_test_is_multistage.assert_not_Dvcfile_dvc_s": {"doc_hash": "2ad76fee00f888e94bcdffb630080891878a0230d5dfecaf9483098cb112af3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_stage_collection_": {"doc_hash": "509eb6a9c4705c335c092c9a2e9aad7d22bd6a79aebfeb7022f8014076c294cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_positive_test_gc_cloud_positive.for_flag_in_cw_ca_.assert_main_gc_vf_": {"doc_hash": "e5c37b395f1affead2f12c9e7b973870d024732f9b5a1efe5a5c9ead84b7cd08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_remove_order_": {"doc_hash": "295ffb0d8274b6a796c5dc06f33f0959549f6d160061ff003e5d0e1a8d18ddd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_split_pipeline_test_split_pipeline.assert_set_edges_": {"doc_hash": "f37bc94eb4a160234fe2540f0dc324824a254c1a933a3be6a835a6c88c286503"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_pipeline_list_show_multistage_test_pipeline_list_show_multistage.None_2.assert_1_pipelines_in_to": {"doc_hash": "c0495e9d0e8b487e1a7d08106deef3b3c2b7b9188ca1ecc9e77c0735dfa55ba0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_pipeline_ascii_multistage_": {"doc_hash": "b5ec207c1dfdaa3c75860eaed5fc371227592b1792a5daef5dbad6d3208c1acc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_modify_missing_remote_test_external_dir_resource_on_no_cache.with_pytest_raises_Remote.dvc_run_deps_fspath_exte": {"doc_hash": "73f1146cd68e6c91c5c301365c25a1fd9fbef000a1289d0e39e4a803c0f4f1b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_push_order_test_push_order.assert_mocked_upload_call": {"doc_hash": "65e959cf158c9db193631ec0408adb3800975b7c394fa737c0cb63ac518f1168"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_modify_validation_": {"doc_hash": "e7a06d2331ac63cdd78e415a9994eb9dcbaabbd756bd194469d9db7577559b7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_filecmp_SingleStageRun._get_stage_target.return.stage_path": {"doc_hash": "d8334ee819cbf5aff78ddd4af0003e704fb4101515a89695aa4f717c548fff79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__TODO_Test_for_multis_TestReproDepUnderDir.test.None_6": {"doc_hash": "62d36c2a06ad4745c8a1286f0ab2239ec0ab77efabefa8f4f4cccc1e9fade9a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPipeline_TestReproPipelines.test_cli.self_assertEqual_ret_0_": {"doc_hash": "d11065dea36533e18a62608b3f1df49a642180063aa7e8ef25f5d992fd21787c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDir_TestReproChangedDir.test.None_4": {"doc_hash": "b7ab6af23b517f329ba4c355df665b136291ca9788e3611b026582be174af268"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAllPipelines_TestReproAllPipelines.test.with_patch_object_.self_assertEqual_mock_rep": {"doc_hash": "9685baf1e899ada282dc226ee6076fe57327aac48259b43e9fcb22603bdb932a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproNoCommit_TestReproAlreadyCached.test.self_assertNotEqual_run_o": {"doc_hash": "61b50158f0bc95020ab1b315495863179cabde65d3459364aa3d5b5cb7137c2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached.test_force_with_dependencies_TestReproAlreadyCached.test_force_with_dependencies.self_assertNotEqual_run_o": {"doc_hash": "f2fcc9686c4ceac30db9841f845c15c881637f75a4888dceeeddcf4dfb8d8489"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_os_TestReproChangedDirDataMultiStage.pass": {"doc_hash": "d5661eb8074900df7c21162d8e6e43e9cc3b7bcd250086149ea6e97441691f75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_non_existing_stage_name_test_downstream.None_10": {"doc_hash": "1362cec6803feccf023debdbf03ea43951712ed05b3a5106a074d97e068add21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_cmd_changes_test_repro_when_cmd_changes.assert_dvc_reproduce_targ": {"doc_hash": "39a611861cd0c59907b387cf5848dd6915059752cdc08ea5e4363c38aca7400e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_is_added_in_dvcfile_test_repro_when_new_deps_is_added_in_dvcfile.assert_dvc_reproduce_targ": {"doc_hash": "7572fb8463f78cdbf9b6a78923a000cdb1e92990ee344f86f071dc5945d29106"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_outs_is_added_in_dvcfile_test_repro_when_new_outs_is_added_in_dvcfile.assert_dvc_reproduce_targ": {"doc_hash": "2e807b8a9293849321b4d84546f7c12a9152ada33dc4e20297bd7a7e20bc246f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_is_moved_test_repro_when_new_deps_is_moved.assert_dvc_reproduce_targ": {"doc_hash": "cefb3fb72b39eeabdb7be090e4b292d0eb7c862c036c9fee652d1b787d4487eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_out_overlaps_others_stage_outs_test_repro_when_new_out_overlaps_others_stage_outs.with_pytest_raises_Overla.dvc_reproduce_run_copy_": {"doc_hash": "7c6dc3c0db063b7e98bdaec8354c0d23c83bb2368456aa15bc2e43a95875de6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_added_does_not_exist_test_repro_when_new_deps_added_does_not_exist.with_pytest_raises_Reprod.dvc_reproduce_run_copy_": {"doc_hash": "ba53a2335d372d19e9e50db90c3868998132335bc471e3f388ec7bb09b6fc418"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_outs_added_does_not_exist_test_repro_when_new_outs_added_does_not_exist.with_pytest_raises_Reprod.dvc_reproduce_run_copy_": {"doc_hash": "c03506c8daac9010810cf1ca476bb6574b9e91c2445f2a42d11b1e141f775fa6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_lockfile_gets_deleted_test_repro_when_lockfile_gets_deleted.None_5": {"doc_hash": "9d64b5772d9afc77485d0276a79cb9135116dd8a95993608f1fb33380c784552"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_cyclic_graph_error_": {"doc_hash": "772f137e0a625dc20b9eccbf84bec61ee8045cf7f2f94736fa28bfb9da3b58cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_pytest_test_run_with_name.assert_os_path_exists_fo": {"doc_hash": "d88fe84d2c2c3c29cf81706355ae4c6e370ad05eb661fc25500616c1a6227cdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_with_multistage_and_single_stage_test_run_with_multistage_and_single_stage.assert_stage2_name_co": {"doc_hash": "33f14e940ccae411789de13a578f9a57dd808c57eea2772200bbd1c0c5628de8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_multi_stage_repeat_test_run_multi_stage_repeat.assert_all_": {"doc_hash": "8ddde79e5f1ad9841820cba84a51ab6902eaa5f763bab80ad2bc09024f663bc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multi_stage_try_writing_on_single_stage_file_test_multi_stage_try_writing_on_single_stage_file.with_pytest_raises_MultiS.run_copy_foo2_foo3_": {"doc_hash": "7fc1998e66e606315860c7d50b3b82a851b27ae94d9a624c87b9e427d493a835"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multi_stage_run_cached_test_multistage_dump_on_non_cached_outputs.assert_not_os_path_exists": {"doc_hash": "d46ff37499cf90a56a177ca4ed2042e0cd25d38b7bd5f1f0b53fbcb6b7d1dbd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multistage_with_wdir_test_multistage_with_wdir.assert_dir_data_sta": {"doc_hash": "b4940a4183b3832e2aca4b415bcf6094f8dc48bd51f25cac25463d1f1832a420"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multistage_always_changed_test_multistage_always_changed.assert_data_stages_co": {"doc_hash": "b5a0feff672d17dc67b6fcdf64ddc507a81d1db94bc61ad2e0139efb331bb901"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_graph_test_graph.with_pytest_raises_Cyclic.dvc_run_deps_baz_out": {"doc_hash": "d5938df296feef07cc9023e7ebab8b72d6387ac993b4058d1ed0d07d7da85f23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_dump_on_multistage_": {"doc_hash": "a0c2121d4c03fa9b810e6c84db017037426da78524fbe2c59ce4d599ce619cc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_filecmp_from_tests_basic_env_impo": {"doc_hash": "250456e5e57ead029a96b4785329ae0b52832ef6d1f237b64f61535e8e3b1d1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRun_TestRun.test.with_self_assertRaises_Ou.self_dvc_run_": {"doc_hash": "87297eb4e42f16fea80dcb9658689055455cd5c1e0bc850f9a9a258aa6d82890"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunEmpty_TestRunNoExec.test.self_assertFalse_os_path_": {"doc_hash": "746ffa9fda0f34d87832e74cf7d014d5226d3a3b2cdd409f943442f42396ca1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunCircularDependency_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_": {"doc_hash": "31123e54bdcbd8587f13c8be27322d71a76f045d57a040a1bededa16543683e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunDuplicatedArguments_TestRunDuplicatedArguments.test_non_normalized_paths.with_self_assertRaises_Ar.self_dvc_run_": {"doc_hash": "e56056f11f70679bc54b68152437ccfcaf73f602c253aff899ba54f89c7bb061"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunStageInsideOutput_TestRunBadCwd.test_same_prefix.with_self_assertRaises_St.self_dvc_run_cmd_wdir": {"doc_hash": "9a32e1faa35121e92fc10ff6bedf093779d91153201f3040c2727b560c2221fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.with_self_assertRaises_St.self_dvc_run_cmd_wdir": {"doc_hash": "463d0a4d9e05621faae794610cdd9275d93ae3f0826d3ba46160ed53c36e2159"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunBadName_TestRunBadName.test_not_found.with_self_assertRaises_St.self_dvc_run_": {"doc_hash": "54a920ac8505dd0ba28be64c2bbefaf0172080ce90c78d85164b4df945f14342"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunRemoveOuts_TestRunRemoveOuts.test.self_dvc_run_": {"doc_hash": "2e397f4c7dd6bbacae731a0352b0a531bb2d8d3fe0ea9e634499060883fb7813"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_2.self_assertEqual_fd_read_": {"doc_hash": "2336d88b324f725e41dd31a4660ff91983b38e774c28159dfaf958feb36eb53a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_4.self_assertEqual_fd_read_": {"doc_hash": "8222ed409368309f878869473e4763ea0aa68c2f00dbbfc24c672f6fd41bcf6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_2.self_assertEqual_fd_read_": {"doc_hash": "fa201de3b1bcd2e484352082b069728ac3bfdf4ba2543e74b2d40f9e9397f8bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunOverwrite_TestCmdRunOverwrite.test.None_9": {"doc_hash": "b1bc8a88c066f05b24d76ced75a11f63467dd669a353d0f049062438b5c854b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.with_open_metrics_txt_.self_assertEqual_fd_read_": {"doc_hash": "fd7627243382815394b069bfd1897c4ff1778e345b821654c90e383b3daea958"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunWorkingDirectory_TestCmdRunWorkingDirectory.test_default_wdir_is_not_written.None_1": {"doc_hash": "2ac642b8aa517c1805c7b58969a37f4963a7364e09dcd921881f4ce052aed9e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir.self_assertEqual_d_Stage_": {"doc_hash": "fa4d22d4e892e3163f124d91650bdc3b9b00bd941d4d85965b424bf00d69c2bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_test_rerun_deterministic_test_rerun_changed_out.with_pytest_raises_StageF.run_copy_foo_out_ov": {"doc_hash": "9082f9eb891b18b25b16502489369ee4c48d3aaaae43420908e51439c6ed5c4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunCommit_TestRunCommit.test.self_assertEqual_len_os_l": {"doc_hash": "ccadfb9339811187cc303b1f97a23d69dc4916883d02b89b5fc22fc58bc4abc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunPersist_TestRunPersist.should_remove_persistent_outs.self_assertFalse_os_path_": {"doc_hash": "b1a7439b7fb6f6ceca2ede2e425373aa2b10355e58e27c6a416e870a98050612"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunPersistOuts_TestShouldRaiseOnOverlappingOutputPaths.test.None_4": {"doc_hash": "912831723d79d7b337fac0bc479c4300d20b66e789a432cd30fbd792b925462c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRerunWithSameOutputs_TestRerunWithSameOutputs._run_twice_with_same_outputs.None_2": {"doc_hash": "71546c37fd30c08a36a24b80b102098b4275ed76a68befc003c1563fb28e28c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestNewRunShouldRemoveOutsOnNoPersist_TestNewRunShouldNotRemoveOutsOnPersist._outs_command.return._outs_persist_": {"doc_hash": "a3d54eb0e3d314f41fe1fffe39bbc73cbdce9f4aab891771699f8e11b2ff74e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.test.with_self_dvc_lock_self_.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_not_": {"doc_hash": "e5a6257ad68b2adbec5a518a289c089343e28d3dd36c0fd0c63f7f99909867e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestPersistentOutput_TestPersistentOutput.test_ignore_build_cache.with_open_greetings_r.assert_hello_nhello_n_": {"doc_hash": "0581c8c3832cfd0eda54b58c3846b9e6c3ec0b134842cf79c13c4bb86f56db5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_test_bad_stage_fname_": {"doc_hash": "6d154d9b8fd5b99f51570fd730f6b5b78b3501638ec8e13ad814e8a380b876bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_os_test_empty_list.None_1": {"doc_hash": "1649fbd14f08cbe799edc36d7cde71286901a8a9f17b296da0bd878558b79731"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_list_test_list.None_1": {"doc_hash": "3023a7d23af627e585a717e330e5389c8d0735700d41ed8f03755bddf015656e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_show_test_metrics_diff_prec.assert__show_diff_": {"doc_hash": "bf59acad343589ddd3e75a69a3fc7a694d8c632fc85bc2369d4d86309b2b202b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_diff_sorted_": {"doc_hash": "bb4372ee41399de240736c6ac0531a7d86a06f39b978f18ddfb77f9b34fdb868"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_index.py_os_": {"doc_hash": "d0a664db83d2e207eda848ffc2d819c6c8c247c5176cabc6fa805d6aa82a4271"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_test_is_protected_test_is_protected.if_os_name_nt_and_li.else_.assert_remote_is_protecte": {"doc_hash": "97c68f4b98d49aedca94195a8fc59535610c7a6ed64abe06e950df4da557d604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_reproduce.py_mock_test_get_active_graph.assert_not_active_graph_e": {"doc_hash": "efe2226edcc4175deead66da3dcb137de654a5b67e812bd70af2a9963b448237"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_reproduce.py_test_number_reproduces_": {"doc_hash": "35dc960e57e5c36dcf01395aff172a411f3d1a5aad89ae31d179ac5738f28a82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_os_test_open.with_tree_open_foo_r_.assert_fobj_read_fo": {"doc_hash": "cb46ef19bd1fcbb829ad3ed2d5d0593a6cf2e25bd82674ae3a32bf11f7a2dfc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_open_in_history_test_open_in_history.for_rev_in_dvc_brancher_r.with_tree_open_foo_r_.assert_fobj_read_fo": {"doc_hash": "caaffe01af864377054db18bbe15bb01fe94225781ab91a9cc1f47461bfa95fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_isdir_isfile_test_isdir_mixed.assert_not_tree_isfile_d": {"doc_hash": "1af68819a16895a5e4b206c08fe1768143c5931b35864fbd098009468cbbee33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_walk_": {"doc_hash": "1afaf3515bc8fc8e2ceeb0d53f679530bc348966d7270e48fd50601dd10afb1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_from_dvc_stage_import_Pip_test_stage_dump_no_outs_deps.assert_lockfile_load_dvc_": {"doc_hash": "7648a1c77fef81155d5c2c49e91779e5e68f62d20927f3da529b4cf311881700"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_dump_when_already_exists_test_stage_dump_when_already_exists.assert_lockfile_load_dvc_": {"doc_hash": "48a7b7ad36602ef4fd99e22249632cae14c3b8d107812e3143140638b66329ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_dump_with_deps_and_outs_test_stage_dump_with_deps_and_outs.assert_lockfile_load_dvc_": {"doc_hash": "8976aa92d69cd3e5e438b99e1cbf0626e3717fe7cca49676656b0c629c7945e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_overwrites_if_already_exists_test_load_when_lockfile_does_not_exist.assert_lockfile_loa": {"doc_hash": "109ff0f5631f5878e7837c0d886a580adfb8ce4a0575c28e392cc34ee16cbfce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_load_when_lockfile_is_corrupted_": {"doc_hash": "398954372dfdd2d4dd38cf8bc69fe763ceac975193192cbc56ced7300f0d1718"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_signal_TestPathConversion.test.self_assertEqual_stage_du": {"doc_hash": "53539043f725b5e7089fde160cfeb066a3cefc226a04b26069c449948af8e3bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config._to_relpath.return.PathInfo_path_as_posix_": {"doc_hash": "56ff2bccd4c5019e81f1060491d8683411171ca3c3ad8c7f6ff7d7c923203b49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_relative_path_TestRemote.test_relative_path.self_assertEqual_": {"doc_hash": "32341f74f51f7232d8527bb9f2373c9c7a9e64654dbf86f8e4647fe9f77dbd4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_config.py__": {"doc_hash": "3040d71dcd253abd55f628215ec75a066594daa72262b2bea81c391c6238acf3"}}, "docstore/data": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__main__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__main__.py__", "embedding": null, "metadata": {"file_path": "dvc/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 8, "span_ids": ["docstring"], "tokens": 39}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Main entry point for DVC command line tool.\"\"\"\nimport sys\n\nfrom dvc.main import main\n\nif __name__ == \"__main__\":\n sys.exit(main(sys.argv[1:]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_get_parent_parser_get_parent_parser.return.parent_parser": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_get_parent_parser_get_parent_parser.return.parent_parser", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 128, "span_ids": ["get_parent_parser"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_parent_parser():\n \"\"\"Create instances of a parser containing common arguments shared among\n all the commands.\n\n When overwriting `-q` or `-v`, you need to instantiate a new object\n in order to prevent some weird behavior.\n \"\"\"\n parent_parser = argparse.ArgumentParser(add_help=False)\n\n log_level_group = parent_parser.add_mutually_exclusive_group()\n log_level_group.add_argument(\n \"-q\", \"--quiet\", action=\"store_true\", default=False, help=\"Be quiet.\"\n )\n log_level_group.add_argument(\n \"-v\",\n \"--verbose\",\n action=\"store_true\",\n default=False,\n help=\"Be verbose.\",\n )\n\n return parent_parser", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_parse_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_parse_args_", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 190, "span_ids": ["parse_args"], "tokens": 361}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_args(argv=None):\n \"\"\"Parses CLI arguments.\n\n Args:\n argv: optional list of arguments to parse. sys.argv is used by default.\n\n Raises:\n dvc.exceptions.DvcParserError: raised for argument parsing errors.\n \"\"\"\n parent_parser = get_parent_parser()\n\n # Main parser\n desc = \"Data Version Control\"\n parser = DvcParser(\n prog=\"dvc\",\n description=desc,\n parents=[parent_parser],\n formatter_class=argparse.RawTextHelpFormatter,\n add_help=False,\n )\n\n # NOTE: We are doing this to capitalize help message.\n # Unfortunately, there is no easier and clearer way to do it,\n # as adding this argument in get_parent_parser() either in\n # log_level_group or on parent_parser itself will cause unexpected error.\n parser.add_argument(\n \"-h\",\n \"--help\",\n action=\"help\",\n default=argparse.SUPPRESS,\n help=\"Show this help message and exit.\",\n )\n\n # NOTE: On some python versions action='version' prints to stderr\n # instead of stdout https://bugs.python.org/issue18920\n parser.add_argument(\n \"-V\",\n \"--version\",\n action=VersionAction,\n nargs=0,\n help=\"Show program's version.\",\n )\n\n # Sub commands\n subparsers = parser.add_subparsers(\n title=\"Available Commands\",\n metavar=\"COMMAND\",\n dest=\"cmd\",\n help=\"Use `dvc COMMAND --help` for command-specific help.\",\n )\n\n fix_subparsers(subparsers)\n\n for cmd in COMMANDS:\n cmd.add_parser(subparsers, parent_parser)\n\n args = parser.parse_args(argv)\n\n return args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_CmdBase_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_CmdBase_", "embedding": null, "metadata": {"file_path": "dvc/command/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 59, "span_ids": ["CmdBase.default_targets", "CmdBaseNoRepo.__init__", "CmdBase", "CmdBase.__init__", "CmdBase.run", "CmdBaseNoRepo"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdBase(object):\n def __init__(self, args):\n from dvc.repo import Repo\n from dvc.updater import Updater\n\n self.repo = Repo()\n self.config = self.repo.config\n self.args = args\n hardlink_lock = self.config[\"core\"].get(\"hardlink_lock\", False)\n updater = Updater(self.repo.dvc_dir, hardlink_lock=hardlink_lock)\n updater.check()\n\n @property\n def default_targets(self):\n \"\"\"Default targets for `dvc repro` and `dvc pipeline`.\"\"\"\n from dvc.dvcfile import DVC_FILE\n\n msg = \"assuming default target '{}'.\".format(DVC_FILE)\n logger.warning(msg)\n return [DVC_FILE]\n\n # Abstract methods that have to be implemented by any inheritance class\n def run(self):\n raise NotImplementedError\n\n\nclass CmdBaseNoRepo(CmdBase):\n def __init__(self, args):\n self.args = args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/commit.py", "file_name": "commit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 73, "span_ids": ["add_parser"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n COMMIT_HELP = \"Save changed data to cache and update DVC-files.\"\n\n commit_parser = subparsers.add_parser(\n \"commit\",\n parents=[parent_parser],\n description=append_doc_link(COMMIT_HELP, \"commit\"),\n help=COMMIT_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n commit_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Commit even if hash value for dependencies/outputs changed.\",\n )\n commit_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Commit all dependencies of the specified target.\",\n )\n commit_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Commit cache for subdirectories of the specified directory.\",\n )\n commit_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"DVC-files to commit. Optional. \"\n \"(Finds all DVC-files in the workspace by default.)\",\n )\n commit_parser.set_defaults(func=CmdCommit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/daemon.py", "file_name": "daemon.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 69, "span_ids": ["add_parser"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n DAEMON_HELP = \"Service daemon.\"\n daemon_parser = subparsers.add_parser(\n \"daemon\",\n parents=[parent_parser],\n description=DAEMON_HELP,\n add_help=False,\n )\n\n daemon_subparsers = daemon_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use `dvc daemon CMD --help` for command-specific \" \"help.\",\n )\n\n fix_subparsers(daemon_subparsers)\n\n DAEMON_UPDATER_HELP = \"Fetch latest available version.\"\n daemon_updater_parser = daemon_subparsers.add_parser(\n \"updater\",\n parents=[parent_parser],\n description=DAEMON_UPDATER_HELP,\n help=DAEMON_UPDATER_HELP,\n )\n daemon_updater_parser.set_defaults(func=CmdDaemonUpdater)\n\n DAEMON_ANALYTICS_HELP = \"Send dvc usage analytics.\"\n daemon_analytics_parser = daemon_subparsers.add_parser(\n \"analytics\",\n parents=[parent_parser],\n description=DAEMON_ANALYTICS_HELP,\n help=DAEMON_ANALYTICS_HELP,\n )\n daemon_analytics_parser.add_argument(\"target\", help=\"Analytics file.\")\n daemon_analytics_parser.set_defaults(func=CmdDaemonAnalytics)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_shared_parent_parser_shared_parent_parser.return.shared_parent_parser": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_shared_parent_parser_shared_parent_parser.return.shared_parent_parser", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 105, "span_ids": ["shared_parent_parser"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def shared_parent_parser():\n from dvc.cli import get_parent_parser\n\n # Parent parser used in pull/push/status\n shared_parent_parser = argparse.ArgumentParser(\n add_help=False, parents=[get_parent_parser()]\n )\n shared_parent_parser.add_argument(\n \"-j\",\n \"--jobs\",\n type=int,\n help=\"Number of jobs to run simultaneously.\",\n metavar=\"\",\n )\n shared_parent_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"Limit command scope to these DVC-files. \"\n \"Using -R, directories to search DVC-files in can also be given.\",\n )\n\n return shared_parent_parser", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/destroy.py", "file_name": "destroy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 55, "span_ids": ["add_parser"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n DESTROY_HELP = \"Remove DVC-files, local DVC config and data cache.\"\n\n destroy_parser = subparsers.add_parser(\n \"destroy\",\n parents=[parent_parser],\n description=append_doc_link(DESTROY_HELP, \"destroy\"),\n help=DESTROY_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n destroy_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Force destruction.\",\n )\n destroy_parser.set_defaults(func=CmdDestroy)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/gc.py", "file_name": "gc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 143, "span_ids": ["add_parser"], "tokens": 492}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n GC_HELP = \"Garbage collect unused objects from cache or remote storage.\"\n GC_DESCRIPTION = (\n \"Removes all files in the cache or a remote which are not in\\n\"\n \"use by the specified Git revisions (defaults to just HEAD).\"\n )\n gc_parser = subparsers.add_parser(\n \"gc\",\n parents=[parent_parser],\n description=append_doc_link(GC_DESCRIPTION, \"gc\"),\n help=GC_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n gc_parser.add_argument(\n \"-w\",\n \"--workspace\",\n action=\"store_true\",\n default=False,\n help=\"Keep data files used in the current workspace (working tree).\",\n )\n gc_parser.add_argument(\n \"-a\",\n \"--all-branches\",\n action=\"store_true\",\n default=False,\n help=\"Keep data files for the tips of all Git branches.\",\n )\n gc_parser.add_argument(\n \"-T\",\n \"--all-tags\",\n action=\"store_true\",\n default=False,\n help=\"Keep data files for all Git tags.\",\n )\n gc_parser.add_argument(\n \"--all-commits\",\n action=\"store_true\",\n default=False,\n help=\"Keep data files for all Git commits.\",\n )\n gc_parser.add_argument(\n \"-c\",\n \"--cloud\",\n action=\"store_true\",\n default=False,\n help=\"Collect garbage in remote repository.\",\n )\n gc_parser.add_argument(\n \"-r\",\n \"--remote\",\n help=\"Remote storage to collect garbage in\",\n metavar=\"\",\n )\n gc_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Force garbage collection - automatically agree to all prompts.\",\n )\n gc_parser.add_argument(\n \"-j\",\n \"--jobs\",\n type=int,\n help=\"Number of jobs to run simultaneously.\",\n metavar=\"\",\n )\n gc_parser.add_argument(\n \"-p\",\n \"--projects\",\n dest=\"repos\",\n type=str,\n nargs=\"*\",\n help=\"Keep data files required by these projects \"\n \"in addition to the current one. \"\n \"Useful if you share a single cache across repos.\",\n metavar=\"\",\n )\n gc_parser.set_defaults(func=CmdGC)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/imp.py", "file_name": "imp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 31, "end_line": 64, "span_ids": ["add_parser"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n IMPORT_HELP = (\n \"Download file or directory tracked by DVC or by Git \"\n \"into the workspace, and track it.\"\n )\n\n import_parser = subparsers.add_parser(\n \"import\",\n parents=[parent_parser],\n description=append_doc_link(IMPORT_HELP, \"import\"),\n help=IMPORT_HELP,\n formatter_class=argparse.RawTextHelpFormatter,\n )\n import_parser.add_argument(\n \"url\", help=\"Location of DVC or Git repository to download from\"\n )\n import_parser.add_argument(\n \"path\", help=\"Path to a file or directory within the repository\"\n )\n import_parser.add_argument(\n \"-o\",\n \"--out\",\n nargs=\"?\",\n help=\"Destination path to download files to\",\n metavar=\"\",\n )\n import_parser.add_argument(\n \"--rev\",\n nargs=\"?\",\n help=\"Git revision (e.g. SHA, branch, tag)\",\n metavar=\"\",\n )\n import_parser.set_defaults(func=CmdImport)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 63, "span_ids": ["add_parser"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n LOCK_HELP = \"Lock DVC-files.\"\n lock_parser = subparsers.add_parser(\n \"lock\",\n parents=[parent_parser],\n description=append_doc_link(LOCK_HELP, \"lock\"),\n help=LOCK_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n lock_parser.add_argument(\"targets\", nargs=\"+\", help=\"DVC-files to lock.\")\n lock_parser.set_defaults(func=CmdLock)\n\n UNLOCK_HELP = \"Unlock DVC-files.\"\n unlock_parser = subparsers.add_parser(\n \"unlock\",\n parents=[parent_parser],\n description=append_doc_link(UNLOCK_HELP, \"unlock\"),\n help=UNLOCK_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n unlock_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"DVC-files to unlock.\"\n )\n unlock_parser.set_defaults(func=CmdUnlock)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 256, "span_ids": ["add_parser"], "tokens": 560}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n PIPELINE_HELP = \"Manage pipelines.\"\n pipeline_parser = subparsers.add_parser(\n \"pipeline\",\n parents=[parent_parser],\n description=append_doc_link(PIPELINE_HELP, \"pipeline\"),\n help=PIPELINE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n\n pipeline_subparsers = pipeline_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use `dvc pipeline CMD --help` for command-specific help.\",\n )\n\n fix_subparsers(pipeline_subparsers)\n\n PIPELINE_LIST_HELP = \"List connected groups of stages (pipelines).\"\n pipeline_list_parser = pipeline_subparsers.add_parser(\n \"list\",\n parents=[parent_parser],\n description=append_doc_link(PIPELINE_LIST_HELP, \"pipeline/list\"),\n help=PIPELINE_LIST_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n pipeline_list_parser.set_defaults(func=CmdPipelineList)\n\n PIPELINE_SHOW_HELP = \"Show stages in a pipeline.\"\n pipeline_show_parser = pipeline_subparsers.add_parser(\n \"show\",\n parents=[parent_parser],\n description=append_doc_link(PIPELINE_SHOW_HELP, \"pipeline/show\"),\n help=PIPELINE_SHOW_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n pipeline_show_group = pipeline_show_parser.add_mutually_exclusive_group()\n pipeline_show_group.add_argument(\n \"-c\",\n \"--commands\",\n action=\"store_true\",\n default=False,\n help=\"Print commands instead of paths to DVC-files.\",\n )\n pipeline_show_group.add_argument(\n \"-o\",\n \"--outs\",\n action=\"store_true\",\n default=False,\n help=\"Print output files instead of paths to DVC-files.\",\n )\n pipeline_show_parser.add_argument(\n \"-l\",\n \"--locked\",\n action=\"store_true\",\n default=False,\n help=\"Print locked DVC stages\",\n )\n pipeline_show_parser.add_argument(\n \"--ascii\",\n action=\"store_true\",\n default=False,\n help=\"Output DAG as ASCII.\",\n )\n pipeline_show_parser.add_argument(\n \"--dot\",\n action=\"store_true\",\n default=False,\n help=\"Print DAG with .dot format.\",\n )\n pipeline_show_parser.add_argument(\n \"--tree\",\n action=\"store_true\",\n default=False,\n help=\"Output DAG as Dependencies Tree.\",\n )\n pipeline_show_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"DVC-files to show pipeline for. Optional. \"\n \"(Finds all DVC-files in the workspace by default.)\",\n )\n pipeline_show_parser.set_defaults(func=CmdPipelineShow)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 216, "span_ids": ["add_parser"], "tokens": 870}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n from dvc.command.config import parent_config_parser\n\n REMOTE_HELP = \"Set up and manage data remotes.\"\n remote_parser = subparsers.add_parser(\n \"remote\",\n parents=[parent_parser],\n description=append_doc_link(REMOTE_HELP, \"remote\"),\n help=REMOTE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n\n remote_subparsers = remote_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use `dvc remote CMD --help` for \" \"command-specific help.\",\n )\n\n fix_subparsers(remote_subparsers)\n\n REMOTE_ADD_HELP = \"Add a new data remote.\"\n remote_add_parser = remote_subparsers.add_parser(\n \"add\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(REMOTE_ADD_HELP, \"remote/add\"),\n help=REMOTE_ADD_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remote_add_parser.add_argument(\"name\", help=\"Name of the remote\")\n remote_add_parser.add_argument(\n \"url\",\n help=\"URL. See full list of supported urls at {}\".format(\n format_link(\"https://man.dvc.org/remote\")\n ),\n )\n remote_add_parser.add_argument(\n \"-d\",\n \"--default\",\n action=\"store_true\",\n default=False,\n help=\"Set as default remote.\",\n )\n remote_add_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Force overwriting existing configs\",\n )\n remote_add_parser.set_defaults(func=CmdRemoteAdd)\n\n REMOTE_DEFAULT_HELP = \"Set/unset the default data remote.\"\n remote_default_parser = remote_subparsers.add_parser(\n \"default\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(REMOTE_DEFAULT_HELP, \"remote/default\"),\n help=REMOTE_DEFAULT_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remote_default_parser.add_argument(\n \"name\", nargs=\"?\", help=\"Name of the remote.\"\n )\n remote_default_parser.add_argument(\n \"-u\",\n \"--unset\",\n action=\"store_true\",\n default=False,\n help=\"Unset default remote.\",\n )\n remote_default_parser.set_defaults(func=CmdRemoteDefault)\n\n REMOTE_MODIFY_HELP = \"Modify the configuration of a data remote.\"\n remote_modify_parser = remote_subparsers.add_parser(\n \"modify\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(REMOTE_MODIFY_HELP, \"remote/modify\"),\n help=REMOTE_MODIFY_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remote_modify_parser.add_argument(\"name\", help=\"Name of the remote.\")\n remote_modify_parser.add_argument(\n \"option\", help=\"Name of the option to modify.\"\n )\n remote_modify_parser.add_argument(\n \"value\", nargs=\"?\", help=\"(optional) Value of the option.\"\n )\n remote_modify_parser.add_argument(\n \"-u\",\n \"--unset\",\n default=False,\n action=\"store_true\",\n help=\"Unset option.\",\n )\n remote_modify_parser.set_defaults(func=CmdRemoteModify)\n\n REMOTE_LIST_HELP = \"List all available data remotes.\"\n remote_list_parser = remote_subparsers.add_parser(\n \"list\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(REMOTE_LIST_HELP, \"remote/list\"),\n help=REMOTE_LIST_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remote_list_parser.set_defaults(func=CmdRemoteList)\n\n REMOTE_REMOVE_HELP = \"Remove a data remote.\"\n remote_remove_parser = remote_subparsers.add_parser(\n \"remove\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(REMOTE_REMOVE_HELP, \"remote/remove\"),\n help=REMOTE_REMOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remote_remove_parser.add_argument(\n \"name\", help=\"Name of the remote to remove.\"\n )\n remote_remove_parser.set_defaults(func=CmdRemoteRemove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 79, "span_ids": ["add_parser"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n REMOVE_HELP = \"Remove DVC-tracked files or directories.\"\n remove_parser = subparsers.add_parser(\n \"remove\",\n parents=[parent_parser],\n description=append_doc_link(REMOVE_HELP, \"remove\"),\n help=REMOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remove_parser_group = remove_parser.add_mutually_exclusive_group()\n remove_parser_group.add_argument(\n \"-o\",\n \"--outs\",\n action=\"store_true\",\n default=True,\n help=\"Only remove DVC-file outputs. (Default)\",\n )\n remove_parser_group.add_argument(\n \"-p\",\n \"--purge\",\n action=\"store_true\",\n default=False,\n help=\"Remove DVC-file and all its outputs.\",\n )\n remove_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Force purge.\",\n )\n remove_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"DVC-files to remove.\"\n )\n remove_parser.set_defaults(func=CmdRemove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/repro.py", "file_name": "repro.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 160, "span_ids": ["add_parser"], "tokens": 603}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n REPRO_HELP = (\n \"Reproduce complete or partial pipelines by executing their stages.\"\n )\n repro_parser = subparsers.add_parser(\n \"repro\",\n parents=[parent_parser],\n description=append_doc_link(REPRO_HELP, \"repro\"),\n help=REPRO_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n repro_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"DVC-file to reproduce. 'Dvcfile' by default.\",\n )\n repro_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce even if dependencies were not changed.\",\n )\n repro_parser.add_argument(\n \"-s\",\n \"--single-item\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce only single data item without recursive dependencies \"\n \"check.\",\n )\n repro_parser.add_argument(\n \"-c\",\n \"--cwd\",\n default=os.path.curdir,\n help=\"Directory within your repo to reproduce from.\",\n metavar=\"\",\n )\n repro_parser.add_argument(\n \"-m\",\n \"--metrics\",\n action=\"store_true\",\n default=False,\n help=\"Show metrics after reproduction.\",\n )\n repro_parser.add_argument(\n \"--dry\",\n action=\"store_true\",\n default=False,\n help=\"Only print the commands that would be executed without \"\n \"actually executing.\",\n )\n repro_parser.add_argument(\n \"-i\",\n \"--interactive\",\n action=\"store_true\",\n default=False,\n help=\"Ask for confirmation before reproducing each stage.\",\n )\n repro_parser.add_argument(\n \"-p\",\n \"--pipeline\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce the whole pipeline that the specified stage file \"\n \"belongs to.\",\n )\n repro_parser.add_argument(\n \"-P\",\n \"--all-pipelines\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce all pipelines in the repo.\",\n )\n repro_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce all stages in the specified directory.\",\n )\n repro_parser.add_argument(\n \"--ignore-build-cache\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce all descendants of a changed stage even if their \"\n \"direct dependencies didn't change.\",\n )\n repro_parser.add_argument(\n \"--no-commit\",\n action=\"store_true\",\n default=False,\n help=\"Don't put files/directories into cache.\",\n )\n repro_parser.add_argument(\n \"--downstream\",\n action=\"store_true\",\n default=False,\n help=\"Start from the specified stages when reproducing pipelines.\",\n )\n repro_parser.set_defaults(func=CmdRepro)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_CmdRun._parsed_cmd_CmdRun._quote_argument.return._format_argument_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_CmdRun._parsed_cmd_CmdRun._quote_argument.return._format_argument_", "embedding": null, "metadata": {"file_path": "dvc/command/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 72, "span_ids": ["CmdRun._parsed_cmd", "CmdRun._quote_argument"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdRun(CmdBase):\n\n def _parsed_cmd(self):\n \"\"\"\n We need to take into account two cases:\n\n - ['python code.py foo bar']: Used mainly with dvc as a library\n - ['echo', 'foo bar']: List of arguments received from the CLI\n\n The second case would need quoting, as it was passed through:\n dvc run echo \"foo bar\"\n \"\"\"\n if len(self.args.command) < 2:\n return \" \".join(self.args.command)\n\n return \" \".join(self._quote_argument(arg) for arg in self.args.command)\n\n def _quote_argument(self, argument):\n if \" \" not in argument or '\"' in argument:\n return argument\n\n return '\"{}\"'.format(argument)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 214, "span_ids": ["add_parser"], "tokens": 814}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n RUN_HELP = \"Generate a stage file from a command and execute the command.\"\n run_parser = subparsers.add_parser(\n \"run\",\n parents=[parent_parser],\n description=append_doc_link(RUN_HELP, \"run\"),\n help=RUN_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n run_parser.add_argument(\n \"-d\",\n \"--deps\",\n action=\"append\",\n default=[],\n help=\"Declare dependencies for reproducible cmd.\",\n metavar=\"\",\n )\n run_parser.add_argument(\"-n\", \"--name\", help=argparse.SUPPRESS)\n run_parser.add_argument(\n \"-o\",\n \"--outs\",\n action=\"append\",\n default=[],\n help=\"Declare output file or directory.\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"-O\",\n \"--outs-no-cache\",\n action=\"append\",\n default=[],\n help=\"Declare output file or directory \"\n \"(do not put into DVC cache).\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"-p\",\n \"--params\",\n action=\"append\",\n default=[],\n help=\"Declare parameter to use as additional dependency.\",\n metavar=\"[:]\",\n )\n run_parser.add_argument(\n \"-m\",\n \"--metrics\",\n action=\"append\",\n default=[],\n help=\"Declare output metric file or directory.\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"-M\",\n \"--metrics-no-cache\",\n action=\"append\",\n default=[],\n help=\"Declare output metric file or directory \"\n \"(do not put into DVC cache).\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"-f\",\n \"--file\",\n help=\"Specify name of the DVC-file this command will generate.\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"-w\",\n \"--wdir\",\n help=\"Directory within your repo to run your command in.\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"--no-exec\",\n action=\"store_true\",\n default=False,\n help=\"Only create stage file without actually running it.\",\n )\n run_parser.add_argument(\n \"-y\",\n \"--yes\",\n action=\"store_true\",\n default=False,\n help=\"Deprecated, use --overwrite-dvcfile instead\",\n )\n run_parser.add_argument(\n \"--overwrite-dvcfile\",\n action=\"store_true\",\n default=False,\n help=\"Overwrite existing DVC-file without asking for confirmation.\",\n )\n run_parser.add_argument(\n \"--ignore-build-cache\",\n action=\"store_true\",\n default=False,\n help=\"Run this stage even if it has been already ran with the same \"\n \"command/dependencies/outputs/etc before.\",\n )\n run_parser.add_argument(\n \"--no-commit\",\n action=\"store_true\",\n default=False,\n help=\"Don't put files/directories into cache.\",\n )\n run_parser.add_argument(\n \"--outs-persist\",\n action=\"append\",\n default=[],\n help=\"Declare output file or directory that will not be \"\n \"removed upon repro.\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"--outs-persist-no-cache\",\n action=\"append\",\n default=[],\n help=\"Declare output file or directory that will not be \"\n \"removed upon repro (do not put into DVC cache).\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"--always-changed\",\n action=\"store_true\",\n default=False,\n help=\"Always consider this DVC-file as changed.\",\n )\n run_parser.add_argument(\n \"command\", nargs=argparse.REMAINDER, help=\"Command to execute.\"\n )\n run_parser.set_defaults(func=CmdRun)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__Launch_dvc_daemon_co__spawn_windows.Popen_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__Launch_dvc_daemon_co__spawn_windows.Popen_", "embedding": null, "metadata": {"file_path": "dvc/daemon.py", "file_name": "daemon.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["_spawn_windows", "docstring"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Launch `dvc daemon` command in a separate detached process.\"\"\"\n\nimport inspect\nimport logging\nimport os\nimport sys\nfrom subprocess import Popen\n\nfrom dvc.env import DVC_DAEMON\nfrom dvc.utils import fix_env\nfrom dvc.utils import is_binary\n\n\nlogger = logging.getLogger(__name__)\n\nCREATE_NEW_PROCESS_GROUP = 0x00000200\nDETACHED_PROCESS = 0x00000008\n\n\ndef _spawn_windows(cmd, env):\n from subprocess import STARTUPINFO, STARTF_USESHOWWINDOW\n\n creationflags = CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS\n\n startupinfo = STARTUPINFO()\n startupinfo.dwFlags |= STARTF_USESHOWWINDOW\n\n Popen(\n cmd,\n env=env,\n close_fds=True,\n shell=False,\n creationflags=creationflags,\n startupinfo=startupinfo,\n ).communicate()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_posix__spawn_posix._pylint_disable_protect": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_posix__spawn_posix._pylint_disable_protect", "embedding": null, "metadata": {"file_path": "dvc/daemon.py", "file_name": "daemon.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 67, "span_ids": ["_spawn_posix"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _spawn_posix(cmd, env):\n # NOTE: using os._exit instead of sys.exit, because dvc built\n # with PyInstaller has trouble with SystemExit exception and throws\n # errors such as \"[26338] Failed to execute script __main__\"\n try:\n pid = os.fork()\n if pid > 0:\n return\n except OSError:\n logger.exception(\"failed at first fork\")\n os._exit(1) # pylint: disable=protected-access\n\n os.setsid()\n os.umask(0)\n\n try:\n pid = os.fork()\n if pid > 0:\n os._exit(0) # pylint: disable=protected-access\n except OSError:\n logger.exception(\"failed at second fork\")\n os._exit(1) # pylint: disable=protected-access\n\n sys.stdin.close()\n sys.stdout.close()\n sys.stderr.close()\n\n Popen(cmd, env=env, close_fds=True, shell=False).communicate()\n\n os._exit(0) # pylint: disable=protected-access", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.point_AsciiCanvas.point.self_canvas_y_x_char": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.point_AsciiCanvas.point.self_canvas_y_x_char", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 172, "span_ids": ["AsciiCanvas.point"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AsciiCanvas(object):\n\n def point(self, x, y, char):\n \"\"\"Create a point on ASCII canvas.\n\n Args:\n x (int): x coordinate. Should be >= 0 and < number of columns in\n the canvas.\n y (int): y coordinate. Should be >= 0 an < number of lines in the\n canvas.\n char (str): character to place in the specified point on the\n canvas.\n \"\"\"\n assert len(char) == 1\n assert x >= 0\n assert x < self.cols\n assert y >= 0\n assert y < self.lines\n\n self.canvas[y][x] = char", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.line_AsciiCanvas.line.if_dx_0_and_dy_0_.else_.for_y_in_range_y1_y0_1.self_point_x_y_char_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.line_AsciiCanvas.line.if_dx_0_and_dy_0_.else_.for_y_in_range_y1_y0_1.self_point_x_y_char_", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 214, "span_ids": ["AsciiCanvas.line"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AsciiCanvas(object):\n\n def line(self, x0, y0, x1, y1, char):\n \"\"\"Create a line on ASCII canvas.\n\n Args:\n x0 (int): x coordinate where the line should start.\n y0 (int): y coordinate where the line should start.\n x1 (int): x coordinate where the line should end.\n y1 (int): y coordinate where the line should end.\n char (str): character to draw the line with.\n \"\"\"\n # pylint: disable=too-many-arguments, too-many-branches\n if x0 > x1:\n x1, x0 = x0, x1\n y1, y0 = y0, y1\n\n dx = x1 - x0\n dy = y1 - y0\n\n if dx == 0 and dy == 0:\n self.point(x0, y0, char)\n elif abs(dx) >= abs(dy):\n for x in range(x0, x1 + 1):\n if dx == 0:\n y = y0\n else:\n y = y0 + int(round((x - x0) * dy / float((dx))))\n self.point(x, y, char)\n elif y0 < y1:\n for y in range(y0, y1 + 1):\n if dy == 0:\n x = x0\n else:\n x = x0 + int(round((y - y0) * dx / float((dy))))\n self.point(x, y, char)\n else:\n for y in range(y1, y0 + 1):\n if dy == 0:\n x = x0\n else:\n x = x1 + int(round((y - y1) * dx / float((dy))))\n self.point(x, y, char)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.text_AsciiCanvas.box.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.text_AsciiCanvas.box.None_3", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 216, "end_line": 253, "span_ids": ["AsciiCanvas.text", "AsciiCanvas.box"], "tokens": 307}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AsciiCanvas(object):\n\n def text(self, x, y, text):\n \"\"\"Print a text on ASCII canvas.\n\n Args:\n x (int): x coordinate where the text should start.\n y (int): y coordinate where the text should start.\n text (str): string that should be printed.\n \"\"\"\n for i, char in enumerate(text):\n self.point(x + i, y, char)\n\n def box(self, x0, y0, width, height):\n \"\"\"Create a box on ASCII canvas.\n\n Args:\n x0 (int): x coordinate of the box corner.\n y0 (int): y coordinate of the box corner.\n width (int): box width.\n height (int): box height.\n \"\"\"\n assert width > 1\n assert height > 1\n\n width -= 1\n height -= 1\n\n for x in range(x0, x0 + width):\n self.point(x, y0, \"-\")\n self.point(x, y0 + height, \"-\")\n\n for y in range(y0, y0 + height):\n self.point(x0, y, \"|\")\n self.point(x0 + width, y, \"|\")\n\n self.point(x0, y0, \"+\")\n self.point(x0 + width, y0, \"+\")\n self.point(x0, y0 + height, \"+\")\n self.point(x0 + width, y0 + height, \"+\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__build_sugiyama_layout__build_sugiyama_layout.return.sug": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__build_sugiyama_layout__build_sugiyama_layout.return.sug", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 294, "span_ids": ["_build_sugiyama_layout"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _build_sugiyama_layout(vertexes, edges):\n #\n # Just a reminder about naming conventions:\n # +------------X\n # |\n # |\n # |\n # |\n # Y\n #\n\n vertexes = {v: Vertex(\" {} \".format(v)) for v in vertexes}\n # NOTE: reverting edges to correctly orientate the graph\n edges = [Edge(vertexes[e], vertexes[s]) for s, e in edges]\n vertexes = vertexes.values()\n graph = Graph(vertexes, edges)\n\n for vertex in vertexes:\n vertex.view = VertexViewer(vertex.data)\n\n # NOTE: determine min box length to create the best layout\n minw = min([v.view.w for v in vertexes])\n\n for edge in edges:\n edge.view = EdgeViewer()\n\n sug = SugiyamaLayout(graph.C[0])\n graph = graph.C[0]\n roots = list(filter(lambda x: len(x.e_in()) == 0, graph.sV))\n\n sug.init_all(roots=roots, optimize=True)\n\n sug.yspace = VertexViewer.HEIGHT\n sug.xspace = minw\n sug.route_edge = route_with_lines\n\n sug.draw()\n\n return sug", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_draw_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_draw_", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 371, "span_ids": ["draw"], "tokens": 635}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def draw(vertexes, edges):\n \"\"\"Build a DAG and draw it in ASCII.\n\n Args:\n vertexes (list): list of graph vertexes.\n edges (list): list of graph edges.\n \"\"\"\n # pylint: disable=too-many-locals\n # NOTE: coordinates might me negative, so we need to shift\n # everything to the positive plane before we actually draw it.\n Xs = [] # pylint: disable=invalid-name\n Ys = [] # pylint: disable=invalid-name\n\n sug = _build_sugiyama_layout(vertexes, edges)\n\n for vertex in sug.g.sV:\n # NOTE: moving boxes w/2 to the left\n Xs.append(vertex.view.xy[0] - vertex.view.w / 2.0)\n Xs.append(vertex.view.xy[0] + vertex.view.w / 2.0)\n Ys.append(vertex.view.xy[1])\n Ys.append(vertex.view.xy[1] + vertex.view.h)\n\n for edge in sug.g.sE:\n for x, y in edge.view._pts: # pylint: disable=protected-access\n Xs.append(x)\n Ys.append(y)\n\n minx = min(Xs)\n miny = min(Ys)\n maxx = max(Xs)\n maxy = max(Ys)\n\n canvas_cols = int(math.ceil(math.ceil(maxx) - math.floor(minx))) + 1\n canvas_lines = int(round(maxy - miny))\n\n canvas = AsciiCanvas(canvas_cols, canvas_lines)\n\n # NOTE: first draw edges so that node boxes could overwrite them\n for edge in sug.g.sE:\n # pylint: disable=protected-access\n assert len(edge.view._pts) > 1\n for index in range(1, len(edge.view._pts)):\n start = edge.view._pts[index - 1]\n end = edge.view._pts[index]\n\n start_x = int(round(start[0] - minx))\n start_y = int(round(start[1] - miny))\n end_x = int(round(end[0] - minx))\n end_y = int(round(end[1] - miny))\n\n assert start_x >= 0\n assert start_y >= 0\n assert end_x >= 0\n assert end_y >= 0\n\n canvas.line(start_x, start_y, end_x, end_y, \"*\")\n\n for vertex in sug.g.sV:\n # NOTE: moving boxes w/2 to the left\n x = vertex.view.xy[0] - vertex.view.w / 2.0\n y = vertex.view.xy[1]\n\n canvas.box(\n int(round(x - minx)),\n int(round(y - miny)),\n vertex.view.w,\n vertex.view.h,\n )\n\n canvas.text(\n int(round(x - minx)) + 1, int(round(y - miny)) + 1, vertex.data\n )\n\n canvas.draw()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/gs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/gs.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "DependencyGS"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.base import DependencyBase\nfrom dvc.output.gs import OutputGS\n\n\nclass DependencyGS(DependencyBase, OutputGS):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/hdfs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/hdfs.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "DependencyHDFS"], "tokens": 35}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.base import DependencyBase\nfrom dvc.output.hdfs import OutputHDFS\n\n\nclass DependencyHDFS(DependencyBase, OutputHDFS):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/local.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/local.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "DependencyLOCAL"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.base import DependencyBase\nfrom dvc.output.local import OutputLOCAL\n\n\nclass DependencyLOCAL(DependencyBase, OutputLOCAL):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/s3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/s3.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "DependencyS3"], "tokens": 35}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.base import DependencyBase\nfrom dvc.output.s3 import OutputS3\n\n\nclass DependencyS3(DependencyBase, OutputS3):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/ssh.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/ssh.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/ssh.py", "file_name": "ssh.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "DependencySSH"], "tokens": 32}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.base import DependencyBase\nfrom dvc.output.ssh import OutputSSH\n\n\nclass DependencySSH(DependencyBase, OutputSSH):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loadd_from_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loadd_from_", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 137, "span_ids": ["loadd_from", "loads_from"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def loadd_from(stage, d_list):\n ret = []\n for d in d_list:\n p = d.pop(OutputBase.PARAM_PATH)\n cache = d.pop(OutputBase.PARAM_CACHE, True)\n metric = d.pop(OutputBase.PARAM_METRIC, False)\n persist = d.pop(OutputBase.PARAM_PERSIST, False)\n tags = d.pop(OutputBase.PARAM_TAGS, None)\n ret.append(\n _get(\n stage,\n p,\n info=d,\n cache=cache,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n )\n return ret\n\n\ndef loads_from(stage, s_list, use_cache=True, metric=False, persist=False):\n ret = []\n for s in s_list:\n ret.append(\n _get(\n stage,\n s,\n info={},\n cache=use_cache,\n metric=metric,\n persist=persist,\n )\n )\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/gs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/gs.py__", "embedding": null, "metadata": {"file_path": "dvc/output/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "OutputGS"], "tokens": 33}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.s3 import OutputS3\nfrom dvc.remote.gs import RemoteGS\n\n\nclass OutputGS(OutputS3):\n REMOTE = RemoteGS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/prompt.py__Manages_user_prompts__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/prompt.py__Manages_user_prompts__", "embedding": null, "metadata": {"file_path": "dvc/prompt.py", "file_name": "prompt.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 57, "span_ids": ["password", "confirm", "_ask", "docstring"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages user prompts.\"\"\"\n\nimport logging\nimport sys\nfrom getpass import getpass\n\nlogger = logging.getLogger(__name__)\n\n\ndef _ask(prompt, limited_to=None):\n if not sys.stdout.isatty():\n return None\n\n while True:\n try:\n answer = input(prompt + \" \").lower()\n except EOFError:\n return None\n\n if not limited_to:\n return answer\n\n if answer in limited_to:\n return answer\n\n logger.info(\n \"Your response must be one of: {options}. \"\n \"Please try again.\".format(options=limited_to)\n )\n\n\ndef confirm(statement):\n \"\"\"Ask the user for confirmation about the specified statement.\n\n Args:\n statement (unicode): statement to ask the user confirmation about.\n\n Returns:\n bool: whether or not specified statement was confirmed.\n \"\"\"\n prompt = \"{statement} [y/n]\".format(statement=statement)\n answer = _ask(prompt, limited_to=[\"yes\", \"no\", \"y\", \"n\"])\n return answer and answer.startswith(\"y\")\n\n\ndef password(statement):\n \"\"\"Ask the user for a password.\n\n Args:\n statement (str): string to prompt the user with.\n\n Returns:\n str: password entered by the user.\n \"\"\"\n logger.info(\"{statement}: \".format(statement=statement))\n return getpass(\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.hadoop_fs_RemoteHDFS.hadoop_fs.return.out_decode_utf_8_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.hadoop_fs_RemoteHDFS.hadoop_fs.return.out_decode_utf_8_", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 76, "span_ids": ["RemoteHDFS.hadoop_fs"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHDFS(RemoteBASE):\n\n def hadoop_fs(self, cmd, user=None):\n cmd = \"hadoop fs -\" + cmd\n if user:\n cmd = \"HADOOP_USER_NAME={} \".format(user) + cmd\n\n # NOTE: close_fds doesn't work with redirected stdin/stdout/stderr.\n # See https://github.com/iterative/dvc/issues/1197.\n close_fds = os.name != \"nt\"\n\n executable = os.getenv(\"SHELL\") if os.name != \"nt\" else None\n p = subprocess.Popen(\n cmd,\n shell=True,\n close_fds=close_fds,\n executable=executable,\n env=fix_env(os.environ),\n stdin=subprocess.PIPE,\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n )\n out, err = p.communicate()\n if p.returncode != 0:\n raise RemoteCmdError(self.scheme, cmd, p.returncode, err)\n return out.decode(\"utf-8\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.execute_SSHConnection.execute.return.b_join_stdout_chunks_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.execute_SSHConnection.execute.return.b_join_stdout_chunks_d", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 229, "span_ids": ["SSHConnection.execute"], "tokens": 287}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n def execute(self, cmd):\n stdin, stdout, stderr = self._ssh.exec_command(cmd)\n channel = stdout.channel\n\n stdin.close()\n channel.shutdown_write()\n\n stdout_chunks = []\n stderr_chunks = []\n while (\n not channel.closed\n or channel.recv_ready()\n or channel.recv_stderr_ready()\n ):\n import select\n\n got_chunk = False\n readq, _, _ = select.select([stdout.channel], [], [], self.timeout)\n for c in readq:\n if c.recv_ready():\n stdout_chunks.append(stdout.channel.recv(len(c.in_buffer)))\n got_chunk = True\n\n if c.recv_stderr_ready():\n stderr_len = len(c.in_stderr_buffer)\n s = stderr.channel.recv_stderr(stderr_len)\n stderr_chunks.append(s)\n got_chunk = True\n\n if (\n not got_chunk\n and stdout.channel.exit_status_ready()\n and not stderr.channel.recv_stderr_ready()\n and not stdout.channel.recv_ready()\n ):\n stdout.channel.shutdown_read()\n stdout.channel.close()\n break\n\n stdout.close()\n stderr.close()\n\n ret = stdout.channel.recv_exit_status()\n if ret != 0:\n err = b\"\".join(stderr_chunks).decode(\"utf-8\")\n raise RemoteCmdError(\"ssh\", cmd, ret, err)\n\n return b\"\".join(stdout_chunks).decode(\"utf-8\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.used_cache_Repo.used_cache.return.cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.used_cache_Repo.used_cache.return.cache", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 310, "span_ids": ["Repo.used_cache"], "tokens": 356}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def used_cache(\n self,\n targets=None,\n all_branches=False,\n with_deps=False,\n all_tags=False,\n all_commits=False,\n remote=None,\n force=False,\n jobs=None,\n recursive=False,\n ):\n \"\"\"Get the stages related to the given target and collect\n the `info` of its outputs.\n\n This is useful to know what files from the cache are _in use_\n (namely, a file described as an output on a stage).\n\n The scope is, by default, the working directory, but you can use\n `all_branches`/`all_tags`/`all_commits` to expand the scope.\n\n Returns:\n A dictionary with Schemes (representing output's location) mapped\n to items containing the output's `dumpd` names and the output's\n children (if the given output is a directory).\n \"\"\"\n from dvc.cache import NamedCache\n\n cache = NamedCache()\n\n for branch in self.brancher(\n all_branches=all_branches,\n all_tags=all_tags,\n all_commits=all_commits,\n ):\n targets = targets or [None]\n\n pairs = cat(\n self.collect_granular(\n target, recursive=recursive, with_deps=with_deps\n )\n for target in targets\n )\n\n suffix = \"({})\".format(branch) if branch else \"\"\n for stage, filter_info in pairs:\n used_cache = stage.get_used_cache(\n remote=remote,\n force=force,\n jobs=jobs,\n filter_info=filter_info,\n )\n cache.update(used_cache, suffix=suffix)\n\n return cache", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/commit.py", "file_name": "commit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 13, "span_ids": ["imports", "commit"], "tokens": 83}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from . import locked\nfrom dvc.dvcfile import Dvcfile\n\n\n@locked\ndef commit(self, target, with_deps=False, recursive=False, force=False):\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n for stage in stages:\n stage.check_can_commit(force=force)\n stage.commit()\n\n Dvcfile(self, stage.path).dump(stage)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/destroy.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/destroy.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/destroy.py", "file_name": "destroy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["_destroy_stages", "imports", "destroy"], "tokens": 98}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.utils.fs import remove\nfrom . import locked\n\n\n@locked\ndef _destroy_stages(repo):\n for stage in repo.stages:\n stage.remove(remove_outs=False)\n\n\n# NOTE: not locking `destroy`, as `remove` will need to delete `.dvc` dir,\n# which will cause issues on Windows, as `.dvc/lock` will be busy.\ndef destroy(repo):\n _destroy_stages(repo)\n remove(repo.dvc_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_gc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_gc_", "embedding": null, "metadata": {"file_path": "dvc/repo/gc.py", "file_name": "gc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 96, "span_ids": ["gc"], "tokens": 445}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@locked\ndef gc(\n self,\n all_branches=False,\n cloud=False,\n remote=None,\n with_deps=False,\n all_tags=False,\n all_commits=False,\n force=False,\n jobs=None,\n repos=None,\n workspace=False,\n):\n\n # require `workspace` to be true to come into effect.\n # assume `workspace` to be enabled if any of `all_tags`, `all_commits`,\n # or `all_branches` are enabled.\n _raise_error_if_all_disabled(\n workspace=workspace,\n all_tags=all_tags,\n all_commits=all_commits,\n all_branches=all_branches,\n )\n\n from contextlib import ExitStack\n from dvc.repo import Repo\n\n all_repos = []\n\n if repos:\n all_repos = [Repo(path) for path in repos]\n\n with ExitStack() as stack:\n for repo in all_repos:\n stack.enter_context(repo.lock)\n stack.enter_context(repo.state)\n\n used = NamedCache()\n for repo in all_repos + [self]:\n used.update(\n repo.used_cache(\n all_branches=all_branches,\n with_deps=with_deps,\n all_tags=all_tags,\n all_commits=all_commits,\n remote=remote,\n force=force,\n jobs=jobs,\n )\n )\n\n _do_gc(\"local\", self.cache.local.gc, used, jobs)\n\n if self.cache.s3:\n _do_gc(\"s3\", self.cache.s3.gc, used, jobs)\n\n if self.cache.gs:\n _do_gc(\"gs\", self.cache.gs.gc, used, jobs)\n\n if self.cache.ssh:\n _do_gc(\"ssh\", self.cache.ssh.gc, used, jobs)\n\n if self.cache.hdfs:\n _do_gc(\"hdfs\", self.cache.hdfs.gc, used, jobs)\n\n if self.cache.azure:\n _do_gc(\"azure\", self.cache.azure.gc, used, jobs)\n\n if cloud:\n _do_gc(\"remote\", self.cloud.get_remote(remote, \"gc -c\").gc, used, jobs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_init_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_init_", "embedding": null, "metadata": {"file_path": "dvc/repo/init.py", "file_name": "init.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 114, "span_ids": ["init"], "tokens": 443}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def init(root_dir=os.curdir, no_scm=False, force=False, subdir=False):\n \"\"\"\n Creates an empty repo on the given directory -- basically a\n `.dvc` directory with subdirectories for configuration and cache.\n\n It should be tracked by a SCM or use the `--no-scm` flag.\n\n If the given directory is not empty, you must use the `--force`\n flag to override it.\n\n Args:\n root_dir: Path to repo's root directory.\n\n Returns:\n Repo instance.\n\n Raises:\n KeyError: Raises an exception.\n \"\"\"\n\n if no_scm and subdir:\n raise InvalidArgumentError(\n \"Cannot initialize repo with `--no-scm` and `--subdir`\"\n )\n\n root_dir = os.path.realpath(root_dir)\n dvc_dir = os.path.join(root_dir, Repo.DVC_DIR)\n\n try:\n scm = SCM(root_dir, search_parent_directories=subdir, no_scm=no_scm)\n except SCMError:\n raise InitError(\n \"{repo} is not tracked by any supported SCM tool (e.g. Git). \"\n \"Use `--no-scm` if you don't want to use any SCM or \"\n \"`--subdir` if initializing inside a subdirectory of a parent SCM \"\n \"repository.\".format(repo=root_dir)\n )\n\n if os.path.isdir(dvc_dir):\n if not force:\n raise InitError(\n \"'{repo}' exists. Use `-f` to force.\".format(\n repo=relpath(dvc_dir)\n )\n )\n\n remove(dvc_dir)\n\n os.mkdir(dvc_dir)\n\n config = Config.init(dvc_dir)\n\n if no_scm:\n with config.edit() as conf:\n conf[\"core\"][\"no_scm\"] = True\n\n proj = Repo(root_dir)\n\n scm.add([config.files[\"repo\"]])\n\n if scm.ignore_file:\n scm.add([os.path.join(dvc_dir, scm.ignore_file)])\n logger.info(\"\\nYou can now commit the changes to git.\\n\")\n\n _welcome_message()\n\n return proj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/install.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/install.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/install.py", "file_name": "install.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 3, "span_ids": ["install"], "tokens": 19}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def install(self, use_pre_commit_tool):\n self.scm.install(use_pre_commit_tool)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/lock.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/lock.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["imports", "lock"], "tokens": 95}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from . import locked\n\n\n@locked\ndef lock(self, target, unlock=False):\n from .. import dvcfile\n from dvc.utils import parse_target\n\n path, target = parse_target(target)\n dvcfile = dvcfile.Dvcfile(self, path)\n stage = dvcfile.stages[target]\n stage.locked = False if unlock else True\n dvcfile.dump(stage, update_dvcfile=True)\n\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/__init__.py_Metrics_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/__init__.py_Metrics_", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["Metrics.show", "Metrics.__init__", "Metrics.add", "Metrics.diff", "Metrics", "Metrics.remove"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Metrics(object):\n def __init__(self, repo):\n self.repo = repo\n\n def add(self, *args, **kwargs):\n from dvc.repo.metrics.add import add\n\n return add(self.repo, *args, **kwargs)\n\n def show(self, *args, **kwargs):\n from dvc.repo.metrics.show import show\n\n return show(self.repo, *args, **kwargs)\n\n def remove(self, *args, **kwargs):\n from dvc.repo.metrics.remove import remove\n\n return remove(self.repo, *args, **kwargs)\n\n def diff(self, *args, **kwargs):\n from .diff import diff\n\n return diff(self.repo, *args, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/add.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/add.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 6, "span_ids": ["add", "imports"], "tokens": 21}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.repo.metrics.modify import modify\n\n\ndef add(repo, path):\n modify(repo, path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/remove.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/remove.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 6, "span_ids": ["imports", "remove"], "tokens": 24}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.repo.metrics.modify import modify\n\n\ndef remove(repo, path):\n modify(repo, path, delete=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/move.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/move.py_os_", "embedding": null, "metadata": {"file_path": "dvc/repo/move.py", "file_name": "move.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 73, "span_ids": ["imports", "_expand_target_path", "move"], "tokens": 471}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom . import locked\nfrom dvc.exceptions import MoveNotDataSourceError\nfrom dvc.repo.scm_context import scm_context\n\n\ndef _expand_target_path(from_path, to_path):\n if os.path.isdir(to_path):\n return os.path.join(to_path, os.path.basename(from_path))\n return to_path\n\n\n@locked\n@scm_context\ndef move(self, from_path, to_path):\n \"\"\"\n Renames an output file and modifies the stage associated\n to reflect the change on the pipeline.\n\n If the output has the same name as its stage, it would\n also rename the corresponding DVC-file.\n\n E.g.\n Having: (hello, hello.dvc)\n\n $ dvc move hello greetings\n\n Result: (greeting, greeting.dvc)\n\n It only works with outputs generated by `add` or `import`,\n also known as data sources.\n \"\"\"\n import dvc.output as Output\n from dvc.stage import Stage\n from ..dvcfile import DVC_FILE_SUFFIX, Dvcfile\n\n from_out = Output.loads_from(Stage(self), [from_path])[0]\n assert from_out.scheme == \"local\"\n\n to_path = _expand_target_path(from_path, to_path)\n\n outs = self.find_outs_by_path(from_out.fspath)\n assert len(outs) == 1\n out = outs[0]\n stage = out.stage\n\n if not stage.is_data_source:\n raise MoveNotDataSourceError(stage.relpath)\n\n stage_name = os.path.splitext(os.path.basename(stage.path))[0]\n from_name = os.path.basename(from_out.fspath)\n if stage_name == from_name:\n os.unlink(stage.path)\n\n stage.path = os.path.join(\n os.path.dirname(to_path),\n os.path.basename(to_path) + DVC_FILE_SUFFIX,\n )\n\n stage.wdir = os.path.abspath(\n os.path.join(os.curdir, os.path.dirname(to_path))\n )\n\n to_path = os.path.relpath(to_path, stage.wdir)\n\n to_out = Output.loads_from(stage, [to_path], out.use_cache, out.metric)[0]\n\n out.move(to_out)\n stage.save()\n\n Dvcfile(self, stage.path).dump(stage)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/remove.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/remove.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 15, "span_ids": ["imports", "remove"], "tokens": 66}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from . import locked\n\n\n@locked\ndef remove(self, target, outs_only=False):\n from ..dvcfile import Dvcfile\n\n stage = Dvcfile(self, target).stage\n if outs_only:\n stage.remove_outs(force=True)\n else:\n stage.remove(force=True)\n\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__reproduce_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__reproduce_stages_", "embedding": null, "metadata": {"file_path": "dvc/repo/reproduce.py", "file_name": "reproduce.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 188, "span_ids": ["_reproduce_stages"], "tokens": 670}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _reproduce_stages(\n G,\n stages,\n downstream=False,\n ignore_build_cache=False,\n single_item=False,\n **kwargs\n):\n r\"\"\"Derive the evaluation of the given node for the given graph.\n\n When you _reproduce a stage_, you want to _evaluate the descendants_\n to know if it make sense to _recompute_ it. A post-ordered search\n will give us an order list of the nodes we want.\n\n For example, let's say that we have the following pipeline:\n\n E\n / \\\n D F\n / \\ \\\n B C G\n \\ /\n A\n\n The derived evaluation of D would be: [A, B, C, D]\n\n In case that `downstream` option is specified, the desired effect\n is to derive the evaluation starting from the given stage up to the\n ancestors. However, the `networkx.ancestors` returns a set, without\n any guarantee of any order, so we are going to reverse the graph and\n use a pre-ordered search using the given stage as a starting point.\n\n E A\n / \\ / \\\n D F B C G\n / \\ \\ --- reverse --> \\ / /\n B C G D F\n \\ / \\ /\n A E\n\n The derived evaluation of _downstream_ B would be: [B, D, E]\n \"\"\"\n import networkx as nx\n\n if single_item:\n all_pipelines = stages\n else:\n all_pipelines = []\n for stage in stages:\n if downstream:\n # NOTE (py3 only):\n # Python's `deepcopy` defaults to pickle/unpickle the object.\n # Stages are complex objects (with references to `repo`,\n # `outs`, and `deps`) that cause struggles when you try\n # to serialize them. We need to create a copy of the graph\n # itself, and then reverse it, instead of using\n # graph.reverse() directly because it calls `deepcopy`\n # underneath -- unless copy=False is specified.\n all_pipelines += nx.dfs_preorder_nodes(\n G.copy().reverse(copy=False), stage\n )\n else:\n all_pipelines += nx.dfs_postorder_nodes(G, stage)\n\n pipeline = []\n for stage in all_pipelines:\n if stage not in pipeline:\n pipeline.append(stage)\n\n result = []\n for stage in pipeline:\n try:\n ret = _reproduce_stage(stage, **kwargs)\n\n if len(ret) != 0 and ignore_build_cache:\n # NOTE: we are walking our pipeline from the top to the\n # bottom. If one stage is changed, it will be reproduced,\n # which tells us that we should force reproducing all of\n # the other stages down below, even if their direct\n # dependencies didn't change.\n kwargs[\"force\"] = True\n\n result.extend(ret)\n except Exception as exc:\n raise ReproductionError(stage.relpath) from exc\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py__cloud_status__cloud_status.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py__cloud_status__cloud_status.return.ret", "embedding": null, "metadata": {"file_path": "dvc/repo/status.py", "file_name": "status.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 100, "span_ids": ["_cloud_status"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _cloud_status(\n self,\n targets=None,\n jobs=None,\n remote=None,\n all_branches=False,\n with_deps=False,\n all_tags=False,\n all_commits=False,\n):\n \"\"\"Returns a dictionary with the files that are new or deleted.\n\n - new: Remote doesn't have the file\n - deleted: File is no longer in the local cache\n\n Example:\n Given the following commands:\n\n $ echo \"foo\" > foo\n $ echo \"bar\" > bar\n $ dvc add foo bar\n $ dvc status -c\n\n It will return something like:\n\n { \"foo\": \"new\", \"bar\": \"new\" }\n\n Now, after pushing and removing \"bar\" from the local cache:\n\n $ dvc push\n $ rm .dvc/cache/c1/57a79031e1c40f85931829bc5fc552\n\n The result would be:\n\n { \"bar\": \"deleted\" }\n \"\"\"\n import dvc.remote.base as cloud\n\n used = self.used_cache(\n targets,\n all_branches=all_branches,\n all_tags=all_tags,\n all_commits=all_commits,\n with_deps=with_deps,\n force=True,\n remote=remote,\n jobs=jobs,\n )\n\n ret = {}\n status_info = self.cloud.status(used, jobs, remote=remote)\n for info in status_info.values():\n name = info[\"name\"]\n status = info[\"status\"]\n if status in [cloud.STATUS_OK, cloud.STATUS_MISSING]:\n continue\n\n prefix_map = {cloud.STATUS_DELETED: \"deleted\", cloud.STATUS_NEW: \"new\"}\n\n ret[name] = prefix_map[status]\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_status_", "embedding": null, "metadata": {"file_path": "dvc/repo/status.py", "file_name": "status.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 138, "span_ids": ["status"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@locked\ndef status(\n self,\n targets=None,\n jobs=None,\n cloud=False,\n remote=None,\n all_branches=False,\n with_deps=False,\n all_tags=False,\n all_commits=False,\n):\n if cloud or remote:\n return _cloud_status(\n self,\n targets,\n jobs,\n all_branches=all_branches,\n with_deps=with_deps,\n remote=remote,\n all_tags=all_tags,\n all_commits=all_commits,\n )\n\n ignored = list(\n compress(\n [\"--all-branches\", \"--all-tags\", \"--all-commits\", \"--jobs\"],\n [all_branches, all_tags, all_commits, jobs],\n )\n )\n if ignored:\n msg = \"The following options are meaningless for local status: {}\"\n raise InvalidArgumentError(msg.format(\", \".join(ignored)))\n\n return _local_status(self, targets, with_deps=with_deps)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/__init__.py__Manages_source_control_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/__init__.py__Manages_source_control_", "embedding": null, "metadata": {"file_path": "dvc/scm/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["NoSCM", "SCM", "NoSCM.__getattr__", "docstring"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages source control systems (e.g. Git).\"\"\"\n\nfrom dvc.scm.base import Base, NoSCMError\nfrom dvc.scm.git import Git\n\n\n# Syntactic sugar to signal that this is an actual implementation for a DVC\n# project under no SCM control.\nclass NoSCM(Base):\n def __getattr__(self, name):\n raise NoSCMError\n\n\ndef SCM(\n root_dir, search_parent_directories=True, no_scm=False\n): # pylint: disable=invalid-name\n \"\"\"Returns SCM instance that corresponds to a repo at the specified\n path.\n\n Args:\n root_dir (str): path to a root directory of the repo.\n search_parent_directories (bool): whether to look for repo root in\n parent directories.\n no_scm (bool): return NoSCM if True.\n\n Returns:\n dvc.scm.base.Base: SCM instance.\n \"\"\"\n\n if no_scm:\n return NoSCM(root_dir)\n\n return Git(root_dir, search_parent_directories=search_parent_directories)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._prepare_db_State._prepare_db.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._prepare_db_State._prepare_db.None_4", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 208, "span_ids": ["State._prepare_db"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def _prepare_db(self, empty=False):\n from dvc import __version__\n\n if not empty:\n cmd = \"PRAGMA user_version;\"\n self._execute(cmd)\n ret = self._fetchall()\n assert len(ret) == 1\n assert len(ret[0]) == 1\n assert isinstance(ret[0][0], int)\n version = ret[0][0]\n\n if version > self.VERSION:\n raise StateVersionTooNewError(\n __version__, self.VERSION, version\n )\n elif version < self.VERSION:\n logger.warning(\n \"State file version '%d' is too old. \"\n \"Reformatting to the current version '%d'.\",\n version,\n self.VERSION,\n )\n cmd = \"DROP TABLE IF EXISTS {};\"\n self._execute(cmd.format(self.STATE_TABLE))\n self._execute(cmd.format(self.STATE_INFO_TABLE))\n self._execute(cmd.format(self.LINK_STATE_TABLE))\n\n # Check that the state file is indeed a database\n cmd = \"CREATE TABLE IF NOT EXISTS {} ({})\"\n self._execute(cmd.format(self.STATE_TABLE, self.STATE_TABLE_LAYOUT))\n self._execute(\n cmd.format(self.STATE_INFO_TABLE, self.STATE_INFO_TABLE_LAYOUT)\n )\n self._execute(\n cmd.format(self.LINK_STATE_TABLE, self.LINK_STATE_TABLE_LAYOUT)\n )\n\n cmd = (\n \"INSERT OR IGNORE INTO {} (count) SELECT 0 \"\n \"WHERE NOT EXISTS (SELECT * FROM {})\"\n )\n self._execute(cmd.format(self.STATE_INFO_TABLE, self.STATE_INFO_TABLE))\n\n cmd = \"PRAGMA user_version = {};\"\n self._execute(cmd.format(self.VERSION))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.load_State._vacuum.self.database.isolation_level_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.load_State._vacuum.self.database.isolation_level_1._", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 246, "span_ids": ["State.load", "State._vacuum"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def load(self):\n \"\"\"Loads state database.\"\"\"\n retries = 1\n while True:\n assert self.database is None\n assert self.cursor is None\n assert self.inserts == 0\n empty = not os.path.exists(self.state_file)\n # NOTE: we use nolock option because fcntl() lock sqlite uses\n # doesn't work on some older NFS/CIFS filesystems.\n # This opens a possibility of data corruption by concurrent writes,\n # which is prevented by repo lock.\n self.database = _connect_sqlite(self.state_file, {\"nolock\": 1})\n self.cursor = self.database.cursor()\n\n # Try loading once to check that the file is indeed a database\n # and reformat it if it is not.\n try:\n self._prepare_db(empty=empty)\n return\n except sqlite3.DatabaseError:\n self.cursor.close()\n self.database.close()\n self.database = None\n self.cursor = None\n self.inserts = 0\n if retries > 0:\n os.unlink(self.state_file)\n retries -= 1\n else:\n raise\n\n def _vacuum(self):\n # NOTE: see https://bugs.python.org/issue28518\n self.database.isolation_level = None\n self._execute(\"VACUUM\")\n self.database.isolation_level = \"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.dump_State.dump.self.inserts.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.dump_State.dump.self.inserts.0", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 248, "end_line": 295, "span_ids": ["State.dump"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def dump(self):\n \"\"\"Saves state database.\"\"\"\n assert self.database is not None\n\n cmd = \"SELECT count from {} WHERE rowid=?\".format(\n self.STATE_INFO_TABLE\n )\n self._execute(cmd, (self.STATE_INFO_ROW,))\n ret = self._fetchall()\n assert len(ret) == 1\n assert len(ret[0]) == 1\n count = self._from_sqlite(ret[0][0]) + self.inserts\n\n if count > self.row_limit:\n msg = \"cleaning up state, this might take a while.\"\n logger.warning(msg)\n\n delete = count - self.row_limit\n delete += int(self.row_limit * (self.row_cleanup_quota / 100.0))\n cmd = (\n \"DELETE FROM {} WHERE timestamp IN (\"\n \"SELECT timestamp FROM {} ORDER BY timestamp ASC LIMIT {});\"\n )\n self._execute(\n cmd.format(self.STATE_TABLE, self.STATE_TABLE, delete)\n )\n\n self._vacuum()\n\n cmd = \"SELECT COUNT(*) FROM {}\"\n\n self._execute(cmd.format(self.STATE_TABLE))\n ret = self._fetchall()\n assert len(ret) == 1\n assert len(ret[0]) == 1\n count = ret[0][0]\n\n cmd = \"UPDATE {} SET count = ? WHERE rowid = ?\".format(\n self.STATE_INFO_TABLE\n )\n self._execute(cmd, (self._to_sqlite(count), self.STATE_INFO_ROW))\n\n self.database.commit()\n self.cursor.close()\n self.database.close()\n self.database = None\n self.cursor = None\n self.inserts = 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_darwin_System._reflink_darwin.return.clonefile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_darwin_System._reflink_darwin.return.clonefile_", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 77, "span_ids": ["System._reflink_darwin"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def _reflink_darwin(src, dst):\n import ctypes\n\n LIBC = \"libc.dylib\"\n LIBC_FALLBACK = \"/usr/lib/libSystem.dylib\"\n try:\n clib = ctypes.CDLL(LIBC)\n except OSError as exc:\n logger.debug(\n \"unable to access '{}' (errno '{}'). \"\n \"Falling back to '{}'.\".format(LIBC, exc.errno, LIBC_FALLBACK)\n )\n if exc.errno != errno.ENOENT:\n raise\n # NOTE: trying to bypass System Integrity Protection (SIP)\n clib = ctypes.CDLL(LIBC_FALLBACK)\n\n if not hasattr(clib, \"clonefile\"):\n return -1\n\n clonefile = clib.clonefile\n clonefile.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int]\n clonefile.restype = ctypes.c_int\n\n return clonefile(\n ctypes.c_char_p(src.encode(\"utf-8\")),\n ctypes.c_char_p(dst.encode(\"utf-8\")),\n ctypes.c_int(0),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 113, "span_ids": ["System._reflink_linux", "System._reflink_windows"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def _reflink_windows(src, dst):\n return -1\n\n @staticmethod\n def _reflink_linux(src, dst):\n import os\n import fcntl\n\n FICLONE = 0x40049409\n\n try:\n ret = 255\n with open(src, \"r\") as s, open(dst, \"w+\") as d:\n ret = fcntl.ioctl(d.fileno(), FICLONE, s.fileno())\n finally:\n if ret != 0:\n os.unlink(dst)\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 118, "span_ids": ["System.reflink"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def reflink(source, link_name):\n source, link_name = fspath(source), fspath(link_name)\n\n system = platform.system()\n try:\n if system == \"Windows\":\n ret = System._reflink_windows(source, link_name)\n elif system == \"Darwin\":\n ret = System._reflink_darwin(source, link_name)\n elif system == \"Linux\":\n ret = System._reflink_linux(source, link_name)\n else:\n ret = -1\n except IOError:\n ret = -1\n\n if ret != 0:\n raise DvcException(\"reflink is not supported\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.inode_System.inode.return.inode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.inode_System.inode.return.inode", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 239, "span_ids": ["System.inode"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def inode(path):\n path = fspath(path)\n\n if System.is_unix():\n import ctypes\n\n inode = os.lstat(path).st_ino\n # NOTE: See https://bugs.python.org/issue29619 and\n # https://stackoverflow.com/questions/34643289/\n # pythons-os-stat-is-returning-wrong-inode-value\n inode = ctypes.c_ulong(inode).value\n else:\n # getdirinfo from ntfsutils works on both files and dirs\n info = System._getdirinfo(path)\n inode = abs(\n hash(\n (\n info.dwVolumeSerialNumber,\n info.nFileIndexHigh,\n info.nFileIndexLow,\n )\n )\n )\n assert inode >= 0\n assert inode < 2 ** 64\n return inode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._check_Updater._check.if_self__is_outdated_.self__notify_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._check_Updater._check.if_self__is_outdated_.self__notify_", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 66, "span_ids": ["Updater._check"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Updater(object):\n\n def _check(self):\n if not os.path.exists(self.updater_file) or self._is_outdated_file():\n self.fetch()\n return\n\n with open(self.updater_file, \"r\") as fobj:\n import json\n\n try:\n info = json.load(fobj)\n self.latest = info[\"version\"]\n except Exception as exc:\n msg = \"'{}' is not a valid json: {}\"\n logger.debug(msg.format(self.updater_file, exc))\n self.fetch()\n return\n\n if self._is_outdated():\n self._notify()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.cloud.storage.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.cloud.storage.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-google.cloud.storage.py", "file_name": "hook-google.cloud.storage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 10, "span_ids": ["imports"], "tokens": 74}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"google-cloud-storage\")\n\n# NOTE: including \"requests\" metadata because of google-resumable-media\n# bug. See [1] for more info.\n#\n# [1] https://github.com/googleapis/google-resumable-media-python/issues/59\ndatas += copy_metadata(\"requests\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google_compute_engine.logger.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google_compute_engine.logger.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-google_compute_engine.logger.py", "file_name": "hook-google_compute_engine.logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["imports"], "tokens": 28}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"google-compute-engine\")\nhiddenimports = [\"google_cloud_engine\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__", "embedding": null, "metadata": {"file_path": "scripts/innosetup/config_gen.py", "file_name": "config_gen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 12, "span_ids": ["docstring"], "tokens": 68}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# This script generates config.ini for setup.iss script\nimport configparser\n\nfrom dvc import __version__\n\nconfig = configparser.ConfigParser()\nconfig.add_section(\"Version\")\nconfig.set(\"Version\", \"Version\", __version__)\n\nwith open(\"scripts/innosetup/config.ini\", \"w\") as f:\n config.write(f)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py_os_", "embedding": null, "metadata": {"file_path": "tests/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["imports"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport sys\nfrom subprocess import check_call\n\n\nREPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nos.chdir(REPO_ROOT)\n\nos.putenv(\n \"PATH\", \":\".join([os.path.join(REPO_ROOT, \"bin\"), os.getenv(\"PATH\")])\n)\nos.putenv(\"DVC_HOME\", REPO_ROOT)\n\nparams = \" \".join(sys.argv[1:])\n\ncmd = (\n \"py.test -v -n=4 --timeout=600 --timeout_method=thread --log-level=debug\"\n \" --cov=dvc {params} --durations=0\".format(params=params)\n)\ncheck_call(cmd, shell=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_StaticFileServer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_StaticFileServer_", "embedding": null, "metadata": {"file_path": "tests/utils/httpd.py", "file_name": "httpd.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 87, "span_ids": ["StaticFileServer.__exit__", "StaticFileServer", "StaticFileServer.__init__", "StaticFileServer.__enter__"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StaticFileServer:\n _lock = threading.Lock()\n\n def __init__(self, handler_class=ETagHandler):\n self._lock.acquire()\n self._httpd = HTTPServer((\"localhost\", 0), handler_class)\n self._thread = None\n\n def __enter__(self):\n self._thread = threading.Thread(target=self._httpd.serve_forever)\n self._thread.daemon = True\n self._thread.start()\n return self._httpd\n\n def __exit__(self, *args):\n self._httpd.socket.close()\n self._httpd.shutdown()\n self._httpd.server_close()\n self._lock.release()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__Helpers_for_other_modu_dos2unix.return.data_replace_b_r_n_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__Helpers_for_other_modu_dos2unix.return.data_replace_b_r_n_b_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["dos2unix", "docstring"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Helpers for other modules.\"\"\"\n\nimport hashlib\nimport json\nimport logging\nimport math\nimport os\nimport re\nimport sys\nimport time\nimport io\n\nimport colorama\nimport nanotime\nfrom ruamel.yaml import YAML\nfrom shortuuid import uuid\n\nfrom dvc.compat import fspath, fspath_py35\n\n\nlogger = logging.getLogger(__name__)\n\nLOCAL_CHUNK_SIZE = 2 ** 20 # 1 MB\nLARGE_FILE_SIZE = 2 ** 30 # 1 GB\nLARGE_DIR_SIZE = 100\nTARGET_REGEX = re.compile(r\"^(?P.*):(?P[^\\\\/@:]*)$\")\n\n\ndef dos2unix(data):\n return data.replace(b\"\\r\\n\", b\"\\n\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 62, "span_ids": ["add_parser"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n ADD_HELP = \"Track data files or directories with DVC.\"\n\n parser = subparsers.add_parser(\n \"add\",\n parents=[parent_parser],\n description=append_doc_link(ADD_HELP, \"add\"),\n help=ADD_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Recursively add files under directory targets.\",\n )\n parser.add_argument(\n \"--no-commit\",\n action=\"store_true\",\n default=False,\n help=\"Don't put files/directories into cache.\",\n )\n parser.add_argument(\n \"-f\",\n \"--file\",\n help=\"Specify name of the DVC-file this command will generate.\",\n metavar=\"\",\n )\n parser.add_argument(\n \"targets\", nargs=\"+\", help=\"Input files/directories to add.\"\n )\n parser.set_defaults(func=CmdAdd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/init.py", "file_name": "init.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 72, "span_ids": ["add_parser"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n \"\"\"Setup parser for `dvc init`.\"\"\"\n INIT_HELP = \"Initialize DVC in the current directory.\"\n INIT_DESCRIPTION = (\n \"Initialize DVC in the current directory. Expects directory\\n\"\n \"to be a Git repository unless --no-scm option is specified.\"\n )\n\n init_parser = subparsers.add_parser(\n \"init\",\n parents=[parent_parser],\n description=append_doc_link(INIT_DESCRIPTION, \"init\"),\n help=INIT_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n init_parser.add_argument(\n \"--no-scm\",\n action=\"store_true\",\n default=False,\n help=\"Initiate DVC in directory that is \"\n \"not tracked by any SCM tool (e.g. Git).\",\n )\n init_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=(\n \"Overwrite existing '.dvc/' directory. \"\n \"This operation removes local cache.\"\n ),\n )\n init_parser.add_argument(\n \"--subdir\",\n action=\"store_true\",\n default=False,\n help=(\n \"Necessary for running this command inside a subdirectory of a \"\n \"parent SCM repository.\"\n ),\n )\n init_parser.set_defaults(func=CmdInit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._show_ascii_CmdPipelineShow._show_dependencies_tree.tree_show_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._show_ascii_CmdPipelineShow._show_dependencies_tree.tree_show_", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 101, "span_ids": ["CmdPipelineShow._show_dependencies_tree", "CmdPipelineShow._show_ascii"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdPipelineShow(CmdBase):\n\n def _show_ascii(self, target, commands, outs):\n from dvc.dagascii import draw\n\n nodes, edges, _ = self._build_graph(target, commands, outs)\n\n if not nodes:\n return\n\n draw(nodes, edges)\n\n def _show_dependencies_tree(self, target, commands, outs):\n from treelib import Tree\n\n nodes, edges, is_tree = self._build_graph(target, commands, outs)\n if not nodes:\n return\n if not is_tree:\n raise DvcException(\n \"DAG is not a tree, can not print it in tree-structure way, \"\n \"please use --ascii instead\"\n )\n\n tree = Tree()\n tree.create_node(target, target) # Root node\n observe_list = [target]\n while len(observe_list) > 0:\n current_root = observe_list[0]\n for edge in edges:\n if edge[0] == current_root:\n tree.create_node(edge[1], edge[1], parent=current_root)\n observe_list.append(edge[1])\n observe_list.pop(0)\n tree.show()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/tag.py", "file_name": "tag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 155, "span_ids": ["add_parser"], "tokens": 665}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n TAG_HELP = \"A set of commands to manage DVC tags.\"\n tag_parser = subparsers.add_parser(\n \"tag\",\n parents=[parent_parser],\n description=append_doc_link(TAG_HELP, \"tag\"),\n add_help=False,\n )\n\n tag_subparsers = tag_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use DVC tag CMD --help to display command-specific help.\",\n )\n\n fix_subparsers(tag_subparsers)\n\n TAG_ADD_HELP = \"Add DVC tag.\"\n tag_add_parser = tag_subparsers.add_parser(\n \"add\",\n parents=[parent_parser],\n description=append_doc_link(TAG_ADD_HELP, \"tag-add\"),\n help=TAG_ADD_HELP,\n )\n tag_add_parser.add_argument(\"tag\", help=\"Dvc tag.\")\n tag_add_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"DVC-files.\"\n )\n tag_add_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Add tag for all dependencies of the specified DVC-file.\",\n )\n tag_add_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Add tag for subdirectories of the specified directory.\",\n )\n tag_add_parser.set_defaults(func=CmdTagAdd)\n\n TAG_REMOVE_HELP = \"Remove DVC tag.\"\n tag_remove_parser = tag_subparsers.add_parser(\n \"remove\",\n parents=[parent_parser],\n description=append_doc_link(TAG_REMOVE_HELP, \"tag-remove\"),\n help=TAG_REMOVE_HELP,\n )\n tag_remove_parser.add_argument(\"tag\", help=\"Dvc tag.\")\n tag_remove_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"DVC-files.\"\n )\n tag_remove_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Remove tag for all dependencies of the specified DVC-file.\",\n )\n tag_remove_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Remove tag for subdirectories of the specified directory.\",\n )\n tag_remove_parser.set_defaults(func=CmdTagRemove)\n\n TAG_LIST_HELP = \"List DVC tags.\"\n tag_list_parser = tag_subparsers.add_parser(\n \"list\",\n parents=[parent_parser],\n description=append_doc_link(TAG_LIST_HELP, \"tag-list\"),\n help=TAG_LIST_HELP,\n )\n tag_list_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"DVC-files.\"\n )\n tag_list_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"List tags for all dependencies of the specified DVC-file.\",\n )\n tag_list_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"List tags for subdirectories of the specified directory.\",\n )\n tag_list_parser.set_defaults(func=CmdTagList)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.OutputLOCAL_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.OutputLOCAL_", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 97, "span_ids": ["_get"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get(stage, p, info, cache, metric, persist=False, tags=None):\n parsed = urlparse(p)\n\n if parsed.scheme == \"remote\":\n remote = Remote(stage.repo, name=parsed.netloc)\n return OUTS_MAP[remote.scheme](\n stage,\n p,\n info,\n cache=cache,\n remote=remote,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n\n for o in OUTS:\n if o.supported(p):\n return o(\n stage,\n p,\n info,\n cache=cache,\n remote=None,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n return OutputLOCAL(\n stage,\n p,\n info,\n cache=cache,\n remote=None,\n metric=metric,\n persist=persist,\n tags=tags,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_show_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_show_", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 118, "span_ids": ["show"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@locked\ndef show(\n repo,\n targets=None,\n all_branches=False,\n all_tags=False,\n recursive=False,\n revs=None,\n all_commits=False,\n):\n res = {}\n\n for rev in repo.brancher(\n revs=revs,\n all_branches=all_branches,\n all_tags=all_tags,\n all_commits=all_commits,\n ):\n metrics = _collect_metrics(repo, targets, recursive)\n vals = _read_metrics(repo, metrics, rev)\n\n if vals:\n res[rev] = vals\n\n if not res:\n raise NoMetricsError()\n\n # Hide working tree metrics if they are the same as in the active branch\n try:\n active_branch = repo.scm.active_branch()\n except TypeError:\n pass # Detached head\n else:\n if res.get(\"working tree\") == res.get(active_branch):\n res.pop(\"working tree\", None)\n\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/scm_context.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/scm_context.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/scm_context.py", "file_name": "scm_context.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["scm_context"], "tokens": 81}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def scm_context(method):\n def run(repo, *args, **kw):\n try:\n result = method(repo, *args, **kw)\n repo.scm.reset_ignores()\n repo.scm.remind_to_track()\n repo.scm.reset_tracked_files()\n return result\n except Exception:\n repo.scm.cleanup_ignores()\n raise\n\n return run", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/__init__.py_Tag_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/__init__.py_Tag_", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["Tag.__init__", "Tag.remove", "Tag.list", "Tag.add", "Tag"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Tag(object):\n def __init__(self, repo):\n self.repo = repo\n\n def add(self, *args, **kwargs):\n from dvc.repo.tag.add import add\n\n return add(self.repo, *args, **kwargs)\n\n def list(self, *args, **kwargs):\n from dvc.repo.tag.list import list\n\n return list(self.repo, *args, **kwargs)\n\n def remove(self, *args, **kwargs):\n from dvc.repo.tag.remove import remove\n\n return remove(self.repo, *args, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/list.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/list.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/list.py", "file_name": "list.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["imports", "list"], "tokens": 99}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.repo import locked\n\n\n@locked\ndef list(self, target=None, with_deps=False, recursive=False):\n ret = {}\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n for stage in stages:\n outs_tags = {}\n for out in stage.outs:\n if out.tags:\n outs_tags[str(out)] = out.tags.copy()\n if outs_tags:\n ret.update({stage.relpath: outs_tags})\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py_Base_", "embedding": null, "metadata": {"file_path": "dvc/scm/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 27, "end_line": 158, "span_ids": ["Base.untracked_files", "Base.checkout", "Base.tag", "Base.close", "Base.dir", "Base.ignore", "Base.reset_ignores", "Base.is_repo", "Base.commit", "Base.reset_tracked_files", "Base.root_dir", "Base.list_tags", "Base.branch", "Base.cleanup_ignores", "Base.belongs_to_scm", "Base.add", "Base.install", "Base.list_all_commits", "Base.remind_to_track", "Base.ignore_file", "Base.active_branch", "Base.is_tracked", "Base.is_dirty", "Base.__repr__", "Base", "Base.track_file", "Base.__init__", "Base.ignore_list", "Base.is_submodule", "Base.ignore_remove", "Base.list_branches"], "tokens": 850}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Base(object):\n \"\"\"Base class for source control management driver implementations.\"\"\"\n\n def __init__(self, root_dir=os.curdir):\n self._root_dir = os.path.realpath(root_dir)\n\n @property\n def root_dir(self):\n return self._root_dir\n\n def __repr__(self):\n return \"{class_name}: '{directory}'\".format(\n class_name=type(self).__name__, directory=self.dir\n )\n\n @property\n def dir(self):\n \"\"\"Path to a directory with SCM specific information.\"\"\"\n return None\n\n @staticmethod\n def is_repo(root_dir): # pylint: disable=unused-argument\n \"\"\"Returns whether or not root_dir is a valid SCM repository.\"\"\"\n return True\n\n @staticmethod\n def is_submodule(root_dir): # pylint: disable=unused-argument\n \"\"\"Returns whether or not root_dir is a valid SCM repository\n submodule.\n \"\"\"\n return True\n\n def ignore(self, path): # pylint: disable=unused-argument\n \"\"\"Makes SCM ignore a specified path.\"\"\"\n\n def ignore_remove(self, path): # pylint: disable=unused-argument\n \"\"\"Makes SCM stop ignoring a specified path.\"\"\"\n\n @property\n def ignore_file(self):\n \"\"\"Filename for a file that contains ignored paths for this SCM.\"\"\"\n\n def ignore_list(self, p_list):\n \"\"\"Makes SCM ignore all paths specified in a list.\"\"\"\n return [self.ignore(path) for path in p_list]\n\n def add(self, paths):\n \"\"\"Makes SCM start tracking every path from a specified list of paths.\n \"\"\"\n\n def commit(self, msg):\n \"\"\"Makes SCM create a commit.\"\"\"\n\n def checkout(self, branch, create_new=False):\n \"\"\"Makes SCM checkout a branch.\"\"\"\n\n def branch(self, branch):\n \"\"\"Makes SCM create a branch with a specified name.\"\"\"\n\n def tag(self, tag):\n \"\"\"Makes SCM create a tag with a specified name.\"\"\"\n\n def untracked_files(self): # pylint: disable=no-self-use\n \"\"\"Returns a list of untracked files.\"\"\"\n return []\n\n def is_tracked(self, path): # pylint: disable=no-self-use, unused-argument\n \"\"\"Returns whether or not a specified path is tracked.\"\"\"\n return False\n\n def is_dirty(self):\n \"\"\"Return whether the SCM contains uncommitted changes.\"\"\"\n return False\n\n def active_branch(self): # pylint: disable=no-self-use\n \"\"\"Returns current branch in the repo.\"\"\"\n return \"\"\n\n def list_branches(self): # pylint: disable=no-self-use\n \"\"\"Returns a list of available branches in the repo.\"\"\"\n return []\n\n def list_tags(self): # pylint: disable=no-self-use\n \"\"\"Returns a list of available tags in the repo.\"\"\"\n return []\n\n def list_all_commits(self): # pylint: disable=no-self-use\n \"\"\"Returns a list of commits in the repo.\"\"\"\n return []\n\n def install(self, use_pre_commit_tool=False):\n \"\"\"\n Adds dvc commands to SCM hooks for the repo.\n\n If use_pre_commit_tool is set and pre-commit is\n installed it will be used to install the hooks.\n \"\"\"\n\n def cleanup_ignores(self):\n \"\"\"\n This method should clean up ignores (eg. entries in .gitignore),\n use, when method editing ignores (eg. add, run, import) fails to\n perform its task.\n \"\"\"\n\n def reset_ignores(self):\n \"\"\"\n Method to reset in-memory ignore storing mechanism.\n \"\"\"\n\n def reset_tracked_files(self):\n \"\"\"\n Method to reset in-memory tracked files storing mechanism.\n \"\"\"\n\n def remind_to_track(self):\n \"\"\"\n Method to remind user to track newly created files handled by scm\n \"\"\"\n\n def track_file(self, path):\n \"\"\"\n Method to add file to mechanism that will remind user\n to track new files\n \"\"\"\n\n def belongs_to_scm(self, path):\n \"\"\"Return boolean whether file belongs to scm\"\"\"\n\n def close(self):\n \"\"\" Method to close the files \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_os_BaseTree.walk._Directory_tree_generat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_os_BaseTree.walk._Directory_tree_generat", "embedding": null, "metadata": {"file_path": "dvc/scm/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["BaseTree.open", "imports", "BaseTree.tree_root", "BaseTree.exists", "BaseTree.isdir", "BaseTree", "BaseTree.isfile", "BaseTree.walk"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport stat\n\nfrom dvc.compat import fspath\n\n\nclass BaseTree(object):\n \"\"\"Abstract class to represent access to files\"\"\"\n\n @property\n def tree_root(self):\n pass\n\n def open(self, path, mode=\"r\", encoding=\"utf-8\"):\n \"\"\"Open file and return a stream.\"\"\"\n\n def exists(self, path):\n \"\"\"Test whether a path exists.\"\"\"\n\n def isdir(self, path):\n \"\"\"Return true if the pathname refers to an existing directory.\"\"\"\n\n def isfile(self, path):\n \"\"\"Test whether a path is a regular file\"\"\"\n\n def walk(self, top, topdown=True):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\n - it could raise exceptions, there is no onerror argument\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree_WorkingTree.isfile.return.os_path_isfile_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree_WorkingTree.isfile.return.os_path_isfile_path_", "embedding": null, "metadata": {"file_path": "dvc/scm/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 58, "span_ids": ["WorkingTree.__init__", "WorkingTree.tree_root", "WorkingTree.isdir", "WorkingTree", "WorkingTree.exists", "WorkingTree.isfile", "WorkingTree.open"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WorkingTree(BaseTree):\n \"\"\"Proxies the repo file access methods to working tree files\"\"\"\n\n def __init__(self, repo_root=os.getcwd()):\n self.repo_root = repo_root\n\n @property\n def tree_root(self):\n return self.repo_root\n\n def open(self, path, mode=\"r\", encoding=\"utf-8\"):\n \"\"\"Open file and return a stream.\"\"\"\n return open(path, mode=mode, encoding=encoding)\n\n def exists(self, path):\n \"\"\"Test whether a path exists.\"\"\"\n return os.path.lexists(path)\n\n def isdir(self, path):\n \"\"\"Return true if the pathname refers to an existing directory.\"\"\"\n return os.path.isdir(path)\n\n def isfile(self, path):\n \"\"\"Test whether a path is a regular file\"\"\"\n return os.path.isfile(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree.walk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree.walk_", "embedding": null, "metadata": {"file_path": "dvc/scm/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 88, "span_ids": ["WorkingTree.isexec", "WorkingTree.walk", "is_working_tree"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WorkingTree(BaseTree):\n\n def walk(self, top, topdown=True):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\n - it could raise exceptions, there is no onerror argument\n \"\"\"\n\n top = fspath(top)\n\n def onerror(e):\n raise e\n\n for root, dirs, files in os.walk(\n top, topdown=topdown, onerror=onerror\n ):\n yield os.path.normpath(root), dirs, files\n\n def isexec(self, path):\n mode = os.stat(path).st_mode\n return mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n\ndef is_working_tree(tree):\n return isinstance(tree, WorkingTree) or isinstance(\n getattr(tree, \"tree\", None), WorkingTree\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_gs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_gs.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_gs.py", "file_name": "test_gs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["TestDependencyGS._get_cls", "imports", "TestDependencyGS"], "tokens": 41}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.gs import DependencyGS\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencyGS(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencyGS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_hdfs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_hdfs.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_hdfs.py", "file_name": "test_hdfs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["imports", "TestDependencyHDFS._get_cls", "TestDependencyHDFS"], "tokens": 45}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.hdfs import DependencyHDFS\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencyHDFS(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencyHDFS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_http.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_http.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_http.py", "file_name": "test_http.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["TestDependencyHTTP._get_cls", "imports", "TestDependencyHTTP"], "tokens": 41}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.http import DependencyHTTP\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencyHTTP(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencyHTTP", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_local.py_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_local.py_mock_", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 21, "span_ids": ["TestDependencyLOCAL._get_dependency", "TestDependencyLOCAL", "imports", "TestDependencyLOCAL.test_save_missing", "TestDependencyLOCAL._get_cls"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\n\nfrom dvc.dependency import DependencyLOCAL\nfrom dvc.stage import Stage\nfrom tests.basic_env import TestDvc\n\n\nclass TestDependencyLOCAL(TestDvc):\n def _get_cls(self):\n return DependencyLOCAL\n\n def _get_dependency(self):\n stage = Stage(self.dvc)\n return self._get_cls()(stage, \"path\")\n\n def test_save_missing(self):\n d = self._get_dependency()\n with mock.patch.object(d.remote, \"exists\", return_value=False):\n with self.assertRaises(d.DoesNotExistError):\n d.save()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_s3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_s3.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["TestDependencyS3._get_cls", "imports", "TestDependencyS3"], "tokens": 45}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.s3 import DependencyS3\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencyS3(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencyS3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_ssh.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_ssh.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["imports", "TestDependencySSH._get_cls", "TestDependencySSH"], "tokens": 42}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.ssh import DependencySSH\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencySSH(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencySSH", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_gs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_gs.py__", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_gs.py", "file_name": "test_gs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["imports", "TestOutputGS", "TestOutputGS._get_cls"], "tokens": 39}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.gs import OutputGS\nfrom tests.unit.output.test_local import TestOutputLOCAL\n\n\nclass TestOutputGS(TestOutputLOCAL):\n def _get_cls(self):\n return OutputGS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_hdfs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_hdfs.py__", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_hdfs.py", "file_name": "test_hdfs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["imports", "TestOutputHDFS._get_cls", "TestOutputHDFS"], "tokens": 43}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.hdfs import OutputHDFS\nfrom tests.unit.output.test_local import TestOutputLOCAL\n\n\nclass TestOutputHDFS(TestOutputLOCAL):\n def _get_cls(self):\n return OutputHDFS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_TestGetFilesNumber_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_TestGetFilesNumber_", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 96, "span_ids": ["TestGetFilesNumber.test_return_multiple_for_dir", "TestGetFilesNumber.test_return_0_on_no_cache", "TestGetFilesNumber", "TestGetFilesNumber.test_return_1_on_single_file_cache", "TestGetFilesNumber._get_output"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGetFilesNumber(TestDvc):\n def _get_output(self):\n stage = Stage(self.dvc)\n return OutputLOCAL(stage, \"path\")\n\n def test_return_0_on_no_cache(self):\n o = self._get_output()\n o.use_cache = False\n self.assertEqual(0, o.get_files_number())\n\n @patch.object(OutputLOCAL, \"checksum\", \"12345678.dir\")\n @patch.object(\n RemoteLOCAL,\n \"get_dir_cache\",\n return_value=[{\"md5\": \"asdf\"}, {\"md5\": \"qwe\"}],\n )\n def test_return_multiple_for_dir(self, mock_get_dir_cache):\n o = self._get_output()\n\n self.assertEqual(2, o.get_files_number())\n\n @patch.object(OutputLOCAL, \"checksum\", \"12345678\")\n @patch.object(OutputLOCAL, \"is_dir_checksum\", False)\n def test_return_1_on_single_file_cache(self):\n o = self._get_output()\n\n self.assertEqual(1, o.get_files_number())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_s3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_s3.py__", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["imports", "TestOutputS3._get_cls", "TestOutputS3"], "tokens": 43}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.s3 import OutputS3\nfrom tests.unit.output.test_local import TestOutputLOCAL\n\n\nclass TestOutputS3(TestOutputLOCAL):\n def _get_cls(self):\n return OutputS3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_ssh.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_ssh.py__", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["imports", "TestOutputSSH._get_cls", "TestOutputSSH"], "tokens": 40}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.ssh import OutputSSH\nfrom tests.unit.output.test_local import TestOutputLOCAL\n\n\nclass TestOutputSSH(TestOutputLOCAL):\n def _get_cls(self):\n return OutputSSH", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_prompt.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_prompt.py__", "embedding": null, "metadata": {"file_path": "tests/unit/test_prompt.py", "file_name": "test_prompt.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["TestConfirm.test_eof", "imports", "TestConfirm"], "tokens": 88}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from unittest import TestCase\n\nimport mock\n\nfrom dvc.prompt import confirm\n\n\nclass TestConfirm(TestCase):\n @mock.patch(\"sys.stdout.isatty\", return_value=True)\n @mock.patch(\"dvc.prompt.input\", side_effect=EOFError)\n def test_eof(self, mock_input, mock_isatty):\n ret = confirm(\"message\")\n mock_isatty.assert_called()\n mock_input.assert_called()\n self.assertFalse(ret)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink_TestContainsLink.test_should_return_false_on_no_more_dirs_below_path.dirname_patch_assert_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink_TestContainsLink.test_should_return_false_on_no_more_dirs_below_path.dirname_patch_assert_call", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 62, "span_ids": ["TestContainsLink.test_should_return_false_on_path_eq_to_base_path", "TestContainsLink.test_should_return_false_on_no_more_dirs_below_path", "TestContainsLink.test_should_raise_exception_on_base_path_not_in_path", "TestContainsLink.test_should_return_true_on_symlink_in_path", "TestContainsLink"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestContainsLink(TestCase):\n def test_should_raise_exception_on_base_path_not_in_path(self):\n with self.assertRaises(BasePathNotInCheckedPathException):\n contains_symlink_up_to(os.path.join(\"foo\", \"path\"), \"bar\")\n\n @patch.object(System, \"is_symlink\", return_value=True)\n def test_should_return_true_on_symlink_in_path(self, _):\n base_path = \"foo\"\n path = os.path.join(base_path, \"bar\")\n self.assertTrue(contains_symlink_up_to(path, base_path))\n\n @patch.object(System, \"is_symlink\", return_value=False)\n def test_should_return_false_on_path_eq_to_base_path(self, _):\n path = \"path\"\n self.assertFalse(contains_symlink_up_to(path, path))\n\n @patch.object(System, \"is_symlink\", return_value=False)\n @patch.object(os.path, \"dirname\", side_effect=lambda arg: arg)\n def test_should_return_false_on_no_more_dirs_below_path(\n self, dirname_patch, _\n ):\n self.assertFalse(\n contains_symlink_up_to(os.path.join(\"foo\", \"path\"), \"foo\")\n )\n dirname_patch.assert_called_once()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 157, "span_ids": ["add_parser"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n DIFF_DESCRIPTION = (\n \"Show added, modified, or deleted data between commits in the DVC\"\n \" repository, or between a commit and the workspace.\"\n )\n diff_parser = subparsers.add_parser(\n \"diff\",\n parents=[parent_parser],\n description=append_doc_link(DIFF_DESCRIPTION, \"diff\"),\n help=DIFF_DESCRIPTION,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n diff_parser.add_argument(\n \"a_rev\",\n help=\"Old Git commit to compare (defaults to HEAD)\",\n nargs=\"?\",\n default=\"HEAD\",\n )\n diff_parser.add_argument(\n \"b_rev\",\n help=(\"New Git commit to compare (defaults to the current workspace)\"),\n nargs=\"?\",\n )\n diff_parser.add_argument(\n \"--show-json\",\n help=\"Format the output into a JSON\",\n action=\"store_true\",\n default=False,\n )\n diff_parser.add_argument(\n \"--show-hash\",\n help=\"Display hash value for each entry\",\n action=\"store_true\",\n default=False,\n )\n diff_parser.set_defaults(func=CmdDiff)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_logging_CmdTagList.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_logging_CmdTagList.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/tag.py", "file_name": "tag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 59, "span_ids": ["CmdTagList", "CmdTagAdd", "imports", "CmdTagAdd.run", "CmdTagList.run", "CmdTagRemove.run", "CmdTagRemove"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.command.base import fix_subparsers\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import to_yaml_string\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdTagAdd(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.tag.add(\n self.args.tag,\n target=target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.exception(\"failed to add tag\")\n return 1\n return 0\n\n\nclass CmdTagRemove(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.tag.remove(\n self.args.tag,\n target=target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.exception(\"failed to remove tag\")\n return 1\n return 0\n\n\nclass CmdTagList(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n tags = self.repo.tag.list(\n target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n if tags:\n logger.info(to_yaml_string(tags))\n except DvcException:\n logger.exception(\"failed list tags\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_", "embedding": null, "metadata": {"file_path": "dvc/daemon.py", "file_name": "daemon.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 104, "span_ids": ["_spawn", "daemon"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _spawn(cmd, env):\n logger.debug(\"Trying to spawn '{}'\".format(cmd))\n\n if os.name == \"nt\":\n _spawn_windows(cmd, env)\n elif os.name == \"posix\":\n _spawn_posix(cmd, env)\n else:\n raise NotImplementedError\n\n logger.debug(\"Spawned '{}'\".format(cmd))\n\n\ndef daemon(args):\n \"\"\"Launch a `dvc daemon` command in a detached process.\n\n Args:\n args (list): list of arguments to append to `dvc daemon` command.\n \"\"\"\n if os.environ.get(DVC_DAEMON):\n logger.debug(\"skipping launching a new daemon.\")\n return\n\n cmd = [sys.executable]\n if not is_binary():\n cmd += [sys.argv[0]]\n cmd += [\"daemon\", \"-q\"] + args\n\n env = fix_env()\n file_path = os.path.abspath(inspect.stack()[0][1])\n env[\"PYTHONPATH\"] = os.path.dirname(os.path.dirname(file_path))\n env[DVC_DAEMON] = \"1\"\n\n _spawn(cmd, env)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/env.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/env.py__", "embedding": null, "metadata": {"file_path": "dvc/env.py", "file_name": "env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 3, "span_ids": ["impl"], "tokens": 22}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "DVC_DAEMON = \"DVC_DAEMON\"\nDVC_PAGER = \"DVC_PAGER\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_setup_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_setup_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 198, "span_ids": ["setup"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup(level=logging.INFO):\n colorama.init()\n\n logging.config.dictConfig(\n {\n \"version\": 1,\n \"filters\": {\n \"exclude_errors\": {\"()\": ExcludeErrorsFilter},\n \"exclude_info\": {\"()\": ExcludeInfoFilter},\n },\n \"formatters\": {\"color\": {\"()\": ColorFormatter}},\n \"handlers\": {\n \"console_info\": {\n \"class\": \"dvc.logger.LoggerHandler\",\n \"level\": \"INFO\",\n \"formatter\": \"color\",\n \"stream\": \"ext://sys.stdout\",\n \"filters\": [\"exclude_errors\"],\n },\n \"console_debug\": {\n \"class\": \"dvc.logger.LoggerHandler\",\n \"level\": \"DEBUG\",\n \"formatter\": \"color\",\n \"stream\": \"ext://sys.stdout\",\n \"filters\": [\"exclude_info\"],\n },\n \"console_errors\": {\n \"class\": \"dvc.logger.LoggerHandler\",\n \"level\": \"WARNING\",\n \"formatter\": \"color\",\n \"stream\": \"ext://sys.stderr\",\n },\n },\n \"loggers\": {\n \"dvc\": {\n \"level\": level,\n \"handlers\": [\n \"console_info\",\n \"console_debug\",\n \"console_errors\",\n ],\n },\n },\n \"disable_existing_loggers\": False,\n }\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.commit_OutputBase.dumpd.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.commit_OutputBase.dumpd.return.ret", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 241, "end_line": 267, "span_ids": ["OutputBase.commit", "OutputBase.dumpd"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def commit(self):\n if self.use_cache:\n self.cache.save(self.path_info, self.info)\n\n def dumpd(self):\n ret = copy(self.info)\n ret[self.PARAM_PATH] = self.def_path\n\n if self.IS_DEPENDENCY:\n return ret\n\n ret[self.PARAM_CACHE] = self.use_cache\n\n if isinstance(self.metric, dict):\n if (\n self.PARAM_METRIC_XPATH in self.metric\n and not self.metric[self.PARAM_METRIC_XPATH]\n ):\n del self.metric[self.PARAM_METRIC_XPATH]\n\n ret[self.PARAM_METRIC] = self.metric\n ret[self.PARAM_PERSIST] = self.persist\n\n if self.tags:\n ret[self.PARAM_TAGS] = self.tags\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_multipart_RemoteS3._copy_multipart.s3_complete_multipart_upl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_multipart_RemoteS3._copy_multipart.s3_complete_multipart_upl", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 158, "span_ids": ["RemoteS3._copy_multipart"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n @classmethod\n def _copy_multipart(\n cls, s3, from_info, to_info, size, n_parts, extra_args\n ):\n mpu = s3.create_multipart_upload(\n Bucket=to_info.bucket, Key=to_info.path, **extra_args\n )\n mpu_id = mpu[\"UploadId\"]\n\n parts = []\n byte_position = 0\n for i in range(1, n_parts + 1):\n obj = cls.get_head_object(\n s3, from_info.bucket, from_info.path, PartNumber=i\n )\n part_size = obj[\"ContentLength\"]\n lastbyte = byte_position + part_size - 1\n if lastbyte > size:\n lastbyte = size - 1\n\n srange = \"bytes={}-{}\".format(byte_position, lastbyte)\n\n part = s3.upload_part_copy(\n Bucket=to_info.bucket,\n Key=to_info.path,\n PartNumber=i,\n UploadId=mpu_id,\n CopySourceRange=srange,\n CopySource={\"Bucket\": from_info.bucket, \"Key\": from_info.path},\n )\n parts.append(\n {\"PartNumber\": i, \"ETag\": part[\"CopyPartResult\"][\"ETag\"]}\n )\n byte_position += part_size\n\n assert n_parts == len(parts)\n\n s3.complete_multipart_upload(\n Bucket=to_info.bucket,\n Key=to_info.path,\n UploadId=mpu_id,\n MultipartUpload={\"Parts\": parts},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_RemoteS3._copy.if_etag_cached_etag_.raise_ETagMismatchError_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_RemoteS3._copy.if_etag_cached_etag_.raise_ETagMismatchError_e", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 181, "span_ids": ["RemoteS3._copy"], "tokens": 540}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n @classmethod\n def _copy(cls, s3, from_info, to_info, extra_args):\n # NOTE: object's etag depends on the way it was uploaded to s3 or the\n # way it was copied within the s3. More specifically, it depends on\n # the chunk size that was used to transfer it, which would affect\n # whether an object would be uploaded as a single part or as a\n # multipart.\n #\n # If an object's etag looks like '8978c98bb5a48c2fb5f2c4c905768afa',\n # then it was transferred as a single part, which means that the chunk\n # size used to transfer it was greater or equal to the ContentLength\n # of that object. So to preserve that tag over the next transfer, we\n # could use any value >= ContentLength.\n #\n # If an object's etag looks like '50d67013a5e1a4070bef1fc8eea4d5f9-13',\n # then it was transferred as a multipart, which means that the chunk\n # size used to transfer it was less than ContentLength of that object.\n # Unfortunately, in general, it doesn't mean that the chunk size was\n # the same throughout the transfer, so it means that in order to\n # preserve etag, we need to transfer each part separately, so the\n # object is transfered in the same chunks as it was originally.\n from boto3.s3.transfer import TransferConfig\n\n obj = cls.get_head_object(s3, from_info.bucket, from_info.path)\n etag = obj[\"ETag\"].strip('\"')\n size = obj[\"ContentLength\"]\n\n _, _, parts_suffix = etag.partition(\"-\")\n if parts_suffix:\n n_parts = int(parts_suffix)\n cls._copy_multipart(\n s3, from_info, to_info, size, n_parts, extra_args=extra_args\n )\n else:\n source = {\"Bucket\": from_info.bucket, \"Key\": from_info.path}\n s3.copy(\n source,\n to_info.bucket,\n to_info.path,\n ExtraArgs=extra_args,\n Config=TransferConfig(multipart_threshold=size + 1),\n )\n\n cached_etag = cls.get_etag(s3, to_info.bucket, to_info.path)\n if etag != cached_etag:\n raise ETagMismatchError(etag, cached_etag)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_SSHConnection.walk.if_not_topdown_.yield_directory_dirs_no": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_SSHConnection.walk.if_not_topdown_.yield_directory_dirs_no", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 145, "span_ids": ["SSHConnection.walk"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n def walk(self, directory, topdown=True):\n # NOTE: original os.walk() implementation [1] with default options was\n # used as a template.\n #\n # [1] https://github.com/python/cpython/blob/master/Lib/os.py\n try:\n dir_entries = self.sftp.listdir_attr(directory)\n except IOError as exc:\n raise DvcException(\n \"couldn't get the '{}' remote directory files list\".format(\n directory\n )\n ) from exc\n\n dirs = []\n nondirs = []\n for entry in dir_entries:\n name = entry.filename\n if stat.S_ISDIR(entry.st_mode):\n dirs.append(name)\n else:\n nondirs.append(name)\n\n if topdown:\n yield directory, dirs, nondirs\n\n for dname in dirs:\n newpath = posixpath.join(directory, dname)\n yield from self.walk(newpath, topdown=topdown)\n\n if not topdown:\n yield directory, dirs, nondirs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree._walk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree._walk_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 142, "span_ids": ["GitTree.walk", "GitTree._walk"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GitTree(BaseTree):\n\n def _walk(self, tree, topdown=True):\n dirs, nondirs = [], []\n for item in tree:\n name = _item_basename(item)\n if item.mode == GIT_MODE_DIR:\n dirs.append(name)\n else:\n nondirs.append(name)\n\n if topdown:\n yield os.path.normpath(tree.abspath), dirs, nondirs\n\n for i in dirs:\n yield from self._walk(tree[i], topdown=topdown)\n\n if not topdown:\n yield os.path.normpath(tree.abspath), dirs, nondirs\n\n def walk(self, top, topdown=True):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\n - it could raise exceptions, there is no onerror argument\n \"\"\"\n\n tree = self.git_object_by_path(top)\n if tree is None:\n raise IOError(errno.ENOENT, \"No such file\")\n\n yield from self._walk(tree, topdown=topdown)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._file_metadata_changed_State._update_state_for_path_changed.self__execute_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._file_metadata_changed_State._update_state_for_path_changed.self__execute_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 327, "span_ids": ["State._update_state_record_timestamp_for_inode", "State._file_metadata_changed", "State._update_state_for_path_changed"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n @staticmethod\n def _file_metadata_changed(actual_mtime, mtime, actual_size, size):\n return actual_mtime != mtime or actual_size != size\n\n def _update_state_record_timestamp_for_inode(self, actual_inode):\n cmd = \"UPDATE {} SET timestamp = ? WHERE inode = ?\".format(\n self.STATE_TABLE\n )\n self._execute(\n cmd, (current_timestamp(), self._to_sqlite(actual_inode))\n )\n\n def _update_state_for_path_changed(\n self, actual_inode, actual_mtime, actual_size, checksum\n ):\n cmd = (\n \"UPDATE {} SET \"\n \"mtime = ?, size = ?, \"\n \"md5 = ?, timestamp = ? \"\n \"WHERE inode = ?\"\n ).format(self.STATE_TABLE)\n self._execute(\n cmd,\n (\n actual_mtime,\n actual_size,\n checksum,\n current_timestamp(),\n self._to_sqlite(actual_inode),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._insert_new_state_record_State.get_state_record_for_inode.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._insert_new_state_record_State.get_state_record_for_inode.return.None", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 329, "end_line": 361, "span_ids": ["State.get_state_record_for_inode", "State._insert_new_state_record"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def _insert_new_state_record(\n self, actual_inode, actual_mtime, actual_size, checksum\n ):\n assert checksum is not None\n\n cmd = (\n \"INSERT INTO {}(inode, mtime, size, md5, timestamp) \"\n \"VALUES (?, ?, ?, ?, ?)\"\n ).format(self.STATE_TABLE)\n self._execute(\n cmd,\n (\n self._to_sqlite(actual_inode),\n actual_mtime,\n actual_size,\n checksum,\n current_timestamp(),\n ),\n )\n self.inserts += 1\n\n def get_state_record_for_inode(self, inode):\n cmd = (\n \"SELECT mtime, size, md5, timestamp from {} WHERE \"\n \"inode=?\".format(self.STATE_TABLE)\n )\n self._execute(cmd, (self._to_sqlite(inode),))\n results = self._fetchall()\n if results:\n # uniqueness constrain on inode\n assert len(results) == 1\n return results[0]\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_State.save.self__update_state_for_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_State.save.self__update_state_for_pa", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 363, "end_line": 388, "span_ids": ["State.save"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def save(self, path_info, checksum):\n \"\"\"Save checksum for the specified path info.\n\n Args:\n path_info (dict): path_info to save checksum for.\n checksum (str): checksum to save.\n \"\"\"\n assert path_info.scheme == \"local\"\n assert checksum is not None\n assert os.path.exists(fspath_py35(path_info))\n\n actual_mtime, actual_size = get_mtime_and_size(\n path_info, self.repo.tree\n )\n actual_inode = get_inode(path_info)\n\n existing_record = self.get_state_record_for_inode(actual_inode)\n if not existing_record:\n self._insert_new_state_record(\n actual_inode, actual_mtime, actual_size, checksum\n )\n return\n\n self._update_state_for_path_changed(\n actual_inode, actual_mtime, actual_size, checksum\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_State.get.return.checksum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_State.get.return.checksum", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 390, "end_line": 419, "span_ids": ["State.get"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def get(self, path_info):\n \"\"\"Gets the checksum for the specified path info. Checksum will be\n retrieved from the state database if available.\n\n Args:\n path_info (dict): path info to get the checksum for.\n\n Returns:\n str or None: checksum for the specified path info or None if it\n doesn't exist in the state database.\n \"\"\"\n assert path_info.scheme == \"local\"\n path = fspath_py35(path_info)\n\n if not os.path.exists(path):\n return None\n\n actual_mtime, actual_size = get_mtime_and_size(path, self.repo.tree)\n actual_inode = get_inode(path)\n\n existing_record = self.get_state_record_for_inode(actual_inode)\n if not existing_record:\n return None\n\n mtime, size, checksum, _ = existing_record\n if self._file_metadata_changed(actual_mtime, mtime, actual_size, size):\n return None\n\n self._update_state_record_timestamp_for_inode(actual_inode)\n return checksum", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._notify_Updater._notify.logger_info_boxify_messag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._notify_Updater._notify.logger_info_boxify_messag", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 116, "span_ids": ["Updater._notify"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Updater(object):\n\n def _notify(self):\n if not sys.stdout.isatty():\n return\n\n message = (\n \"Update available {red}{current}{reset} -> {green}{latest}{reset}\"\n + \"\\n\"\n + self._get_update_instructions()\n ).format(\n red=colorama.Fore.RED,\n reset=colorama.Fore.RESET,\n green=colorama.Fore.GREEN,\n yellow=colorama.Fore.YELLOW,\n blue=colorama.Fore.BLUE,\n current=self.current,\n latest=self.latest,\n )\n\n logger.info(boxify(message, border_color=\"yellow\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_boxify_boxify.return.box_str": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_boxify_boxify.return.box_str", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 355, "span_ids": ["boxify"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def boxify(message, border_color=None):\n \"\"\"Put a message inside a box.\n\n Args:\n message (unicode): message to decorate.\n border_color (unicode): name of the color to outline the box with.\n \"\"\"\n lines = message.split(\"\\n\")\n max_width = max(_visual_width(line) for line in lines)\n\n padding_horizontal = 5\n padding_vertical = 1\n\n box_size_horizontal = max_width + (padding_horizontal * 2)\n\n chars = {\"corner\": \"+\", \"horizontal\": \"-\", \"vertical\": \"|\", \"empty\": \" \"}\n\n margin = \"{corner}{line}{corner}\\n\".format(\n corner=chars[\"corner\"], line=chars[\"horizontal\"] * box_size_horizontal\n )\n\n padding_lines = [\n \"{border}{space}{border}\\n\".format(\n border=colorize(chars[\"vertical\"], color=border_color),\n space=chars[\"empty\"] * box_size_horizontal,\n )\n * padding_vertical\n ]\n\n content_lines = [\n \"{border}{space}{content}{space}{border}\\n\".format(\n border=colorize(chars[\"vertical\"], color=border_color),\n space=chars[\"empty\"] * padding_horizontal,\n content=_visual_center(line, max_width),\n )\n for line in lines\n ]\n\n box_str = \"{margin}{padding}{content}{padding}{margin}\".format(\n margin=colorize(margin, color=border_color),\n padding=\"\".join(padding_lines),\n content=\"\".join(content_lines),\n )\n\n return box_str", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__Used_in_setup_py_so_do__generate_version.return._base_version_short_sh": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__Used_in_setup_py_so_do__generate_version.return._base_version_short_sh", "embedding": null, "metadata": {"file_path": "dvc/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["_generate_version", "docstring"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Used in setup.py, so don't pull any additional dependencies\n#\n# Based on:\n# - https://github.com/python/mypy/blob/master/mypy/version.py\n# - https://github.com/python/mypy/blob/master/mypy/git.py\nimport os\nimport subprocess\n\n\n_BASE_VERSION = \"0.93.0\"\n\n\ndef _generate_version(base_version):\n \"\"\"Generate a version with information about the Git repository.\"\"\"\n pkg_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n\n if not _is_git_repo(pkg_dir) or not _have_git():\n return base_version\n\n if _is_release(pkg_dir, base_version) and not _is_dirty(pkg_dir):\n return base_version\n\n return \"{base_version}+{short_sha}{dirty}\".format(\n base_version=base_version,\n short_sha=_git_revision(pkg_dir).decode(\"utf-8\")[0:6],\n dirty=\".mod\" if _is_dirty(pkg_dir) else \"\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__is_git_repo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__is_git_repo_", "embedding": null, "metadata": {"file_path": "dvc/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 76, "span_ids": ["_have_git", "_is_dirty", "_is_release", "impl:3", "_git_revision", "_is_git_repo"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _is_git_repo(dir_path):\n \"\"\"Is the given directory version-controlled with Git?\"\"\"\n return os.path.exists(os.path.join(dir_path, \".git\"))\n\n\ndef _have_git():\n \"\"\"Can we run the git executable?\"\"\"\n try:\n subprocess.check_output([\"git\", \"--help\"])\n return True\n except subprocess.CalledProcessError:\n return False\n except OSError:\n return False\n\n\ndef _is_release(dir_path, base_version):\n try:\n output = subprocess.check_output(\n [\"git\", \"describe\", \"--tags\", \"--exact-match\"],\n cwd=dir_path,\n stderr=subprocess.STDOUT,\n ).decode(\"utf-8\")\n tag = output.strip()\n return tag == base_version\n except subprocess.CalledProcessError:\n return False\n\n\ndef _git_revision(dir_path):\n \"\"\"Get SHA of the HEAD of a Git repository.\"\"\"\n return subprocess.check_output(\n [\"git\", \"rev-parse\", \"HEAD\"], cwd=dir_path\n ).strip()\n\n\ndef _is_dirty(dir_path):\n \"\"\"Check whether a git repository has uncommitted changes.\"\"\"\n try:\n subprocess.check_call([\"git\", \"diff\", \"--quiet\"], cwd=dir_path)\n return False\n except subprocess.CalledProcessError:\n return True\n\n\n__version__ = _generate_version(_BASE_VERSION)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 154, "end_line": 169, "span_ids": ["TestAddExternalLocalFile.test", "TestAddExternalLocalFile"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddExternalLocalFile(TestDvc):\n def test(self):\n dname = TestDvc.mkdtemp()\n fname = os.path.join(dname, \"foo\")\n shutil.copyfile(self.FOO, fname)\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertNotEqual(stage, None)\n self.assertEqual(len(stage.deps), 0)\n self.assertEqual(len(stage.outs), 1)\n self.assertEqual(stage.relpath, \"foo.dvc\")\n self.assertEqual(len(os.listdir(dname)), 1)\n self.assertTrue(os.path.isfile(fname))\n self.assertTrue(filecmp.cmp(fname, \"foo\", shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 194, "end_line": 219, "span_ids": ["TestAddLocalRemoteFile.test", "TestAddLocalRemoteFile"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddLocalRemoteFile(TestDvc):\n def test(self):\n \"\"\"\n Making sure that 'remote' syntax is handled properly for local outs.\n \"\"\"\n cwd = os.getcwd()\n remote = \"myremote\"\n\n ret = main([\"remote\", \"add\", remote, cwd])\n self.assertEqual(ret, 0)\n\n self.dvc = DvcRepo()\n\n foo = \"remote://{}/{}\".format(remote, self.FOO)\n ret = main([\"add\", foo])\n self.assertEqual(ret, 0)\n\n d = load_stage_file(\"foo.dvc\")\n self.assertEqual(d[\"outs\"][0][\"path\"], foo)\n\n bar = os.path.join(cwd, self.BAR)\n ret = main([\"add\", bar])\n self.assertEqual(ret, 0)\n\n d = load_stage_file(\"bar.dvc\")\n self.assertEqual(d[\"outs\"][0][\"path\"], self.BAR)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestCmdAdd_TestDoubleAddUnchanged.test_dir.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestCmdAdd_TestDoubleAddUnchanged.test_dir.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 200, "end_line": 222, "span_ids": ["TestCmdAdd.test", "TestDoubleAddUnchanged.test_file", "TestDoubleAddUnchanged", "TestDoubleAddUnchanged.test_dir", "TestCmdAdd"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdAdd(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", \"non-existing-file\"])\n self.assertNotEqual(ret, 0)\n\n\nclass TestDoubleAddUnchanged(TestDvc):\n def test_file(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n def test_dir(self):\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_SymlinkAddTestBase_SymlinkAddTestBase._test.self_assertEqual_relative": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_SymlinkAddTestBase_SymlinkAddTestBase._test.self_assertEqual_relative", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 337, "end_line": 365, "span_ids": ["SymlinkAddTestBase._test", "SymlinkAddTestBase", "SymlinkAddTestBase._prepare_external_data", "SymlinkAddTestBase._get_data_dir"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SymlinkAddTestBase(TestDvc):\n def _get_data_dir(self):\n raise NotImplementedError\n\n def _prepare_external_data(self):\n data_dir = self._get_data_dir()\n\n self.data_file_name = \"data_file\"\n external_data_path = os.path.join(data_dir, self.data_file_name)\n with open(external_data_path, \"w+\") as f:\n f.write(\"data\")\n\n self.link_name = \"data_link\"\n System.symlink(data_dir, self.link_name)\n\n def _test(self):\n self._prepare_external_data()\n\n ret = main([\"add\", os.path.join(self.link_name, self.data_file_name)])\n self.assertEqual(0, ret)\n\n stage_file = self.data_file_name + DVC_FILE_SUFFIX\n self.assertTrue(os.path.exists(stage_file))\n\n d = load_stage_file(stage_file)\n relative_data_path = posixpath.join(\n self.link_name, self.data_file_name\n )\n self.assertEqual(relative_data_path, d[\"outs\"][0][\"path\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldAddDataFromExternalSymlink_TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test.with_patch_object_.self_assertTrue_os_path_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldAddDataFromExternalSymlink_TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test.with_patch_object_.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 368, "end_line": 406, "span_ids": ["TestShouldAddDataFromInternalSymlink.test", "TestShouldAddDataFromInternalSymlink._get_data_dir", "TestShouldAddDataFromExternalSymlink._get_data_dir", "TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test", "TestShouldAddDataFromInternalSymlink", "TestShouldAddDataFromExternalSymlink", "TestShouldAddDataFromExternalSymlink.test", "TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldAddDataFromExternalSymlink(SymlinkAddTestBase):\n def _get_data_dir(self):\n return self.mkdtemp()\n\n def test(self):\n self._test()\n\n\nclass TestShouldAddDataFromInternalSymlink(SymlinkAddTestBase):\n def _get_data_dir(self):\n return self.DATA_DIR\n\n def test(self):\n self._test()\n\n\nclass TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink(TestDvc):\n def test(self):\n def is_symlink_true_below_dvc_root(path):\n if path == os.path.dirname(self.dvc.root_dir):\n return True\n return False\n\n with patch.object(\n System, \"is_symlink\", side_effect=is_symlink_true_below_dvc_root\n ):\n\n ret = main([\"add\", self.DATA])\n self.assertEqual(0, ret)\n\n stage_file_path_on_data_below_symlink = (\n os.path.basename(self.DATA) + DVC_FILE_SUFFIX\n )\n self.assertFalse(\n os.path.exists(stage_file_path_on_data_below_symlink)\n )\n\n stage_file_path = self.DATA + DVC_FILE_SUFFIX\n self.assertTrue(os.path.exists(stage_file_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.assert_expected_error_in_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.assert_expected_error_in_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 409, "end_line": 430, "span_ids": ["TestShouldThrowProperExceptionOnCorruptedStageFile", "TestShouldThrowProperExceptionOnCorruptedStageFile.test"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldThrowProperExceptionOnCorruptedStageFile(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n assert 0 == ret\n\n foo_stage = relpath(self.FOO + DVC_FILE_SUFFIX)\n\n # corrupt stage file\n with open(foo_stage, \"a+\") as file:\n file.write(\"this will break yaml file structure\")\n\n self._caplog.clear()\n\n ret = main([\"add\", self.BAR])\n assert 1 == ret\n\n expected_error = (\n \"unable to read DVC-file: {} \"\n \"YAML file structure is corrupted\".format(foo_stage)\n )\n\n assert expected_error in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddFilename_TestAddFilename.test.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddFilename_TestAddFilename.test.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 419, "end_line": 444, "span_ids": ["TestAddFilename", "TestAddFilename.test"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddFilename(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO, self.BAR, \"-f\", \"error.dvc\"])\n self.assertNotEqual(0, ret)\n\n ret = main([\"add\", \"-R\", self.DATA_DIR, \"-f\", \"error.dvc\"])\n self.assertNotEqual(0, ret)\n\n with self.assertRaises(RecursiveAddingWhileUsingFilename):\n self.dvc.add(self.DATA_DIR, recursive=True, fname=\"error.dvc\")\n\n ret = main([\"add\", self.DATA_DIR, \"-f\", \"data_directory.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"data_directory.dvc\"))\n\n ret = main([\"add\", self.FOO, \"-f\", \"bar.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n self.assertFalse(os.path.exists(\"foo.dvc\"))\n\n os.remove(\"bar.dvc\")\n\n ret = main([\"add\", self.FOO, \"--file\", \"bar.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n self.assertFalse(os.path.exists(\"foo.dvc\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 40, "span_ids": ["TestCache.test_get", "imports", "TestCache.setUp", "TestCache", "TestCache.test_all"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport stat\n\nimport configobj\nimport pytest\n\nfrom dvc.cache import Cache\nfrom dvc.main import main\nfrom dvc.remote.base import DirCacheError\nfrom dvc.utils import relpath\nfrom tests.basic_env import TestDir, TestDvc\n\n\nclass TestCache(TestDvc):\n def setUp(self):\n super().setUp()\n self.cache1_md5 = \"123\"\n self.cache2_md5 = \"234\"\n self.cache1 = os.path.join(\n self.dvc.cache.local.cache_dir,\n self.cache1_md5[0:2],\n self.cache1_md5[2:],\n )\n self.cache2 = os.path.join(\n self.dvc.cache.local.cache_dir,\n self.cache2_md5[0:2],\n self.cache2_md5[2:],\n )\n self.create(self.cache1, \"1\")\n self.create(self.cache2, \"2\")\n\n def test_all(self):\n md5_list = list(Cache(self.dvc).local.all())\n self.assertEqual(len(md5_list), 2)\n self.assertIn(self.cache1_md5, md5_list)\n self.assertIn(self.cache2_md5, md5_list)\n\n def test_get(self):\n cache = Cache(self.dvc).local.get(self.cache1_md5)\n self.assertEqual(cache, self.cache1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test_remote_references.assert_self_dvc_cache_ssh": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test_remote_references.assert_self_dvc_cache_ssh", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 62, "end_line": 88, "span_ids": ["TestExternalCacheDir.test_remote_references", "TestExternalCacheDir.test", "TestExternalCacheDir"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestExternalCacheDir(TestDvc):\n def test(self):\n cache_dir = TestDvc.mkdtemp()\n\n ret = main([\"config\", \"cache.dir\", cache_dir])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(self.dvc.cache.local.cache_dir))\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(\".dvc/cache\"))\n self.assertNotEqual(len(os.listdir(cache_dir)), 0)\n\n def test_remote_references(self):\n ssh_url = \"ssh://user@localhost:23\"\n assert main([\"remote\", \"add\", \"storage\", ssh_url]) == 0\n assert main([\"remote\", \"add\", \"cache\", \"remote://storage/tmp\"]) == 0\n assert main([\"config\", \"cache.ssh\", \"cache\"]) == 0\n\n self.dvc.__init__()\n\n assert self.dvc.cache.ssh.path_info == ssh_url + \"/tmp\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestSharedCacheDir_TestSharedCacheDir.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestSharedCacheDir_TestSharedCacheDir.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 135, "span_ids": ["TestSharedCacheDir", "TestSharedCacheDir.test"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSharedCacheDir(TestDir):\n def test(self):\n cache_dir = os.path.abspath(os.path.join(os.curdir, \"cache\"))\n for d in [\"dir1\", \"dir2\"]:\n os.mkdir(d)\n os.chdir(d)\n\n ret = main([\"init\", \"--no-scm\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"config\", \"cache.dir\", cache_dir])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(os.path.join(\".dvc\", \"cache\")))\n\n with open(\"common\", \"w+\") as fd:\n fd.write(\"common\")\n\n with open(\"unique\", \"w+\") as fd:\n fd.write(d)\n\n ret = main([\"add\", \"common\", \"unique\"])\n self.assertEqual(ret, 0)\n\n os.chdir(\"..\")\n\n self.assertFalse(os.path.exists(os.path.join(\"dir1\", \".dvc\", \"cache\")))\n self.assertFalse(os.path.exists(os.path.join(\"dir2\", \".dvc\", \"cache\")))\n\n subdirs = list(\n filter(\n lambda x: os.path.isdir(os.path.join(cache_dir, x)),\n os.listdir(cache_dir),\n )\n )\n self.assertEqual(len(subdirs), 3)\n self.assertEqual(\n len(os.listdir(os.path.join(cache_dir, subdirs[0]))), 1\n )\n self.assertEqual(\n len(os.listdir(os.path.join(cache_dir, subdirs[1]))), 1\n )\n self.assertEqual(\n len(os.listdir(os.path.join(cache_dir, subdirs[2]))), 1\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckout_TestCheckout._test_checkout.self_assertTrue_filecmp_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckout_TestCheckout._test_checkout.self_assertTrue_filecmp_c", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 34, "end_line": 57, "span_ids": ["TestCheckout._test_checkout", "TestCheckout.setUp", "TestCheckout.test", "TestCheckout"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckout(TestRepro):\n def setUp(self):\n super().setUp()\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.data_dir_stage = stages[0]\n self.assertTrue(self.data_dir_stage is not None)\n\n self.orig = \"orig\"\n shutil.copy(self.FOO, self.orig)\n os.unlink(self.FOO)\n\n self.orig_dir = \"orig_dir\"\n shutil.copytree(self.DATA_DIR, self.orig_dir)\n shutil.rmtree(self.DATA_DIR)\n\n def test(self):\n self.dvc.checkout(force=True)\n self._test_checkout()\n\n def _test_checkout(self):\n self.assertTrue(os.path.isfile(self.FOO))\n self.assertTrue(filecmp.cmp(self.FOO, self.orig, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSingleStage_TestCheckoutCorruptedCacheFile.test.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSingleStage_TestCheckoutCorruptedCacheFile.test.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 60, "end_line": 83, "span_ids": ["TestCheckoutCorruptedCacheFile", "TestCheckoutCorruptedCacheFile.test", "TestCheckoutSingleStage", "TestCheckoutSingleStage.test"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutSingleStage(TestCheckout):\n def test(self):\n ret = main([\"checkout\", \"--force\", self.foo_stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"checkout\", \"--force\", self.data_dir_stage.path])\n self.assertEqual(ret, 0)\n\n self._test_checkout()\n\n\nclass TestCheckoutCorruptedCacheFile(TestRepro):\n def test(self):\n cache = self.foo_stage.outs[0].cache_path\n\n os.chmod(cache, 0o644)\n with open(cache, \"a\") as fd:\n fd.write(\"1\")\n\n with pytest.raises(CheckoutError):\n self.dvc.checkout(force=True)\n\n self.assertFalse(os.path.isfile(self.FOO))\n self.assertFalse(os.path.isfile(cache))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCorruptedCacheDir_TestCheckoutCorruptedCacheDir.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCorruptedCacheDir_TestCheckoutCorruptedCacheDir.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 86, "end_line": 111, "span_ids": ["TestCheckoutCorruptedCacheDir.test", "TestCheckoutCorruptedCacheDir"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutCorruptedCacheDir(TestDvc):\n def test(self):\n # NOTE: using 'copy' so that cache and link don't have same inode\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n self.dvc = DvcRepo(\".\")\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.assertEqual(len(stages[0].outs), 1)\n out = stages[0].outs[0]\n\n # NOTE: modifying cache file for one of the files inside the directory\n # to check if dvc will detect that the cache is corrupted.\n entry = self.dvc.cache.local.load_dir_cache(out.checksum)[0]\n checksum = entry[self.dvc.cache.local.PARAM_CHECKSUM]\n cache = self.dvc.cache.local.get(checksum)\n\n os.chmod(cache, 0o644)\n with open(cache, \"w+\") as fobj:\n fobj.write(\"1\")\n\n with pytest.raises(CheckoutError):\n self.dvc.checkout(force=True)\n\n self.assertFalse(os.path.exists(cache))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCmdCheckout_CheckoutBase.outs_info.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCmdCheckout_CheckoutBase.outs_info.return._", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 114, "end_line": 148, "span_ids": ["TestCmdCheckout", "CheckoutBase", "CheckoutBase.outs_info", "CheckoutBase.commit_data_file", "TestCmdCheckout.test", "CheckoutBase.read_ignored"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdCheckout(TestCheckout):\n def test(self):\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self._test_checkout()\n\n\nclass CheckoutBase(TestDvcGit):\n GIT_IGNORE = \".gitignore\"\n\n def commit_data_file(self, fname, content=\"random text\"):\n with open(fname, \"w\") as fd:\n fd.write(content)\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n self.dvc.scm.add([fname + \".dvc\", \".gitignore\"])\n self.dvc.scm.commit(\"adding \" + fname)\n\n def read_ignored(self):\n with open(self.GIT_IGNORE) as f:\n return [s.strip(\"\\n\") for s in f.readlines()]\n\n def outs_info(self, stage):\n FileInfo = collections.namedtuple(\"FileInfo\", \"path inode\")\n\n paths = [\n path\n for output in stage[\"outs\"]\n for path in self.dvc.tree.walk_files(output[\"path\"])\n ]\n\n return [\n FileInfo(path=path, inode=System.inode(path)) for path in paths\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestRemoveFilesWhenCheckout_TestRemoveFilesWhenCheckout.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestRemoveFilesWhenCheckout_TestRemoveFilesWhenCheckout.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 147, "end_line": 170, "span_ids": ["TestRemoveFilesWhenCheckout.test", "TestRemoveFilesWhenCheckout"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoveFilesWhenCheckout(CheckoutBase):\n def test(self):\n fname = \"file_in_a_branch\"\n branch_master = \"master\"\n branch_1 = \"b1\"\n\n self.dvc.scm.add(self.dvc.scm.untracked_files())\n self.dvc.scm.commit(\"add all files\")\n\n # add the file into a separate branch\n self.dvc.scm.checkout(branch_1, True)\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self.commit_data_file(fname)\n\n # Checkout back in master\n self.dvc.scm.checkout(branch_master)\n self.assertTrue(os.path.exists(fname))\n\n # Make sure `dvc checkout` removes the file\n # self.dvc.checkout()\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self.assertFalse(os.path.exists(fname))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir_TestCheckoutCleanWorkingDir.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir_TestCheckoutCleanWorkingDir.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 187, "span_ids": ["TestCheckoutCleanWorkingDir.test", "TestCheckoutCleanWorkingDir"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutCleanWorkingDir(CheckoutBase):\n @patch(\"dvc.prompt.confirm\", return_value=True)\n def test(self, mock_prompt):\n mock_prompt.return_value = True\n\n stages = self.dvc.add(self.DATA_DIR)\n stage = stages[0]\n\n working_dir_change = os.path.join(self.DATA_DIR, \"not_cached.txt\")\n with open(working_dir_change, \"w\") as f:\n f.write(\"not_cached\")\n\n ret = main([\"checkout\", stage.relpath])\n self.assertEqual(ret, 0)\n self.assertFalse(os.path.exists(working_dir_change))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir.test_force_TestCheckoutCleanWorkingDir.test_force.self_assertRaises_DvcExce": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir.test_force_TestCheckoutCleanWorkingDir.test_force.self_assertRaises_DvcExce", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 189, "end_line": 206, "span_ids": ["TestCheckoutCleanWorkingDir.test_force"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutCleanWorkingDir(CheckoutBase):\n\n @patch(\"dvc.prompt.confirm\", return_value=False)\n def test_force(self, mock_prompt):\n mock_prompt.return_value = False\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n\n working_dir_change = os.path.join(self.DATA_DIR, \"not_cached.txt\")\n with open(working_dir_change, \"w\") as f:\n f.write(\"not_cached\")\n\n ret = main([\"checkout\", stage.relpath])\n self.assertNotEqual(ret, 0)\n\n mock_prompt.assert_called()\n self.assertNotEqual(ret, 0)\n self.assertRaises(DvcException)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSelectiveRemove_TestCheckoutSelectiveRemove.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSelectiveRemove_TestCheckoutSelectiveRemove.test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 216, "end_line": 242, "span_ids": ["TestCheckoutSelectiveRemove.test", "TestCheckoutSelectiveRemove"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutSelectiveRemove(CheckoutBase):\n def test(self):\n # Use copy to test for changes in the inodes\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(0, ret)\n\n stage_path = self.DATA_DIR + DVC_FILE_SUFFIX\n stage = load_stage_file(stage_path)\n staged_files = self.outs_info(stage)\n\n # move instead of remove, to lock inode assigned to stage_files[0].path\n # if we were to use remove, we might end up with same inode assigned to\n # newly checked out file\n shutil.move(staged_files[0].path, \"random_name\")\n\n ret = main([\"checkout\", \"--force\", stage_path])\n self.assertEqual(ret, 0)\n\n checkedout_files = self.outs_info(stage)\n\n self.assertEqual(len(staged_files), len(checkedout_files))\n self.assertEqual(staged_files[0].path, checkedout_files[0].path)\n self.assertNotEqual(staged_files[0].inode, checkedout_files[0].inode)\n self.assertEqual(staged_files[1].inode, checkedout_files[1].inode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreBasic_TestGitIgnoreBasic.test.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreBasic_TestGitIgnoreBasic.test.None_9", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 238, "end_line": 264, "span_ids": ["TestGitIgnoreBasic.test", "TestGitIgnoreBasic"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitIgnoreBasic(CheckoutBase):\n def test(self):\n fname1 = \"file_1\"\n fname2 = \"file_2\"\n fname3 = \"file_3\"\n\n self.dvc.scm.add(self.dvc.scm.untracked_files())\n self.dvc.scm.commit(\"add all files\")\n\n self.assertFalse(os.path.exists(self.GIT_IGNORE))\n\n self.commit_data_file(fname1)\n self.commit_data_file(fname2)\n self.dvc.run(\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, fname3),\n deps=[self.CODE, self.FOO],\n outs_no_cache=[fname3],\n )\n\n self.assertTrue(os.path.exists(self.GIT_IGNORE))\n\n ignored = self.read_ignored()\n\n self.assertEqual(len(ignored), 2)\n\n self.assertIn(\"/\" + fname1, ignored)\n self.assertIn(\"/\" + fname2, ignored)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreWhenCheckout_TestGitIgnoreWhenCheckout.test.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreWhenCheckout_TestGitIgnoreWhenCheckout.test.None_12", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 267, "end_line": 296, "span_ids": ["TestGitIgnoreWhenCheckout.test", "TestGitIgnoreWhenCheckout"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitIgnoreWhenCheckout(CheckoutBase):\n def test(self):\n fname_master = \"file_in_a_master\"\n branch_master = \"master\"\n fname_branch = \"file_in_a_branch\"\n branch_1 = \"b1\"\n\n self.dvc.scm.add(self.dvc.scm.untracked_files())\n self.dvc.scm.commit(\"add all files\")\n self.commit_data_file(fname_master)\n\n self.dvc.scm.checkout(branch_1, True)\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self.commit_data_file(fname_branch)\n\n self.dvc.scm.checkout(branch_master)\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n\n ignored = self.read_ignored()\n\n self.assertEqual(len(ignored), 1)\n self.assertIn(\"/\" + fname_master, ignored)\n\n self.dvc.scm.checkout(branch_1)\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n ignored = self.read_ignored()\n self.assertIn(\"/\" + fname_branch, ignored)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMissingMd5InStageFile_TestCheckoutEmptyDir.test.self_assertEqual_len_os_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMissingMd5InStageFile_TestCheckoutEmptyDir.test.self_assertEqual_len_os_l", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 303, "end_line": 332, "span_ids": ["TestCheckoutMissingMd5InStageFile.test", "TestCheckoutEmptyDir.test", "TestCheckoutEmptyDir", "TestCheckoutMissingMd5InStageFile"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutMissingMd5InStageFile(TestRepro):\n def test(self):\n d = load_stage_file(self.file1_stage)\n del d[Stage.PARAM_OUTS][0][RemoteLOCAL.PARAM_CHECKSUM]\n del d[Stage.PARAM_DEPS][0][RemoteLOCAL.PARAM_CHECKSUM]\n dump_stage_file(self.file1_stage, d)\n\n with pytest.raises(CheckoutError):\n self.dvc.checkout(force=True)\n\n\nclass TestCheckoutEmptyDir(TestDvc):\n def test(self):\n dname = \"empty_dir\"\n os.mkdir(dname)\n\n stages = self.dvc.add(dname)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n self.assertEqual(len(stage.outs), 1)\n\n stage.outs[0].remove()\n self.assertFalse(os.path.exists(dname))\n\n stats = self.dvc.checkout(force=True)\n assert stats[\"added\"] == [dname + os.sep]\n\n self.assertTrue(os.path.isdir(dname))\n self.assertEqual(len(os.listdir(dname)), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutNotCachedFile_TestCheckoutDirectory.test.self_assertTrue_os_path_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutNotCachedFile_TestCheckoutDirectory.test.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 335, "end_line": 374, "span_ids": ["TestCheckoutWithDeps", "TestCheckoutNotCachedFile.test", "TestCheckoutNotCachedFile", "TestCheckoutDirectory", "TestCheckoutDirectory.test", "TestCheckoutWithDeps.test"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutNotCachedFile(TestDvc):\n def test(self):\n cmd = \"python {} {} {}\".format(self.CODE, self.FOO, \"out\")\n\n self.dvc.add(self.FOO)\n stage = self.dvc.run(\n cmd=cmd, deps=[self.FOO, self.CODE], outs_no_cache=[\"out\"]\n )\n self.assertTrue(stage is not None)\n\n stats = self.dvc.checkout(force=True)\n assert not any(stats.values())\n\n\nclass TestCheckoutWithDeps(TestRepro):\n def test(self):\n os.unlink(self.FOO)\n os.unlink(self.file1)\n\n self.assertFalse(os.path.exists(self.FOO))\n self.assertFalse(os.path.exists(self.file1))\n\n ret = main([\"checkout\", \"--force\", self.file1_stage, \"--with-deps\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(os.path.exists(self.FOO))\n self.assertTrue(os.path.exists(self.file1))\n\n\nclass TestCheckoutDirectory(TestRepro):\n def test(self):\n stage = self.dvc.add(self.DATA_DIR)[0]\n\n shutil.rmtree(self.DATA_DIR)\n self.assertFalse(os.path.exists(self.DATA_DIR))\n\n ret = main([\"checkout\", stage.path])\n self.assertEqual(ret, 0)\n\n self.assertTrue(os.path.exists(self.DATA_DIR))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutHook_TestCheckoutHook.test.with_self_assertRaises_Co.self_dvc_checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutHook_TestCheckoutHook.test.with_self_assertRaises_Co.self_dvc_checkout_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 370, "end_line": 385, "span_ids": ["TestCheckoutHook", "TestCheckoutHook.test"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutHook(TestDvc):\n @patch(\"sys.stdout.isatty\", return_value=True)\n @patch(\"dvc.prompt.input\", side_effect=EOFError)\n def test(self, mock_input, mock_isatty):\n \"\"\" Test that dvc checkout handles EOFError gracefully, which is what\n it will experience when running in a git hook.\n \"\"\"\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertNotEqual(stage, None)\n\n self.create(os.path.join(self.DATA_DIR, \"test\"), \"test\")\n\n with self.assertRaises(ConfirmRemoveError):\n self.dvc.checkout()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_os_TestArgParse.test.self_assertIsInstance_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_os_TestArgParse.test.self_assertIsInstance_arg", "embedding": null, "metadata": {"file_path": "tests/func/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "TestArgParse", "TestArgParse.test"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.cli import parse_args\nfrom dvc.command.add import CmdAdd\nfrom dvc.command.base import CmdBase\nfrom dvc.command.checkout import CmdCheckout\nfrom dvc.command.config import CmdConfig\nfrom dvc.command.data_sync import CmdDataPull\nfrom dvc.command.data_sync import CmdDataPush\nfrom dvc.command.gc import CmdGC\nfrom dvc.command.init import CmdInit\nfrom dvc.command.remove import CmdRemove\nfrom dvc.command.repro import CmdRepro\nfrom dvc.command.run import CmdRun\nfrom dvc.command.status import CmdDataStatus\nfrom dvc.exceptions import DvcException\nfrom tests.basic_env import TestDvc\n\n\nclass TestArgParse(TestDvc):\n def test(self):\n args = parse_args([\"init\"])\n self.assertIsInstance(args.func(args), CmdInit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestRun_TestRun.test.self_assertEqual_args_com": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestRun_TestRun.test.self_assertEqual_args_com", "embedding": null, "metadata": {"file_path": "tests/func/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 72, "span_ids": ["TestRun.test", "TestRun"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRun(TestDvc):\n def test(self):\n dep1 = \"dep1\"\n dep2 = \"dep2\"\n\n out1 = \"out1\"\n out2 = \"out2\"\n\n out_no_cache1 = \"out_no_cache1\"\n out_no_cache2 = \"out_no_cache2\"\n\n fname = \"dvc.dvc\"\n cmd = \"cmd\"\n arg1 = \"arg1\"\n arg2 = \"arg2\"\n\n args = parse_args(\n [\n \"run\",\n \"-d\",\n dep1,\n \"--deps\",\n dep2,\n \"-o\",\n out1,\n \"--outs\",\n out2,\n \"-O\",\n out_no_cache1,\n \"--outs-no-cache\",\n out_no_cache2,\n \"-f\",\n fname,\n \"--file\",\n fname,\n cmd,\n arg1,\n arg2,\n ]\n )\n\n self.assertIsInstance(args.func(args), CmdRun)\n self.assertEqual(args.deps, [dep1, dep2])\n self.assertEqual(args.outs, [out1, out2])\n self.assertEqual(args.outs_no_cache, [out_no_cache1, out_no_cache2])\n self.assertEqual(args.file, fname)\n self.assertEqual(args.command, [cmd, arg1, arg2])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestPull_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestPull_", "embedding": null, "metadata": {"file_path": "tests/func/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 79, "end_line": 179, "span_ids": ["TestRemove", "TestAdd", "TestPull.test", "TestConfig", "TestGCMultipleDvcRepos", "TestCheckout", "TestGCMultipleDvcRepos.test", "TestFindRoot.test", "TestPull", "TestGC", "TestFindRoot", "TestPush.test", "TestStatus.test", "TestRemove.test", "TestRepro", "TestConfig.test", "TestPush", "TestStatus", "TestRepro.test", "TestGC.test", "TestCheckout.test", "TestAdd.test"], "tokens": 575}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPull(TestDvc):\n def test(self):\n args = parse_args([\"pull\"])\n self.assertIsInstance(args.func(args), CmdDataPull)\n\n\nclass TestPush(TestDvc):\n def test(self):\n args = parse_args([\"push\"])\n self.assertIsInstance(args.func(args), CmdDataPush)\n\n\nclass TestStatus(TestDvc):\n def test(self):\n args = parse_args([\"status\"])\n self.assertIsInstance(args.func(args), CmdDataStatus)\n\n\nclass TestRepro(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args(\n [\"repro\", target1, target2, \"-f\", \"--force\", \"-s\", \"--single-item\"]\n )\n\n self.assertIsInstance(args.func(args), CmdRepro)\n self.assertEqual(args.targets, [target1, target2])\n self.assertEqual(args.force, True)\n self.assertEqual(args.single_item, True)\n\n\nclass TestRemove(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args([\"remove\", target1, target2])\n\n self.assertIsInstance(args.func(args), CmdRemove)\n self.assertEqual(args.targets, [target1, target2])\n\n\nclass TestAdd(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args([\"add\", target1, target2])\n\n self.assertIsInstance(args.func(args), CmdAdd)\n self.assertEqual(args.targets, [target1, target2])\n\n\nclass TestGC(TestDvc):\n def test(self):\n args = parse_args([\"gc\"])\n self.assertIsInstance(args.func(args), CmdGC)\n\n\nclass TestGCMultipleDvcRepos(TestDvc):\n def test(self):\n args = parse_args([\"gc\", \"-p\", \"/tmp/asdf\", \"/tmp/xyz\"])\n\n self.assertIsInstance(args.func(args), CmdGC)\n\n self.assertEqual(args.repos, [\"/tmp/asdf\", \"/tmp/xyz\"])\n\n\nclass TestConfig(TestDvc):\n def test(self):\n name = \"param\"\n value = \"1\"\n\n args = parse_args([\"config\", \"-u\", \"--unset\", name, value])\n\n self.assertIsInstance(args.func(args), CmdConfig)\n self.assertEqual(args.unset, True)\n self.assertEqual(args.name, name)\n self.assertEqual(args.value, value)\n\n\nclass TestCheckout(TestDvc):\n def test(self):\n args = parse_args([\"checkout\"])\n self.assertIsInstance(args.func(args), CmdCheckout)\n\n\nclass TestFindRoot(TestDvc):\n def test(self):\n os.chdir(\"..\")\n\n class A(object):\n quiet = False\n verbose = True\n\n args = A()\n with self.assertRaises(DvcException):\n CmdBase(args)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 67, "span_ids": ["TestDataCloud._test_cloud", "TestDataCloud.test", "TestDataCloud"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDataCloud(TestDvc):\n def _test_cloud(self, config, cl):\n self.dvc.config = config\n cloud = DataCloud(self.dvc)\n self.assertIsInstance(cloud.get_remote(), cl)\n\n def test(self):\n config = copy.deepcopy(TEST_CONFIG)\n\n clist = [\n (\"s3://mybucket/\", RemoteS3),\n (\"gs://mybucket/\", RemoteGS),\n (\"ssh://user@localhost:/\", RemoteSSH),\n (\"http://localhost:8000/\", RemoteHTTP),\n (\"azure://ContainerName=mybucket;conn_string;\", RemoteAZURE),\n (\"oss://mybucket/\", RemoteOSS),\n (TestDvc.mkdtemp(), RemoteLOCAL),\n ]\n\n for scheme, cl in clist:\n remote_url = scheme + str(uuid.uuid4())\n config[\"remote\"][TEST_REMOTE][\"url\"] = remote_url\n self._test_cloud(config, cl)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 102, "span_ids": ["TestDataCloudBase.should_test", "TestDataCloudBase._ensure_should_run", "TestDataCloudBase.get_url", "TestDataCloudBase", "TestDataCloudBase._setup_cloud", "TestDataCloudBase._get_cloud_class", "TestDataCloudBase._get_keyfile"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDataCloudBase(TestDvc):\n def _get_cloud_class(self):\n return None\n\n @staticmethod\n def should_test():\n return False\n\n @staticmethod\n def get_url():\n return NotImplementedError\n\n def _get_keyfile(self):\n return None\n\n def _ensure_should_run(self):\n if not self.should_test():\n raise SkipTest(\n \"Test {} is disabled\".format(self.__class__.__name__)\n )\n\n def _setup_cloud(self):\n self._ensure_should_run()\n\n repo = self.get_url()\n keyfile = self._get_keyfile()\n\n config = copy.deepcopy(TEST_CONFIG)\n config[\"remote\"][TEST_REMOTE] = {\"url\": repo, \"keyfile\": keyfile}\n self.dvc.config = config\n self.cloud = DataCloud(self.dvc)\n\n self.assertIsInstance(self.cloud.get_remote(), self._get_cloud_class())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 104, "end_line": 183, "span_ids": ["TestDataCloudBase.test", "TestDataCloudBase._test_cloud"], "tokens": 675}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDataCloudBase(TestDvc):\n\n def _test_cloud(self):\n self._setup_cloud()\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n out = stage.outs[0]\n cache = out.cache_path\n md5 = out.checksum\n info = out.get_used_cache()\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage_dir = stages[0]\n self.assertTrue(stage_dir is not None)\n out_dir = stage_dir.outs[0]\n cache_dir = out_dir.cache_path\n name_dir = str(out_dir)\n md5_dir = out_dir.checksum\n info_dir = NamedCache.make(out_dir.scheme, md5_dir, name_dir)\n\n with self.cloud.repo.state:\n # Check status\n status = self.cloud.status(info, show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_NEW}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status(info_dir, show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_NEW}}\n self.assertEqual(status_dir, expected)\n\n # Push and check status\n self.cloud.push(info)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n\n self.cloud.push(info_dir)\n self.assertTrue(os.path.isfile(cache_dir))\n\n status = self.cloud.status(info, show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_OK}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status(info_dir, show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_OK}}\n self.assertEqual(status_dir, expected)\n\n # Remove and check status\n remove(self.dvc.cache.local.cache_dir)\n\n status = self.cloud.status(info, show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_DELETED}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status(info_dir, show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_DELETED}}\n self.assertEqual(status_dir, expected)\n\n # Pull and check status\n self.cloud.pull(info)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n with open(cache, \"r\") as fd:\n self.assertEqual(fd.read(), self.FOO_CONTENTS)\n\n self.cloud.pull(info_dir)\n self.assertTrue(os.path.isfile(cache_dir))\n\n status = self.cloud.status(info, show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_OK}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status(info_dir, show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_OK}}\n self.assertTrue(status_dir, expected)\n\n def test(self):\n self._ensure_should_run()\n self._test_cloud()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.self__test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.self__test_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 512, "end_line": 541, "span_ids": ["TestWarnOnOutdatedStage.test", "TestWarnOnOutdatedStage._test", "TestWarnOnOutdatedStage.main", "TestWarnOnOutdatedStage"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestWarnOnOutdatedStage(TestDvc):\n def main(self, args):\n ret = main(args)\n self.assertEqual(ret, 0)\n\n def _test(self):\n url = Local.get_url()\n self.main([\"remote\", \"add\", \"-d\", TEST_REMOTE, url])\n\n stage = self.dvc.run(outs=[\"bar\"], cmd=\"echo bar > bar\")\n self.main([\"push\"])\n\n stage_file_path = stage.relpath\n content = load_stage_file(stage_file_path)\n del content[\"outs\"][0][\"md5\"]\n dump_stage_file(stage_file_path, content)\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n self._caplog.clear()\n self.main([\"status\", \"-c\"])\n expected_warning = (\n \"Output 'bar'(Stage: 'bar.dvc') is missing version info. \"\n \"Cache for it will not be collected. \"\n \"Use `dvc repro` to get your pipeline up to date.\"\n )\n\n assert expected_warning in self._caplog.text\n\n def test(self):\n self._test()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 578, "end_line": 590, "span_ids": ["TestRecursiveSyncOperations._test_recursive_fetch"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRecursiveSyncOperations(Local, TestDataCloudBase):\n\n def _test_recursive_fetch(self, data_md5, data_sub_md5):\n self._clear_local_cache()\n\n local_cache_data_path = self.dvc.cache.local.get(data_md5)\n local_cache_data_sub_path = self.dvc.cache.local.get(data_sub_md5)\n\n self.assertFalse(os.path.exists(local_cache_data_path))\n self.assertFalse(os.path.exists(local_cache_data_sub_path))\n\n self.main([\"fetch\", \"-R\", self.DATA_DIR])\n\n self.assertTrue(os.path.exists(local_cache_data_path))\n self.assertTrue(os.path.exists(local_cache_data_sub_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 592, "end_line": 616, "span_ids": ["TestRecursiveSyncOperations._test_recursive_push", "TestRecursiveSyncOperations.test"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRecursiveSyncOperations(Local, TestDataCloudBase):\n\n def _test_recursive_push(self, data_md5, data_sub_md5):\n remote = self.cloud.get_remote()\n cloud_data_path = remote.get(data_md5)\n cloud_data_sub_path = remote.get(data_sub_md5)\n\n self.assertFalse(os.path.exists(cloud_data_path))\n self.assertFalse(os.path.exists(cloud_data_sub_path))\n\n self.main([\"push\", \"-R\", self.DATA_DIR])\n\n self.assertTrue(os.path.exists(cloud_data_path))\n self.assertTrue(os.path.exists(cloud_data_sub_path))\n\n def test(self):\n self._setup_cloud()\n self._prepare_repo()\n\n data_md5 = file_md5(self.DATA)[0]\n data_sub_md5 = file_md5(self.DATA_SUB)[0]\n\n self._test_recursive_push(data_md5, data_sub_md5)\n\n self._test_recursive_fetch(data_md5, data_sub_md5)\n\n self._test_recursive_pull()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCBranchesTags_TestGCBranchesTags.test.self__check_cache_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCBranchesTags_TestGCBranchesTags.test.self__check_cache_1_", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 104, "span_ids": ["TestGCBranchesTags.test", "TestGCBranchesTags", "TestGCBranchesTags._check_cache"], "tokens": 509}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGCBranchesTags(TestDvcGit):\n def _check_cache(self, num):\n total = 0\n for root, dirs, files in os.walk(os.path.join(\".dvc\", \"cache\")):\n total += len(files)\n self.assertEqual(total, num)\n\n def test(self):\n fname = \"file\"\n\n with open(fname, \"w+\") as fobj:\n fobj.write(\"v1.0\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"v1.0\")\n self.dvc.scm.tag(\"v1.0\")\n\n self.dvc.scm.checkout(\"test\", create_new=True)\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"test\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"test\")\n\n self.dvc.scm.checkout(\"master\")\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"trash\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"trash\")\n\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"master\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"master\")\n\n self._check_cache(4)\n\n self.dvc.gc(all_tags=True, all_branches=True)\n\n self._check_cache(3)\n\n self.dvc.gc(all_tags=False, all_branches=True)\n\n self._check_cache(2)\n\n self.dvc.gc(all_tags=True, all_branches=False)\n\n self._check_cache(1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos_TestGCMultipleDvcRepos.setUp.self.additional_dvc_7.DvcRepo_self_additional_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos_TestGCMultipleDvcRepos.setUp.self.additional_dvc_7.DvcRepo_self_additional_p", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 111, "end_line": 133, "span_ids": ["TestGCMultipleDvcRepos", "TestGCMultipleDvcRepos.setUp", "TestGCMultipleDvcRepos._check_cache"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGCMultipleDvcRepos(TestDvcGit):\n def _check_cache(self, num):\n total = 0\n for root, dirs, files in os.walk(os.path.join(\".dvc\", \"cache\")):\n total += len(files)\n self.assertEqual(total, num)\n\n def setUp(self):\n super().setUp()\n self.additional_path = TestDir.mkdtemp()\n self.additional_git = Repo.init(self.additional_path)\n self.additional_dvc = DvcRepo.init(self.additional_path)\n\n cache_path = os.path.join(self._root_dir, \".dvc\", \"cache\")\n config_path = os.path.join(\n self.additional_path, \".dvc\", \"config.local\"\n )\n cfg = configobj.ConfigObj()\n cfg.filename = config_path\n cfg[\"cache\"] = {\"dir\": cache_path}\n cfg.write()\n\n self.additional_dvc = DvcRepo(self.additional_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_os_TestMoveNotDataSource.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_os_TestMoveNotDataSource.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 63, "span_ids": ["TestMove", "TestMoveNotDataSource", "TestMoveNonExistentFile", "imports", "TestCmdMove.test", "TestMoveNotDataSource.test", "TestMove.test", "TestMoveNonExistentFile.test", "TestMoveDirectory.test", "TestMoveDirectory", "TestCmdMove"], "tokens": 446}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.dvcfile import DVC_FILE_SUFFIX\nfrom dvc.exceptions import DvcException\nfrom dvc.exceptions import MoveNotDataSourceError\nfrom dvc.main import main\nfrom dvc.utils.stage import load_stage_file\nfrom tests.basic_env import TestDvc\nfrom tests.basic_env import TestDvcGit\nfrom tests.func.test_repro import TestRepro\nfrom tests.utils import cd\n\n\nclass TestMove(TestDvc):\n def test(self):\n dst = self.FOO + \"1\"\n self.dvc.add(self.FOO)\n self.dvc.move(self.FOO, dst)\n\n self.assertFalse(os.path.isfile(self.FOO))\n self.assertTrue(os.path.isfile(dst))\n\n\nclass TestMoveNonExistentFile(TestDvc):\n def test(self):\n with self.assertRaises(DvcException):\n self.dvc.move(\"non_existent_file\", \"dst\")\n\n\nclass TestMoveDirectory(TestDvc):\n def test(self):\n dst = \"dst\"\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n self.dvc.move(self.DATA_DIR, dst)\n self.assertFalse(os.path.exists(self.DATA_DIR))\n self.assertTrue(os.path.exists(dst))\n\n\nclass TestCmdMove(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n ret = main([\"move\", self.FOO, self.FOO + \"1\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"move\", \"non-existing-file\", \"dst\"])\n self.assertNotEqual(ret, 0)\n\n\nclass TestMoveNotDataSource(TestRepro):\n def test(self):\n from dvc.repo import Repo as DvcRepo\n\n self.dvc = DvcRepo(self._root_dir)\n with self.assertRaises(MoveNotDataSourceError):\n self.dvc.move(self.file1, \"dst\")\n\n ret = main([\"move\", self.file1, \"dst\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileWithExtension_TestMoveFileWithExtension.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileWithExtension_TestMoveFileWithExtension.test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 81, "span_ids": ["TestMoveFileWithExtension", "TestMoveFileWithExtension.test"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMoveFileWithExtension(TestDvc):\n def test(self):\n with open(os.path.join(self.dvc.root_dir, \"file.csv\"), \"w\") as fd:\n fd.write(\"1,2,3\\n\")\n\n self.dvc.add(\"file.csv\")\n\n self.assertTrue(os.path.exists(\"file.csv\"))\n self.assertTrue(os.path.exists(\"file.csv.dvc\"))\n\n ret = main([\"move\", \"file.csv\", \"other_name.csv\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(\"file.csv\"))\n self.assertFalse(os.path.exists(\"file.csv.dvc\"))\n self.assertTrue(os.path.exists(\"other_name.csv\"))\n self.assertTrue(os.path.exists(\"other_name.csv.dvc\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectory_TestMoveFileToDirectory.test.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectory_TestMoveFileToDirectory.test.None_6", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 100, "span_ids": ["TestMoveFileToDirectory.test", "TestMoveFileToDirectory"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMoveFileToDirectory(TestDvc):\n def test(self):\n foo_dvc_file = self.FOO + DVC_FILE_SUFFIX\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(foo_dvc_file))\n\n new_foo_path = os.path.join(self.DATA_DIR, self.FOO)\n new_foo_dvc_path = new_foo_path + DVC_FILE_SUFFIX\n ret = main([\"move\", self.FOO, new_foo_path])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(self.FOO))\n self.assertFalse(os.path.exists(foo_dvc_file))\n self.assertTrue(os.path.exists(new_foo_path))\n self.assertTrue(os.path.exists(new_foo_dvc_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectoryWithoutSpecifiedTargetName_TestMoveFileToDirectoryWithoutSpecifiedTargetName.test.self_assertEqual_self_FOO": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectoryWithoutSpecifiedTargetName_TestMoveFileToDirectoryWithoutSpecifiedTargetName.test.self_assertEqual_self_FOO", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 123, "span_ids": ["TestMoveFileToDirectoryWithoutSpecifiedTargetName", "TestMoveFileToDirectoryWithoutSpecifiedTargetName.test"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMoveFileToDirectoryWithoutSpecifiedTargetName(TestDvc):\n def test(self):\n foo_stage_file_path = self.FOO + DVC_FILE_SUFFIX\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(foo_stage_file_path))\n\n target_foo_path = os.path.join(self.DATA_DIR, self.FOO)\n target_foo_stage_file_path = target_foo_path + DVC_FILE_SUFFIX\n\n ret = main([\"move\", self.FOO, self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(self.FOO))\n self.assertFalse(os.path.exists(foo_stage_file_path))\n\n self.assertTrue(os.path.exists(target_foo_path))\n self.assertTrue(os.path.exists(target_foo_stage_file_path))\n\n new_stage = load_stage_file(target_foo_stage_file_path)\n self.assertEqual(self.FOO, new_stage[\"outs\"][0][\"path\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_set_os_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_set_os_l", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 150, "span_ids": ["TestMoveDirectoryShouldNotOverwriteExisting", "TestMoveDirectoryShouldNotOverwriteExisting.test"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMoveDirectoryShouldNotOverwriteExisting(TestDvcGit):\n def test(self):\n dir_name = \"dir\"\n orig_listdir = set(os.listdir(self.DATA_DIR))\n\n self.dvc.add(self.DATA_DIR)\n\n os.mkdir(dir_name)\n new_dir_name = os.path.join(dir_name, self.DATA_DIR)\n\n self.dvc.move(self.DATA_DIR, dir_name)\n\n data_dir_stage = self.DATA_DIR + DVC_FILE_SUFFIX\n self.assertFalse(os.path.exists(self.DATA_DIR))\n self.assertFalse(os.path.exists(data_dir_stage))\n\n self.assertTrue(os.path.exists(dir_name))\n self.assertEqual(\n set(os.listdir(dir_name)),\n set([\".gitignore\", data_dir_stage, self.DATA_DIR]),\n )\n\n self.assertTrue(os.path.exists(new_dir_name))\n self.assertTrue(os.path.isfile(new_dir_name + DVC_FILE_SUFFIX))\n self.assertEqual(set(os.listdir(new_dir_name)), orig_listdir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileBetweenDirectories_TestMoveFileBetweenDirectories.test.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileBetweenDirectories_TestMoveFileBetweenDirectories.test.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 153, "end_line": 178, "span_ids": ["TestMoveFileBetweenDirectories.test", "TestMoveFileBetweenDirectories"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMoveFileBetweenDirectories(TestDvc):\n def test(self):\n data_stage_file = self.DATA + DVC_FILE_SUFFIX\n ret = main([\"add\", self.DATA])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(data_stage_file))\n\n new_data_dir = \"data_dir2\"\n os.makedirs(new_data_dir)\n\n ret = main([\"move\", self.DATA, new_data_dir])\n self.assertEqual(ret, 0)\n\n new_data_path = os.path.join(new_data_dir, os.path.basename(self.DATA))\n new_data_stage_file = new_data_path + DVC_FILE_SUFFIX\n\n self.assertFalse(os.path.exists(self.DATA))\n self.assertFalse(os.path.exists(data_stage_file))\n\n self.assertTrue(os.path.exists(new_data_path))\n self.assertTrue(os.path.exists(new_data_stage_file))\n\n new_stage_file = load_stage_file(new_data_stage_file)\n self.assertEqual(\n os.path.basename(self.DATA), new_stage_file[\"outs\"][0][\"path\"]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_output.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_output.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/func/test_output.py", "file_name": "test_output.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports", "test_scheme", "_get_out"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.output import _get\nfrom dvc.output import OUTS_MAP\nfrom dvc.stage import Stage\n\n\nTESTS = [\n (\"s3://bucket/path\", \"s3\"),\n (\"gs://bucket/path\", \"gs\"),\n (\"ssh://example.com:/dir/path\", \"ssh\"),\n (\"hdfs://example.com/dir/path\", \"hdfs\"),\n (\"path/to/file\", \"local\"),\n (\"path\\\\to\\\\file\", \"local\"),\n (\"file\", \"local\"),\n (\"./file\", \"local\"),\n (\".\\\\file\", \"local\"),\n (\"../file\", \"local\"),\n (\"..\\\\file\", \"local\"),\n (\"unknown://path\", \"local\"),\n]\n\n\ndef _get_out(dvc, path):\n return _get(Stage(dvc), path, None, None, None, None)\n\n\n@pytest.mark.parametrize(\"url,scheme\", TESTS)\ndef test_scheme(dvc, url, scheme):\n assert type(_get_out(dvc, url)) == OUTS_MAP[scheme]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_logging_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_logging_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 55, "span_ids": ["TestPipelineShowSingle.test_commands", "imports", "TestPipelineShowSingle.test_not_dvc_file", "TestPipelineShowSingle.test_outs", "TestPipelineShowSingle.test_non_existing", "TestPipelineShowSingle.test_tree", "TestPipelineShowSingle.test_dot_commands", "TestPipelineShowSingle", "TestPipelineShowSingle.setUp", "TestPipelineShowSingle.test", "TestPipelineShowSingle.test_ascii_outs", "TestPipelineShowSingle.test_dot_outs", "TestPipelineShowSingle.test_dot"], "tokens": 418}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.main import main\nfrom dvc.command.pipeline import CmdPipelineShow, CmdPipelineList\nfrom tests.basic_env import TestDvc\nfrom tests.func.test_repro import TestRepro\nfrom tests.func.test_repro import TestReproChangedDeepData\n\n\nclass TestPipelineShowSingle(TestDvc):\n def setUp(self):\n super().setUp()\n self.stage = \"foo.dvc\"\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n def test(self):\n ret = main([\"pipeline\", \"show\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_tree(self):\n ret = main([\"pipeline\", \"show\", \"--tree\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_dot_outs(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_not_dvc_file(self):\n ret = main([\"pipeline\", \"show\", self.FOO])\n self.assertNotEqual(ret, 0)\n\n def test_non_existing(self):\n ret = main([\"pipeline\", \"show\", \"non-existing\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 192, "end_line": 217, "span_ids": ["TestPipelineListEmpty", "TestPipelineListSingle.test", "TestDvcRepoPipeline.one_pipeline", "TestPipelineListSingle", "TestPipelineListEmpty.test", "TestDvcRepoPipeline", "TestDvcRepoPipeline.test_no_stages"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPipelineListEmpty(TestDvc):\n def test(self):\n ret = main([\"pipeline\", \"list\"])\n self.assertEqual(ret, 0)\n\n\nclass TestPipelineListSingle(TestPipelineShowDeep):\n def test(self):\n ret = main([\"pipeline\", \"list\"])\n self.assertEqual(ret, 0)\n\n\nclass TestDvcRepoPipeline(TestDvc):\n def test_no_stages(self):\n pipelines = self.dvc.pipelines\n self.assertEqual(len(pipelines), 0)\n\n def one_pipeline(self):\n self.dvc.add(\"foo\")\n self.dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"\")\n self.dvc.run(deps=[\"bar\"], outs=[\"baz\"], cmd=\"echo baz > baz\")\n pipelines = self.dvc.pipelines\n\n self.assertEqual(len(pipelines), 1)\n self.assertEqual(pipelines[0].nodes, 3)\n self.assertEqual(pipelines[0].edges, 2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_overwrite_TestRemote.test_referencing_other_remotes.assert_config_remote_ba": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_overwrite_TestRemote.test_referencing_other_remotes.assert_config_remote_ba", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 66, "span_ids": ["TestRemote.test_overwrite", "TestRemote.test_referencing_other_remotes"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemote(TestDvc):\n\n def test_overwrite(self):\n remote_name = \"a\"\n remote_url = \"s3://bucket/name\"\n self.assertEqual(main([\"remote\", \"add\", remote_name, remote_url]), 0)\n self.assertEqual(main([\"remote\", \"add\", remote_name, remote_url]), 251)\n self.assertEqual(\n main([\"remote\", \"add\", \"-f\", remote_name, remote_url]), 0\n )\n\n def test_referencing_other_remotes(self):\n assert main([\"remote\", \"add\", \"foo\", \"ssh://localhost/\"]) == 0\n assert main([\"remote\", \"add\", \"bar\", \"remote://foo/dvc-storage\"]) == 0\n\n config = configobj.ConfigObj(self.dvc.config.files[\"repo\"])\n assert config['remote \"bar\"'][\"url\"] == \"remote://foo/dvc-storage\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteRemove_TestRemoteDefault.test.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteRemove_TestRemoteDefault.test.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 120, "span_ids": ["TestRemoteDefault.test", "TestRemoteRemove", "TestRemoteDefault", "TestRemoteRemove.test"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteRemove(TestDvc):\n def test(self):\n ret = main([\"config\", \"core.checksum_jobs\", \"1\"])\n self.assertEqual(ret, 0)\n\n remote = \"mys3\"\n ret = main([\"remote\", \"add\", remote, \"s3://bucket/name\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"remote\", \"remove\", remote])\n self.assertEqual(ret, 0)\n\n\nclass TestRemoteDefault(TestDvc):\n def test(self):\n remote = \"mys3\"\n ret = main([\"remote\", \"add\", \"mys3\", \"s3://bucket/path\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"remote\", \"default\", \"mys3\"])\n self.assertEqual(ret, 0)\n config_file = os.path.join(self.dvc.dvc_dir, Config.CONFIG)\n config = configobj.ConfigObj(config_file)\n default = config[\"core\"][\"remote\"]\n self.assertEqual(default, remote)\n\n ret = main([\"remote\", \"default\", \"--unset\"])\n self.assertEqual(ret, 0)\n config = configobj.ConfigObj(config_file)\n default = config.get(\"core\", {}).get(\"remote\")\n self.assertEqual(default, None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_os_TestRemove.test.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_os_TestRemove.test.None_8", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports", "TestRemove", "TestRemove.test"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom mock import patch\n\nfrom dvc.exceptions import DvcException\nfrom dvc.main import main\nfrom dvc.stage import Stage\nfrom dvc.stage.exceptions import StageFileDoesNotExistError\nfrom dvc.system import System\nfrom dvc.utils.fs import remove\nfrom tests.basic_env import TestDvc\n\n\nclass TestRemove(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n stage_removed = self.dvc.remove(stage.path, outs_only=True)\n\n self.assertIsInstance(stage_removed, Stage)\n self.assertEqual(stage.path, stage_removed.path)\n self.assertFalse(os.path.isfile(self.FOO))\n\n stage_removed = self.dvc.remove(stage.path)\n self.assertIsInstance(stage_removed, Stage)\n self.assertEqual(stage.path, stage_removed.path)\n self.assertFalse(os.path.isfile(self.FOO))\n self.assertFalse(os.path.exists(stage.path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveNonExistentFile_TestRemoveBrokenSymlink.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveNonExistentFile_TestRemoveBrokenSymlink.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 54, "span_ids": ["TestRemoveNonExistentFile", "TestRemoveBrokenSymlink", "TestRemoveBrokenSymlink.test", "TestRemoveNonExistentFile.test"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoveNonExistentFile(TestDvc):\n def test(self):\n with self.assertRaises(StageFileDoesNotExistError):\n self.dvc.remove(\"non_existent_dvc_file\")\n\n\nclass TestRemoveBrokenSymlink(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.type\", \"symlink\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n remove(self.dvc.cache.local.cache_dir)\n\n self.assertTrue(System.is_symlink(self.FOO))\n\n ret = main([\"remove\", self.FOO + \".dvc\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.lexists(self.FOO))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveDirectory_TestCmdRemove.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveDirectory_TestCmdRemove.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 56, "end_line": 78, "span_ids": ["TestRemoveDirectory", "TestCmdRemove.test", "TestRemoveDirectory.test", "TestCmdRemove"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoveDirectory(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage_add = stages[0]\n self.assertTrue(stage_add is not None)\n stage_removed = self.dvc.remove(stage_add.path)\n self.assertEqual(stage_add.path, stage_removed.path)\n self.assertFalse(os.path.exists(self.DATA_DIR))\n self.assertFalse(os.path.exists(stage_removed.path))\n\n\nclass TestCmdRemove(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n ret = main([\"remove\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"remove\", \"non-existing-dvc-file\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemovePurge_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemovePurge_", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 98, "span_ids": ["TestRemovePurge.test_force", "TestRemovePurge", "TestRemovePurge.test"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemovePurge(TestDvc):\n def test(self):\n dvcfile = self.dvc.add(self.FOO)[0].path\n ret = main([\"remove\", \"--purge\", \"--force\", dvcfile])\n\n self.assertEqual(ret, 0)\n self.assertFalse(os.path.exists(self.FOO))\n self.assertFalse(os.path.exists(dvcfile))\n\n @patch(\"dvc.prompt.confirm\", return_value=False)\n def test_force(self, mock_prompt):\n dvcfile = self.dvc.add(self.FOO)[0].path\n ret = main([\"remove\", \"--purge\", dvcfile])\n\n mock_prompt.assert_called()\n self.assertEqual(ret, 1)\n self.assertRaises(DvcException)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 88, "span_ids": ["TestRepro.setUp", "TestRepro", "TestReproFail.test", "TestReproFail"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRepro(SingleStageRun, TestDvc):\n def setUp(self):\n super().setUp()\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n self.foo_stage = stages[0]\n self.assertTrue(self.foo_stage is not None)\n\n self.file1 = \"file1\"\n self.file1_stage = self.file1 + \".dvc\"\n self.stage = self._run(\n fname=self.file1_stage,\n outs=[self.file1],\n deps=[self.FOO, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, self.file1),\n name=\"run1\",\n )\n\n\nclass TestReproFail(TestRepro):\n def test(self):\n os.unlink(self.CODE)\n\n ret = main([\"repro\", self._get_stage_target(self.stage)])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproCyclicGraph_TestReproCyclicGraph.test.with_self_assertRaises_Cy.self_dvc_reproduce_cycle": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproCyclicGraph_TestReproCyclicGraph.test.with_self_assertRaises_Cy.self_dvc_reproduce_cycle", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 115, "span_ids": ["TestReproCyclicGraph.test", "TestReproCyclicGraph"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproCyclicGraph(SingleStageRun, TestDvc):\n def test(self):\n self._run(\n deps=[self.FOO],\n outs=[\"bar.txt\"],\n cmd=\"echo bar > bar.txt\",\n name=\"copybarbar.txt\",\n )\n\n self._run(\n deps=[\"bar.txt\"],\n outs=[\"baz.txt\"],\n cmd=\"echo baz > baz.txt\",\n name=\"copybazbaz.txt\",\n )\n\n stage_dump = {\n \"cmd\": \"echo baz > foo\",\n \"deps\": [{\"path\": \"baz.txt\"}],\n \"outs\": [{\"path\": self.FOO}],\n }\n dump_stage_file(\"cycle.dvc\", stage_dump)\n\n with self.assertRaises(CyclicGraphError):\n self.dvc.reproduce(\"cycle.dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput_TestReproWorkingDirectoryAsOutput.test.with_self_assertRaises_St.self_dvc_reproduce_faulty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput_TestReproWorkingDirectoryAsOutput.test.with_self_assertRaises_St.self_dvc_reproduce_faulty", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 155, "span_ids": ["TestReproWorkingDirectoryAsOutput.test", "TestReproWorkingDirectoryAsOutput"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproWorkingDirectoryAsOutput(TestDvc):\n \"\"\"\n | stage.cwd | out.path | cwd as output |\n |:-----------:|:---------:|:-------------:|\n | dir | dir | True |\n | dir/subdir/ | dir | True |\n | dir | dir-1 | False |\n | . | something | False |\n \"\"\"\n\n def test(self):\n # File structure:\n # .\n # |-- dir1\n # | |__ dir2.dvc (out.path == ../dir2)\n # |__ dir2\n # |__ something.dvc (stage.cwd == ./dir2)\n\n os.mkdir(os.path.join(self.dvc.root_dir, \"dir1\"))\n\n self.dvc.run(\n fname=os.path.join(\"dir1\", \"dir2.dvc\"),\n wdir=\"dir1\",\n outs=[os.path.join(\"..\", \"dir2\")],\n cmd=\"mkdir {path}\".format(path=os.path.join(\"..\", \"dir2\")),\n )\n\n faulty_stage_path = os.path.join(\"dir2\", \"something.dvc\")\n\n output = os.path.join(\"..\", \"something\")\n stage_dump = {\n \"cmd\": \"echo something > {}\".format(output),\n \"outs\": [{\"path\": output}],\n }\n dump_stage_file(faulty_stage_path, stage_dump)\n\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.reproduce(faulty_stage_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_similar_paths_TestReproWorkingDirectoryAsOutput.test_similar_paths.try_.except_StagePathAsOutputE.self_fail_should_not_rai": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_similar_paths_TestReproWorkingDirectoryAsOutput.test_similar_paths.try_.except_StagePathAsOutputE.self_fail_should_not_rai", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 175, "end_line": 197, "span_ids": ["TestReproWorkingDirectoryAsOutput.test_similar_paths"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproWorkingDirectoryAsOutput(TestDvc):\n\n def test_similar_paths(self):\n # File structure:\n #\n # .\n # |-- something.dvc (out.path == something)\n # |-- something\n # |__ something-1\n # |-- a\n # |__ a.dvc (stage.cwd == something-1)\n\n self.dvc.run(outs=[\"something\"], cmd=\"mkdir something\")\n\n os.mkdir(\"something-1\")\n\n stage = os.path.join(\"something-1\", \"a.dvc\")\n\n stage_dump = {\"cmd\": \"echo a > a\", \"outs\": [{\"path\": \"a\"}]}\n dump_stage_file(stage, stage_dump)\n\n try:\n self.dvc.reproduce(stage)\n except StagePathAsOutputError:\n self.fail(\"should not raise StagePathAsOutputError\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepDirWithOutputsUnderIt_TestReproDepDirWithOutputsUnderIt.test.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepDirWithOutputsUnderIt_TestReproDepDirWithOutputsUnderIt.test.None_8", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 257, "end_line": 287, "span_ids": ["TestReproDepDirWithOutputsUnderIt", "TestReproDepDirWithOutputsUnderIt.test"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproDepDirWithOutputsUnderIt(SingleStageRun, TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n stages = self.dvc.add(self.DATA_SUB)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n stage = self.dvc.run(\n fname=\"dvcfile2.dvc\", deps=[self.DATA, self.DATA_SUB]\n )\n self.assertTrue(stage is not None)\n\n file1 = \"file1\"\n file1_stage = file1 + \".dvc\"\n stage = self._run(\n fname=file1_stage,\n deps=[self.DATA_DIR],\n outs=[file1],\n cmd=\"python {} {} {}\".format(self.CODE, self.DATA, file1),\n name=\"copy-data-file1\",\n )\n self.assertTrue(stage is not None)\n\n os.unlink(self.DATA)\n shutil.copyfile(self.FOO, self.DATA)\n\n stages = self.dvc.reproduce(self._get_stage_target(stage))\n self.assertEqual(len(stages), 2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproNoDeps_TestReproNoDeps.test.self_assertEqual_len_stag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproNoDeps_TestReproNoDeps.test.self_assertEqual_len_stag", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 290, "end_line": 309, "span_ids": ["TestReproNoDeps", "TestReproNoDeps.test"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproNoDeps(TestRepro):\n def test(self):\n out = \"out\"\n code_file = \"out.py\"\n stage_file = \"out.dvc\"\n code = (\n 'import uuid\\nwith open(\"{}\", \"w+\") as fd:\\n'\n \"\\tfd.write(str(uuid.uuid4()))\\n\".format(out)\n )\n with open(code_file, \"w+\") as fd:\n fd.write(code)\n stage = self._run(\n fname=stage_file,\n outs=[out],\n cmd=\"python {}\".format(code_file),\n name=\"uuid\",\n )\n\n stages = self.dvc.reproduce(self._get_stage_target(stage))\n self.assertEqual(len(stages), 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproForce_TestReproChangedCode.swap_code.self_create_self_CODE_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproForce_TestReproChangedCode.swap_code.self_create_self_CODE_ne", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 312, "end_line": 335, "span_ids": ["TestReproChangedCode", "TestReproChangedCode.swap_code", "TestReproForce.test", "TestReproChangedCode.test", "TestReproForce"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproForce(TestRepro):\n def test(self):\n stages = self.dvc.reproduce(\n self._get_stage_target(self.stage), force=True\n )\n self.assertEqual(len(stages), 2)\n\n\nclass TestReproChangedCode(TestRepro):\n def test(self):\n self.swap_code()\n\n stages = self.dvc.reproduce(self._get_stage_target(self.stage))\n\n self.assertTrue(filecmp.cmp(self.file1, self.BAR, shallow=False))\n self.assertEqual(len(stages), 1)\n\n def swap_code(self):\n os.unlink(self.CODE)\n new_contents = self.CODE_CONTENTS\n new_contents += \"\\nshutil.copyfile('{}', \" \"sys.argv[2])\\n\".format(\n self.BAR\n )\n self.create(self.CODE, new_contents)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedData_TestReproUpToDate.test.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedData_TestReproUpToDate.test.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 338, "end_line": 371, "span_ids": ["TestReproDry", "TestReproChangedData.swap_foo_with_bar", "TestReproDry.test", "TestReproChangedData", "TestReproChangedData.test", "TestReproUpToDate", "TestReproUpToDate.test"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproChangedData(TestRepro):\n def test(self):\n self.swap_foo_with_bar()\n\n stages = self.dvc.reproduce(self._get_stage_target(self.stage))\n\n self.assertTrue(filecmp.cmp(self.file1, self.BAR, shallow=False))\n self.assertEqual(len(stages), 2)\n\n def swap_foo_with_bar(self):\n os.unlink(self.FOO)\n shutil.copyfile(self.BAR, self.FOO)\n\n\nclass TestReproDry(TestReproChangedData):\n def test(self):\n self.swap_foo_with_bar()\n\n stages = self.dvc.reproduce(\n self._get_stage_target(self.stage), dry=True\n )\n\n self.assertTrue(len(stages), 2)\n self.assertFalse(filecmp.cmp(self.file1, self.BAR, shallow=False))\n\n ret = main([\"repro\", \"--dry\", self._get_stage_target(self.stage)])\n self.assertEqual(ret, 0)\n self.assertFalse(filecmp.cmp(self.file1, self.BAR, shallow=False))\n\n\nclass TestReproUpToDate(TestRepro):\n def test(self):\n ret = main([\"repro\", self._get_stage_target(self.stage)])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDryNoExec_TestReproDryNoExec.test.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDryNoExec_TestReproDryNoExec.test.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 333, "end_line": 367, "span_ids": ["TestReproDryNoExec.test", "TestReproDryNoExec"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproDryNoExec(TestDvc):\n def test(self):\n deps = []\n for d in range(3):\n idir = \"idir{}\".format(d)\n odir = \"odir{}\".format(d)\n\n deps.append(\"-d\")\n deps.append(odir)\n\n os.mkdir(idir)\n\n f = os.path.join(idir, \"file\")\n with open(f, \"w+\") as fobj:\n fobj.write(str(d))\n\n ret = main(\n [\n \"run\",\n \"--no-exec\",\n \"-d\",\n idir,\n \"-o\",\n odir,\n \"python -c 'import shutil; \"\n 'shutil.copytree(\"{}\", \"{}\")\\''.format(idir, odir),\n ]\n )\n self.assertEqual(ret, 0)\n\n ret = main([\"run\", \"--no-exec\", \"-f\", \"Dvcfile\"] + deps)\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", \"--dry\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDeepData_TestReproChangedDeepData.test.self_assertEqual_len_stag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDeepData_TestReproChangedDeepData.test.self_assertEqual_len_stag", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 411, "end_line": 431, "span_ids": ["TestReproChangedDeepData.setUp", "TestReproChangedDeepData", "TestReproChangedDeepData.test"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproChangedDeepData(TestReproChangedData):\n def setUp(self):\n super().setUp()\n\n self.file2 = \"file2\"\n self.stage = self._run(\n fname=self.file2 + \".dvc\",\n outs=[self.file2],\n deps=[self.file1, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.file1, self.file2),\n name=\"copy-file-file2\",\n )\n\n def test(self):\n self.swap_foo_with_bar()\n\n stages = self.dvc.reproduce(self._get_stage_target(self.stage))\n\n self.assertTrue(filecmp.cmp(self.file1, self.BAR, shallow=False))\n self.assertTrue(filecmp.cmp(self.file2, self.BAR, shallow=False))\n self.assertEqual(len(stages), 3)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 393, "end_line": 436, "span_ids": ["TestReproIgnoreBuildCache.test", "TestReproIgnoreBuildCache"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproIgnoreBuildCache(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n foo_stage = stages[0]\n self.assertTrue(foo_stage is not None)\n\n code1 = \"code1.py\"\n shutil.copyfile(self.CODE, code1)\n file1 = \"file1\"\n file1_stage = self.dvc.run(\n outs=[file1],\n deps=[self.FOO, code1],\n cmd=\"python {} {} {}\".format(code1, self.FOO, file1),\n )\n self.assertTrue(file1_stage is not None)\n\n code2 = \"code2.py\"\n shutil.copyfile(self.CODE, code2)\n file2 = \"file2\"\n file2_stage = self.dvc.run(\n outs=[file2],\n deps=[file1, code2],\n cmd=\"python {} {} {}\".format(code2, file1, file2),\n )\n self.assertTrue(file2_stage is not None)\n\n code3 = \"code3.py\"\n shutil.copyfile(self.CODE, code3)\n file3 = \"file3\"\n file3_stage = self.dvc.run(\n outs=[file3],\n deps=[file2, code3],\n cmd=\"python {} {} {}\".format(code3, file2, file3),\n )\n self.assertTrue(file3_stage is not None)\n\n with open(code2, \"a\") as fobj:\n fobj.write(\"\\n\\n\")\n\n stages = self.dvc.reproduce(file3_stage.path, ignore_build_cache=True)\n self.assertEqual(len(stages), 2)\n self.assertEqual(stages[0].path, file2_stage.path)\n self.assertEqual(stages[1].path, file3_stage.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 536, "end_line": 566, "span_ids": ["TestReproLocked.test_non_existing", "TestReproLocked", "TestReproLocked.test"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproLocked(TestReproChangedData):\n def test(self):\n file2 = \"file2\"\n file2_stage = self._run(\n fname=file2 + \".dvc\",\n outs=[file2],\n deps=[self.file1, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.file1, file2),\n name=\"copy-file1-file2\",\n )\n\n self.swap_foo_with_bar()\n\n ret = main([\"lock\", self._get_stage_target(file2_stage)])\n self.assertEqual(ret, 0)\n stages = self.dvc.reproduce(self._get_stage_target(file2_stage))\n self.assertEqual(len(stages), 0)\n\n ret = main([\"unlock\", self._get_stage_target(file2_stage)])\n self.assertEqual(ret, 0)\n stages = self.dvc.reproduce(self._get_stage_target(file2_stage))\n self.assertTrue(filecmp.cmp(self.file1, self.BAR, shallow=False))\n self.assertTrue(filecmp.cmp(file2, self.BAR, shallow=False))\n self.assertEqual(len(stages), 3)\n\n def test_non_existing(self):\n with self.assertRaises(StageFileDoesNotExistError):\n self.dvc.lock_stage(\"non-existing-stage\")\n\n ret = main([\"lock\", \"non-existing-stage\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 569, "end_line": 607, "span_ids": ["TestReproLockedCallback.test", "TestReproLockedCallback", "TestReproLockedUnchanged.test", "TestReproLockedUnchanged"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproLockedCallback(SingleStageRun, TestDvc):\n def test(self):\n file1 = \"file1\"\n file1_stage = file1 + \".dvc\"\n # NOTE: purposefully not specifying dependencies\n # to create a callback stage.\n stage = self._run(\n fname=file1_stage,\n outs=[file1],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, file1),\n name=\"copy-FOO-file1\",\n )\n self.assertTrue(stage is not None)\n\n stages = self.dvc.reproduce(self._get_stage_target(stage))\n self.assertEqual(len(stages), 1)\n\n self.dvc.lock_stage(self._get_stage_target(stage))\n stages = self.dvc.reproduce(self._get_stage_target(stage))\n self.assertEqual(len(stages), 0)\n\n self.dvc.lock_stage(self._get_stage_target(stage), unlock=True)\n stages = self.dvc.reproduce(self._get_stage_target(stage))\n self.assertEqual(len(stages), 1)\n\n\nclass TestReproLockedUnchanged(TestRepro):\n def test(self):\n \"\"\"\n Check that locking/unlocking doesn't affect stage state\n \"\"\"\n target = self._get_stage_target(self.stage)\n self.dvc.lock_stage(target)\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 0)\n\n self.dvc.lock_stage(target, unlock=True)\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMetricsAddUnchanged_TestReproMetricsAddUnchanged.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMetricsAddUnchanged_TestReproMetricsAddUnchanged.test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 570, "end_line": 597, "span_ids": ["TestReproMetricsAddUnchanged.test", "TestReproMetricsAddUnchanged"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproMetricsAddUnchanged(TestDvc):\n def test(self):\n \"\"\"\n Check that adding/removing metrics doesn't affect stage state\n \"\"\"\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n file1 = \"file1\"\n file1_stage = file1 + \".dvc\"\n self.dvc.run(\n fname=file1_stage,\n outs_no_cache=[file1],\n deps=[self.FOO, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, file1),\n )\n\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n self.dvc.metrics.add(file1)\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n self.dvc.metrics.remove(file1)\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPhony_TestReproDataSource.test.self_assertEqual_stages_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPhony_TestReproDataSource.test.self_assertEqual_stages_0", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 640, "end_line": 668, "span_ids": ["TestReproDataSource.test", "TestReproDataSource", "TestReproPhony", "TestReproPhony.test", "TestNonExistingOutput", "TestNonExistingOutput.test"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproPhony(TestReproChangedData):\n def test(self):\n stage = self._run(\n cmd=\"cat \" + self.file1, deps=[self.file1], name=\"no_cmd?\"\n )\n\n self.swap_foo_with_bar()\n\n self.dvc.reproduce(self._get_stage_target(stage))\n\n self.assertTrue(filecmp.cmp(self.file1, self.BAR, shallow=False))\n\n\nclass TestNonExistingOutput(TestRepro):\n def test(self):\n os.unlink(self.FOO)\n\n with self.assertRaises(ReproductionError):\n self.dvc.reproduce(self._get_stage_target(self.stage))\n\n\nclass TestReproDataSource(TestReproChangedData):\n def test(self):\n self.swap_foo_with_bar()\n\n stages = self.dvc.reproduce(self.foo_stage.path)\n\n self.assertTrue(filecmp.cmp(self.FOO, self.BAR, shallow=False))\n self.assertEqual(stages[0].outs[0].checksum, file_md5(self.BAR)[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDirData_TestReproChangedDirData.test.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDirData_TestReproChangedDirData.test.None_9", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 704, "end_line": 745, "span_ids": ["TestReproChangedDirData.test", "TestReproChangedDirData"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproChangedDirData(SingleStageRun, TestDvc):\n def test(self):\n dir_name = \"dir\"\n dir_code = \"dir_code.py\"\n\n with open(dir_code, \"w+\") as fd:\n fd.write(\n \"import os; import sys; import shutil; \"\n \"shutil.copytree(sys.argv[1], sys.argv[2])\"\n )\n\n stage = self._run(\n outs=[dir_name],\n deps=[self.DATA_DIR, dir_code],\n cmd=\"python {} {} {}\".format(dir_code, self.DATA_DIR, dir_name),\n name=\"copy-dir\",\n )\n target = self._get_stage_target(stage)\n\n self.assertTrue(stage is not None)\n\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 0)\n\n with open(self.DATA_SUB, \"a\") as fd:\n fd.write(\"add\")\n\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n # Check that dvc indeed registers changed output dir\n shutil.move(self.BAR, dir_name)\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n # Check that dvc registers mtime change for the directory.\n System.hardlink(self.DATA_SUB, self.DATA_SUB + \".lnk\")\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMissingMd5InStageFile_TestCmdRepro.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMissingMd5InStageFile_TestCmdRepro.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 748, "end_line": 770, "span_ids": ["TestReproMissingMd5InStageFile.test", "TestCmdRepro.test", "TestReproMissingMd5InStageFile", "TestCmdRepro"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproMissingMd5InStageFile(TestRepro):\n def test(self):\n d = load_stage_file(self.file1_stage)\n del d[Stage.PARAM_OUTS][0][RemoteLOCAL.PARAM_CHECKSUM]\n del d[Stage.PARAM_DEPS][0][RemoteLOCAL.PARAM_CHECKSUM]\n dump_stage_file(self.file1_stage, d)\n\n stages = self.dvc.reproduce(self.file1_stage)\n self.assertEqual(len(stages), 1)\n\n\nclass TestCmdRepro(TestReproChangedData):\n def test(self):\n self.swap_foo_with_bar()\n\n ret = main([\"status\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", self._get_stage_target(self.stage)])\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", \"non-existing-file\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestCmdReproChdir_TestCmdReproChdir.test.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestCmdReproChdir_TestCmdReproChdir.test.None_11", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 766, "end_line": 801, "span_ids": ["TestCmdReproChdir.test", "TestCmdReproChdir"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdReproChdir(TestDvc):\n def test(self):\n dname = \"dir\"\n os.mkdir(dname)\n foo = os.path.join(dname, self.FOO)\n bar = os.path.join(dname, self.BAR)\n code = os.path.join(dname, self.CODE)\n shutil.copyfile(self.FOO, foo)\n shutil.copyfile(self.CODE, code)\n\n ret = main(\n [\n \"run\",\n \"-f\",\n \"{}/Dvcfile\".format(dname),\n \"-w\",\n \"{}\".format(dname),\n \"-d\",\n self.FOO,\n \"-o\",\n self.BAR,\n \"python {} {} {}\".format(self.CODE, self.FOO, self.BAR),\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(foo))\n self.assertTrue(os.path.isfile(bar))\n self.assertTrue(filecmp.cmp(foo, bar, shallow=False))\n\n os.unlink(bar)\n\n ret = main([\"repro\", \"-c\", dname])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(foo))\n self.assertTrue(os.path.isfile(bar))\n self.assertTrue(filecmp.cmp(foo, bar, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 964, "end_line": 997, "span_ids": ["TestReproExternalS3.write", "TestReproExternalS3", "TestReproExternalS3.cmd", "TestReproExternalGS.write", "TestReproExternalS3.bucket", "TestReproExternalGS.cmd", "TestReproExternalGS.scheme", "TestReproExternalGS.bucket", "TestReproExternalGS", "TestReproExternalS3.scheme"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(os.name == \"nt\", reason=\"temporarily disabled on windows\")\nclass TestReproExternalS3(S3, TestReproExternalBase):\n @property\n def scheme(self):\n return \"s3\"\n\n @property\n def bucket(self):\n return TEST_AWS_REPO_BUCKET\n\n def cmd(self, i, o):\n return \"aws s3 cp {} {}\".format(i, o)\n\n def write(self, bucket, key, body):\n s3 = boto3.client(\"s3\")\n s3.put_object(Bucket=bucket, Key=key, Body=body)\n\n\nclass TestReproExternalGS(GCP, TestReproExternalBase):\n @property\n def scheme(self):\n return \"gs\"\n\n @property\n def bucket(self):\n return TEST_GCP_REPO_BUCKET\n\n def cmd(self, i, o):\n return \"gsutil cp {} {}\".format(i, o)\n\n def write(self, bucket, key, body):\n client = gc.Client()\n bucket = client.bucket(bucket)\n bucket.blob(key).upload_from_string(body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1000, "end_line": 1053, "span_ids": ["TestReproExternalHDFS.scheme", "TestReproExternalHDFS.bucket", "TestReproExternalHDFS.cmd", "TestReproExternalHDFS.write", "TestReproExternalHDFS"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproExternalHDFS(HDFS, TestReproExternalBase):\n @property\n def scheme(self):\n return \"hdfs\"\n\n @property\n def bucket(self):\n return \"{}@127.0.0.1\".format(getpass.getuser())\n\n def cmd(self, i, o):\n return \"hadoop fs -cp {} {}\".format(i, o)\n\n def write(self, bucket, key, body):\n url = self.scheme + \"://\" + bucket + \"/\" + key\n p = Popen(\n \"hadoop fs -rm -f {}\".format(url),\n shell=True,\n executable=os.getenv(\"SHELL\"),\n stdin=PIPE,\n stdout=PIPE,\n stderr=PIPE,\n )\n p.communicate()\n\n p = Popen(\n \"hadoop fs -mkdir -p {}\".format(posixpath.dirname(url)),\n shell=True,\n executable=os.getenv(\"SHELL\"),\n stdin=PIPE,\n stdout=PIPE,\n stderr=PIPE,\n )\n out, err = p.communicate()\n if p.returncode != 0:\n print(out)\n print(err)\n self.assertEqual(p.returncode, 0)\n\n with open(\"tmp\", \"w+\") as fd:\n fd.write(body)\n\n p = Popen(\n \"hadoop fs -copyFromLocal {} {}\".format(\"tmp\", url),\n shell=True,\n executable=os.getenv(\"SHELL\"),\n stdin=PIPE,\n stdout=PIPE,\n stderr=PIPE,\n )\n out, err = p.communicate()\n if p.returncode != 0:\n print(out)\n print(err)\n self.assertEqual(p.returncode, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1056, "end_line": 1076, "span_ids": ["TestReproExternalSSH.cmd", "TestReproExternalSSH.bucket", "TestReproExternalSSH.scheme", "TestReproExternalSSH"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@flaky(max_runs=3, min_passes=1)\nclass TestReproExternalSSH(SSH, TestReproExternalBase):\n _dir = None\n cache_type = \"copy\"\n\n @property\n def scheme(self):\n return \"ssh\"\n\n @property\n def bucket(self):\n if not self._dir:\n self._dir = self.mkdtemp()\n return \"{}@127.0.0.1:{}\".format(getpass.getuser(), self._dir)\n\n def cmd(self, i, o):\n prefix = \"ssh://\"\n assert i.startswith(prefix) and o.startswith(prefix)\n i = i[len(prefix) :]\n o = o[len(prefix) :]\n return \"scp {} {}\".format(i, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1078, "end_line": 1099, "span_ids": ["TestReproExternalSSH.write"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@flaky(max_runs=3, min_passes=1)\nclass TestReproExternalSSH(SSH, TestReproExternalBase):\n\n def write(self, bucket, key, body):\n path = posixpath.join(self._dir, key)\n\n ssh = paramiko.SSHClient()\n ssh.load_system_host_keys()\n ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n ssh.connect(\"127.0.0.1\")\n\n sftp = ssh.open_sftp()\n try:\n sftp.stat(path)\n sftp.remove(path)\n except IOError:\n pass\n\n stdin, stdout, stderr = ssh.exec_command(\n \"mkdir -p $(dirname {})\".format(path)\n )\n self.assertEqual(stdout.channel.recv_exit_status(), 0)\n\n with sftp.open(path, \"w+\") as fobj:\n fobj.write(body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1102, "end_line": 1145, "span_ids": ["TestReproExternalLOCAL.bucket", "TestReproExternalLOCAL.write", "TestReproExternalLOCAL.scheme_sep", "TestReproExternalLOCAL.setUp", "TestReproExternalLOCAL.cache_scheme", "TestReproExternalLOCAL", "TestReproExternalLOCAL.cmd", "TestReproExternalLOCAL.scheme", "TestReproExternalLOCAL.sep"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproExternalLOCAL(Local, TestReproExternalBase):\n cache_type = \"hardlink\"\n\n def setUp(self):\n super().setUp()\n self.tmpdir = self.mkdtemp()\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n self.dvc = DvcRepo(\".\")\n\n @property\n def cache_scheme(self):\n return \"local\"\n\n @property\n def scheme(self):\n return \"\"\n\n @property\n def scheme_sep(self):\n return \"\"\n\n @property\n def sep(self):\n return os.sep\n\n @property\n def bucket(self):\n return self.tmpdir\n\n def cmd(self, i, o):\n if os.name == \"nt\":\n return \"copy {} {}\".format(i, o)\n return \"cp {} {}\".format(i, o)\n\n def write(self, bucket, key, body):\n path = os.path.join(bucket, key)\n dname = os.path.dirname(path)\n\n if not os.path.exists(dname):\n os.makedirs(dname)\n\n with open(path, \"w+\") as fd:\n fd.write(body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached.test_force_import_TestReproAlreadyCached.test_force_import.with_patch_download_as_mo.with_patch_checkout_as_mo.self_assertEqual_mock_che": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached.test_force_import_TestReproAlreadyCached.test_force_import.with_patch_download_as_mo.with_patch_checkout_as_mo.self_assertEqual_mock_che", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1312, "end_line": 1336, "span_ids": ["TestReproAlreadyCached.test_force_import"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproAlreadyCached(TestRepro):\n\n def test_force_import(self):\n ret = main([\"import-url\", self.FOO, self.BAR])\n self.assertEqual(ret, 0)\n\n patch_download = patch.object(\n RemoteLOCAL,\n \"download\",\n side_effect=RemoteLOCAL.download,\n autospec=True,\n )\n\n patch_checkout = patch.object(\n OutputBase,\n \"checkout\",\n side_effect=OutputBase.checkout,\n autospec=True,\n )\n\n with patch_download as mock_download:\n with patch_checkout as mock_checkout:\n assert main([\"unlock\", \"bar.dvc\"]) == 0\n ret = main([\"repro\", \"--force\", \"bar.dvc\"])\n self.assertEqual(ret, 0)\n self.assertEqual(mock_download.call_count, 1)\n self.assertEqual(mock_checkout.call_count, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_TestShouldDisplayMetricsOnReproWithMetricsOption.test.self_assertIn_expected_me": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_TestShouldDisplayMetricsOnReproWithMetricsOption.test.self_assertIn_expected_me", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1354, "end_line": 1378, "span_ids": ["TestShouldDisplayMetricsOnReproWithMetricsOption", "TestShouldDisplayMetricsOnReproWithMetricsOption.test"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldDisplayMetricsOnReproWithMetricsOption(TestDvc):\n def test(self):\n metrics_file = \"metrics_file\"\n metrics_value = 0.123489015\n ret = main(\n [\n \"run\",\n \"-m\",\n metrics_file,\n \"echo {} >> {}\".format(metrics_value, metrics_file),\n ]\n )\n self.assertEqual(0, ret)\n\n self._caplog.clear()\n\n from dvc.dvcfile import DVC_FILE_SUFFIX\n\n ret = main(\n [\"repro\", \"--force\", \"--metrics\", metrics_file + DVC_FILE_SUFFIX]\n )\n self.assertEqual(0, ret)\n\n expected_metrics_display = \"{}: {}\".format(metrics_file, metrics_value)\n self.assertIn(expected_metrics_display, self._caplog.text)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_dvc_formatting_retained_test_dvc_formatting_retained.assert__hide_md5_stage_te": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_dvc_formatting_retained_test_dvc_formatting_retained.assert__hide_md5_stage_te", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1550, "end_line": 1565, "span_ids": ["test_dvc_formatting_retained"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_dvc_formatting_retained(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo content\")\n stage = run_copy(\"foo\", \"foo_copy\", fname=\"foo_copy.dvc\")\n stage_path = tmp_dir / stage.relpath\n\n # Add comments and custom formatting to DVC-file\n lines = list(map(_format_dvc_line, stage_path.read_text().splitlines()))\n lines.insert(0, \"# Starting comment\")\n stage_text = \"\".join(line + \"\\n\" for line in lines)\n stage_path.write_text(stage_text)\n\n # Rewrite data source and repro\n (tmp_dir / \"foo\").write_text(\"new foo\")\n dvc.reproduce(\"foo_copy.dvc\", force=True)\n\n assert _hide_md5(stage_text) == _hide_md5(stage_path.read_text())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py__upload_multipart_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py__upload_multipart_", "embedding": null, "metadata": {"file_path": "tests/func/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 87, "span_ids": ["_upload_multipart", "test_copy_multipart_preserve_etag"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _upload_multipart(s3, Bucket, Key):\n mpu = s3.create_multipart_upload(Bucket=Bucket, Key=Key)\n mpu_id = mpu[\"UploadId\"]\n\n parts = []\n n_parts = 10\n for i in range(1, n_parts + 1):\n # NOTE: Generation parts of variable size. Part size should be at\n # least 5MB:\n # https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html\n part_size = REDUCED_PART_SIZE + i\n body = b\"1\" * part_size\n part = s3.upload_part(\n Bucket=Bucket,\n Key=Key,\n PartNumber=i,\n UploadId=mpu_id,\n Body=body,\n ContentLength=len(body),\n )\n parts.append({\"PartNumber\": i, \"ETag\": part[\"ETag\"]})\n\n s3.complete_multipart_upload(\n Bucket=Bucket,\n Key=Key,\n UploadId=mpu_id,\n MultipartUpload={\"Parts\": parts},\n )\n\n\n@mock_s3\n@reduced_min_part_size\ndef test_copy_multipart_preserve_etag():\n from_info, to_info = _get_src_dst()\n\n s3 = boto3.client(\"s3\")\n s3.create_bucket(Bucket=from_info.bucket)\n _upload_multipart(s3, from_info.bucket, from_info.path)\n RemoteS3._copy(s3, from_info, to_info, {})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGit_TestSCMGit.test_is_tracked.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGit_TestSCMGit.test_is_tracked.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 60, "span_ids": ["TestSCMGit.test_commit", "TestSCMGit", "TestSCMGit.test_is_tracked"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSCMGit(TestGit):\n def test_commit(self):\n G = Git(self._root_dir)\n G.add([\"foo\"])\n G.commit(\"add\")\n self.assertIn(\"foo\", self.git.git.ls_files())\n\n def test_is_tracked(self):\n foo = os.path.abspath(self.FOO)\n G = Git(self._root_dir)\n G.add([self.FOO, self.UNICODE])\n self.assertTrue(G.is_tracked(foo))\n self.assertTrue(G.is_tracked(self.FOO))\n self.assertTrue(G.is_tracked(self.UNICODE))\n G.commit(\"add\")\n self.assertTrue(G.is_tracked(foo))\n self.assertTrue(G.is_tracked(self.FOO))\n G.repo.index.remove([self.FOO], working_tree=True)\n self.assertFalse(G.is_tracked(foo))\n self.assertFalse(G.is_tracked(self.FOO))\n self.assertFalse(G.is_tracked(\"not-existing-file\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestReload_TestReload.test.self_assertEqual_d_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestReload_TestReload.test.self_assertEqual_d_stage_", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 91, "span_ids": ["TestReload.test", "TestReload"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReload(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n\n d = load_stage_file(stage.relpath)\n\n # NOTE: checking that reloaded stage didn't change its checksum\n md5 = \"11111111111111111111111111111111\"\n d[stage.PARAM_MD5] = md5\n dump_stage_file(stage.relpath, d)\n\n dvcfile = Dvcfile(self.dvc, stage.relpath)\n stage = dvcfile.stage\n\n self.assertTrue(stage is not None)\n dvcfile.dump(stage)\n\n d = load_stage_file(stage.relpath)\n self.assertEqual(d[stage.PARAM_MD5], md5)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution_TestExternalRemoteResolution.test_remote_output.assert_os_path_exists_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution_TestExternalRemoteResolution.test_remote_output.assert_os_path_exists_fil", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 143, "span_ids": ["TestExternalRemoteResolution.test_remote_output", "TestExternalRemoteResolution"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestExternalRemoteResolution(TestDvc):\n def test_remote_output(self):\n tmp_path = tempfile.mkdtemp()\n storage = os.path.join(tmp_path, \"storage\")\n file_path = os.path.join(storage, \"file\")\n\n os.makedirs(storage)\n\n assert main([\"remote\", \"add\", \"tmp\", tmp_path]) == 0\n assert main([\"remote\", \"add\", \"storage\", \"remote://tmp/storage\"]) == 0\n assert (\n main(\n [\n \"run\",\n \"-O\",\n \"remote://storage/file\",\n \"echo file > {path}\".format(path=file_path),\n ]\n )\n == 0\n )\n\n assert os.path.exists(file_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution.test_remote_dependency_TestExternalRemoteResolution.test_remote_dependency.assert_os_path_exists_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution.test_remote_dependency_TestExternalRemoteResolution.test_remote_dependency.assert_os_path_exists_mo", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 145, "end_line": 159, "span_ids": ["TestExternalRemoteResolution.test_remote_dependency"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestExternalRemoteResolution(TestDvc):\n\n def test_remote_dependency(self):\n tmp_path = tempfile.mkdtemp()\n storage = os.path.join(tmp_path, \"storage\")\n file_path = os.path.join(storage, \"file\")\n\n os.makedirs(storage)\n\n with open(file_path, \"w\") as fobj:\n fobj.write(\"Isle of Dogs\")\n\n assert main([\"remote\", \"add\", \"tmp\", tmp_path]) == 0\n assert main([\"remote\", \"add\", \"storage\", \"remote://tmp/storage\"]) == 0\n assert main([\"import-url\", \"remote://storage/file\", \"movie.txt\"]) == 0\n\n assert os.path.exists(\"movie.txt\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_system.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_system.py__", "embedding": null, "metadata": {"file_path": "tests/func/test_system.py", "file_name": "test_system.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 18, "span_ids": ["imports", "test_getdirinfo"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport pytest\n\nfrom dvc.system import System\n\n\n@pytest.mark.skipif(os.name != \"nt\", reason=\"Windows specific\")\ndef test_getdirinfo(tmp_path):\n # simulate someone holding an exclusive access\n locked = str(tmp_path / \"locked\")\n fd = os.open(locked, os.O_WRONLY | os.O_CREAT | os.O_EXCL)\n try:\n # should not raise WinError\n System._getdirinfo(locked)\n finally:\n os.close(fd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAddNoChecksumInfo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAddNoChecksumInfo_", "embedding": null, "metadata": {"file_path": "tests/func/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 119, "span_ids": ["TestTagAddNoChecksumInfo.test", "TestTagRemoveNoTag", "TestTagAddNoChecksumInfo", "TestTagRemoveNoTag.test"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestTagAddNoChecksumInfo(TestDvc):\n def test(self):\n ret = main([\"run\", \"-o\", self.FOO, \"--no-exec\"])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n ret = main([\"tag\", \"add\", \"v1\", \"foo.dvc\"])\n self.assertEqual(ret, 0)\n\n assert \"missing checksum info for 'foo'\" in self._caplog.text\n\n\nclass TestTagRemoveNoTag(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n ret = main([\"tag\", \"remove\", \"v1\", \"foo.dvc\"])\n self.assertEqual(ret, 0)\n\n assert \"tag 'v1' not found for 'foo'\" in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["TestWorkingTree.test_isdir", "TestWorkingTree.test_open", "TestWorkingTree", "TestWorkingTree.test_exists", "TestWorkingTree.setUp", "docstring", "TestWorkingTree.test_isfile"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# encoding: utf-8\n\nfrom os.path import join\n\nfrom dvc.ignore import CleanTree\nfrom dvc.scm import SCM\nfrom dvc.scm.git import GitTree\nfrom dvc.scm.tree import WorkingTree\nfrom tests.basic_env import TestDir\nfrom tests.basic_env import TestGit\nfrom tests.basic_env import TestGitSubmodule\n\n\nclass TestWorkingTree(TestDir):\n def setUp(self):\n super().setUp()\n self.tree = WorkingTree()\n\n def test_open(self):\n with self.tree.open(self.FOO) as fd:\n self.assertEqual(fd.read(), self.FOO_CONTENTS)\n with self.tree.open(self.UNICODE) as fd:\n self.assertEqual(fd.read(), self.UNICODE_CONTENTS)\n\n def test_exists(self):\n self.assertTrue(self.tree.exists(self.FOO))\n self.assertTrue(self.tree.exists(self.UNICODE))\n self.assertFalse(self.tree.exists(\"not-existing-file\"))\n\n def test_isdir(self):\n self.assertTrue(self.tree.isdir(self.DATA_DIR))\n self.assertFalse(self.tree.isdir(self.FOO))\n self.assertFalse(self.tree.isdir(\"not-existing-file\"))\n\n def test_isfile(self):\n self.assertTrue(self.tree.isfile(self.FOO))\n self.assertFalse(self.tree.isfile(self.DATA_DIR))\n self.assertFalse(self.tree.isfile(\"not-existing-file\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit_TestWalkInGit.test_nobranch.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit_TestWalkInGit.test_nobranch.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 136, "end_line": 150, "span_ids": ["TestWalkInGit.test_nobranch", "TestWalkInGit"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestWalkInGit(AssertWalkEqualMixin, TestGit):\n def test_nobranch(self):\n tree = CleanTree(WorkingTree(self._root_dir))\n self.assertWalkEqual(\n tree.walk(\".\"),\n [\n (\".\", [\"data_dir\"], [\"bar\", \"\u0442\u0435\u0441\u0442\", \"code.py\", \"foo\"]),\n (join(\"data_dir\"), [\"data_sub_dir\"], [\"data\"]),\n (join(\"data_dir\", \"data_sub_dir\"), [], [\"data_sub\"]),\n ],\n )\n self.assertWalkEqual(\n tree.walk(join(\"data_dir\", \"data_sub_dir\")),\n [(join(\"data_dir\", \"data_sub_dir\"), [], [\"data_sub\"])],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit.test_branch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit.test_branch_", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 189, "span_ids": ["TestWalkInGit.test_branch"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestWalkInGit(AssertWalkEqualMixin, TestGit):\n\n def test_branch(self):\n scm = SCM(self._root_dir)\n scm.add([self.DATA_SUB_DIR])\n scm.commit(\"add data_dir/data_sub_dir/data_sub\")\n tree = GitTree(self.git, \"master\")\n self.assertWalkEqual(\n tree.walk(\".\"),\n [\n (self._root_dir, [\"data_dir\"], [\"code.py\"]),\n (join(self._root_dir, \"data_dir\"), [\"data_sub_dir\"], []),\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n ),\n ],\n )\n self.assertWalkEqual(\n tree.walk(join(\"data_dir\", \"data_sub_dir\")),\n [\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n )\n ],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_unprotect.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_unprotect.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_unprotect.py", "file_name": "test_unprotect.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["imports", "TestUnprotect", "TestUnprotect.test"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.main import main\nfrom tests.basic_env import TestDvc\n\n\nclass TestUnprotect(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n cache = os.path.join(\n \".dvc\", \"cache\", \"ac\", \"bd18db4cc2f85cedef654fccc4a4d8\"\n )\n\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertFalse(os.access(cache, os.W_OK))\n\n ret = main([\"unprotect\", self.FOO])\n self.assertEqual(ret, 0)\n\n self.assertTrue(os.access(self.FOO, os.W_OK))\n\n if os.name == \"nt\":\n # NOTE: cache is now unprotected, because NTFS doesn't allow\n # deleting read-only files, so we have to try to set write perms\n # on files that we try to delete, which propagates to the cache\n # file. But it should be restored after the next cache check, hence\n # why we call `dvc status` here.\n self.assertTrue(os.access(cache, os.W_OK))\n ret = main([\"status\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.access(cache, os.W_OK))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_match_ignore_from_file_test_match_ignore_from_file.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_match_ignore_from_file_test_match_ignore_from_file.assert_", "embedding": null, "metadata": {"file_path": "tests/unit/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 92, "span_ids": ["test_match_ignore_from_file"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"file_to_ignore_relpath, patterns, expected_match\",\n [\n (\"to_ignore\", [\"to_ignore\"], True),\n (\"to_ignore.txt\", [\"to_ignore*\"], True),\n (\n os.path.join(\"rel\", \"p\", \"p2\", \"to_ignore\"),\n [\"rel/**/to_ignore\"],\n True,\n ),\n (\n os.path.join(\n os.path.sep,\n \"full\",\n \"path\",\n \"to\",\n \"ignore\",\n \"file\",\n \"to_ignore\",\n ),\n [\"to_ignore\"],\n True,\n ),\n (\"to_ignore.txt\", [\"/*.txt\"], True),\n (\n os.path.join(\"rel\", \"path\", \"path2\", \"to_ignore\"),\n [\"rel/*/to_ignore\"],\n False,\n ),\n (os.path.join(\"path\", \"to_ignore.txt\"), [\"/*.txt\"], False),\n (\n os.path.join(\"rel\", \"path\", \"path2\", \"dont_ignore\"),\n [\"rel/**/to_ignore\"],\n False,\n ),\n (\"dont_ignore.txt\", [\"dont_ignore\"], False),\n (\"dont_ignore.txt\", [\"dont*\", \"!dont_ignore.txt\"], False),\n (\"../../../something.txt\", [\"**/something.txt\"], False),\n ],\n)\ndef test_match_ignore_from_file(\n file_to_ignore_relpath, patterns, expected_match\n):\n\n dvcignore_path = os.path.join(\n os.path.sep, \"full\", \"path\", \"to\", \"ignore\", \"file\", \".dvcignore\"\n )\n dvcignore_dirname = os.path.dirname(dvcignore_path)\n\n ignore_file = mock_dvcignore(dvcignore_path, patterns)\n\n assert (\n ignore_file.matches(dvcignore_dirname, file_to_ignore_relpath)\n == expected_match\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_should_ignore_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_should_ignore_dir_", "embedding": null, "metadata": {"file_path": "tests/unit/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 95, "end_line": 106, "span_ids": ["test_should_ignore_dir"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"omit_dir\", [\".git\", \".hg\", \".dvc\"])\ndef test_should_ignore_dir(omit_dir):\n ignore = DvcIgnoreDirs([\".git\", \".hg\", \".dvc\"])\n\n root = os.path.join(os.path.sep, \"walk\", \"dir\", \"root\")\n dirs = [omit_dir, \"dir1\", \"dir2\"]\n files = []\n\n new_dirs, _ = ignore(root, dirs, files)\n\n assert set(new_dirs) == {\"dir1\", \"dir2\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exception_under_verbose_TestColorFormatter.test_exception_under_verbose.with_caplog_at_level_logg.assert_expected_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exception_under_verbose_TestColorFormatter.test_exception_under_verbose.with_caplog_at_level_logg.assert_expected_format", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 99, "end_line": 120, "span_ids": ["TestColorFormatter.test_exception_under_verbose"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestColorFormatter:\n\n def test_exception_under_verbose(self, caplog, dt):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n try:\n raise Exception(\"description\")\n except Exception:\n stack_trace = traceback.format_exc()\n logger.exception(\"\")\n\n expected = (\n \"{green}{datetime}{nc} \"\n \"{red}ERROR{nc}: description\\n\"\n \"{red}{line}{nc}\\n\"\n \"{stack_trace}\"\n \"{red}{line}{nc}\".format(\n line=\"-\" * 60,\n stack_trace=stack_trace,\n **colors,\n datetime=dt,\n )\n )\n\n assert expected == formatter.format(caplog.records[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_collections.py_from_dvc_utils_collection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_collections.py_from_dvc_utils_collection_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_collections.py", "file_name": "test_collections.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 50, "span_ids": ["imports", "test_apply_diff_seq", "MyDict", "test_apply_diff_mapping", "test_apply_diff_is_inplace", "MyInt"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.utils.collections import apply_diff\n\n\nclass MyDict(dict):\n pass\n\n\nclass MyInt(int):\n pass\n\n\ndef test_apply_diff_is_inplace():\n dest = MyDict()\n dest.attr = 42\n apply_diff({}, dest)\n\n assert type(dest) is MyDict, \"Preserves class\"\n assert dest.attr == 42, \"Preserves custom attrs\"\n\n\ndef test_apply_diff_mapping():\n src = {\"a\": 1}\n dest = {\"b\": 2}\n apply_diff(src, dest)\n assert dest == src, \"Adds and removes keys\"\n\n src = {\"a\": 1}\n dest = {\"a\": MyInt(1)}\n apply_diff(src, dest)\n assert type(dest[\"a\"]) is MyInt, \"Does not replace equals\"\n\n src = {\"d\": {\"a\": 1}}\n inner = {}\n dest = {\"d\": inner}\n apply_diff(src, dest)\n assert dest[\"d\"] is inner, \"Updates inner dicts\"\n\n\ndef test_apply_diff_seq():\n src = [1]\n dest = [MyInt(1)]\n apply_diff(src, dest)\n assert type(dest[0]) is MyInt, \"Does not replace equals\"\n\n src = {\"l\": [1]}\n inner = []\n dest = {\"l\": inner}\n apply_diff(src, dest)\n assert dest[\"l\"] is inner, \"Updates inner lists\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py_os_", "embedding": null, "metadata": {"file_path": "tests/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["get_gitignore_content", "imports", "to_posixpath", "trees_equal", "cd"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom contextlib import contextmanager\nfrom filecmp import dircmp\n\nfrom dvc.scm import Git\n\n\ndef get_gitignore_content():\n with open(Git.GITIGNORE, \"r\") as gitignore:\n return gitignore.read().splitlines()\n\n\n@contextmanager\ndef cd(newdir):\n prevdir = os.getcwd()\n os.chdir(os.path.expanduser(newdir))\n try:\n yield\n finally:\n os.chdir(prevdir)\n\n\ndef trees_equal(dir_path_1, dir_path_2):\n\n comparison = dircmp(dir_path_1, dir_path_2)\n\n assert set(comparison.left_only) == set(comparison.right_only) == set()\n\n for d in comparison.common_dirs:\n trees_equal(os.path.join(dir_path_1, d), os.path.join(dir_path_2, d))\n\n\ndef to_posixpath(path):\n return path.replace(\"\\\\\", \"/\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/https.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/https.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/https.py", "file_name": "https.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "DependencyHTTPS"], "tokens": 30}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .http import DependencyHTTP\nfrom dvc.remote.https import RemoteHTTPS\n\n\nclass DependencyHTTPS(DependencyHTTP):\n REMOTE = RemoteHTTPS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_RemoteBASE.changed.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_RemoteBASE.changed.return.False", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 328, "end_line": 375, "span_ids": ["RemoteBASE.changed"], "tokens": 317}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def changed(self, path_info, checksum_info):\n \"\"\"Checks if data has changed.\n\n A file is considered changed if:\n - It doesn't exist on the working directory (was unlinked)\n - Hash value is not computed (saving a new file)\n - The hash value stored is different from the given one\n - There's no file in the cache\n\n Args:\n path_info: dict with path information.\n checksum: expected hash value for this data.\n\n Returns:\n bool: True if data has changed, False otherwise.\n \"\"\"\n\n logger.debug(\n \"checking if '%s'('%s') has changed.\", path_info, checksum_info\n )\n\n if not self.exists(path_info):\n logger.debug(\"'%s' doesn't exist.\", path_info)\n return True\n\n checksum = checksum_info.get(self.PARAM_CHECKSUM)\n if checksum is None:\n logger.debug(\"hash value for '%s' is missing.\", path_info)\n return True\n\n if self.changed_cache(checksum):\n logger.debug(\n \"cache for '%s'('%s') has changed.\", path_info, checksum\n )\n return True\n\n actual = self.get_checksum(path_info)\n if checksum != actual:\n logger.debug(\n \"hash value '%s' for '%s' has changed (actual '%s').\",\n checksum,\n actual,\n path_info,\n )\n return True\n\n logger.debug(\"'%s' hasn't changed.\", path_info)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_cache_file_RemoteBASE.changed_cache_file.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_cache_file_RemoteBASE.changed_cache_file.return.True", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 724, "end_line": 766, "span_ids": ["RemoteBASE.changed_cache_file"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def changed_cache_file(self, checksum):\n \"\"\"Compare the given checksum with the (corresponding) actual one.\n\n - Use `State` as a cache for computed checksums\n + The entries are invalidated by taking into account the following:\n * mtime\n * inode\n * size\n * checksum\n\n - Remove the file from cache if it doesn't match the actual checksum\n \"\"\"\n\n cache_info = self.checksum_to_path_info(checksum)\n if self.is_protected(cache_info):\n logger.debug(\n \"Assuming '%s' is unchanged since it is read-only\", cache_info\n )\n return False\n\n actual = self.get_checksum(cache_info)\n\n logger.debug(\n \"cache '%s' expected '%s' actual '%s'\",\n cache_info,\n checksum,\n actual,\n )\n\n if not checksum or not actual:\n return True\n\n if actual.split(\".\")[0] == checksum.split(\".\")[0]:\n # making cache file read-only so we don't need to check it\n # next time\n self.protect(cache_info)\n return False\n\n if self.exists(cache_info):\n logger.warning(\"corrupted cache file '%s'.\", cache_info)\n self.remove(cache_info)\n\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.already_cached_RemoteBASE.safe_remove.self_remove_path_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.already_cached_RemoteBASE.safe_remove.self_remove_path_info_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 565, "end_line": 586, "span_ids": ["RemoteBASE.already_cached", "RemoteBASE.safe_remove"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def already_cached(self, path_info):\n current = self.get_checksum(path_info)\n\n if not current:\n return False\n\n return not self.changed_cache(current)\n\n def safe_remove(self, path_info, force=False):\n if not self.exists(path_info):\n return\n\n if not force and not self.already_cached(path_info):\n msg = (\n \"file '{}' is going to be removed.\"\n \" Are you sure you want to proceed?\".format(str(path_info))\n )\n\n if not prompt.confirm(msg):\n raise ConfirmRemoveError(str(path_info))\n\n self.remove(path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/https.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/https.py__", "embedding": null, "metadata": {"file_path": "dvc/remote/https.py", "file_name": "https.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "RemoteHTTPS"], "tokens": 30}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from .http import RemoteHTTP\nfrom dvc.scheme import Schemes\n\n\nclass RemoteHTTPS(RemoteHTTP):\n scheme = Schemes.HTTPS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scheme.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scheme.py__", "embedding": null, "metadata": {"file_path": "dvc/scheme.py", "file_name": "scheme.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 12, "span_ids": ["Schemes"], "tokens": 72}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Schemes:\n SSH = \"ssh\"\n HDFS = \"hdfs\"\n S3 = \"s3\"\n AZURE = \"azure\"\n HTTP = \"http\"\n HTTPS = \"https\"\n GS = \"gs\"\n GDRIVE = \"gdrive\"\n LOCAL = \"local\"\n OSS = \"oss\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State_State._from_sqlite.return.num": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State_State._from_sqlite.return.num", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 161, "span_ids": ["State.files", "State._execute", "State.__exit__", "State.__enter__", "State._fetchall", "State", "State._to_sqlite", "State.__init__", "State._from_sqlite"], "tokens": 721}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object): # pylint: disable=too-many-instance-attributes\n \"\"\"Class for the state database.\n\n Args:\n repo (dvc.repo.Repo): repo instance that this state belongs to.\n config (configobj.ConfigObj): config for the state.\n\n Raises:\n StateVersionTooNewError: thrown when dvc version is older than the\n state database version.\n \"\"\"\n\n VERSION = 3\n STATE_FILE = \"state\"\n STATE_TABLE = \"state\"\n STATE_TABLE_LAYOUT = (\n \"inode INTEGER PRIMARY KEY, \"\n \"mtime TEXT NOT NULL, \"\n \"size TEXT NOT NULL, \"\n \"md5 TEXT NOT NULL, \"\n \"timestamp TEXT NOT NULL\"\n )\n\n STATE_INFO_TABLE = \"state_info\"\n STATE_INFO_TABLE_LAYOUT = \"count INTEGER\"\n STATE_INFO_ROW = 1\n\n LINK_STATE_TABLE = \"link_state\"\n LINK_STATE_TABLE_LAYOUT = (\n \"path TEXT PRIMARY KEY, \"\n \"inode INTEGER NOT NULL, \"\n \"mtime TEXT NOT NULL\"\n )\n\n STATE_ROW_LIMIT = 100000000\n STATE_ROW_CLEANUP_QUOTA = 50\n\n MAX_INT = 2 ** 63 - 1\n MAX_UINT = 2 ** 64 - 2\n\n def __init__(self, repo):\n self.repo = repo\n self.dvc_dir = repo.dvc_dir\n self.root_dir = repo.root_dir\n\n state_config = repo.config.get(\"state\", {})\n self.row_limit = state_config.get(\"row_limit\", self.STATE_ROW_LIMIT)\n self.row_cleanup_quota = state_config.get(\n \"row_cleanup_quota\", self.STATE_ROW_CLEANUP_QUOTA\n )\n\n if not self.dvc_dir:\n self.state_file = None\n return\n\n self.state_file = os.path.join(self.dvc_dir, self.STATE_FILE)\n\n # https://www.sqlite.org/tempfiles.html\n self.temp_files = [\n self.state_file + \"-journal\",\n self.state_file + \"-wal\",\n ]\n\n self.database = None\n self.cursor = None\n self.inserts = 0\n\n @property\n def files(self):\n return self.temp_files + [self.state_file]\n\n def __enter__(self):\n self.load()\n\n def __exit__(self, typ, value, tbck):\n self.dump()\n\n def _execute(self, cmd, parameters=()):\n logger.debug(cmd)\n return self.cursor.execute(cmd, parameters)\n\n def _fetchall(self):\n ret = self.cursor.fetchall()\n logger.debug(\"fetched: %s\", ret)\n return ret\n\n def _to_sqlite(self, num):\n assert num >= 0\n assert num < self.MAX_UINT\n # NOTE: sqlite stores unit as signed ints, so maximum uint is 2^63-1\n # see http://jakegoulding.com/blog/2011/02/06/sqlite-64-bit-integers/\n if num > self.MAX_INT:\n ret = -(num - self.MAX_INT)\n else:\n ret = num\n assert self._from_sqlite(ret) == num\n return ret\n\n def _from_sqlite(self, num):\n assert abs(num) <= self.MAX_INT\n if num < 0:\n return abs(num) + self.MAX_INT\n assert num < self.MAX_UINT\n assert num >= 0\n return num", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__encoding_utf_8_TestDirFixture.setUp.self_create_self_UNICODE_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__encoding_utf_8_TestDirFixture.setUp.self_create_self_UNICODE_", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 95, "span_ids": ["TestDirFixture.mkdtemp", "TestDirFixture.__init__", "TestDirFixture._pushd", "TestDirFixture.setUp", "TestDirFixture.create", "TestDirFixture", "TestDirFixture._popd", "docstring", "TestDirFixture.root_dir"], "tokens": 729}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# encoding: utf-8\n\nimport logging\nimport os\nimport tempfile\nimport warnings\nfrom unittest import TestCase\n\nimport pytest\nimport shortuuid\nfrom git import Repo\nfrom git.exc import GitCommandNotFound\n\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.utils.fs import remove\n\n\nlogger = logging.getLogger(\"dvc\")\n\n\nclass TestDirFixture(object):\n DATA_DIR = \"data_dir\"\n DATA_SUB_DIR = os.path.join(DATA_DIR, \"data_sub_dir\")\n DATA = os.path.join(DATA_DIR, \"data\")\n DATA_SUB = os.path.join(DATA_SUB_DIR, \"data_sub\")\n DATA_CONTENTS = DATA\n DATA_SUB_CONTENTS = DATA_SUB\n FOO = \"foo\"\n FOO_CONTENTS = FOO\n BAR = \"bar\"\n # NOTE: len(FOO_CONTENTS) must be != len(BAR_CONTENTS)\n #\n # Our state database relies on file mtime and file size to determine\n # that a file has changed. Usually, mtime is enough by itself but on\n # some filesystems like APFS on macOS mtime resolution is so bad,\n # that our tests can overwrite a file in that time window without dvc\n # being able to detect that, thus causing tests to fail. Usually,\n # in tests, we replace foo with bar, so we need to make sure that when we\n # modify a file in our tests, its content length changes.\n BAR_CONTENTS = BAR + \"r\"\n CODE = \"code.py\"\n CODE_CONTENTS = (\n \"import sys\\nimport shutil\\n\"\n \"shutil.copyfile(sys.argv[1], sys.argv[2])\"\n )\n UNICODE = \"\u0442\u0435\u0441\u0442\"\n UNICODE_CONTENTS = \"\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\"\n\n def __init__(self):\n root_dir = self.mkdtemp()\n self._root_dir = os.path.realpath(root_dir)\n\n @property\n def root_dir(self):\n return self._root_dir\n\n def _pushd(self, d):\n if not hasattr(self, \"_saved_dir\"):\n self._saved_dir = os.path.realpath(os.curdir)\n os.chdir(d)\n\n def _popd(self):\n os.chdir(self._saved_dir)\n self._saved_dir = None\n\n def create(self, name, contents):\n dname = os.path.dirname(name)\n if len(dname) > 0 and not os.path.isdir(dname):\n os.makedirs(dname)\n\n with open(name, \"a\", encoding=\"utf-8\") as f:\n f.write(\n contents\n if isinstance(contents, str)\n else contents.decode(\"utf-8\")\n )\n\n @staticmethod\n def mkdtemp(base_directory=None):\n prefix = \"dvc-test.{}.\".format(os.getpid())\n suffix = \".{}\".format(shortuuid.uuid())\n return tempfile.mkdtemp(\n prefix=prefix, suffix=suffix, dir=base_directory\n )\n\n def setUp(self):\n self._pushd(self._root_dir)\n self.create(self.FOO, self.FOO_CONTENTS)\n self.create(self.BAR, self.BAR_CONTENTS)\n self.create(self.CODE, self.CODE_CONTENTS)\n os.mkdir(self.DATA_DIR)\n os.mkdir(self.DATA_SUB_DIR)\n self.create(self.DATA, self.DATA_CONTENTS)\n self.create(self.DATA_SUB, self.DATA_SUB_CONTENTS)\n self.create(self.UNICODE, self.UNICODE_CONTENTS)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDirFixture.tearDown_TestDirFixture.tearDown.try_.except_OSError_as_exc_.if_os_name_nt_and_ex.else_.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDirFixture.tearDown_TestDirFixture.tearDown.try_.except_OSError_as_exc_.if_os_name_nt_and_ex.else_.raise", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 116, "span_ids": ["TestDirFixture.tearDown"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDirFixture(object):\n\n def tearDown(self):\n self._popd()\n try:\n remove(self._root_dir)\n except OSError as exc:\n # We ignore this under Windows with a warning because it happened\n # to be really hard to trace all not properly closed files.\n #\n # Best guess so far is that gitpython is the culprit:\n # it opens files and uses __del__ to close them, which can happen\n # late in current pythons. TestGitFixture and TestDvcFixture try\n # to close that and it works on most of the tests, but not all.\n # Repos and thus git repos are created all over the dvc ;)\n if os.name == \"nt\" and exc.winerror == 32:\n warnings.warn(\"Failed to remove test dir: \" + str(exc))\n else:\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCmdDirectoryRecursive_TestAddCmdDirectoryRecursive.test_warn_about_large_directories.with_self__caplog_at_leve.assert_warning_in_self__c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCmdDirectoryRecursive_TestAddCmdDirectoryRecursive.test_warn_about_large_directories.with_self__caplog_at_leve.assert_warning_in_self__c", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 82, "end_line": 109, "span_ids": ["TestAddCmdDirectoryRecursive", "TestAddCmdDirectoryRecursive.test_warn_about_large_directories", "TestAddCmdDirectoryRecursive.test"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddCmdDirectoryRecursive(TestDvc):\n def test(self):\n ret = main([\"add\", \"--recursive\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n def test_warn_about_large_directories(self):\n warning = (\n \"You are adding a large directory 'large-dir' recursively,\"\n \" consider tracking it as a whole instead.\\n\"\n \"{purple}HINT:{nc} Remove the generated DVC-file and then\"\n \" run `{cyan}dvc add large-dir{nc}`\".format(\n purple=colorama.Fore.MAGENTA,\n cyan=colorama.Fore.CYAN,\n nc=colorama.Style.RESET_ALL,\n )\n )\n\n os.mkdir(\"large-dir\")\n\n # Create a lot of files\n for iteration in range(LARGE_DIR_SIZE + 1):\n path = os.path.join(\"large-dir\", str(iteration))\n with open(path, \"w\") as fobj:\n fobj.write(path)\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n assert main([\"add\", \"--recursive\", \"large-dir\"]) == 0\n assert warning in self._caplog.messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.self__test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.self__test_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 308, "end_line": 394, "span_ids": ["TestDataCloudCLIBase.get_url", "TestDataCloudCLIBase.test", "TestDataCloudCLIBase._setup_cloud", "TestDataCloudCLIBase._test", "TestDataCloudCLIBase._test_cloud", "TestDataCloudCLIBase", "TestDataCloudCLIBase.should_test", "TestDataCloudCLIBase.main"], "tokens": 555}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDataCloudCLIBase(TestDvc):\n def main(self, args):\n ret = main(args)\n self.assertEqual(ret, 0)\n\n @staticmethod\n def should_test():\n return False\n\n @staticmethod\n def get_url():\n raise NotImplementedError\n\n def _setup_cloud(self):\n pass\n\n def _test_cloud(self, remote=None):\n self._setup_cloud()\n\n args = [\"-v\", \"-j\", \"2\"]\n if remote:\n args += [\"-r\", remote]\n else:\n args += []\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n cache = stage.outs[0].cache_path\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage_dir = stages[0]\n self.assertTrue(stage_dir is not None)\n cache_dir = stage_dir.outs[0].cache_path\n\n # FIXME check status output\n\n self.main([\"push\"] + args)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n self.assertTrue(os.path.isfile(cache_dir))\n\n remove(self.dvc.cache.local.cache_dir)\n\n self.main([\"fetch\"] + args)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n self.assertTrue(os.path.isfile(cache_dir))\n\n self.main([\"pull\"] + args)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n self.assertTrue(os.path.isfile(cache_dir))\n self.assertTrue(os.path.isfile(self.FOO))\n self.assertTrue(os.path.isdir(self.DATA_DIR))\n\n with open(cache, \"r\") as fd:\n self.assertEqual(fd.read(), self.FOO_CONTENTS)\n self.assertTrue(os.path.isfile(cache_dir))\n\n # NOTE: check if remote gc works correctly on directories\n self.main([\"gc\", \"-cw\", \"-f\"] + args)\n shutil.move(\n self.dvc.cache.local.cache_dir,\n self.dvc.cache.local.cache_dir + \".back\",\n )\n\n self.main([\"fetch\"] + args)\n\n self.main([\"pull\", \"-f\"] + args)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n self.assertTrue(os.path.isfile(cache_dir))\n self.assertTrue(os.path.isfile(self.FOO))\n self.assertTrue(os.path.isdir(self.DATA_DIR))\n\n def _test(self):\n pass\n\n def test(self):\n if not self.should_test():\n raise SkipTest(\n \"Test {} is disabled\".format(self.__class__.__name__)\n )\n self._test()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__format_dvc_line__hide_md5.return.re_sub_r_b_a_f0_9_32_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__format_dvc_line__hide_md5.return.re_sub_r_b_a_f0_9_32_b", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1580, "end_line": 1593, "span_ids": ["_format_dvc_line", "_hide_md5"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _format_dvc_line(line):\n # Add line comment for all cache and md5 keys\n if \"cache:\" in line or \"md5:\" in line:\n return line + \" # line comment\"\n # Format command as one word per line\n elif line.startswith(\"cmd: \"):\n pre, command = line.split(None, 1)\n return pre + \" >\\n\" + \"\\n\".join(\" \" + s for s in command.split())\n else:\n return line\n\n\ndef _hide_md5(text):\n return re.sub(r\"\\b[a-f0-9]{32}\\b\", \"\", text)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_parent_config_parser_parent_config_parser_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_parent_config_parser_parent_config_parser_set_", "embedding": null, "metadata": {"file_path": "dvc/command/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 74, "span_ids": ["impl:3"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "parent_config_parser = argparse.ArgumentParser(add_help=False)\nparent_config_parser.add_argument(\n \"--global\",\n dest=\"level\",\n action=\"store_const\",\n const=\"global\",\n help=\"Use global config.\",\n)\nparent_config_parser.add_argument(\n \"--system\",\n dest=\"level\",\n action=\"store_const\",\n const=\"system\",\n help=\"Use system config.\",\n)\nparent_config_parser.add_argument(\n \"--local\",\n dest=\"level\",\n action=\"store_const\",\n const=\"local\",\n help=\"Use local config.\",\n)\nparent_config_parser.set_defaults(level=\"repo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 79, "span_ids": ["add_parser"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n CONFIG_HELP = \"Get or set config options.\"\n\n config_parser = subparsers.add_parser(\n \"config\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(CONFIG_HELP, \"config\"),\n help=CONFIG_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n config_parser.add_argument(\n \"-u\",\n \"--unset\",\n default=False,\n action=\"store_true\",\n help=\"Unset option.\",\n )\n config_parser.add_argument(\"name\", help=\"Option name.\")\n config_parser.add_argument(\"value\", nargs=\"?\", help=\"Option value.\")\n config_parser.set_defaults(func=CmdConfig)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 8, "span_ids": ["DependencyHTTP", "imports"], "tokens": 44}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.base import DependencyBase\nfrom dvc.output.base import OutputBase\nfrom dvc.remote.http import RemoteHTTP\n\n\nclass DependencyHTTP(DependencyBase, OutputBase):\n REMOTE = RemoteHTTP", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.changed_cache.return.self_cache_changed_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.changed_cache.return.self_cache_changed_cache_", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 177, "span_ids": ["OutputBase.changed_checksum", "OutputBase.use_scm_ignore", "OutputBase.checksum", "OutputBase.scheme", "OutputBase.dir_cache", "OutputBase", "OutputBase.changed_cache", "OutputBase.__init__", "OutputBase.exists", "OutputBase._parse_path", "OutputBase.cache_path", "OutputBase.checksum_11", "OutputBase.__str__", "OutputBase.is_dir_checksum", "OutputBase.is_in_repo", "OutputBase.save_info", "OutputBase.supported", "OutputBase.__repr__", "OutputBase.cache"], "tokens": 851}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n IS_DEPENDENCY = False\n\n REMOTE = RemoteBASE\n\n PARAM_PATH = \"path\"\n PARAM_CACHE = \"cache\"\n PARAM_METRIC = \"metric\"\n PARAM_METRIC_TYPE = \"type\"\n PARAM_METRIC_XPATH = \"xpath\"\n PARAM_PERSIST = \"persist\"\n\n METRIC_SCHEMA = Any(\n None,\n bool,\n {\n PARAM_METRIC_TYPE: Any(str, None),\n PARAM_METRIC_XPATH: Any(str, None),\n },\n )\n\n PARAM_TAGS = \"tags\"\n\n DoesNotExistError = OutputDoesNotExistError\n IsNotFileOrDirError = OutputIsNotFileOrDirError\n IsStageFileError = OutputIsStageFileError\n\n sep = \"/\"\n\n def __init__(\n self,\n stage,\n path,\n info=None,\n remote=None,\n cache=True,\n metric=False,\n persist=False,\n tags=None,\n ):\n self._validate_output_path(path)\n # This output (and dependency) objects have too many paths/urls\n # here is a list and comments:\n #\n # .def_path - path from definition in stage file\n # .path_info - PathInfo/URLInfo structured resolved path\n # .fspath - local only, resolved\n # .__str__ - for presentation purposes, def_path/relpath\n #\n # By resolved path, which contains actual location,\n # should be absolute and don't contain remote:// refs.\n self.stage = stage\n self.repo = stage.repo if stage else None\n self.def_path = path\n self.info = info\n self.remote = remote or self.REMOTE(self.repo, {})\n self.use_cache = False if self.IS_DEPENDENCY else cache\n self.metric = False if self.IS_DEPENDENCY else metric\n self.persist = persist\n self.tags = None if self.IS_DEPENDENCY else (tags or {})\n\n self.path_info = self._parse_path(remote, path)\n if self.use_cache and self.cache is None:\n raise RemoteCacheRequiredError(self.path_info)\n\n def _parse_path(self, remote, path):\n if remote:\n parsed = urlparse(path)\n return remote.path_info / parsed.path.lstrip(\"/\")\n return self.REMOTE.path_cls(path)\n\n def __repr__(self):\n return \"{class_name}: '{def_path}'\".format(\n class_name=type(self).__name__, def_path=self.def_path\n )\n\n def __str__(self):\n return self.def_path\n\n @property\n def scheme(self):\n return self.REMOTE.scheme\n\n @property\n def is_in_repo(self):\n return False\n\n @property\n def use_scm_ignore(self):\n if not self.is_in_repo:\n return False\n\n return self.use_cache or self.stage.is_repo_import\n\n @property\n def cache(self):\n return getattr(self.repo.cache, self.scheme)\n\n @property\n def dir_cache(self):\n return self.cache.get_dir_cache(self.checksum)\n\n @classmethod\n def supported(cls, url):\n return cls.REMOTE.supported(url)\n\n @property\n def cache_path(self):\n return self.cache.checksum_to_path_info(self.checksum).url\n\n @property\n def checksum(self):\n return self.info.get(self.remote.PARAM_CHECKSUM)\n\n @checksum.setter\n def checksum(self, checksum):\n self.info[self.remote.PARAM_CHECKSUM] = checksum\n\n @property\n def is_dir_checksum(self):\n return self.remote.is_dir_checksum(self.checksum)\n\n @property\n def exists(self):\n return self.remote.exists(self.path_info)\n\n def save_info(self):\n return self.remote.save_info(self.path_info)\n\n def changed_checksum(self):\n return self.checksum != self.remote.get_checksum(self.path_info)\n\n def changed_cache(self, filter_info=None):\n if not self.use_cache or not self.checksum:\n return True\n\n return self.cache.changed_cache(self.checksum, filter_info=filter_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.status_OutputBase.isfile.return.self_remote_isfile_self_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.status_OutputBase.isfile.return.self_remote_isfile_self_p", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 200, "span_ids": ["OutputBase.isdir", "OutputBase.is_empty", "OutputBase.status", "OutputBase.isfile", "OutputBase.changed"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def status(self):\n if self.checksum and self.use_cache and self.changed_cache():\n return {str(self): \"not in cache\"}\n\n if not self.exists:\n return {str(self): \"deleted\"}\n\n if self.changed_checksum():\n return {str(self): \"modified\"}\n\n if not self.checksum:\n return {str(self): \"new\"}\n\n return {}\n\n def changed(self):\n status = self.status()\n logger.debug(str(status))\n return bool(status)\n\n @property\n def is_empty(self):\n return self.remote.is_empty(self.path_info)\n\n def isdir(self):\n return self.remote.isdir(self.path_info)\n\n def isfile(self):\n return self.remote.isfile(self.path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py__", "embedding": null, "metadata": {"file_path": "dvc/output/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "OutputHDFS"], "tokens": 34}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.base import OutputBase\nfrom dvc.remote.hdfs import RemoteHDFS\n\n\nclass OutputHDFS(OutputBase):\n REMOTE = RemoteHDFS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.__str___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.__str___", "embedding": null, "metadata": {"file_path": "dvc/output/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 90, "span_ids": ["OutputLOCAL.is_in_repo", "OutputLOCAL.dumpd", "OutputLOCAL.fspath", "OutputLOCAL.verify_metric", "OutputLOCAL.__str__"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputLOCAL(OutputBase):\n\n def __str__(self):\n if not self.is_in_repo:\n return str(self.def_path)\n\n cur_dir = os.getcwd()\n if path_isin(cur_dir, self.repo.root_dir):\n return relpath(self.path_info, cur_dir)\n\n return relpath(self.path_info, self.repo.root_dir)\n\n @property\n def fspath(self):\n return self.path_info.fspath\n\n @property\n def is_in_repo(self):\n def_scheme = urlparse(self.def_path).scheme\n return def_scheme != \"remote\" and not os.path.isabs(self.def_path)\n\n def dumpd(self):\n ret = super().dumpd()\n if self.is_in_repo:\n path = self.path_info.relpath(self.stage.wdir).as_posix()\n else:\n path = self.def_path\n\n ret[self.PARAM_PATH] = path\n\n return ret\n\n def verify_metric(self):\n if not self.metric:\n return\n\n path = fspath_py35(self.path_info)\n if not os.path.exists(path):\n return\n\n if os.path.isdir(path):\n msg = \"directory '{}' cannot be used as metrics.\"\n raise DvcException(msg.format(self.path_info))\n\n if not istextfile(path):\n msg = \"binary file '{}' cannot be used as metrics.\"\n raise DvcException(msg.format(self.path_info))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py__", "embedding": null, "metadata": {"file_path": "dvc/output/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "OutputS3"], "tokens": 34}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.base import OutputBase\nfrom dvc.remote.s3 import RemoteS3\n\n\nclass OutputS3(OutputBase):\n REMOTE = RemoteS3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py__", "embedding": null, "metadata": {"file_path": "dvc/output/ssh.py", "file_name": "ssh.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports", "OutputSSH"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.base import OutputBase\nfrom dvc.remote.ssh import RemoteSSH\n\n\nclass OutputSSH(OutputBase):\n REMOTE = RemoteSSH", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._changed_dir_cache_RemoteBASE.changed_cache.return.self_changed_cache_file_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._changed_dir_cache_RemoteBASE.changed_cache.return.self_changed_cache_file_c", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 768, "end_line": 798, "span_ids": ["RemoteBASE.changed_cache", "RemoteBASE._changed_dir_cache"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _changed_dir_cache(self, checksum, path_info=None, filter_info=None):\n if self.changed_cache_file(checksum):\n return True\n\n if not (path_info and filter_info) and not self._changed_unpacked_dir(\n checksum\n ):\n return False\n\n for entry in self.get_dir_cache(checksum):\n entry_checksum = entry[self.PARAM_CHECKSUM]\n\n if path_info and filter_info:\n entry_info = path_info / entry[self.PARAM_RELPATH]\n if not entry_info.isin_or_eq(filter_info):\n continue\n\n if self.changed_cache_file(entry_checksum):\n return True\n\n if not (path_info and filter_info):\n self._update_unpacked_dir(checksum)\n\n return False\n\n def changed_cache(self, checksum, path_info=None, filter_info=None):\n if self.is_dir_checksum(checksum):\n return self._changed_dir_cache(\n checksum, path_info=path_info, filter_info=filter_info\n )\n return self.changed_cache_file(checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1253, "end_line": 1308, "span_ids": ["RemoteBASE.get_files_number", "RemoteBASE.unprotect", "RemoteBASE._update_unpacked_dir", "RemoteBASE._get_unpacked_dir_names", "RemoteBASE._checkout", "RemoteBASE._changed_unpacked_dir", "RemoteBASE._remove_unpacked_dir", "RemoteBASE.extract_used_local_checksums"], "tokens": 317}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _checkout(\n self,\n path_info,\n checksum,\n force=False,\n progress_callback=None,\n relink=False,\n filter_info=None,\n ):\n if not self.is_dir_checksum(checksum):\n return self._checkout_file(\n path_info, checksum, force, progress_callback, relink\n )\n\n return self._checkout_dir(\n path_info, checksum, force, progress_callback, relink, filter_info\n )\n\n def get_files_number(self, path_info, checksum, filter_info):\n from funcy.py3 import ilen\n\n if not checksum:\n return 0\n\n if not self.is_dir_checksum(checksum):\n return 1\n\n if not filter_info:\n return len(self.get_dir_cache(checksum))\n\n return ilen(\n filter_info.isin_or_eq(path_info / entry[self.PARAM_CHECKSUM])\n for entry in self.get_dir_cache(checksum)\n )\n\n @staticmethod\n def unprotect(path_info):\n pass\n\n def _get_unpacked_dir_names(self, checksums):\n return set()\n\n def extract_used_local_checksums(self, named_cache):\n used = set(named_cache.scheme_keys(\"local\"))\n unpacked = self._get_unpacked_dir_names(used)\n return used | unpacked\n\n def _changed_unpacked_dir(self, checksum):\n return True\n\n def _update_unpacked_dir(self, checksum):\n pass\n\n def _remove_unpacked_dir(self, checksum):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._ignored_Git.ignore.self_ignored_paths_append": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._ignored_Git.ignore.self_ignored_paths_append", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 157, "span_ids": ["Git._ignored", "Git.ignore"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def _ignored(self, path):\n from git.exc import GitCommandError\n\n try:\n self.repo.git.check_ignore(path)\n return True\n except GitCommandError:\n return False\n\n def ignore(self, path):\n entry, gitignore = self._get_gitignore(path)\n\n if self._ignored(path):\n return\n\n msg = \"Adding '{}' to '{}'.\".format(relpath(path), relpath(gitignore))\n logger.debug(msg)\n\n self._add_entry_to_gitignore(entry, gitignore)\n\n self.track_file(relpath(gitignore))\n\n self.ignored_paths.append(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._add_entry_to_gitignore_Git._add_entry_to_gitignore.with_open_gitignore_a_.fobj_write_n_forma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._add_entry_to_gitignore_Git._add_entry_to_gitignore.with_open_gitignore_a_.fobj_write_n_forma", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 171, "span_ids": ["Git._add_entry_to_gitignore"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def _add_entry_to_gitignore(self, entry, gitignore):\n entry = GitWildMatchPattern.escape(entry)\n\n with open(gitignore, \"a+\", encoding=\"utf-8\") as fobj:\n fobj.seek(0, os.SEEK_END)\n if fobj.tell() == 0:\n # Empty file\n prefix = \"\"\n else:\n fobj.seek(fobj.tell() - 1, os.SEEK_SET)\n last = fobj.read(1)\n prefix = \"\" if last == \"\\n\" else \"\\n\"\n fobj.write(\"{}{}\\n\".format(prefix, entry))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.ignore_remove_Git.add.try_.except_AssertionError_.logger_exception_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.ignore_remove_Git.add.try_.except_AssertionError_.logger_exception_msg_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 173, "end_line": 202, "span_ids": ["Git.ignore_remove", "Git.add"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def ignore_remove(self, path):\n entry, gitignore = self._get_gitignore(path)\n\n if not os.path.exists(gitignore):\n return\n\n with open(gitignore, \"r\") as fobj:\n lines = fobj.readlines()\n\n filtered = list(filter(lambda x: x.strip() != entry.strip(), lines))\n\n with open(gitignore, \"w\") as fobj:\n fobj.writelines(filtered)\n\n self.track_file(relpath(gitignore))\n\n def add(self, paths):\n # NOTE: GitPython is not currently able to handle index version >= 3.\n # See https://github.com/iterative/dvc/issues/610 for more details.\n try:\n self.repo.index.add(paths)\n except AssertionError:\n msg = (\n \"failed to add '{}' to git. You can add those files \"\n \"manually using `git add`. See \"\n \"https://github.com/iterative/dvc/issues/610 for more \"\n \"details.\".format(str(paths))\n )\n\n logger.exception(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_tests_requirements_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_tests_requirements_", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 178, "span_ids": ["impl:39", "impl:23"], "tokens": 601}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "tests_requirements = [\n \"wheel>=0.31.1\",\n # Test requirements:\n \"pytest>=4.6.0\",\n \"pytest-timeout>=1.3.3\",\n \"pytest-cov>=2.6.1\",\n \"pytest-xdist>=1.26.1\",\n \"pytest-mock==1.11.2\",\n \"flaky>=3.5.3\",\n \"mock>=3.0.0\",\n \"xmltodict>=0.11.0\",\n \"awscli>=1.16.297\",\n \"google-compute-engine==2.8.13\",\n \"Pygments\", # required by collective.checkdocs,\n \"collective.checkdocs\",\n \"flake8==3.7.9\",\n \"psutil\",\n \"flake8-docstrings\",\n \"pydocstyle<4.0\",\n \"jaraco.windows==3.9.2\",\n \"mock-ssh-server>=0.6.0\",\n \"moto==1.3.14.dev464\",\n \"rangehttpserver==1.2.0\",\n]\n\nif (sys.version_info) >= (3, 6):\n tests_requirements.append(\"black==19.10b0\")\n\nsetup(\n name=\"dvc\",\n version=version,\n description=\"Git for data scientists - manage your code and data together\",\n long_description=open(\"README.rst\", \"r\").read(),\n author=\"Dmitry Petrov\",\n author_email=\"dmitry@dvc.org\",\n download_url=\"https://github.com/iterative/dvc\",\n license=\"Apache License 2.0\",\n install_requires=install_requires,\n extras_require={\n \"all\": all_remotes,\n \"gs\": gs,\n \"gdrive\": gdrive,\n \"s3\": s3,\n \"azure\": azure,\n \"oss\": oss,\n \"ssh\": ssh,\n \"ssh_gssapi\": ssh_gssapi,\n \"hdfs\": hdfs,\n \"tests\": tests_requirements,\n },\n keywords=\"data-science data-version-control machine-learning git\"\n \" developer-tools reproducibility collaboration ai\",\n python_requires=\">=3.5\",\n classifiers=[\n \"Development Status :: 4 - Beta\",\n \"Programming Language :: Python :: 3\",\n \"Programming Language :: Python :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n \"Programming Language :: Python :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n ],\n packages=find_packages(exclude=[\"tests\"]),\n include_package_data=True,\n url=\"http://dvc.org\",\n entry_points={\"console_scripts\": [\"dvc = dvc.main:main\"]},\n cmdclass={\"build_py\": build_py},\n zip_safe=False,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI._do_test_TestConfigCLI._do_test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI._do_test_TestConfigCLI._do_test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 34, "end_line": 59, "span_ids": ["TestConfigCLI._do_test"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestConfigCLI(TestDvc):\n\n def _do_test(self, local=False):\n section = \"core\"\n field = \"analytics\"\n section_field = \"{}.{}\".format(section, field)\n value = \"True\"\n newvalue = \"False\"\n\n base = [\"config\"]\n if local:\n base.append(\"--local\")\n\n ret = main(base + [section_field, value])\n self.assertEqual(ret, 0)\n self.assertTrue(self._contains(section, field, value, local))\n\n ret = main(base + [section_field])\n self.assertEqual(ret, 0)\n\n ret = main(base + [section_field, newvalue])\n self.assertEqual(ret, 0)\n self.assertTrue(self._contains(section, field, newvalue, local))\n self.assertFalse(self._contains(section, field, value, local))\n\n ret = main(base + [section_field, \"--unset\"])\n self.assertEqual(ret, 0)\n self.assertFalse(self._contains(section, field, value, local))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._name_md5_forma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._name_md5_forma", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 636, "end_line": 664, "span_ids": ["TestShouldWarnOnNoChecksumInLocalAndRemoteCache", "TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldWarnOnNoChecksumInLocalAndRemoteCache(TestDvc):\n def setUp(self):\n super().setUp()\n\n cache_dir = self.mkdtemp()\n ret = main([\"add\", self.FOO])\n self.assertEqual(0, ret)\n\n ret = main([\"add\", self.BAR])\n self.assertEqual(0, ret)\n\n # purge cache\n remove(self.dvc.cache.local.cache_dir)\n\n ret = main([\"remote\", \"add\", \"remote_name\", \"-d\", cache_dir])\n self.assertEqual(0, ret)\n\n checksum_foo = file_md5(self.FOO)[0]\n checksum_bar = file_md5(self.BAR)[0]\n self.message_header = (\n \"Some of the cache files do not exist neither locally \"\n \"nor on remote. Missing cache files: \"\n )\n self.message_bar_part = \"name: {}, md5: {}\".format(\n self.BAR, checksum_bar\n )\n self.message_foo_part = \"name: {}, md5: {}\".format(\n self.FOO, checksum_foo\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_outside_of_repo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_outside_of_repo_", "embedding": null, "metadata": {"file_path": "tests/func/test_version.py", "file_name": "test_version.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 84, "span_ids": ["test_info_outside_of_repo", "test_fs_info_outside_of_repo"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_info_outside_of_repo(tmp_dir, caplog):\n assert main([\"version\"]) == 0\n\n assert re.search(r\"DVC version: \\d+\\.\\d+\\.\\d+\", caplog.text)\n assert re.search(r\"Python version: \\d\\.\\d\\.\\d\", caplog.text)\n assert re.search(r\"Platform: .*\", caplog.text)\n assert re.search(r\"Binary: (True|False)\", caplog.text)\n assert re.search(r\"Package: .*\", caplog.text)\n assert re.search(r\"Supported remotes: .*\", caplog.text)\n assert not re.search(r\"(Cache: (.*link - (not )?(,\\s)?){3})\", caplog.text)\n assert \"Repo:\" not in caplog.text\n\n\n@pytest.mark.skipif(psutil is None, reason=\"No psutil.\")\ndef test_fs_info_outside_of_repo(tmp_dir, caplog):\n assert main([\"version\"]) == 0\n\n assert \"Filesystem type (cache directory): \" not in caplog.text\n assert \"Filesystem type (workspace): \" in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_user_test_ssh_user.assert_remote_path_info_u": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_user_test_ssh_user.assert_remote_path_info_u", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 78, "end_line": 103, "span_ids": ["test_ssh_user"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"config,expected_user\",\n [\n ({\"url\": \"ssh://test1@example.com\"}, \"test1\"),\n ({\"url\": \"ssh://example.com\", \"user\": \"test2\"}, \"test2\"),\n ({\"url\": \"ssh://example.com\"}, \"ubuntu\"),\n ({\"url\": \"ssh://test1@not_in_ssh_config.com\"}, \"test1\"),\n (\n {\"url\": \"ssh://test1@not_in_ssh_config.com\", \"user\": \"test2\"},\n \"test2\",\n ),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, getpass.getuser()),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_user(mock_file, mock_exists, dvc, config, expected_user):\n remote = RemoteSSH(dvc, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.path_info.user == expected_user", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_port_test_ssh_port.assert_remote_path_info_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_port_test_ssh_port.assert_remote_path_info_p", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 106, "end_line": 128, "span_ids": ["test_ssh_port"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"config,expected_port\",\n [\n ({\"url\": \"ssh://example.com:2222\"}, 2222),\n ({\"url\": \"ssh://example.com\"}, 1234),\n ({\"url\": \"ssh://example.com\", \"port\": 4321}, 4321),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, RemoteSSH.DEFAULT_PORT),\n ({\"url\": \"ssh://not_in_ssh_config.com:2222\"}, 2222),\n ({\"url\": \"ssh://not_in_ssh_config.com:2222\", \"port\": 4321}, 4321),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_port(mock_file, mock_exists, dvc, config, expected_port):\n remote = RemoteSSH(dvc, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.path_info.port == expected_port", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_progress.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_progress.py_logging_", "embedding": null, "metadata": {"file_path": "tests/unit/test_progress.py", "file_name": "test_progress.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 51, "span_ids": ["test_quiet_notty", "imports", "test_quiet_logging", "test_quiet_logging_disable_false", "test_default"], "tokens": 364}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport sys\n\nimport mock\n\nfrom dvc.progress import Tqdm\nfrom dvc.utils import env2bool\n\n\ndef test_quiet_logging(caplog, capsys):\n with caplog.at_level(logging.CRITICAL, logger=\"dvc\"):\n for _ in Tqdm(range(10)):\n pass\n out_err = capsys.readouterr()\n assert out_err.out == \"\"\n assert out_err.err == \"\"\n\n\ndef test_quiet_logging_disable_false(caplog, capsys):\n with caplog.at_level(logging.CRITICAL, logger=\"dvc\"):\n # simulate interactive terminal\n with mock.patch.object(sys.stderr, \"isatty\", return_value=True):\n for _ in Tqdm(range(10), disable=False):\n pass\n out_err = capsys.readouterr()\n assert out_err.out == \"\"\n assert out_err.err == \"\"\n\n\ndef test_quiet_notty(caplog, capsys):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n for _ in Tqdm(range(10)):\n pass\n out_err = capsys.readouterr()\n assert out_err.out == \"\"\n if env2bool(\"DVC_IGNORE_ISATTY\"):\n assert \"0/10\" in out_err.err\n else:\n assert out_err.err == \"\"\n\n\ndef test_default(caplog, capsys):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n # simulate interactive terminal\n with mock.patch.object(sys.stderr, \"isatty\", return_value=True):\n for _ in Tqdm(range(10)):\n pass\n out_err = capsys.readouterr()\n assert out_err.out == \"\"\n assert \"0/10\" in out_err.err", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.get_used_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.get_used_cache_", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 412, "end_line": 466, "span_ids": ["OutputBase._validate_output_path", "OutputBase.get_used_cache"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def get_used_cache(self, **kwargs):\n \"\"\"Get a dumpd of the given `out`, with an entry including the branch.\n\n The `used_cache` of an output is no more than its `info`.\n\n In case that the given output is a directory, it will also\n include the `info` of its files.\n \"\"\"\n\n if not self.use_cache:\n return NamedCache()\n\n if self.stage.is_repo_import:\n cache = NamedCache()\n (dep,) = self.stage.deps\n cache.external[dep.repo_pair].add(dep.def_path)\n return cache\n\n if not self.checksum:\n msg = (\n \"Output '{}'({}) is missing version info. \"\n \"Cache for it will not be collected. \"\n \"Use `dvc repro` to get your pipeline up to date.\".format(\n self, self.stage\n )\n )\n if self.exists:\n msg += (\n \"\\n\"\n \"You can also use `dvc commit {stage}` to associate \"\n \"existing '{out}' with '{stage}'.\".format(\n out=self, stage=self.stage.relpath\n )\n )\n logger.warning(msg)\n return NamedCache()\n\n ret = NamedCache.make(self.scheme, self.checksum, str(self))\n\n if not self.is_dir_checksum:\n return ret\n\n ret.add_child_cache(\n self.checksum, self._collect_used_dir_cache(**kwargs),\n )\n\n return ret\n\n @classmethod\n def _validate_output_path(cls, path):\n from dvc.dvcfile import Dvcfile\n\n if Dvcfile.is_valid_filename(path):\n raise cls.IsStageFileError(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.remove_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.remove_", "embedding": null, "metadata": {"file_path": "dvc/remote/oss.py", "file_name": "oss.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 135, "span_ids": ["RemoteOSS._list_paths", "RemoteOSS.list_cache_paths", "RemoteOSS.remove", "RemoteOSS._download", "RemoteOSS._upload", "RemoteOSS.exists", "RemoteOSS._generate_download_url"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteOSS(RemoteBASE):\n\n def remove(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n logger.debug(\"Removing oss://{}\".format(path_info))\n self.oss_service.delete_object(path_info.path)\n\n def _list_paths(self, prefix, progress_callback=None):\n import oss2\n\n for blob in oss2.ObjectIterator(self.oss_service, prefix=prefix):\n if progress_callback:\n progress_callback()\n yield blob.key\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n if prefix:\n prefix = posixpath.join(\n self.path_info.path, prefix[:2], prefix[2:]\n )\n else:\n prefix = self.path_info.path\n return self._list_paths(prefix, progress_callback)\n\n def _upload(\n self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs\n ):\n with Tqdm(desc=name, disable=no_progress_bar, bytes=True) as pbar:\n self.oss_service.put_object_from_file(\n to_info.path, from_file, progress_callback=pbar.update_to\n )\n\n def _download(\n self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs\n ):\n with Tqdm(desc=name, disable=no_progress_bar, bytes=True) as pbar:\n self.oss_service.get_object_to_file(\n from_info.path, to_file, progress_callback=pbar.update_to\n )\n\n def _generate_download_url(self, path_info, expires=3600):\n assert path_info.bucket == self.path_info.bucket\n\n return self.oss_service.sign_url(\"GET\", path_info.path, expires)\n\n def exists(self, path_info):\n paths = self._list_paths(path_info.path)\n return any(path_info.path == path for path in paths)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.exists_GitTree._is_tree_and_contains.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.exists_GitTree._is_tree_and_contains.return.False", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 85, "span_ids": ["GitTree.isfile", "GitTree._is_tree_and_contains", "GitTree.exists", "GitTree.isdir"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GitTree(BaseTree):\n\n def exists(self, path):\n return self.git_object_by_path(path) is not None\n\n def isdir(self, path):\n obj = self.git_object_by_path(path)\n if obj is None:\n return False\n return obj.mode == GIT_MODE_DIR\n\n def isfile(self, path):\n obj = self.git_object_by_path(path)\n if obj is None:\n return False\n # according to git-fast-import(1) file mode could be 644 or 755\n return obj.mode & GIT_MODE_FILE == GIT_MODE_FILE\n\n @staticmethod\n def _is_tree_and_contains(obj, path):\n if obj.mode != GIT_MODE_DIR:\n return False\n # see https://github.com/gitpython-developers/GitPython/issues/851\n # `return (i in tree)` doesn't work so here is a workaround:\n for item in obj:\n if _item_basename(item) == path:\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.git_object_by_path_GitTree.git_object_by_path.return.tree": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.git_object_by_path_GitTree.git_object_by_path.return.tree", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 109, "span_ids": ["GitTree.git_object_by_path"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GitTree(BaseTree):\n\n def git_object_by_path(self, path):\n import git\n\n path = relpath(os.path.realpath(path), self.git.working_dir)\n assert path.split(os.sep, 1)[0] != \"..\"\n\n try:\n tree = self.git.tree(self.rev)\n except git.exc.BadName as exc:\n raise DvcException(\n \"revision '{}' not found in Git '{}'\".format(\n self.rev, os.path.relpath(self.git.working_dir)\n )\n ) from exc\n\n if not path or path == \".\":\n return tree\n for i in path.split(os.sep):\n if not self._is_tree_and_contains(tree, i):\n # there is no tree for specified path\n return None\n tree = tree[i]\n return tree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_dir_checksum_should_be_key_order_agnostic_test_dir_checksum_should_be_key_order_agnostic.assert_checksum1_check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_dir_checksum_should_be_key_order_agnostic_test_dir_checksum_should_be_key_order_agnostic.assert_checksum1_check", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 145, "end_line": 170, "span_ids": ["test_dir_checksum_should_be_key_order_agnostic"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_dir_checksum_should_be_key_order_agnostic(tmp_dir, dvc):\n tmp_dir.gen({\"data\": {\"1\": \"1 content\", \"2\": \"2 content\"}})\n\n path_info = PathInfo(\"data\")\n with dvc.state:\n with patch.object(\n RemoteBASE,\n \"_collect_dir\",\n return_value=[\n {\"relpath\": \"1\", \"md5\": \"1\"},\n {\"relpath\": \"2\", \"md5\": \"2\"},\n ],\n ):\n checksum1 = dvc.cache.local.get_dir_checksum(path_info)\n\n with patch.object(\n RemoteBASE,\n \"_collect_dir\",\n return_value=[\n {\"md5\": \"1\", \"relpath\": \"1\"},\n {\"md5\": \"2\", \"relpath\": \"2\"},\n ],\n ):\n checksum2 = dvc.cache.local.get_dir_checksum(path_info)\n\n assert checksum1 == checksum2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/get.py", "file_name": "get.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 88, "span_ids": ["add_parser"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n GET_HELP = \"Download file or directory tracked by DVC or by Git.\"\n get_parser = subparsers.add_parser(\n \"get\",\n parents=[parent_parser],\n description=append_doc_link(GET_HELP, \"get\"),\n help=GET_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n get_parser.add_argument(\n \"url\", help=\"Location of DVC or Git repository to download from\"\n )\n get_parser.add_argument(\n \"path\", help=\"Path to a file or directory within the repository\"\n )\n get_parser.add_argument(\n \"-o\",\n \"--out\",\n nargs=\"?\",\n help=\"Destination path to download files to\",\n metavar=\"\",\n )\n get_parser.add_argument(\n \"--rev\",\n nargs=\"?\",\n help=\"Git revision (e.g. SHA, branch, tag)\",\n metavar=\"\",\n )\n get_parser.add_argument(\n \"--show-url\",\n action=\"store_true\",\n help=\"Print the storage location (URL) the target data would be \"\n \"downloaded from, and exit.\",\n )\n get_parser.set_defaults(func=CmdGet)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/imp_url.py", "file_name": "imp_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 68, "span_ids": ["add_parser"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n IMPORT_HELP = (\n \"Download or copy file from URL and take it under DVC control.\"\n )\n\n import_parser = subparsers.add_parser(\n \"import-url\",\n parents=[parent_parser],\n description=append_doc_link(IMPORT_HELP, \"import-url\"),\n help=IMPORT_HELP,\n formatter_class=argparse.RawTextHelpFormatter,\n )\n import_parser.add_argument(\n \"url\",\n help=\"Supported urls:\\n\"\n \"/path/to/file\\n\"\n \"/path/to/directory\\n\"\n \"C:\\\\\\\\path\\\\to\\\\file\\n\"\n \"C:\\\\\\\\path\\\\to\\\\directory\\n\"\n \"https://example.com/path/to/file\\n\"\n \"s3://bucket/path/to/file\\n\"\n \"s3://bucket/path/to/directory\\n\"\n \"gs://bucket/path/to/file\\n\"\n \"gs://bucket/path/to/directory\\n\"\n \"hdfs://example.com/path/to/file\\n\"\n \"ssh://example.com:/path/to/file\\n\"\n \"ssh://example.com:/path/to/directory\\n\"\n \"remote://myremote/path/to/file (see `dvc remote`)\",\n )\n import_parser.add_argument(\n \"out\", nargs=\"?\", help=\"Destination path to put files to.\"\n )\n import_parser.add_argument(\n \"-f\",\n \"--file\",\n help=\"Specify name of the DVC-file this command will generate.\",\n metavar=\"\",\n )\n import_parser.set_defaults(func=CmdImportUrl)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.exists_RemoteHTTP.get_file_checksum.return.etag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.exists_RemoteHTTP.get_file_checksum.return.etag", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 122, "span_ids": ["RemoteHTTP.get_file_checksum", "RemoteHTTP.exists", "RemoteHTTP._content_length"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHTTP(RemoteBASE):\n\n def exists(self, path_info):\n return bool(self._request(\"HEAD\", path_info.url))\n\n def _content_length(self, response):\n res = response.headers.get(\"Content-Length\")\n return int(res) if res else None\n\n def get_file_checksum(self, path_info):\n url = path_info.url\n headers = self._request(\"HEAD\", url).headers\n etag = headers.get(\"ETag\") or headers.get(\"Content-MD5\")\n\n if not etag:\n raise DvcException(\n \"could not find an ETag or \"\n \"Content-MD5 header for '{url}'\".format(url=url)\n )\n\n if etag.startswith(\"W/\"):\n raise DvcException(\n \"Weak ETags are not supported.\"\n \" (Etag: '{etag}', URL: '{url}')\".format(etag=etag, url=url)\n )\n\n return etag", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.batch_exists_RemoteSSH.batch_exists.with_self_ssh_path_infos_.return.results": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.batch_exists_RemoteSSH.batch_exists.with_self_ssh_path_infos_.return.results", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 292, "span_ids": ["RemoteSSH.batch_exists"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteSSH(RemoteBASE):\n\n def batch_exists(self, path_infos, callback):\n def _exists(chunk_and_channel):\n chunk, channel = chunk_and_channel\n ret = []\n for path in chunk:\n try:\n channel.stat(path)\n ret.append(True)\n except IOError as exc:\n if exc.errno != errno.ENOENT:\n raise\n ret.append(False)\n callback(path)\n return ret\n\n with self.ssh(path_infos[0]) as ssh:\n channels = ssh.open_max_sftp_channels()\n max_workers = len(channels)\n\n with ThreadPoolExecutor(max_workers=max_workers) as executor:\n paths = [path_info.path for path_info in path_infos]\n chunks = to_chunks(paths, num_chunks=max_workers)\n chunks_and_channels = zip(chunks, channels)\n outcome = executor.map(_exists, chunks_and_channels)\n results = list(itertools.chain.from_iterable(outcome))\n\n return results", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection_SSHConnection.islink.return.stat_S_ISLNK_self_st_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection_SSHConnection.islink.return.stat_S_ISLNK_self_st_mode", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 84, "span_ids": ["SSHConnection.sftp", "SSHConnection.isfile", "SSHConnection", "SSHConnection.islink", "SSHConnection.getsize", "SSHConnection.exists", "SSHConnection.__init__", "SSHConnection.isdir", "SSHConnection.st_mode", "SSHConnection.close"], "tokens": 353}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n def __init__(self, host, *args, **kwargs):\n logger.debug(\n \"Establishing ssh connection with '{host}' \"\n \"through port '{port}' as user '{username}'\".format(\n host=host, **kwargs\n )\n )\n self.timeout = kwargs.get(\"timeout\", 1800)\n\n self._ssh = paramiko.SSHClient()\n self._ssh.load_system_host_keys()\n self._ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n\n self._ssh.connect(host, *args, **kwargs)\n self._ssh.get_transport().set_keepalive(10)\n self._sftp_channels = []\n\n @property\n def sftp(self):\n if not self._sftp_channels:\n self._sftp_channels = [self._ssh.open_sftp()]\n return self._sftp_channels[0]\n\n def close(self):\n for sftp in self._sftp_channels:\n sftp.close()\n self._ssh.close()\n\n def st_mode(self, path):\n with suppress(FileNotFoundError):\n return self.sftp.lstat(path).st_mode\n\n return 0\n\n def getsize(self, path):\n with suppress(FileNotFoundError):\n return self.sftp.lstat(path).st_size\n\n return 0\n\n def exists(self, path, sftp=None):\n return bool(self.st_mode(path))\n\n def isdir(self, path):\n return stat.S_ISDIR(self.st_mode(path))\n\n def isfile(self, path):\n return stat.S_ISREG(self.st_mode(path))\n\n def islink(self, path):\n return stat.S_ISLNK(self.st_mode(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get_url.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get_url.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/get_url.py", "file_name": "get_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 20, "span_ids": ["imports", "get_url"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport dvc.dependency as dependency\nimport dvc.output as output\nfrom dvc.utils import resolve_output\n\n\n@staticmethod\ndef get_url(url, out=None):\n out = resolve_output(url, out)\n\n if os.path.exists(url):\n url = os.path.abspath(url)\n\n out = os.path.abspath(out)\n\n (dep,) = dependency.loads_from(None, [url])\n (out,) = output.loads_from(None, [out], use_cache=False)\n dep.download(out)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/imp.py", "file_name": "imp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imp"], "tokens": 58}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def imp(self, url, path, out=None, rev=None):\n erepo = {\"url\": url}\n if rev is not None:\n erepo[\"rev\"] = rev\n\n return self.imp_url(path, out=out, erepo=erepo, locked=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_link_State.save_link.self__execute_cmd_relat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_link_State.save_link.self__execute_cmd_relat", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 421, "end_line": 440, "span_ids": ["State.save_link"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def save_link(self, path_info):\n \"\"\"Adds the specified path to the list of links created by dvc. This\n list is later used on `dvc checkout` to cleanup old links.\n\n Args:\n path_info (dict): path info to add to the list of links.\n \"\"\"\n assert path_info.scheme == \"local\"\n\n if not os.path.exists(fspath_py35(path_info)):\n return\n\n mtime, _ = get_mtime_and_size(path_info, self.repo.tree)\n inode = get_inode(path_info)\n relative_path = relpath(path_info, self.root_dir)\n\n cmd = \"REPLACE INTO {}(path, inode, mtime) \" \"VALUES (?, ?, ?)\".format(\n self.LINK_STATE_TABLE\n )\n self._execute(cmd, (relative_path, self._to_sqlite(inode), mtime))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py_os_", "embedding": null, "metadata": {"file_path": "tests/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 37, "span_ids": ["imports"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\n# Increasing fd ulimit for tests\nif os.name == \"nt\":\n import win32file\n import subprocess\n\n win32file._setmaxstdio(2048)\n\n # Workaround for two bugs:\n #\n # 1) gitpython-developers/GitPython#546\n # GitPython leaves git cat-file --batch/--batch-check processes that are\n # not cleaned up correctly, so Popen._active list has their defunct\n # process handles, that it is not able to cleanup because of bug 2)\n #\n # 2) https://bugs.python.org/issue37380\n # subprocess.Popen._internal_poll on windows is getting\n #\n # \tOSError: [WinError 6] The handle is invalid\n #\n # exception, which it doesn't ignore and so Popen is not able to cleanup\n # old processes and that prevents it from creating any new processes at\n # all, which results in our tests failing whenever they try to use Popen.\n\n def noop():\n pass\n\n subprocess._cleanup = noop\nelse:\n import resource\n\n resource.setrlimit(resource.RLIMIT_NOFILE, (2048, 2048))\n\n nproc_soft, nproc_hard = resource.getrlimit(resource.RLIMIT_NPROC)\n resource.setrlimit(resource.RLIMIT_NPROC, (nproc_hard, nproc_hard))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 209, "span_ids": ["TestDvc", "TestGitSubmodule", "TestDvcFixture.setUp", "TestDvcGit.inject_fixtures", "TestDvcGit", "TestGit", "TestDvcGitFixture.tearDown", "TestGit.__init__", "TestDvcGitFixture", "TestDir.__init__", "TestGitSubmoduleFixture.setUp", "TestGitSubmoduleFixture", "TestDvc.inject_fixtures", "TestDvcFixture", "TestDvc.__init__", "TestDir", "TestDvcGit.__init__", "TestDvcGitFixture.setUp", "TestGitSubmodule.__init__"], "tokens": 427}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitSubmoduleFixture(TestGitFixture):\n def setUp(self):\n super().setUp()\n subrepo = Repo.init()\n subrepo_path = \"subrepo\"\n self.git.create_submodule(subrepo_path, subrepo_path, subrepo.git_dir)\n self._pushd(subrepo_path)\n\n\nclass TestDvcFixture(TestDirFixture):\n def setUp(self):\n super().setUp()\n self.dvc = DvcRepo.init(self.root_dir, no_scm=True)\n\n\nclass TestDvcGitFixture(TestGitFixture):\n def setUp(self):\n super().setUp()\n self.dvc = DvcRepo.init(self.root_dir)\n self.dvc.scm.commit(\"init dvc\")\n\n def tearDown(self):\n self.dvc.scm.close()\n super().tearDown()\n\n\n# NOTE: Inheritance order in the classes below is important.\n\n\nclass TestDir(TestDirFixture, TestCase):\n def __init__(self, methodName):\n TestDirFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n\nclass TestGit(TestGitFixture, TestCase):\n def __init__(self, methodName):\n TestGitFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n\nclass TestGitSubmodule(TestGitSubmoduleFixture, TestCase):\n def __init__(self, methodName):\n TestGitSubmoduleFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n\nclass TestDvc(TestDvcFixture, TestCase):\n def __init__(self, methodName):\n TestDvcFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n @pytest.fixture(autouse=True)\n def inject_fixtures(self, caplog):\n self._caplog = caplog\n\n\nclass TestDvcGit(TestDvcGitFixture, TestCase):\n def __init__(self, methodName):\n TestDvcGitFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n @pytest.fixture(autouse=True)\n def inject_fixtures(self, caplog):\n self._caplog = caplog", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_external_test_open_external.assert_api_read_version_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_external_test_open_external.assert_api_read_version_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 96, "span_ids": ["test_open_external"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote_url\", all_remote_params, indirect=True)\ndef test_open_external(remote_url, erepo_dir):\n _set_remote_url_and_commit(erepo_dir.dvc, remote_url)\n\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"version\", \"master\", commit=\"add version\")\n\n with erepo_dir.branch(\"branch\", new=\"True\"):\n # NOTE: need file to be other size for Mac\n erepo_dir.dvc_gen(\"version\", \"branchver\", commit=\"add version\")\n\n erepo_dir.dvc.push(all_branches=True)\n\n # Remove cache to force download\n remove(erepo_dir.dvc.cache.local.cache_dir)\n\n # Using file url to force clone to tmp repo\n repo_url = \"file://{}\".format(erepo_dir)\n with api.open(\"version\", repo=repo_url) as fd:\n assert fd.read() == \"master\"\n\n assert api.read(\"version\", repo=repo_url, rev=\"branch\") == \"branchver\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_single_ascii_TestPipelineShow.test_dot_commands.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_single_ascii_TestPipelineShow.test_dot_commands.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 58, "end_line": 99, "span_ids": ["TestPipelineShow.test_ascii_commands", "TestPipelineShow.test_commands", "TestPipelineShow", "test_single_ascii_commands", "TestPipelineShow.test_dot_commands", "test_single_ascii", "TestPipelineShow.test_dot", "TestPipelineShow.test", "TestPipelineShow.test_ascii", "TestPipelineShow.test_ascii_outs"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_single_ascii(tmp_dir, dvc):\n tmp_dir.dvc_gen(\"foo\", \"foo content\")\n assert main([\"pipeline\", \"show\", \"--ascii\", \"foo.dvc\"]) == 0\n\n\ndef test_single_ascii_commands(tmp_dir, dvc):\n tmp_dir.dvc_gen(\"foo\", \"foo content\")\n assert main([\"pipeline\", \"show\", \"--ascii\", \"foo.dvc\", \"--commands\"]) == 0\n\n\nclass TestPipelineShow(TestRepro):\n def test(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_ascii(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_ascii_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--dot\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_print_locked_stages_TestPipelineShowOuts.test_outs.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_print_locked_stages_TestPipelineShowOuts.test_outs.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 123, "end_line": 147, "span_ids": ["TestPipelineShowOuts.setUp", "TestPipelineShowOuts", "test_print_locked_stages", "test_dot_outs", "TestPipelineShowOuts.test_outs"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_print_locked_stages(tmp_dir, dvc, caplog):\n tmp_dir.dvc_gen({\"foo\": \"foo content\", \"bar\": \"bar content\"})\n dvc.lock_stage(\"foo.dvc\")\n\n caplog.clear()\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n assert main([\"pipeline\", \"show\", \"foo.dvc\", \"--locked\"]) == 0\n\n assert \"foo.dvc\" in caplog.text\n assert \"bar.dvc\" not in caplog.text\n\n\ndef test_dot_outs(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo content\")\n run_copy(\"foo\", \"file\")\n assert main([\"pipeline\", \"show\", \"--dot\", \"file.dvc\", \"--outs\"]) == 0\n\n\nclass TestPipelineShowOuts(TestRepro):\n def setUp(self):\n super().setUp()\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_dot_outs.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_dot_outs.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 133, "end_line": 172, "span_ids": ["TestPipelineShowDeep.test_dot", "TestPipelineShowDeep.test_dot_commands", "TestPipelineShowDeep.test_outs", "TestPipelineShowDeep.test_ascii_commands", "TestPipelineShowDeep.test_ascii_outs", "TestPipelineShowDeep.test_dot_outs", "TestPipelineShowDeep", "TestPipelineShowDeep.test_ascii", "TestPipelineShowDeep.test", "TestPipelineShowDeep.test_commands"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPipelineShowDeep(TestReproChangedDeepData):\n def test(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_ascii(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_ascii_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--dot\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)\n\n def test_dot_outs(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproShell_TestReproShell.test.None_2.self_assertEqual_os_geten": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproShell_TestReproShell.test.None_2.self_assertEqual_os_geten", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1222, "end_line": 1242, "span_ids": ["TestReproShell.test", "TestReproShell"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproShell(TestDvc):\n def test(self):\n if os.name == \"nt\":\n return\n\n fname = \"shell.txt\"\n stage = fname + \".dvc\"\n\n self.dvc.run(\n fname=stage, outs=[fname], cmd=\"echo $SHELL > {}\".format(fname)\n )\n\n with open(fname, \"r\") as fd:\n self.assertEqual(os.getenv(\"SHELL\"), fd.read().strip())\n\n os.unlink(fname)\n\n self.dvc.reproduce(stage)\n\n with open(fname, \"r\") as fd:\n self.assertEqual(os.getenv(\"SHELL\"), fd.read().strip())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_state_overflow_mock_get_inode.return.get_inode_mocked": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_state_overflow_mock_get_inode.return.get_inode_mocked", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 52, "span_ids": ["test_state_overflow", "mock_get_inode"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_state_overflow(tmp_dir, dvc):\n # NOTE: trying to add more entries than state can handle,\n # to see if it will clean up and vacuum successfully\n dvc.config[\"state\"][\"row_limit\"] = 10\n\n path = tmp_dir / \"dir\"\n path.mkdir()\n for i in range(20):\n (path / str(i)).write_text(str(i))\n\n dvc.add(\"dir\")\n\n\ndef mock_get_inode(inode):\n def get_inode_mocked(path):\n return inode\n\n return get_inode_mocked", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_state_record_for_inode_test_get_state_record_for_inode.with_state_.assert_ret_is_not_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_state_record_for_inode_test_get_state_record_for_inode.with_state_.assert_ret_is_not_None", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 70, "span_ids": ["test_get_state_record_for_inode"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mock.patch(\"dvc.state.get_inode\", autospec=True)\ndef test_get_state_record_for_inode(get_inode_mock, tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo content\")\n\n state = State(dvc)\n inode = state.MAX_INT + 2\n assert inode != state._to_sqlite(inode)\n\n foo = tmp_dir / \"foo\"\n md5 = file_md5(foo)[0]\n get_inode_mock.side_effect = mock_get_inode(inode)\n\n with state:\n state.save(PathInfo(foo), md5)\n ret = state.get_state_record_for_inode(inode)\n assert ret is not None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get_url.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get_url.py__", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_get_url.py", "file_name": "test_get_url.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 15, "span_ids": ["imports", "test_get_url"], "tokens": 97}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.get_url import CmdGetUrl\n\n\ndef test_get_url(mocker):\n cli_args = parse_args([\"get-url\", \"src\", \"out\"])\n assert cli_args.func == CmdGetUrl\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.Repo.get_url\")\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\"src\", out=\"out\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp.py_from_dvc_cli_import_parse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp.py_from_dvc_cli_import_parse_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_imp.py", "file_name": "test_imp.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_import"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.imp import CmdImport\n\n\ndef test_import(mocker):\n cli_args = parse_args(\n [\"import\", \"repo_url\", \"src\", \"--out\", \"out\", \"--rev\", \"version\"]\n )\n assert cli_args.func == CmdImport\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"imp\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\"repo_url\", path=\"src\", out=\"out\", rev=\"version\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_from_dvc_cli_import_parse_test_run.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_from_dvc_cli_import_parse_test_run.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 67, "span_ids": ["imports", "test_run"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.run import CmdRun\n\n\ndef test_run(mocker, dvc):\n cli_args = parse_args(\n [\n \"run\",\n \"--name\",\n \"nam\",\n \"--deps\",\n \"deps\",\n \"--outs\",\n \"outs\",\n \"--outs-no-cache\",\n \"outs-no-cache\",\n \"--metrics\",\n \"metrics\",\n \"--metrics-no-cache\",\n \"metrics-no-cache\",\n \"--file\",\n \"file\",\n \"--wdir\",\n \"wdir\",\n \"--no-exec\",\n \"--yes\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"--no-commit\",\n \"--outs-persist\",\n \"outs-persist\",\n \"--outs-persist-no-cache\",\n \"outs-persist-no-cache\",\n \"--always-changed\",\n \"--params\",\n \"file:param1,param2\",\n \"--params\",\n \"param3\",\n \"command\",\n ]\n )\n assert cli_args.func == CmdRun\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"run\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n deps=[\"deps\"],\n outs=[\"outs\"],\n outs_no_cache=[\"outs-no-cache\"],\n metrics=[\"metrics\"],\n metrics_no_cache=[\"metrics-no-cache\"],\n outs_persist=[\"outs-persist\"],\n outs_persist_no_cache=[\"outs-persist-no-cache\"],\n params=[\"file:param1,param2\", \"param3\"],\n fname=\"file\",\n wdir=\"wdir\",\n no_exec=True,\n overwrite=True,\n ignore_build_cache=True,\n no_commit=True,\n always_changed=True,\n cmd=\"command\",\n name=\"nam\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_from_cli_test_run_args_from_cli.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_from_cli_test_run_args_from_cli.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 93, "span_ids": ["test_run_args_from_cli"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_run_args_from_cli(mocker, dvc):\n args = parse_args([\"run\", \"echo\", \"foo\"])\n cmd = args.func(args)\n m = mocker.patch.object(cmd.repo, \"run\", autospec=True)\n assert cmd.run() == 0\n m.assert_called_once_with(\n deps=[],\n outs=[],\n outs_no_cache=[],\n metrics=[],\n metrics_no_cache=[],\n outs_persist=[],\n outs_persist_no_cache=[],\n params=[],\n fname=None,\n wdir=None,\n no_exec=False,\n overwrite=False,\n ignore_build_cache=False,\n no_commit=False,\n always_changed=False,\n cmd=\"echo foo\",\n name=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_with_spaces_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_with_spaces_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 96, "end_line": 120, "span_ids": ["test_run_args_with_spaces"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_run_args_with_spaces(mocker, dvc):\n args = parse_args([\"run\", \"echo\", \"foo bar\"])\n cmd = args.func(args)\n m = mocker.patch.object(cmd.repo, \"run\", autospec=True)\n assert cmd.run() == 0\n m.assert_called_once_with(\n deps=[],\n outs=[],\n outs_no_cache=[],\n metrics=[],\n metrics_no_cache=[],\n outs_persist=[],\n outs_persist_no_cache=[],\n params=[],\n fname=None,\n wdir=None,\n no_exec=False,\n overwrite=False,\n ignore_build_cache=False,\n no_commit=False,\n always_changed=False,\n cmd='echo \"foo bar\"',\n name=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_WindowsPathInfo__URLPathParents.__repr__.return._parents_format_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_WindowsPathInfo__URLPathParents.__repr__.return._parents_format_sel", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 107, "span_ids": ["_URLPathInfo:2", "_URLPathInfo.__str__", "_URLPathParents.__getitem__", "_URLPathInfo", "_URLPathParents", "_URLPathParents.__repr__", "WindowsPathInfo", "PosixPathInfo", "_URLPathParents.__len__", "_URLPathParents.__init__"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WindowsPathInfo(PathInfo, pathlib.PureWindowsPath):\n pass\n\n\nclass PosixPathInfo(PathInfo, pathlib.PurePosixPath):\n pass\n\n\nclass _URLPathInfo(PosixPathInfo):\n def __str__(self):\n return self.__fspath__()\n\n __unicode__ = __str__\n\n\nclass _URLPathParents(object):\n def __init__(self, src):\n self.src = src\n self._parents = self.src._path.parents\n\n def __len__(self):\n return len(self._parents)\n\n def __getitem__(self, idx):\n return self.src.replace(path=self._parents[idx])\n\n def __repr__(self):\n return \"<{}.parents>\".format(self.src)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/update.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/update.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 15, "span_ids": ["imports", "update"], "tokens": 64}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from . import locked\n\n\n@locked\ndef update(self, target, rev=None):\n from ..dvcfile import Dvcfile\n\n dvcfile = Dvcfile(self, target)\n stage = dvcfile.stage\n stage.update(rev)\n\n dvcfile.dump(stage)\n\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDownstream_TestReproDownstream.test.assert_evaluation_2_relp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDownstream_TestReproDownstream.test.assert_evaluation_2_relp", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1591, "end_line": 1624, "span_ids": ["TestReproDownstream.test", "TestReproDownstream"], "tokens": 372}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproDownstream(TestDvc):\n def test(self):\n # The dependency graph should look like this:\n #\n # E\n # / \\\n # D F\n # / \\ \\\n # B C G\n # \\ /\n # A\n #\n assert main([\"run\", \"-o\", \"A\", \"echo A>A\"]) == 0\n assert main([\"run\", \"-d\", \"A\", \"-o\", \"B\", \"echo B>B\"]) == 0\n assert main([\"run\", \"-d\", \"A\", \"-o\", \"C\", \"echo C>C\"]) == 0\n assert main([\"run\", \"-d\", \"B\", \"-d\", \"C\", \"-o\", \"D\", \"echo D>D\"]) == 0\n assert main([\"run\", \"-o\", \"G\", \"echo G>G\"]) == 0\n assert main([\"run\", \"-d\", \"G\", \"-o\", \"F\", \"echo F>F\"]) == 0\n assert main([\"run\", \"-d\", \"D\", \"-d\", \"F\", \"-o\", \"E\", \"echo E>E\"]) == 0\n\n # We want the evaluation to move from B to E\n #\n # E\n # /\n # D\n # /\n # B\n #\n evaluation = self.dvc.reproduce(\"B.dvc\", downstream=True, force=True)\n\n assert len(evaluation) == 3\n assert evaluation[0].relpath == \"B.dvc\"\n assert evaluation[1].relpath == \"D.dvc\"\n assert evaluation[2].relpath == \"E.dvc\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_ssh_dir_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_ssh_dir_out_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1607, "end_line": 1652, "span_ids": ["test_ssh_dir_out"], "tokens": 448}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n os.name == \"nt\",\n reason=\"external output scenario is not supported on Windows\",\n)\ndef test_ssh_dir_out(tmp_dir, dvc, ssh_server):\n tmp_dir.gen({\"foo\": \"foo content\"})\n\n # Set up remote and cache\n user = ssh_server.test_creds[\"username\"]\n port = ssh_server.port\n keyfile = ssh_server.test_creds[\"key_filename\"]\n\n remote_url = SSHMocked.get_url(user, port)\n assert main([\"remote\", \"add\", \"upstream\", remote_url]) == 0\n assert main([\"remote\", \"modify\", \"upstream\", \"keyfile\", keyfile]) == 0\n\n cache_url = SSHMocked.get_url(user, port)\n assert main([\"remote\", \"add\", \"sshcache\", cache_url]) == 0\n assert main([\"config\", \"cache.ssh\", \"sshcache\"]) == 0\n assert main([\"remote\", \"modify\", \"sshcache\", \"keyfile\", keyfile]) == 0\n\n # Recreating to reread configs\n repo = DvcRepo(dvc.root_dir)\n\n # To avoid \"WARNING: UNPROTECTED PRIVATE KEY FILE\" from ssh\n os.chmod(keyfile, 0o600)\n\n (tmp_dir / \"script.py\").write_text(\n \"import sys, pathlib\\n\"\n \"path = pathlib.Path(sys.argv[1])\\n\"\n \"dir_out = path / 'dir-out'\\n\"\n \"dir_out.mkdir()\\n\"\n \"(dir_out / '1.txt').write_text('1')\\n\"\n \"(dir_out / '2.txt').write_text('2')\\n\"\n )\n\n url_info = URLInfo(remote_url)\n repo.run(\n cmd=\"python {} {}\".format(tmp_dir / \"script.py\", url_info.path),\n outs=[\"remote://upstream/dir-out\"],\n deps=[\"foo\"], # add a fake dep to not consider this a callback\n )\n\n repo.reproduce(\"dir-out.dvc\")\n repo.reproduce(\"dir-out.dvc\", force=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_json_logger.logging_getLogger___name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_json_logger.logging_getLogger___name_", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["imports"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import json\nimport logging\nimport os\nimport platform\nimport requests\nimport sys\nimport tempfile\nimport uuid\n\nimport distro\n\nfrom dvc import __version__\nfrom dvc.config import Config, to_bool\nfrom dvc.daemon import daemon\nfrom dvc.exceptions import NotDvcRepoError\nfrom dvc.lock import Lock, LockError\nfrom dvc.repo import Repo\nfrom dvc.scm import SCM, NoSCM\nfrom dvc.scm.base import SCMError\nfrom dvc.utils import env2bool, is_binary\nfrom dvc.utils.fs import makedirs\n\n\nlogger = logging.getLogger(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_collect_and_send_report_collect_and_send_report.with_tempfile_NamedTempor.daemon_analytics_fobj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_collect_and_send_report_collect_and_send_report.with_tempfile_NamedTempor.daemon_analytics_fobj", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 27, "end_line": 50, "span_ids": ["collect_and_send_report"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def collect_and_send_report(args=None, return_code=None):\n \"\"\"\n Collect information from the runtime/environment and the command\n being executed into a report and send it over the network.\n\n To prevent analytics from blocking the execution of the main thread,\n sending the report is done in a separate process.\n\n The inter-process communication happens through a file containing the\n report as a JSON, where the _collector_ generates it and the _sender_\n removes it after sending it.\n \"\"\"\n report = {}\n\n # Include command execution information on the report only when available.\n if args and hasattr(args, \"func\"):\n report.update({\"cmd_class\": args.func.__name__})\n\n if return_code is not None:\n report.update({\"cmd_return_code\": return_code})\n\n with tempfile.NamedTemporaryFile(delete=False, mode=\"w\") as fobj:\n json.dump(report, fobj)\n daemon([\"analytics\", fobj.name])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__scm_in_use__runtime_info.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__scm_in_use__runtime_info.return._", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 105, "span_ids": ["_runtime_info", "_scm_in_use"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _scm_in_use():\n try:\n scm = SCM(root_dir=Repo.find_root())\n return type(scm).__name__\n except SCMError:\n return NoSCM.__name__\n except NotDvcRepoError:\n pass\n\n\ndef _runtime_info():\n \"\"\"\n Gather information from the environment where DVC runs to fill a report.\n \"\"\"\n return {\n \"dvc_version\": __version__,\n \"is_binary\": is_binary(),\n \"scm_class\": _scm_in_use(),\n \"system_info\": _system_info(),\n \"user_id\": _find_or_create_user_id(),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__system_info__system_info.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__system_info__system_info.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 134, "span_ids": ["_system_info"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _system_info():\n system = platform.system()\n\n if system == \"Windows\":\n version = sys.getwindowsversion()\n\n return {\n \"os\": \"windows\",\n \"windows_version_build\": version.build,\n \"windows_version_major\": version.major,\n \"windows_version_minor\": version.minor,\n \"windows_version_service_pack\": version.service_pack,\n }\n\n if system == \"Darwin\":\n return {\"os\": \"mac\", \"mac_version\": platform.mac_ver()[0]}\n\n if system == \"Linux\":\n return {\n \"os\": \"linux\",\n \"linux_distro\": distro.id(),\n \"linux_distro_like\": distro.like(),\n \"linux_distro_version\": distro.version(),\n }\n\n # We don't collect data for any other system.\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__find_or_create_user_id_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__find_or_create_user_id_", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 173, "span_ids": ["_find_or_create_user_id"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _find_or_create_user_id():\n \"\"\"\n The user's ID is stored on a file under the global config directory.\n\n The file should contain a JSON with a \"user_id\" key:\n\n {\"user_id\": \"16fd2706-8baf-433b-82eb-8c7fada847da\"}\n\n IDs are generated randomly with UUID.\n \"\"\"\n config_dir = Config.get_dir(\"global\")\n fname = os.path.join(config_dir, \"user_id\")\n lockfile = os.path.join(config_dir, \"user_id.lock\")\n\n # Since the `fname` and `lockfile` are under the global config,\n # we need to make sure such directory exist already.\n makedirs(config_dir, exist_ok=True)\n\n try:\n with Lock(lockfile):\n try:\n with open(fname, \"r\") as fobj:\n user_id = json.load(fobj)[\"user_id\"]\n\n except (FileNotFoundError, ValueError, KeyError):\n user_id = str(uuid.uuid4())\n\n with open(fname, \"w\") as fobj:\n json.dump({\"user_id\": user_id}, fobj)\n\n return user_id\n\n except LockError:\n logger.debug(\n \"Failed to acquire '{lockfile}'\".format(lockfile=lockfile)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_os_get_url.with__make_repo_repo_rev.return.str_remote_obj_checksum_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_os_get_url.with__make_repo_repo_rev.return.str_remote_obj_checksum_t", "embedding": null, "metadata": {"file_path": "dvc/api.py", "file_name": "api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["imports", "UrlNotDvcRepoError", "get_url", "UrlNotDvcRepoError.__init__"], "tokens": 284}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom contextlib import contextmanager, _GeneratorContextManager as GCM\n\nfrom dvc.repo import Repo\nfrom dvc.exceptions import DvcException, NotDvcRepoError\nfrom dvc.external_repo import external_repo\n\n\nclass UrlNotDvcRepoError(DvcException):\n \"\"\"Thrown if the given URL is not a DVC repository.\"\"\"\n\n def __init__(self, url):\n super().__init__(\"'{}' is not a DVC repository.\".format(url))\n\n\ndef get_url(path, repo=None, rev=None, remote=None):\n \"\"\"\n Returns the URL to the storage location of a data file or directory tracked\n in a DVC repo. For Git repos, HEAD is used unless a rev argument is\n supplied. The default remote is tried unless a remote argument is supplied.\n\n Raises UrlNotDvcRepoError if repo is not a DVC project.\n\n NOTE: This function does not check for the actual existence of the file or\n directory in the remote storage.\n \"\"\"\n with _make_repo(repo, rev=rev) as _repo:\n if not isinstance(_repo, Repo):\n raise UrlNotDvcRepoError(_repo.url)\n out = _repo.find_out_by_relpath(path)\n remote_obj = _repo.cloud.get_remote(remote)\n return str(remote_obj.checksum_to_path_info(out.checksum))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_open_open.return._OpenContextManager__open": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_open_open.return._OpenContextManager__open", "embedding": null, "metadata": {"file_path": "dvc/api.py", "file_name": "api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 56, "span_ids": ["open"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def open(path, repo=None, rev=None, remote=None, mode=\"r\", encoding=None):\n \"\"\"\n Open file in the supplied path tracked in a repo (both DVC projects and\n plain Git repos are supported). For Git repos, HEAD is used unless a rev\n argument is supplied. The default remote is tried unless a remote argument\n is supplied. It may only be used as a context manager:\n\n with dvc.api.open(\n 'path/to/file',\n repo='https://example.com/url/to/repo'\n ) as fd:\n # ... Handle file object fd\n \"\"\"\n args = (path,)\n kwargs = {\n \"repo\": repo,\n \"remote\": remote,\n \"rev\": rev,\n \"mode\": mode,\n \"encoding\": encoding,\n }\n return _OpenContextManager(_open, args, kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py__OpenContextManager__open.with__make_repo_repo_rev.with__repo_open_by_relpat.yield_fd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py__OpenContextManager__open.with__make_repo_repo_rev.with__repo_open_by_relpat.yield_fd", "embedding": null, "metadata": {"file_path": "dvc/api.py", "file_name": "api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 75, "span_ids": ["_OpenContextManager", "_open", "_OpenContextManager.__init__", "_OpenContextManager.__getattr__"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _OpenContextManager(GCM):\n def __init__(self, func, args, kwds):\n self.gen = func(*args, **kwds)\n self.func, self.args, self.kwds = func, args, kwds\n\n def __getattr__(self, name):\n raise AttributeError(\n \"dvc.api.open() should be used in a with statement.\"\n )\n\n\ndef _open(path, repo=None, rev=None, remote=None, mode=\"r\", encoding=None):\n with _make_repo(repo, rev=rev) as _repo:\n with _repo.open_by_relpath(\n path, remote=remote, mode=mode, encoding=encoding\n ) as fd:\n yield fd", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_read_", "embedding": null, "metadata": {"file_path": "dvc/api.py", "file_name": "api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 101, "span_ids": ["read", "_make_repo"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def read(path, repo=None, rev=None, remote=None, mode=\"r\", encoding=None):\n \"\"\"\n Returns the contents of a tracked file (by DVC or Git). For Git repos, HEAD\n is used unless a rev argument is supplied. The default remote is tried\n unless a remote argument is supplied.\n \"\"\"\n with open(\n path, repo=repo, rev=rev, remote=remote, mode=mode, encoding=encoding\n ) as fd:\n return fd.read()\n\n\n@contextmanager\ndef _make_repo(repo_url=None, rev=None):\n repo_url = repo_url or os.getcwd()\n if rev is None and os.path.exists(repo_url):\n try:\n yield Repo(repo_url)\n return\n except NotDvcRepoError:\n pass # fallthrough to external_repo\n with external_repo(url=repo_url, rev=rev) as repo:\n yield repo", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py__Manages_cache_of_a_DVC__make_remote_property.return.cached_property_getter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py__Manages_cache_of_a_DVC__make_remote_property.return.cached_property_getter_", "embedding": null, "metadata": {"file_path": "dvc/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["_make_remote_property", "docstring"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages cache of a DVC repo.\"\"\"\nfrom collections import defaultdict\n\nfrom funcy import cached_property\n\n\ndef _make_remote_property(name):\n \"\"\"\n The config file is stored in a way that allows you to have a\n cache for each remote.\n\n This is needed when specifying external outputs\n (as they require you to have an external cache location).\n\n Imagine a config file like the following:\n\n ['remote \"dvc-storage\"']\n url = ssh://localhost/tmp\n ask_password = true\n\n [cache]\n ssh = dvc-storage\n\n This method creates a cached property, containing cache named `name`:\n\n self.config == {'ssh': 'dvc-storage'}\n self.ssh # a RemoteSSH instance\n \"\"\"\n\n def getter(self):\n from dvc.remote import Remote\n\n remote = self.config.get(name)\n if not remote:\n return None\n\n return Remote(self.repo, name=remote)\n\n getter.__name__ = name\n return cached_property(getter)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache_Cache.azure._make_remote_property_az": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache_Cache.azure._make_remote_property_az", "embedding": null, "metadata": {"file_path": "dvc/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 43, "end_line": 71, "span_ids": ["Cache.__init__", "Cache", "Cache:5"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Cache(object):\n \"\"\"Class that manages cache locations of a DVC repo.\n\n Args:\n repo (dvc.repo.Repo): repo instance that this cache belongs to.\n \"\"\"\n\n CACHE_DIR = \"cache\"\n\n def __init__(self, repo):\n from dvc.remote import Remote\n\n self.repo = repo\n self.config = config = repo.config[\"cache\"]\n\n local = config.get(\"local\")\n\n if local:\n settings = {\"name\": local}\n else:\n settings = {**config, \"url\": config[\"dir\"]}\n\n self.local = Remote(repo, **settings)\n\n s3 = _make_remote_property(\"s3\")\n gs = _make_remote_property(\"gs\")\n ssh = _make_remote_property(\"ssh\")\n hdfs = _make_remote_property(\"hdfs\")\n azure = _make_remote_property(\"azure\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_NamedCache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_NamedCache_", "embedding": null, "metadata": {"file_path": "dvc/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 167, "span_ids": ["NamedCache.add_child_cache", "NamedCache.scheme_keys", "NamedCache.update", "NamedCache.child_keys", "NamedCache", "NamedCache.dir_keys", "NamedCache.__getitem__", "NamedCache.add", "NamedCache.__init__", "NamedCache.add_external", "NamedCache.make", "NamedCache.scheme_names"], "tokens": 475}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedCache(object):\n def __init__(self):\n self._items = defaultdict(lambda: defaultdict(NamedCacheItem))\n self.external = defaultdict(set)\n\n @classmethod\n def make(cls, scheme, checksum, name):\n cache = cls()\n cache.add(scheme, checksum, name)\n return cache\n\n def __getitem__(self, key):\n return self._items[key]\n\n def add(self, scheme, checksum, name):\n \"\"\"Add a mapped name for the specified checksum.\"\"\"\n self._items[scheme][checksum].names.add(name)\n\n def add_child_cache(self, checksum, cache, suffix=\"\"):\n \"\"\"Add/update child cache for the specified checksum.\"\"\"\n for scheme, src in cache._items.items():\n dst = self._items[scheme][checksum].children\n for child_checksum, item in src.items():\n dst[child_checksum].update(item, suffix=suffix)\n\n for repo_pair, files in cache.external.items():\n self.external[repo_pair].update(files)\n\n def add_external(self, url, rev, path):\n self.external[url, rev].add(path)\n\n def update(self, cache, suffix=\"\"):\n for scheme, src in cache._items.items():\n dst = self._items[scheme]\n for checksum, item in src.items():\n dst[checksum].update(item, suffix=suffix)\n\n for repo_pair, files in cache.external.items():\n self.external[repo_pair].update(files)\n\n def scheme_keys(self, scheme):\n \"\"\"Iterate over a flat list of all keys for the specified scheme,\n including children.\n \"\"\"\n for key, item in self._items[scheme].items():\n yield key\n yield from item.child_keys()\n\n def scheme_names(self, scheme):\n \"\"\"Iterate over a flat list of checksum, names items for the specified\n scheme, including children.\n \"\"\"\n for key, item in self._items[scheme].items():\n yield key, item.names\n yield from item.child_names()\n\n def dir_keys(self, scheme):\n return (\n key for key, item in self._items[scheme].items() if item.children\n )\n\n def child_keys(self, scheme, checksum):\n return self._items[scheme][checksum].child_keys()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py__DVC_command_line_inter_VersionAction.__call__.sys_exit_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py__DVC_command_line_inter_VersionAction.__call__.sys_exit_0_", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 106, "span_ids": ["VersionAction.__call__", "docstring", "DvcParser", "DvcParser.error", "VersionAction"], "tokens": 403}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"DVC command line interface\"\"\"\nimport argparse\nimport logging\nimport sys\n\nfrom .command import (\n add,\n cache,\n checkout,\n commit,\n config,\n daemon,\n data_sync,\n destroy,\n diff,\n gc,\n get,\n get_url,\n imp,\n imp_url,\n init,\n install,\n ls,\n lock,\n metrics,\n params,\n move,\n pipeline,\n remote,\n remove,\n repro,\n root,\n run,\n tag,\n unprotect,\n update,\n version,\n git_hook,\n)\nfrom .command.base import fix_subparsers\nfrom .exceptions import DvcParserError\n\n\nlogger = logging.getLogger(__name__)\n\nCOMMANDS = [\n init,\n get,\n get_url,\n destroy,\n add,\n remove,\n move,\n unprotect,\n run,\n repro,\n data_sync,\n gc,\n imp,\n imp_url,\n config,\n checkout,\n remote,\n cache,\n metrics,\n params,\n install,\n root,\n ls,\n lock,\n pipeline,\n daemon,\n commit,\n tag,\n diff,\n version,\n update,\n git_hook,\n]\n\n\nclass DvcParser(argparse.ArgumentParser):\n \"\"\"Custom parser class for dvc CLI.\"\"\"\n\n def error(self, message):\n \"\"\"Custom error method.\n Args:\n message (str): error message.\n\n Raises:\n dvc.exceptions.DvcParser: dvc parser exception.\n \"\"\"\n logger.error(message)\n self.print_help()\n raise DvcParserError()\n\n\nclass VersionAction(argparse.Action): # pragma: no cover\n # pylint: disable=too-few-public-methods\n \"\"\"Shows DVC version and exits.\"\"\"\n\n def __call__(self, parser, namespace, values, option_string=None):\n from dvc import __version__\n\n print(__version__)\n sys.exit(0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_argparse_CmdAdd.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_argparse_CmdAdd.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["imports", "CmdAdd", "CmdAdd.run"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link, CmdBase\nfrom dvc.exceptions import DvcException, RecursiveAddingWhileUsingFilename\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdAdd(CmdBase):\n def run(self):\n try:\n if len(self.args.targets) > 1 and self.args.file:\n raise RecursiveAddingWhileUsingFilename()\n\n self.repo.add(\n self.args.targets,\n recursive=self.args.recursive,\n no_commit=self.args.no_commit,\n fname=self.args.file,\n )\n\n except DvcException:\n logger.exception(\"\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_logging_append_doc_link.return._message_nDocumentation": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_logging_append_doc_link.return._message_nDocumentation", "embedding": null, "metadata": {"file_path": "dvc/command/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["imports", "fix_subparsers", "append_doc_link"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef fix_subparsers(subparsers):\n \"\"\"Workaround for bug in Python 3. See more info at:\n https://bugs.python.org/issue16308\n https://github.com/iterative/dvc/issues/769\n\n Args:\n subparsers: subparsers to fix.\n \"\"\"\n subparsers.required = True\n subparsers.dest = \"cmd\"\n\n\ndef append_doc_link(help_message, path):\n from dvc.utils import format_link\n\n if not path:\n return help_message\n doc_base = \"https://man.dvc.org/\"\n return \"{message}\\nDocumentation: {link}\".format(\n message=help_message, link=format_link(doc_base + path)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/cache.py_argparse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/cache.py_argparse_", "embedding": null, "metadata": {"file_path": "dvc/command/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 60, "span_ids": ["imports", "CmdCacheDir.run", "CmdCacheDir", "add_parser"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\n\nfrom dvc.command.base import append_doc_link, fix_subparsers\nfrom dvc.command.config import CmdConfig\n\n\nclass CmdCacheDir(CmdConfig):\n def run(self):\n with self.config.edit(level=self.args.level) as edit:\n edit[\"cache\"][\"dir\"] = self.args.value\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n from dvc.command.config import parent_config_parser\n\n CACHE_HELP = \"Manage cache settings.\"\n\n cache_parser = subparsers.add_parser(\n \"cache\",\n parents=[parent_parser],\n description=append_doc_link(CACHE_HELP, \"cache\"),\n help=CACHE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n\n cache_subparsers = cache_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use `dvc cache CMD --help` for command-specific \" \"help.\",\n )\n\n fix_subparsers(cache_subparsers)\n\n parent_cache_config_parser = argparse.ArgumentParser(\n add_help=False, parents=[parent_config_parser]\n )\n CACHE_DIR_HELP = \"Configure cache directory location.\"\n\n cache_dir_parser = cache_subparsers.add_parser(\n \"dir\",\n parents=[parent_parser, parent_cache_config_parser],\n description=append_doc_link(CACHE_HELP, \"cache/dir\"),\n help=CACHE_DIR_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n cache_dir_parser.add_argument(\n \"-u\",\n \"--unset\",\n default=False,\n action=\"store_true\",\n help=\"Unset option.\",\n )\n cache_dir_parser.add_argument(\n \"value\",\n help=\"Path to cache directory. Relative paths are resolved relative \"\n \"to the current directory and saved to config relative to the \"\n \"config file location.\",\n )\n cache_dir_parser.set_defaults(func=CmdCacheDir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_argparse_log_summary.logger_info__human_join_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_argparse_log_summary.logger_info__human_join_s", "embedding": null, "metadata": {"file_path": "dvc/command/checkout.py", "file_name": "checkout.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["imports", "log_summary", "_human_join"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nimport colorama\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import CheckoutError\n\nlogger = logging.getLogger(__name__)\n\n\ndef _human_join(words):\n words = list(words)\n if not words:\n return \"\"\n\n return (\n \"{before} and {after}\".format(\n before=\", \".join(words[:-1]), after=words[-1],\n )\n if len(words) > 1\n else words[0]\n )\n\n\ndef log_summary(stats):\n states = (\"added\", \"deleted\", \"modified\")\n summary = (\n \"{} {}\".format(len(stats[state]), state)\n for state in states\n if stats.get(state)\n )\n logger.info(_human_join(summary) or \"No changes.\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_log_changes_log_changes.for_state_color_in_color.for_entry_in_entries_.logger_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_log_changes_log_changes.for_state_color_in_color.for_entry_in_entries_.logger_info_", "embedding": null, "metadata": {"file_path": "dvc/command/checkout.py", "file_name": "checkout.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 59, "span_ids": ["log_changes"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def log_changes(stats):\n colors = [\n (\"modified\", colorama.Fore.YELLOW,),\n (\"added\", colorama.Fore.GREEN),\n (\"deleted\", colorama.Fore.RED,),\n ]\n\n for state, color in colors:\n entries = stats.get(state)\n\n if not entries:\n continue\n\n for entry in entries:\n logger.info(\n \"{color}{state}{nc}{spacing}{entry}\".format(\n color=color,\n state=state[0].upper(),\n nc=colorama.Fore.RESET,\n spacing=\"\\t\",\n entry=entry,\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_CmdCheckout_CmdCheckout.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_CmdCheckout_CmdCheckout.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/checkout.py", "file_name": "checkout.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 84, "span_ids": ["CmdCheckout", "CmdCheckout.run"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdCheckout(CmdBase):\n def run(self):\n stats, exc = None, None\n try:\n stats = self.repo.checkout(\n targets=self.args.targets,\n with_deps=self.args.with_deps,\n force=self.args.force,\n relink=self.args.relink,\n recursive=self.args.recursive,\n )\n except CheckoutError as _exc:\n exc = _exc\n stats = exc.stats\n\n if self.args.summary:\n log_summary(stats)\n else:\n log_changes(stats)\n\n if exc:\n raise exc\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/checkout.py", "file_name": "checkout.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 137, "span_ids": ["add_parser"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n CHECKOUT_HELP = \"Checkout data files from cache.\"\n\n checkout_parser = subparsers.add_parser(\n \"checkout\",\n parents=[parent_parser],\n description=append_doc_link(CHECKOUT_HELP, \"checkout\"),\n help=CHECKOUT_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n checkout_parser.add_argument(\n \"--summary\",\n action=\"store_true\",\n default=False,\n help=\"Show summary of the changes.\",\n )\n checkout_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Checkout all dependencies of the specified target.\",\n )\n checkout_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Checkout all subdirectories of the specified directory.\",\n )\n checkout_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Do not prompt when removing working directory files.\",\n )\n checkout_parser.add_argument(\n \"--relink\",\n action=\"store_true\",\n default=False,\n help=\"Recreate links or copies from cache to workspace.\",\n )\n checkout_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"DVC-files to checkout. Optional. \"\n \"(Finds all DVC-files in the workspace by default.)\",\n )\n checkout_parser.set_defaults(func=CmdCheckout)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_argparse_CmdCommit.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_argparse_CmdCommit.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/commit.py", "file_name": "commit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["imports", "CmdCommit", "CmdCommit.run"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdCommit(CmdBase):\n def run(self):\n if not self.args.targets:\n self.args.targets = [None]\n\n for target in self.args.targets:\n try:\n self.repo.commit(\n target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n force=self.args.force,\n )\n except DvcException:\n logger.exception(\n \"failed to commit{}\".format(\n (\" \" + target) if target else \"\"\n )\n )\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_argparse_CmdConfig._check.if_opt_and_opt_not_in_con.raise_ConfigError_msg_for": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_argparse_CmdConfig._check.if_opt_and_opt_not_in_con.raise_ConfigError_msg_for", "embedding": null, "metadata": {"file_path": "dvc/command/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["imports", "CmdConfig.run", "CmdConfig", "CmdConfig.__init__", "CmdConfig._check"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link, CmdBaseNoRepo\nfrom dvc.config import Config, ConfigError\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdConfig(CmdBaseNoRepo):\n def __init__(self, args):\n super().__init__(args)\n\n self.config = Config(validate=False)\n\n def run(self):\n section, opt = self.args.name.lower().strip().split(\".\", 1)\n\n if self.args.value is None and not self.args.unset:\n conf = self.config.load_one(self.args.level)\n self._check(conf, section, opt)\n logger.info(conf[section][opt])\n return 0\n\n with self.config.edit(self.args.level) as conf:\n if self.args.unset:\n self._check(conf, section, opt)\n del conf[section][opt]\n else:\n self._check(conf, section)\n conf[section][opt] = self.args.value\n\n if self.args.name == \"cache.type\":\n logger.warning(\n \"You have changed the 'cache.type' option. This doesn't update\"\n \" any existing workspace file links, but it can be done with:\"\n \"\\n dvc checkout --relink\"\n )\n\n return 0\n\n def _check(self, conf, section, opt=None):\n if section not in conf:\n msg = \"section {} doesn't exist\"\n raise ConfigError(msg.format(self.args.name))\n\n if opt and opt not in conf[section]:\n msg = \"option {} doesn't exist\"\n raise ConfigError(msg.format(self.args.name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_from_dvc_command_base_imp_CmdDaemonAnalytics.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_from_dvc_command_base_imp_CmdDaemonAnalytics.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/daemon.py", "file_name": "daemon.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["CmdDaemonAnalytics.run", "CmdDaemonBase", "imports", "CmdDaemonUpdater.run", "CmdDaemonAnalytics", "CmdDaemonUpdater"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.command.base import CmdBaseNoRepo\nfrom dvc.command.base import fix_subparsers\n\n\nclass CmdDaemonBase(CmdBaseNoRepo):\n pass\n\n\nclass CmdDaemonUpdater(CmdDaemonBase):\n def run(self):\n import os\n from dvc.repo import Repo\n from dvc.config import Config\n from dvc.updater import Updater\n\n root_dir = Repo.find_root()\n dvc_dir = os.path.join(root_dir, Repo.DVC_DIR)\n config = Config(dvc_dir, validate=False)\n hardlink_lock = config.get(\"core\", {}).get(\"hardlink_lock\", False)\n updater = Updater(dvc_dir, hardlink_lock=hardlink_lock)\n updater.fetch(detach=False)\n\n return 0\n\n\nclass CmdDaemonAnalytics(CmdDaemonBase):\n def run(self):\n from dvc import analytics\n\n analytics.send(self.args.target)\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_argparse_CmdDataPull.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_argparse_CmdDataPull.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["CmdDataBase.check_up_to_date", "CmdDataPull.run", "imports", "CmdDataPull", "CmdDataBase"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.command.checkout import log_summary\nfrom dvc.exceptions import DvcException, CheckoutError\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdDataBase(CmdBase):\n @classmethod\n def check_up_to_date(cls, processed_files_count):\n if processed_files_count == 0:\n logger.info(\"Everything is up to date.\")\n\n\nclass CmdDataPull(CmdDataBase):\n def run(self):\n try:\n stats = self.repo.pull(\n targets=self.args.targets,\n jobs=self.args.jobs,\n remote=self.args.remote,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n all_commits=self.args.all_commits,\n with_deps=self.args.with_deps,\n force=self.args.force,\n recursive=self.args.recursive,\n )\n log_summary(stats)\n except (CheckoutError, DvcException) as exc:\n log_summary(getattr(exc, \"stats\", {}))\n logger.exception(\"failed to pull data from the cloud\")\n return 1\n\n self.check_up_to_date(stats[\"downloaded\"])\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataPush_CmdDataPush.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataPush_CmdDataPush.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 61, "span_ids": ["CmdDataPush.run", "CmdDataPush"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdDataPush(CmdDataBase):\n def run(self):\n try:\n processed_files_count = self.repo.push(\n targets=self.args.targets,\n jobs=self.args.jobs,\n remote=self.args.remote,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n all_commits=self.args.all_commits,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.exception(\"failed to push data to the cloud\")\n return 1\n self.check_up_to_date(processed_files_count)\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataFetch_CmdDataFetch.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataFetch_CmdDataFetch.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 81, "span_ids": ["CmdDataFetch.run", "CmdDataFetch"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdDataFetch(CmdDataBase):\n def run(self):\n try:\n processed_files_count = self.repo.fetch(\n targets=self.args.targets,\n jobs=self.args.jobs,\n remote=self.args.remote,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n all_commits=self.args.all_commits,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.exception(\"failed to fetch data from the cloud\")\n return 1\n self.check_up_to_date(processed_files_count)\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_argparse_CmdDestroy.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_argparse_CmdDestroy.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/destroy.py", "file_name": "destroy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["imports", "CmdDestroy.run", "CmdDestroy"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nimport dvc.prompt as prompt\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdDestroy(CmdBase):\n def run(self):\n try:\n statement = (\n \"This will destroy all information about your pipelines,\"\n \" all data files, as well as cache in .dvc/cache.\"\n \"\\n\"\n \"Are you sure you want to continue?\"\n )\n\n if not self.args.force and not prompt.confirm(statement):\n raise DvcException(\n \"cannot destroy without a confirmation from the user.\"\n \" Use `-f` to force.\"\n )\n\n self.repo.destroy()\n except Exception:\n logger.exception(\"failed to destroy DVC\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_argparse_CmdDiff.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_argparse_CmdDiff.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 118, "span_ids": ["imports", "CmdDiff._format", "CmdDiff", "CmdDiff.run"], "tokens": 631}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport json\nimport logging\nimport os\n\nimport colorama\n\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdDiff(CmdBase):\n @staticmethod\n def _format(diff):\n \"\"\"\n Given a diff structure, generate a string of paths separated\n by new lines and grouped together by their state.\n\n A group's header is colored and its entries are sorted to enhance\n readability, for example:\n\n Added:\n another_file.txt\n backup.tar\n dir/\n dir/1\n\n An example of a diff formatted when entries contain hash:\n\n Added:\n d3b07384 foo\n\n Modified:\n c157a790..f98bf6f1 bar\n\n If a group has no entries, it won't be included in the result.\n\n At the bottom, include a summary with the number of files per state.\n \"\"\"\n\n def _digest(checksum):\n if type(checksum) is str:\n return checksum[0:8]\n return \"{}..{}\".format(checksum[\"old\"][0:8], checksum[\"new\"][0:8])\n\n colors = {\n \"added\": colorama.Fore.GREEN,\n \"modified\": colorama.Fore.YELLOW,\n \"deleted\": colorama.Fore.RED,\n }\n\n summary = {}\n groups = []\n\n for state in [\"added\", \"deleted\", \"modified\"]:\n summary[state] = 0\n entries = diff[state]\n\n if not entries:\n continue\n\n content = []\n\n for entry in entries:\n path = entry[\"path\"]\n checksum = entry.get(\"hash\")\n summary[state] += 1 if not path.endswith(os.sep) else 0\n content.append(\n \"{space}{checksum}{separator}{path}\".format(\n space=\" \",\n checksum=_digest(checksum) if checksum else \"\",\n separator=\" \" if checksum else \"\",\n path=entry[\"path\"],\n )\n )\n\n groups.append(\n \"{color}{header}{nc}:\\n{content}\".format(\n color=colors[state],\n header=state.capitalize(),\n nc=colorama.Fore.RESET,\n content=\"\\n\".join(content),\n )\n )\n\n groups.append(\n \"files summary: {added} added, {deleted} deleted,\"\n \" {modified} modified\".format_map(summary)\n )\n\n return \"\\n\\n\".join(groups)\n\n def run(self):\n try:\n diff = self.repo.diff(self.args.a_rev, self.args.b_rev)\n\n if not any(diff.values()):\n return 0\n\n if not self.args.show_hash:\n for _, entries in diff.items():\n for entry in entries:\n del entry[\"hash\"]\n\n if self.args.show_json:\n res = json.dumps(diff)\n else:\n res = self._format(diff)\n\n logger.info(res)\n\n except DvcException:\n logger.exception(\"failed to get diff\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_argparse_CmdGC.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_argparse_CmdGC.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/gc.py", "file_name": "gc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 61, "span_ids": ["imports", "CmdGC", "CmdGC.run"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\nimport os\n\nimport dvc.prompt as prompt\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdGC(CmdBase):\n def run(self):\n from dvc.repo.gc import _raise_error_if_all_disabled\n\n _raise_error_if_all_disabled(\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n all_commits=self.args.all_commits,\n workspace=self.args.workspace,\n )\n\n msg = \"This will remove all cache except items used in \"\n\n msg += \"the working tree\"\n if self.args.all_commits:\n msg += \" and all git commits\"\n elif self.args.all_branches and self.args.all_tags:\n msg += \" and all git branches and tags\"\n elif self.args.all_branches:\n msg += \" and all git branches\"\n elif self.args.all_tags:\n msg += \" and all git tags\"\n\n if self.args.repos:\n msg += \" of the current and the following repos:\"\n\n for repo_path in self.args.repos:\n msg += \"\\n - %s\" % os.path.abspath(repo_path)\n else:\n msg += \" of the current repo.\"\n\n logger.warning(msg)\n\n msg = \"Are you sure you want to proceed?\"\n if not self.args.force and not prompt.confirm(msg):\n return 1\n\n self.repo.gc(\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n all_commits=self.args.all_commits,\n cloud=self.args.cloud,\n remote=self.args.remote,\n force=self.args.force,\n jobs=self.args.jobs,\n repos=self.args.repos,\n workspace=self.args.workspace,\n )\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_argparse_CmdGet._get_file_from_repo.try_.except_DvcException_.return.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_argparse_CmdGet._get_file_from_repo.try_.except_DvcException_.return.1", "embedding": null, "metadata": {"file_path": "dvc/command/get.py", "file_name": "get.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 50, "span_ids": ["CmdGet", "CmdGet._get_file_from_repo", "imports", "CmdGet._show_url", "CmdGet.run"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom .base import append_doc_link\nfrom .base import CmdBaseNoRepo\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdGet(CmdBaseNoRepo):\n def _show_url(self):\n from dvc.api import get_url\n\n try:\n url = get_url(\n self.args.path, repo=self.args.url, rev=self.args.rev\n )\n logger.info(url)\n except DvcException:\n logger.exception(\"failed to show URL\")\n return 1\n\n return 0\n\n def run(self):\n if self.args.show_url:\n return self._show_url()\n\n return self._get_file_from_repo()\n\n def _get_file_from_repo(self):\n from dvc.repo import Repo\n\n try:\n Repo.get(\n self.args.url,\n path=self.args.path,\n out=self.args.out,\n rev=self.args.rev,\n )\n return 0\n except DvcException:\n logger.exception(\n \"failed to get '{}' from '{}'\".format(\n self.args.path, self.args.url\n )\n )\n return 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get_url.py_argparse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get_url.py_argparse_", "embedding": null, "metadata": {"file_path": "dvc/command/get_url.py", "file_name": "get_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["imports", "CmdGetUrl.run", "CmdGetUrl", "add_parser"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom .base import append_doc_link\nfrom .base import CmdBaseNoRepo\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdGetUrl(CmdBaseNoRepo):\n def run(self):\n from dvc.repo import Repo\n\n try:\n Repo.get_url(self.args.url, out=self.args.out)\n return 0\n except DvcException:\n logger.exception(\"failed to get '{}'\".format(self.args.url))\n return 1\n\n\ndef add_parser(subparsers, parent_parser):\n GET_HELP = \"Download or copy files from URL.\"\n get_parser = subparsers.add_parser(\n \"get-url\",\n parents=[parent_parser],\n description=append_doc_link(GET_HELP, \"get-url\"),\n help=GET_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n get_parser.add_argument(\n \"url\", help=\"See `dvc import-url -h` for full list of supported URLs.\"\n )\n get_parser.add_argument(\n \"out\", nargs=\"?\", help=\"Destination path to put data to.\"\n )\n get_parser.set_defaults(func=CmdGetUrl)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_logging_CmdPreCommit._run.return.main_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_logging_CmdPreCommit._run.return.main_status_", "embedding": null, "metadata": {"file_path": "dvc/command/git_hook.py", "file_name": "git_hook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["CmdHookBase", "imports", "CmdPreCommit._run", "CmdPreCommit", "CmdHookBase.run"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nfrom dvc.command.base import CmdBaseNoRepo, fix_subparsers\nfrom dvc.exceptions import NotDvcRepoError\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdHookBase(CmdBaseNoRepo):\n def run(self):\n from dvc.repo import Repo\n\n try:\n repo = Repo()\n repo.close()\n except NotDvcRepoError:\n return 0\n\n return self._run()\n\n\nclass CmdPreCommit(CmdHookBase):\n def _run(self):\n from dvc.main import main\n\n return main([\"status\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_CmdPostCheckout_CmdPrePush.run.return.main_push_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_CmdPostCheckout_CmdPrePush.run.return.main_push_", "embedding": null, "metadata": {"file_path": "dvc/command/git_hook.py", "file_name": "git_hook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 58, "span_ids": ["CmdPrePush", "CmdPrePush.run", "CmdPostCheckout", "CmdPostCheckout.run"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdPostCheckout(CmdHookBase):\n def run(self):\n # when we are running from pre-commit tool, it doesn't provide CLI\n # flags, but instead provides respective env vars that we could use.\n flag = os.environ.get(\"PRE_COMMIT_CHECKOUT_TYPE\")\n if flag is None and len(self.args.args) >= 3:\n # see https://git-scm.com/docs/githooks#_post_checkout\n flag = self.args.args[2]\n\n # checking out some reference and not specific file.\n if flag != \"1\":\n return 0\n\n # make sure we are not in the middle of a rebase/merge, so we\n # don't accidentally break it with an unsuccessful checkout.\n # Note that git hooks are always running in repo root.\n if os.path.isdir(os.path.join(\".git\", \"rebase-merge\")):\n return 0\n\n from dvc.main import main\n\n return main([\"checkout\"])\n\n\nclass CmdPrePush(CmdHookBase):\n def run(self):\n from dvc.main import main\n\n return main([\"push\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/git_hook.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/git_hook.py", "file_name": "git_hook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 113, "span_ids": ["add_parser"], "tokens": 376}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n GIT_HOOK_HELP = \"Run GIT hook.\"\n\n git_hook_parser = subparsers.add_parser(\n \"git-hook\",\n parents=[parent_parser],\n description=GIT_HOOK_HELP,\n add_help=False,\n )\n\n git_hook_subparsers = git_hook_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use `dvc daemon CMD --help` for command-specific help.\",\n )\n\n fix_subparsers(git_hook_subparsers)\n\n PRE_COMMIT_HELP = \"Run pre-commit GIT hook.\"\n pre_commit_parser = git_hook_subparsers.add_parser(\n \"pre-commit\",\n parents=[parent_parser],\n description=PRE_COMMIT_HELP,\n help=PRE_COMMIT_HELP,\n )\n pre_commit_parser.add_argument(\n \"args\", nargs=\"*\", help=\"Arguments passed by GIT or pre-commit tool.\",\n )\n pre_commit_parser.set_defaults(func=CmdPreCommit)\n\n POST_CHECKOUT_HELP = \"Run post-checkout GIT hook.\"\n post_checkout_parser = git_hook_subparsers.add_parser(\n \"post-checkout\",\n parents=[parent_parser],\n description=POST_CHECKOUT_HELP,\n help=POST_CHECKOUT_HELP,\n )\n post_checkout_parser.add_argument(\n \"args\", nargs=\"*\", help=\"Arguments passed by GIT or pre-commit tool.\",\n )\n post_checkout_parser.set_defaults(func=CmdPostCheckout)\n\n PRE_PUSH_HELP = \"Run pre-push GIT hook.\"\n pre_push_parser = git_hook_subparsers.add_parser(\n \"pre-push\",\n parents=[parent_parser],\n description=PRE_PUSH_HELP,\n help=PRE_PUSH_HELP,\n )\n pre_push_parser.add_argument(\n \"args\", nargs=\"*\", help=\"Arguments passed by GIT or pre-commit tool.\",\n )\n pre_push_parser.set_defaults(func=CmdPrePush)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_argparse_CmdImport.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_argparse_CmdImport.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/imp.py", "file_name": "imp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["CmdImport.run", "imports", "CmdImport"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdImport(CmdBase):\n def run(self):\n try:\n self.repo.imp(\n self.args.url,\n self.args.path,\n out=self.args.out,\n rev=self.args.rev,\n )\n except DvcException:\n logger.exception(\n \"failed to import '{}' from '{}'.\".format(\n self.args.path, self.args.url\n )\n )\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_argparse_CmdImportUrl.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_argparse_CmdImportUrl.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/imp_url.py", "file_name": "imp_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["imports", "CmdImportUrl", "CmdImportUrl.run"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdImportUrl(CmdBase):\n def run(self):\n try:\n self.repo.imp_url(\n self.args.url, out=self.args.out, fname=self.args.file\n )\n except DvcException:\n logger.exception(\n \"failed to import {}. You could also try downloading \"\n \"it manually, and adding it with `dvc add`.\".format(\n self.args.url\n )\n )\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_argparse_CmdInit.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_argparse_CmdInit.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/init.py", "file_name": "init.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["imports", "CmdInit.run", "CmdInit"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBaseNoRepo\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdInit(CmdBaseNoRepo):\n def run(self):\n from dvc.repo import Repo\n from dvc.exceptions import InitError\n\n try:\n self.repo = Repo.init(\n \".\",\n no_scm=self.args.no_scm,\n force=self.args.force,\n subdir=self.args.subdir,\n )\n self.config = self.repo.config\n except InitError:\n logger.exception(\"failed to initiate DVC\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/install.py_argparse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/install.py_argparse_", "embedding": null, "metadata": {"file_path": "dvc/command/install.py", "file_name": "install.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["imports", "CmdInstall.run", "add_parser", "CmdInstall"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdInstall(CmdBase):\n def run(self):\n try:\n self.repo.install(self.args.use_pre_commit_tool)\n except Exception:\n logger.exception(\"failed to install DVC Git hooks\")\n return 1\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n INSTALL_HELP = \"Install DVC git hooks into the repository.\"\n install_parser = subparsers.add_parser(\n \"install\",\n parents=[parent_parser],\n description=append_doc_link(INSTALL_HELP, \"install\"),\n help=INSTALL_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n install_parser.add_argument(\n \"--use-pre-commit-tool\",\n action=\"store_true\",\n default=False,\n help=\"Install DVC hooks using pre-commit \"\n \"(https://pre-commit.com) if it is installed.\",\n )\n install_parser.set_defaults(func=CmdInstall)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_argparse_CmdUnlock.run.return.self__run_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_argparse_CmdUnlock.run.return.self__run_True_", "embedding": null, "metadata": {"file_path": "dvc/command/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["imports", "CmdLockBase._run", "CmdUnlock.run", "CmdUnlock", "CmdLockBase", "CmdLock", "CmdLock.run"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdLockBase(CmdBase):\n def _run(self, unlock):\n for target in self.args.targets:\n try:\n self.repo.lock_stage(target, unlock=unlock)\n except DvcException:\n logger.exception(\n \"failed to {}lock '{}'\".format(\n \"un\" if unlock else \"\", target\n )\n )\n\n return 1\n return 0\n\n\nclass CmdLock(CmdLockBase):\n def run(self):\n return self._run(False)\n\n\nclass CmdUnlock(CmdLockBase):\n def run(self):\n return self._run(True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_argparse_CmdList.run.try_.except_DvcException_.return.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_argparse_CmdList.run.try_.except_DvcException_.return.1", "embedding": null, "metadata": {"file_path": "dvc/command/ls/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["imports", "CmdList.run", "_prettify", "CmdList"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\nimport sys\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBaseNoRepo\nfrom dvc.command.ls.ls_colors import LsColors\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _prettify(entries, with_color=False):\n if with_color:\n ls_colors = LsColors()\n fmt = ls_colors.format\n else:\n\n def fmt(entry):\n return entry[\"path\"]\n\n return [fmt(entry) for entry in entries]\n\n\nclass CmdList(CmdBaseNoRepo):\n def run(self):\n from dvc.repo import Repo\n\n try:\n entries = Repo.ls(\n self.args.url,\n self.args.path,\n rev=self.args.rev,\n recursive=self.args.recursive,\n outs_only=self.args.outs_only,\n )\n if entries:\n entries = _prettify(entries, sys.stdout.isatty())\n logger.info(\"\\n\".join(entries))\n return 0\n except DvcException:\n logger.exception(\"failed to list '{}'\".format(self.args.url))\n return 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/ls/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 81, "span_ids": ["add_parser"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n LIST_HELP = (\n \"List repository contents, including files\"\n \" and directories tracked by DVC and by Git.\"\n )\n list_parser = subparsers.add_parser(\n \"list\",\n parents=[parent_parser],\n description=append_doc_link(LIST_HELP, \"list\"),\n help=LIST_HELP,\n formatter_class=argparse.RawTextHelpFormatter,\n )\n list_parser.add_argument(\"url\", help=\"Location of DVC repository to list\")\n list_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n help=\"Recursively list files.\",\n )\n list_parser.add_argument(\n \"--outs-only\", action=\"store_true\", help=\"Show only DVC outputs.\"\n )\n list_parser.add_argument(\n \"--rev\",\n nargs=\"?\",\n help=\"Git revision (e.g. SHA, branch, tag)\",\n metavar=\"\",\n )\n list_parser.add_argument(\n \"path\",\n nargs=\"?\",\n help=\"Path to directory within the repository to list outputs for\",\n )\n list_parser.set_defaults(func=CmdList)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/ls_colors.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/ls_colors.py_os_", "embedding": null, "metadata": {"file_path": "dvc/command/ls/ls_colors.py", "file_name": "ls_colors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["LsColors._format", "LsColors._load", "imports", "LsColors.__init__", "LsColors.format", "LsColors"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\n\nclass LsColors(object):\n default = \"rs=0:di=01;34:ex=01;32\"\n\n def __init__(self, lscolors=None):\n self._extensions = {}\n self._codes = {}\n self._load(lscolors or os.environ.get(\"LS_COLORS\") or LsColors.default)\n\n def _load(self, lscolors):\n for item in lscolors.split(\":\"):\n try:\n code, color = item.split(\"=\", 1)\n except ValueError:\n continue\n if code.startswith(\"*.\"):\n self._extensions[code[1:]] = color\n else:\n self._codes[code] = color\n\n def format(self, entry):\n text = entry[\"path\"]\n\n if entry.get(\"isout\", False) and \"out\" in self._codes:\n return self._format(text, code=\"out\")\n\n if entry.get(\"isdir\", False):\n return self._format(text, code=\"di\")\n\n if entry.get(\"isexec\", False):\n return self._format(text, code=\"ex\")\n\n _, ext = os.path.splitext(text)\n return self._format(text, ext=ext)\n\n def _format(self, text, code=None, ext=None):\n val = None\n if ext:\n val = self._extensions.get(ext, None)\n if code:\n val = self._codes.get(code, None)\n\n if not val:\n return text\n rs = self._codes.get(\"rs\", 0)\n return \"\\033[{}m{}\\033[{}m\".format(val, text, rs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_argparse_show_metrics.if_missing_.raise_BadMetricError_miss": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_argparse_show_metrics.if_missing_.raise_BadMetricError_miss", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["imports", "show_metrics"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.command.base import fix_subparsers\nfrom dvc.exceptions import BadMetricError\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef show_metrics(\n metrics, all_branches=False, all_tags=False, all_commits=False\n):\n from flatten_json import flatten\n from dvc.utils.diff import format_dict\n\n # When `metrics` contains a `None` key, it means that some files\n # specified as `targets` in `repo.metrics.show` didn't contain any metrics.\n missing = metrics.pop(None, None)\n\n for branch, val in metrics.items():\n if all_branches or all_tags or all_commits:\n logger.info(\"{branch}:\".format(branch=branch))\n\n for fname, metric in val.items():\n if not isinstance(metric, dict):\n logger.info(\"\\t{}: {}\".format(fname, str(metric)))\n continue\n\n logger.info(\"\\t{}:\".format(fname))\n for key, value in flatten(format_dict(metric), \".\").items():\n logger.info(\"\\t\\t{}: {}\".format(key, value))\n\n if missing:\n raise BadMetricError(missing)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsDiff_CmdMetricsDiff.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsDiff_CmdMetricsDiff.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 139, "span_ids": ["CmdMetricsDiff.run", "CmdMetricsDiff"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdMetricsDiff(CmdBase):\n def run(self):\n try:\n diff = self.repo.metrics.diff(\n a_rev=self.args.a_rev,\n b_rev=self.args.b_rev,\n targets=self.args.targets,\n recursive=self.args.recursive,\n all=self.args.all,\n )\n\n if self.args.show_json:\n import json\n\n logger.info(json.dumps(diff))\n else:\n table = _show_diff(diff)\n if table:\n logger.info(table)\n\n except DvcException:\n logger.exception(\"failed to show metrics diff\")\n return 1\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/move.py_argparse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/move.py_argparse_", "embedding": null, "metadata": {"file_path": "dvc/command/move.py", "file_name": "move.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["imports", "CmdMove.run", "add_parser", "CmdMove"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdMove(CmdBase):\n def run(self):\n try:\n self.repo.move(self.args.src, self.args.dst)\n except DvcException:\n msg = \"failed to move '{}' -> '{}'\".format(\n self.args.src, self.args.dst\n )\n logger.exception(msg)\n return 1\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n MOVE_HELP = \"Rename or move a DVC controlled data file or a directory.\"\n MOVE_DESCRIPTION = (\n \"Rename or move a DVC controlled data file or a directory.\\n\"\n \"It renames and modifies the corresponding DVC-file to reflect the\"\n \" changes.\"\n )\n\n move_parser = subparsers.add_parser(\n \"move\",\n parents=[parent_parser],\n description=append_doc_link(MOVE_DESCRIPTION, \"move\"),\n help=MOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n move_parser.add_argument(\n \"src\", help=\"Source path to a data file or directory.\"\n )\n move_parser.add_argument(\"dst\", help=\"Destination path.\")\n move_parser.set_defaults(func=CmdMove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._build_graph_CmdPipelineShow._build_graph.return.list_nodes_edges_netwo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._build_graph_CmdPipelineShow._build_graph.return.list_nodes_edges_netwo", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 80, "span_ids": ["CmdPipelineShow._build_graph"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdPipelineShow(CmdBase):\n\n def _build_graph(self, target, commands=False, outs=False):\n import networkx\n from dvc import dvcfile\n from dvc.repo.graph import get_pipeline\n from dvc.utils import parse_target\n\n path, name = parse_target(target)\n target_stage = dvcfile.Dvcfile(self.repo, path).stages[name]\n G = get_pipeline(self.repo.pipelines, target_stage)\n\n nodes = set()\n for stage in networkx.dfs_preorder_nodes(G, target_stage):\n if commands:\n if stage.cmd is None:\n continue\n nodes.add(stage.cmd)\n elif outs:\n for out in stage.outs:\n nodes.add(str(out))\n else:\n nodes.add(_stage_repr(stage))\n\n edges = []\n for from_stage, to_stage in networkx.edge_dfs(G, target_stage):\n if commands:\n if to_stage.cmd is None:\n continue\n edges.append((from_stage.cmd, to_stage.cmd))\n elif outs:\n for from_out in from_stage.outs:\n for to_out in to_stage.outs:\n edges.append((str(from_out), str(to_out)))\n else:\n edges.append((_stage_repr(from_stage), _stage_repr(to_stage)))\n\n return list(nodes), edges, networkx.is_tree(G)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._write_dot_CmdPipelineList.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._write_dot_CmdPipelineList.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 171, "span_ids": ["CmdPipelineShow._write_dot", "CmdPipelineList", "CmdPipelineShow.run", "CmdPipelineList.run"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdPipelineShow(CmdBase):\n\n def _write_dot(self, target, commands, outs):\n import io\n import networkx\n from networkx.drawing.nx_pydot import write_dot\n\n _, edges, _ = self._build_graph(target, commands, outs)\n edges = [edge[::-1] for edge in edges]\n\n simple_g = networkx.DiGraph()\n simple_g.add_edges_from(edges)\n\n dot_file = io.StringIO()\n write_dot(simple_g, dot_file)\n logger.info(dot_file.getvalue())\n\n def run(self):\n if not self.args.targets:\n self.args.targets = self.default_targets\n\n for target in self.args.targets:\n try:\n if self.args.ascii:\n self._show_ascii(\n target, self.args.commands, self.args.outs\n )\n elif self.args.dot:\n self._write_dot(target, self.args.commands, self.args.outs)\n elif self.args.tree:\n self._show_dependencies_tree(\n target, self.args.commands, self.args.outs\n )\n else:\n self._show(\n target,\n self.args.commands,\n self.args.outs,\n self.args.locked,\n )\n except DvcException:\n msg = \"failed to show pipeline for '{}'\".format(target)\n logger.exception(msg)\n return 1\n return 0\n\n\nclass CmdPipelineList(CmdBase):\n def run(self):\n pipelines = self.repo.pipelines\n for pipeline in pipelines:\n for stage in pipeline:\n logger.info(_stage_repr(stage))\n if len(pipeline) != 0:\n logger.info(\"=\" * 80)\n logger.info(\"{} pipelines total\".format(len(pipelines)))\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_argparse_CmdRemote._check_exists.if_self_args_name_not_in_.raise_ConfigError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_argparse_CmdRemote._check_exists.if_self_args_name_not_in_.raise_ConfigError_", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["imports", "CmdRemote", "CmdRemote.__init__", "CmdRemote._check_exists"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.config import ConfigError\nfrom dvc.command.base import append_doc_link, fix_subparsers\nfrom dvc.command.config import CmdConfig\nfrom dvc.utils import format_link\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRemote(CmdConfig):\n def __init__(self, args):\n super().__init__(args)\n\n if getattr(self.args, \"name\", None):\n self.args.name = self.args.name.lower()\n\n def _check_exists(self, conf):\n if self.args.name not in conf[\"remote\"]:\n raise ConfigError(\n \"remote '{}' doesn't exists.\".format(self.args.name)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteAdd_CmdRemoteAdd.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteAdd_CmdRemoteAdd.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 44, "span_ids": ["CmdRemoteAdd", "CmdRemoteAdd.run"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdRemoteAdd(CmdRemote):\n def run(self):\n if self.args.default:\n logger.info(\n \"Setting '{}' as a default remote.\".format(self.args.name)\n )\n\n with self.config.edit(self.args.level) as conf:\n if self.args.name in conf[\"remote\"] and not self.args.force:\n raise ConfigError(\n \"remote '{}' already exists. Use `-f|--force` to \"\n \"overwrite it.\".format(self.args.name)\n )\n\n conf[\"remote\"][self.args.name] = {\"url\": self.args.url}\n if self.args.default:\n conf[\"core\"][\"remote\"] = self.args.name\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteRemove_CmdRemoteRemove.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteRemove_CmdRemoteRemove.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 62, "span_ids": ["CmdRemoteRemove", "CmdRemoteRemove.run"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdRemoteRemove(CmdRemote):\n def run(self):\n with self.config.edit(self.args.level) as conf:\n self._check_exists(conf)\n del conf[\"remote\"][self.args.name]\n\n # Remove core.remote refs to this remote in any shadowing configs\n for level in reversed(self.config.LEVELS):\n with self.config.edit(level) as conf:\n if conf[\"core\"].get(\"remote\") == self.args.name:\n del conf[\"core\"][\"remote\"]\n\n if level == self.args.level:\n break\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteModify_CmdRemoteList.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteModify_CmdRemoteList.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 97, "span_ids": ["CmdRemoteList", "CmdRemoteDefault.run", "CmdRemoteList.run", "CmdRemoteModify", "CmdRemoteDefault", "CmdRemoteModify.run"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdRemoteModify(CmdRemote):\n def run(self):\n with self.config.edit(self.args.level) as conf:\n self._check_exists(conf)\n conf[\"remote\"][self.args.name][self.args.option] = self.args.value\n return 0\n\n\nclass CmdRemoteDefault(CmdRemote):\n def run(self):\n\n if self.args.name is None and not self.args.unset:\n conf = self.config.load_one(self.args.level)\n try:\n print(conf[\"core\"][\"remote\"])\n except KeyError:\n logger.info(\"No default remote set\")\n return 1\n else:\n with self.config.edit(self.args.level) as conf:\n if self.args.unset:\n conf[\"core\"].pop(\"remote\", None)\n else:\n conf[\"core\"][\"remote\"] = self.args.name\n return 0\n\n\nclass CmdRemoteList(CmdRemote):\n def run(self):\n conf = self.config.load_one(self.args.level)\n for name, conf in conf[\"remote\"].items():\n logger.info(\"{}\\t{}\".format(name, conf[\"url\"]))\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_argparse_CmdRemove.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_argparse_CmdRemove.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["CmdRemove.run", "imports", "CmdRemove._is_outs_only", "CmdRemove"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nimport dvc.prompt as prompt\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRemove(CmdBase):\n def _is_outs_only(self, target):\n if not self.args.purge:\n return True\n\n if self.args.force:\n return False\n\n msg = \"Are you sure you want to remove '{}' with its outputs?\".format(\n target\n )\n\n if prompt.confirm(msg):\n return False\n\n raise DvcException(\n \"Cannot purge without a confirmation from the user.\"\n \" Use `-f` to force.\"\n )\n\n def run(self):\n for target in self.args.targets:\n try:\n outs_only = self._is_outs_only(target)\n self.repo.remove(target, outs_only=outs_only)\n except DvcException:\n logger.exception(\"failed to remove '{}'\".format(target))\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_argparse_CmdRepro.run.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_argparse_CmdRepro.run.return.ret", "embedding": null, "metadata": {"file_path": "dvc/command/repro.py", "file_name": "repro.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 56, "span_ids": ["CmdRepro.run", "imports", "CmdRepro"], "tokens": 322}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\nimport os\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.command.metrics import show_metrics\nfrom dvc.command.status import CmdDataStatus\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRepro(CmdBase):\n def run(self):\n saved_dir = os.path.realpath(os.curdir)\n if self.args.cwd:\n os.chdir(self.args.cwd)\n\n # Dirty hack so the for loop below can at least enter once\n if self.args.all_pipelines:\n self.args.targets = [None]\n elif not self.args.targets:\n self.args.targets = self.default_targets\n\n ret = 0\n for target in self.args.targets:\n try:\n stages = self.repo.reproduce(\n target,\n single_item=self.args.single_item,\n force=self.args.force,\n dry=self.args.dry,\n interactive=self.args.interactive,\n pipeline=self.args.pipeline,\n all_pipelines=self.args.all_pipelines,\n ignore_build_cache=self.args.ignore_build_cache,\n no_commit=self.args.no_commit,\n downstream=self.args.downstream,\n recursive=self.args.recursive,\n )\n\n if len(stages) == 0:\n logger.info(CmdDataStatus.UP_TO_DATE_MSG)\n\n if self.args.metrics:\n metrics = self.repo.metrics.show()\n show_metrics(metrics)\n except DvcException:\n logger.exception(\"\")\n ret = 1\n break\n\n os.chdir(saved_dir)\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/root.py_argparse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/root.py_argparse_", "embedding": null, "metadata": {"file_path": "dvc/command/root.py", "file_name": "root.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["imports", "CmdRoot.run", "CmdRoot", "add_parser"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBaseNoRepo\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRoot(CmdBaseNoRepo):\n def run(self):\n from dvc.repo import Repo\n\n logger.info(relpath(Repo.find_root()))\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n ROOT_HELP = \"Return the relative path to the root of the DVC project.\"\n root_parser = subparsers.add_parser(\n \"root\",\n parents=[parent_parser],\n description=append_doc_link(ROOT_HELP, \"root\"),\n help=ROOT_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n root_parser.set_defaults(func=CmdRoot)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_argparse_CmdRun.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_argparse_CmdRun.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 60, "span_ids": ["imports", "CmdRun", "CmdRun.run"], "tokens": 384}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRun(CmdBase):\n def run(self):\n overwrite = self.args.yes or self.args.overwrite_dvcfile\n\n if not any(\n [\n self.args.deps,\n self.args.outs,\n self.args.outs_no_cache,\n self.args.metrics,\n self.args.metrics_no_cache,\n self.args.outs_persist,\n self.args.outs_persist_no_cache,\n self.args.params,\n self.args.command,\n ]\n ): # pragma: no cover\n logger.error(\n \"too few arguments. Specify at least one: `-d`, `-o`, `-O`, \"\n \"`-m`, `-M`, `-p`, `--outs-persist`, \"\n \"`--outs-persist-no-cache`, `command`.\"\n )\n return 1\n\n try:\n self.repo.run(\n cmd=self._parsed_cmd(),\n outs=self.args.outs,\n outs_no_cache=self.args.outs_no_cache,\n metrics=self.args.metrics,\n metrics_no_cache=self.args.metrics_no_cache,\n deps=self.args.deps,\n params=self.args.params,\n fname=self.args.file,\n wdir=self.args.wdir,\n no_exec=self.args.no_exec,\n overwrite=overwrite,\n ignore_build_cache=self.args.ignore_build_cache,\n no_commit=self.args.no_commit,\n outs_persist=self.args.outs_persist,\n outs_persist_no_cache=self.args.outs_persist_no_cache,\n always_changed=self.args.always_changed,\n name=self.args.name,\n )\n except DvcException:\n logger.exception(\"failed to run command\")\n return 1\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_logging_CmdDataStatus._show.for_key_value_in_status_.if_isinstance_value_str_.elif_value_.self__show_value_indent_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_logging_CmdDataStatus._show.for_key_value_in_status_.if_isinstance_value_str_.elif_value_.self__show_value_indent_", "embedding": null, "metadata": {"file_path": "dvc/command/status.py", "file_name": "status.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["imports", "CmdDataStatus._normalize", "CmdDataStatus", "CmdDataStatus._show"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.command.data_sync import CmdDataBase\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdDataStatus(CmdDataBase):\n STATUS_LEN = 20\n STATUS_INDENT = \"\\t\"\n UP_TO_DATE_MSG = \"Data and pipelines are up to date.\"\n\n def _normalize(self, s):\n s += \":\"\n assert len(s) < self.STATUS_LEN\n return s + (self.STATUS_LEN - len(s)) * \" \"\n\n def _show(self, status, indent=0):\n ind = indent * self.STATUS_INDENT\n\n if isinstance(status, str):\n logger.info(\"{}{}\".format(ind, status))\n return\n\n if isinstance(status, list):\n for entry in status:\n self._show(entry, indent)\n return\n\n assert isinstance(status, dict)\n\n for key, value in status.items():\n if isinstance(value, str):\n logger.info(\"{}{}{}\".format(ind, self._normalize(value), key))\n elif value:\n logger.info(\"{}{}:\".format(ind, key))\n self._show(value, indent + 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_CmdDataStatus.run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_CmdDataStatus.run_", "embedding": null, "metadata": {"file_path": "dvc/command/status.py", "file_name": "status.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 65, "span_ids": ["CmdDataStatus.run"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdDataStatus(CmdDataBase):\n\n def run(self):\n indent = 1 if self.args.cloud else 0\n try:\n st = self.repo.status(\n targets=self.args.targets,\n jobs=self.args.jobs,\n cloud=self.args.cloud,\n remote=self.args.remote,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n all_commits=self.args.all_commits,\n with_deps=self.args.with_deps,\n )\n if st:\n if self.args.quiet:\n return 1\n else:\n self._show(st, indent)\n else:\n logger.info(self.UP_TO_DATE_MSG)\n\n except Exception:\n logger.exception(\"failed to obtain data status\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/unprotect.py_argparse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/unprotect.py_argparse_", "embedding": null, "metadata": {"file_path": "dvc/command/unprotect.py", "file_name": "unprotect.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["imports", "add_parser", "CmdUnprotect", "CmdUnprotect.run"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdUnprotect(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.unprotect(target)\n except DvcException:\n msg = \"failed to unprotect '{}'\".format(target)\n logger.exception(msg)\n return 1\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n UNPROTECT_HELP = (\n \"Unprotect tracked files or directories (when hardlinks or symlinks \"\n \"have been enabled with `dvc config cache.type`)\"\n )\n unprotect_parser = subparsers.add_parser(\n \"unprotect\",\n parents=[parent_parser],\n description=append_doc_link(UNPROTECT_HELP, \"unprotect\"),\n help=UNPROTECT_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n unprotect_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"Data files/directories to unprotect.\"\n )\n unprotect_parser.set_defaults(func=CmdUnprotect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/update.py_argparse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/update.py_argparse_", "embedding": null, "metadata": {"file_path": "dvc/command/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 43, "span_ids": ["imports", "CmdUpdate", "add_parser", "CmdUpdate.run"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdUpdate(CmdBase):\n def run(self):\n ret = 0\n for target in self.args.targets:\n try:\n self.repo.update(target, self.args.rev)\n except DvcException:\n logger.exception(\"failed to update '{}'.\".format(target))\n ret = 1\n return ret\n\n\ndef add_parser(subparsers, parent_parser):\n UPDATE_HELP = \"Update data artifacts imported from other DVC repositories.\"\n update_parser = subparsers.add_parser(\n \"update\",\n parents=[parent_parser],\n description=append_doc_link(UPDATE_HELP, \"update\"),\n help=UPDATE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n update_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"DVC-files to update.\"\n )\n update_parser.add_argument(\n \"--rev\",\n nargs=\"?\",\n help=\"Git revision (e.g. SHA, branch, tag)\",\n metavar=\"\",\n )\n update_parser.set_defaults(func=CmdUpdate)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_argparse_logger.logging_getLogger___name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_argparse_logger.logging_getLogger___name_", "embedding": null, "metadata": {"file_path": "dvc/command/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport itertools\nimport logging\nimport os\nimport platform\nimport uuid\nimport pathlib\n\ntry:\n import psutil\nexcept ImportError:\n psutil = None\n\nfrom dvc.utils import is_binary, relpath\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\nfrom dvc.version import __version__\nfrom dvc.exceptions import DvcException, NotDvcRepoError\nfrom dvc.scm.base import SCMError\nfrom dvc.system import System\nfrom dvc.utils.pkg import PKG\n\nlogger = logging.getLogger(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion_CmdVersion.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion_CmdVersion.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 77, "span_ids": ["CmdVersion.run", "CmdVersion"], "tokens": 422}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdVersion(CmdBaseNoRepo):\n def run(self):\n from dvc.repo import Repo\n\n info = [\n \"DVC version: {}\".format(__version__),\n \"Python version: {}\".format(platform.python_version()),\n \"Platform: {}\".format(platform.platform()),\n \"Binary: {}\".format(is_binary()),\n \"Package: {}\".format(PKG),\n \"Supported remotes: {}\".format(self.get_supported_remotes()),\n ]\n\n try:\n repo = Repo()\n root_directory = repo.root_dir\n\n # cache_dir might not exist yet (e.g. after `dvc init`), and we\n # can't auto-create it, as it might cause issues if the user\n # later decides to enable shared cache mode with\n # `dvc config cache.shared group`.\n if os.path.exists(repo.cache.local.cache_dir):\n info.append(\n \"Cache: {}\".format(self.get_linktype_support_info(repo))\n )\n if psutil:\n fs_type = self.get_fs_type(repo.cache.local.cache_dir)\n info.append(\n \"Filesystem type (cache directory): {}\".format(fs_type)\n )\n else:\n logger.warning(\n \"Unable to detect supported link types, as cache \"\n \"directory '{}' doesn't exist. It is usually auto-created \"\n \"by commands such as `dvc add/fetch/pull/run/import`, \"\n \"but you could create it manually to enable this \"\n \"check.\".format(relpath(repo.cache.local.cache_dir))\n )\n\n except NotDvcRepoError:\n root_directory = os.getcwd()\n except SCMError:\n root_directory = os.getcwd()\n info.append(\"Repo: dvc, git (broken)\")\n else:\n info.append(\"Repo: {}\".format(_get_dvc_repo_info(repo)))\n\n if psutil:\n fs_root = self.get_fs_type(os.path.abspath(root_directory))\n info.append(\"Filesystem type (workspace): {}\".format(fs_root))\n\n logger.info(\"\\n\".join(info))\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion.get_fs_type_CmdVersion.get_supported_remotes.return._join_supported_remot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion.get_fs_type_CmdVersion.get_supported_remotes.return._join_supported_remot", "embedding": null, "metadata": {"file_path": "dvc/command/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 131, "span_ids": ["CmdVersion.get_linktype_support_info", "CmdVersion.get_supported_remotes", "CmdVersion.get_fs_type"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdVersion(CmdBaseNoRepo):\n\n @staticmethod\n def get_fs_type(path):\n partition = {\n pathlib.Path(part.mountpoint): (part.fstype, part.device)\n for part in psutil.disk_partitions(all=True)\n }\n\n path = pathlib.Path(path)\n\n for parent in itertools.chain([path], path.parents):\n if parent in partition:\n return partition[parent]\n return (\"unknown\", \"none\")\n\n @staticmethod\n def get_linktype_support_info(repo):\n links = {\n \"reflink\": (System.reflink, None),\n \"hardlink\": (System.hardlink, System.is_hardlink),\n \"symlink\": (System.symlink, System.is_symlink),\n }\n\n fname = \".\" + str(uuid.uuid4())\n src = os.path.join(repo.cache.local.cache_dir, fname)\n open(src, \"w\").close()\n dst = os.path.join(repo.root_dir, fname)\n\n cache = []\n\n for name, (link, is_link) in links.items():\n try:\n link(src, dst)\n status = \"supported\"\n if is_link and not is_link(dst):\n status = \"broken\"\n os.unlink(dst)\n except DvcException:\n status = \"not supported\"\n cache.append(\"{name} - {status}\".format(name=name, status=status))\n os.remove(src)\n\n return \", \".join(cache)\n\n @staticmethod\n def get_supported_remotes():\n from dvc.remote import REMOTES\n\n supported_remotes = []\n for remote in REMOTES:\n if not remote.get_missing_deps():\n supported_remotes.append(remote.scheme)\n\n return \", \".join(supported_remotes)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py__get_dvc_repo_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py__get_dvc_repo_info_", "embedding": null, "metadata": {"file_path": "dvc/command/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 156, "span_ids": ["add_parser", "_get_dvc_repo_info"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_dvc_repo_info(repo):\n if repo.config.get(\"core\", {}).get(\"no_scm\", False):\n return \"dvc (no_scm)\"\n\n if repo.root_dir != repo.scm.root_dir:\n return \"dvc (subdir), git\"\n\n return \"dvc, git\"\n\n\ndef add_parser(subparsers, parent_parser):\n VERSION_HELP = (\n \"Display the DVC version and system/environment information.\"\n )\n version_parser = subparsers.add_parser(\n \"version\",\n parents=[parent_parser],\n description=append_doc_link(VERSION_HELP, \"version\"),\n help=VERSION_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n version_parser.set_defaults(func=CmdVersion)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/compat.py__Python_version_compati_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/compat.py__Python_version_compati_", "embedding": null, "metadata": {"file_path": "dvc/compat.py", "file_name": "compat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 43, "span_ids": ["docstring"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Python version compatibility code\"\"\"\n\n# Backport os.fspath() from Python 3.6\ntry:\n from os import fspath # noqa: F821\n\n fspath_py35 = lambda s: s # noqa: E731\nexcept ImportError:\n\n def fspath(path):\n \"\"\"Return the path representation of a path-like object.\n\n If str or bytes is passed in, it is returned unchanged. Otherwise the\n os.PathLike interface is used to get the path representation. If the\n path representation is not str or bytes, TypeError is raised. If the\n provided path is not str, bytes, or os.PathLike, TypeError is raised.\n \"\"\"\n if isinstance(path, (str, bytes)):\n return path\n\n # Work from the object's type to match method resolution of other magic\n # methods.\n path_type = type(path)\n try:\n path_repr = path_type.__fspath__(path)\n except AttributeError:\n if hasattr(path_type, \"__fspath__\"):\n raise\n else:\n raise TypeError(\n \"expected str, bytes or os.PathLike object, \"\n \"not \" + path_type.__name__\n )\n if isinstance(path_repr, (str, bytes)):\n return path_repr\n else:\n raise TypeError(\n \"expected {}.__fspath__() to return str or bytes, \"\n \"not {}\".format(path_type.__name__, type(path_repr).__name__)\n )\n\n fspath_py35 = fspath", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__NoRemoteError.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__NoRemoteError.pass", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["ConfigError.__init__", "ConfigError", "NoRemoteError", "docstring"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"DVC config objects.\"\"\"\nimport logging\nimport os\nimport re\nfrom contextlib import contextmanager\nfrom functools import partial\nfrom urllib.parse import urlparse\n\nimport configobj\nfrom funcy import cached_property, compact, re_find, walk_values\nfrom voluptuous import (\n ALLOW_EXTRA,\n All,\n Any,\n Coerce,\n Invalid,\n Lower,\n Optional,\n Range,\n Schema,\n)\n\nfrom dvc.exceptions import DvcException, NotDvcRepoError\nfrom dvc.path_info import PathInfo\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\n\n\nclass ConfigError(DvcException):\n \"\"\"DVC config exception.\"\"\"\n\n def __init__(self, msg):\n super().__init__(\"config file error: {}\".format(msg))\n\n\nclass NoRemoteError(ConfigError):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_supported_cache_type_supported_cache_type.return.types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_supported_cache_type_supported_cache_type.return.types", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 47, "span_ids": ["supported_cache_type"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def supported_cache_type(types):\n \"\"\"Checks if link type config option consists only of valid values.\n\n Args:\n types (list/string): type(s) of links that dvc should try out.\n \"\"\"\n if types is None:\n return None\n if isinstance(types, str):\n types = [typ.strip() for typ in types.split(\",\")]\n\n unsupported = set(types) - {\"reflink\", \"hardlink\", \"symlink\", \"copy\"}\n if unsupported:\n raise Invalid(\n \"Unsupported cache type(s): {}\".format(\", \".join(unsupported))\n )\n\n return types", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__Checks_that_value_is_ei_Choices.return.Any_choices_msg_expect": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__Checks_that_value_is_ei_Choices.return.Any_choices_msg_expect", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 66, "span_ids": ["supported_cache_type", "impl:3", "Choices"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Checks that value is either true or false and converts it to bool\nto_bool = Bool = All(\n Lower,\n Any(\"true\", \"false\"),\n lambda v: v == \"true\",\n msg=\"expected true or false\",\n)\n\n\ndef Choices(*choices):\n \"\"\"Checks that value belongs to the specified set of values\n\n Args:\n *choices: pass allowed values as arguments, or pass a list or\n tuple as a single argument\n \"\"\"\n return Any(*choices, msg=\"expected one of {}\".format(\", \".join(choices)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_ByUrl_ByUrl.return.validate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_ByUrl_ByUrl.return.validate", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 85, "span_ids": ["ByUrl"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ByUrl(mapping):\n schemas = walk_values(Schema, mapping)\n\n def validate(data):\n if \"url\" not in data:\n raise Invalid(\"expected 'url'\")\n\n parsed = urlparse(data[\"url\"])\n # Windows absolute paths should really have scheme == \"\" (local)\n if os.name == \"nt\" and len(parsed.scheme) == 1 and parsed.netloc == \"\":\n return schemas[\"\"](data)\n if parsed.scheme not in schemas:\n raise Invalid(\"Unsupported URL type {}://\".format(parsed.scheme))\n\n return schemas[parsed.scheme](data)\n\n return validate", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_RelPath_HTTP_COMMON._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_RelPath_HTTP_COMMON._", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 110, "span_ids": ["RelPath", "impl:6"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RelPath(str):\n pass\n\n\nREMOTE_COMMON = {\n \"url\": str,\n \"checksum_jobs\": All(Coerce(int), Range(1)),\n Optional(\"no_traverse\"): Bool, # obsoleted\n \"verify\": Bool,\n}\nLOCAL_COMMON = {\n \"type\": supported_cache_type,\n Optional(\"protected\", default=False): Bool, # obsoleted\n \"shared\": All(Lower, Choices(\"group\")),\n Optional(\"slow_link_warning\", default=True): Bool,\n}\nHTTP_COMMON = {\n \"auth\": All(Lower, Choices(\"basic\", \"digest\", \"custom\")),\n \"custom_auth_header\": str,\n \"user\": str,\n \"password\": str,\n \"ask_password\": Bool,\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_SCHEMA_COMPILED_SCHEMA.Schema_SCHEMA_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_SCHEMA_COMPILED_SCHEMA.Schema_SCHEMA_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 196, "span_ids": ["impl:14", "impl:6"], "tokens": 632}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "SCHEMA = {\n \"core\": {\n \"remote\": Lower,\n \"checksum_jobs\": All(Coerce(int), Range(1)),\n Optional(\"interactive\", default=False): Bool,\n Optional(\"analytics\", default=True): Bool,\n Optional(\"hardlink_lock\", default=False): Bool,\n Optional(\"no_scm\", default=False): Bool,\n },\n \"cache\": {\n \"local\": str,\n \"s3\": str,\n \"gs\": str,\n \"hdfs\": str,\n \"ssh\": str,\n \"azure\": str,\n # This is for default local cache\n \"dir\": str,\n **LOCAL_COMMON,\n },\n \"remote\": {\n str: ByUrl(\n {\n \"\": {**LOCAL_COMMON, **REMOTE_COMMON},\n \"s3\": {\n \"region\": str,\n \"profile\": str,\n \"credentialpath\": str,\n \"endpointurl\": str,\n Optional(\"listobjects\", default=False): Bool,\n Optional(\"use_ssl\", default=True): Bool,\n \"sse\": str,\n \"acl\": str,\n \"grant_read\": str,\n \"grant_read_acp\": str,\n \"grant_write_acp\": str,\n \"grant_full_control\": str,\n **REMOTE_COMMON,\n },\n \"gs\": {\n \"projectname\": str,\n \"credentialpath\": str,\n **REMOTE_COMMON,\n },\n \"ssh\": {\n \"type\": supported_cache_type,\n \"port\": Coerce(int),\n \"user\": str,\n \"password\": str,\n \"ask_password\": Bool,\n \"keyfile\": str,\n \"timeout\": Coerce(int),\n \"gss_auth\": Bool,\n **REMOTE_COMMON,\n },\n \"hdfs\": {\"user\": str, **REMOTE_COMMON},\n \"azure\": {\"connection_string\": str, **REMOTE_COMMON},\n \"oss\": {\n \"oss_key_id\": str,\n \"oss_key_secret\": str,\n \"oss_endpoint\": str,\n **REMOTE_COMMON,\n },\n \"gdrive\": {\n \"gdrive_use_service_account\": Bool,\n \"gdrive_client_id\": str,\n \"gdrive_client_secret\": str,\n \"gdrive_user_credentials_file\": str,\n \"gdrive_service_account_email\": str,\n \"gdrive_service_account_user_email\": str,\n \"gdrive_service_account_p12_file_path\": str,\n Optional(\"gdrive_trash_only\", default=False): Bool,\n **REMOTE_COMMON,\n },\n \"http\": {**HTTP_COMMON, **REMOTE_COMMON},\n \"https\": {**HTTP_COMMON, **REMOTE_COMMON},\n \"remote\": {str: object}, # Any of the above options are valid\n }\n )\n },\n \"state\": {\n \"row_limit\": All(Coerce(int), Range(1)),\n \"row_cleanup_quota\": All(Coerce(int), Range(0, 100)),\n },\n}\nCOMPILED_SCHEMA = Schema(SCHEMA)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__load_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__load_config_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 355, "end_line": 408, "span_ids": ["_merge", "_lower_keys", "_pack_remotes", "_save_config", "_parse_remotes", "_load_config"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _load_config(filename):\n conf_obj = configobj.ConfigObj(filename)\n return _parse_remotes(_lower_keys(conf_obj.dict()))\n\n\ndef _save_config(filename, conf_dict):\n logger.debug(\"Writing '{}'.\".format(filename))\n os.makedirs(os.path.dirname(filename), exist_ok=True)\n\n config = configobj.ConfigObj(_pack_remotes(conf_dict))\n config.filename = filename\n config.write()\n\n\ndef _parse_remotes(conf):\n result = {\"remote\": {}}\n\n for section, val in conf.items():\n name = re_find(r'^\\s*remote\\s*\"(.*)\"\\s*$', section)\n if name:\n result[\"remote\"][name] = val\n else:\n result[section] = val\n\n return result\n\n\ndef _pack_remotes(conf):\n # Drop empty sections\n result = compact(conf)\n\n # Transform remote.name -> 'remote \"name\"'\n for name, val in conf[\"remote\"].items():\n result['remote \"{}\"'.format(name)] = val\n result.pop(\"remote\", None)\n\n return result\n\n\ndef _merge(into, update):\n \"\"\"Merges second dict into first recursively\"\"\"\n for key, val in update.items():\n if isinstance(into.get(key), dict) and isinstance(val, dict):\n _merge(into[key], val)\n else:\n into[key] = val\n\n\ndef _lower_keys(data):\n return {\n k.lower(): _lower_keys(v) if isinstance(v, dict) else v\n for k, v in data.items()\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__Draws_DAG_in_ASCII__make_pager.return.pager": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__Draws_DAG_in_ASCII__make_pager.return.pager", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["make_pager", "docstring"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Draws DAG in ASCII.\"\"\"\n\nimport logging\nimport math\nimport os\nimport pydoc\nimport sys\n\nfrom grandalf.graphs import Edge\nfrom grandalf.graphs import Graph\nfrom grandalf.graphs import Vertex\nfrom grandalf.layouts import SugiyamaLayout\nfrom grandalf.routing import EdgeViewer\nfrom grandalf.routing import route_with_lines\n\nfrom dvc.env import DVC_PAGER\nfrom dvc.utils import format_link\n\nlogger = logging.getLogger(__name__)\n\n\nDEFAULT_PAGER = \"less\"\nDEFAULT_PAGER_FORMATTED = \"{} --chop-long-lines --clear-screen\".format(\n DEFAULT_PAGER\n)\n\n\ndef make_pager(cmd):\n def pager(text):\n return pydoc.tempfilepager(pydoc.plain(text), cmd)\n\n return pager", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_find_pager_find_pager.return.pydoc_plainpager": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_find_pager_find_pager.return.pydoc_plainpager", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 52, "span_ids": ["find_pager"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_pager():\n if not sys.stdout.isatty():\n return pydoc.plainpager\n\n env_pager = os.getenv(DVC_PAGER)\n if env_pager:\n return make_pager(env_pager)\n\n if os.system(\"({}) 2>{}\".format(DEFAULT_PAGER, os.devnull)) == 0:\n return make_pager(DEFAULT_PAGER_FORMATTED)\n\n logger.warning(\n \"Unable to find `less` in the PATH. Check out \"\n \"{} for more info.\".format(\n format_link(\"https://man.dvc.org/pipeline/show\")\n )\n )\n return pydoc.plainpager", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_VertexViewer_VertexViewer.w.return.self__w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_VertexViewer_VertexViewer.w.return.self__w", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 78, "span_ids": ["VertexViewer.__init__", "VertexViewer.w", "VertexViewer.h", "VertexViewer"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VertexViewer(object):\n \"\"\"Class to define vertex box boundaries that will be accounted for during\n graph building by grandalf.\n\n Args:\n name (str): name of the vertex.\n \"\"\"\n\n HEIGHT = 3 # top and bottom box edges + text\n\n def __init__(self, name):\n # pylint: disable=invalid-name\n self._h = self.HEIGHT # top and bottom box edges + text\n self._w = len(name) + 2 # right and left bottom edges + text\n\n @property\n def h(self): # pylint: disable=invalid-name\n \"\"\"Height of the box.\"\"\"\n return self._h\n\n @property\n def w(self): # pylint: disable=invalid-name\n \"\"\"Width of the box.\"\"\"\n return self._w", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas_AsciiCanvas.draw.pager_joined_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas_AsciiCanvas.draw.pager_joined_lines_", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 105, "span_ids": ["AsciiCanvas", "AsciiCanvas.__init__", "AsciiCanvas.draw"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AsciiCanvas(object):\n \"\"\"Class for drawing in ASCII.\n\n Args:\n cols (int): number of columns in the canvas. Should be > 1.\n lines (int): number of lines in the canvas. Should be > 1.\n \"\"\"\n\n TIMEOUT = 10\n\n def __init__(self, cols, lines):\n assert cols > 1\n assert lines > 1\n\n self.cols = cols\n self.lines = lines\n\n self.canvas = [[\" \"] * cols for line in range(lines)]\n\n def draw(self):\n \"\"\"Draws ASCII canvas on the screen.\"\"\"\n pager = find_pager()\n lines = map(\"\".join, self.canvas)\n joined_lines = os.linesep.join(lines)\n pager(joined_lines)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py__Manages_dvc_remotes_th_DataCloud.get_remote.raise_NoRemoteError_error": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py__Manages_dvc_remotes_th_DataCloud.get_remote.raise_NoRemoteError_error", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 46, "span_ids": ["DataCloud.get_remote", "DataCloud.__init__", "DataCloud", "docstring"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages dvc remotes that user can use with push/pull/status commands.\"\"\"\n\nimport logging\n\nfrom dvc.config import NoRemoteError\nfrom dvc.remote import Remote\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass DataCloud(object):\n \"\"\"Class that manages dvc remotes.\n\n Args:\n repo (dvc.repo.Repo): repo instance that belongs to the repo that\n we are working on.\n\n Raises:\n config.ConfigError: thrown when config has invalid format.\n \"\"\"\n\n def __init__(self, repo):\n self.repo = repo\n\n def get_remote(self, remote=None, command=\"\"):\n if not remote:\n remote = self.repo.config[\"core\"].get(\"remote\")\n\n if remote:\n return self._init_remote(remote)\n\n if bool(self.repo.config[\"remote\"]):\n error_msg = (\n \"no remote specified. Setup default remote with\\n\"\n \" dvc remote default \\n\"\n \"or use:\\n\"\n \" dvc {} -r \".format(command)\n )\n else:\n error_msg = (\n \"no remote specified. Create a default remote with\\n\"\n \" dvc remote add -d \"\n )\n\n raise NoRemoteError(error_msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_remote_DataCloud.push.return.self_repo_cache_local_pus": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_remote_DataCloud.push.return.self_repo_cache_local_pus", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 67, "span_ids": ["DataCloud.push", "DataCloud._init_remote"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataCloud(object):\n\n def _init_remote(self, remote):\n return Remote(self.repo, name=remote)\n\n def push(self, cache, jobs=None, remote=None, show_checksums=False):\n \"\"\"Push data items in a cloud-agnostic way.\n\n Args:\n cache (NamedCache): named checksums to push to the cloud.\n jobs (int): number of jobs that can be running simultaneously.\n remote (dvc.remote.base.RemoteBASE): optional remote to push to.\n By default remote from core.remote config option is used.\n show_checksums (bool): show checksums instead of file names in\n information messages.\n \"\"\"\n return self.repo.cache.local.push(\n cache,\n jobs=jobs,\n remote=self.get_remote(remote, \"push\"),\n show_checksums=show_checksums,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.pull_DataCloud.pull.return.downloaded_items_num": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.pull_DataCloud.pull.return.downloaded_items_num", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 88, "span_ids": ["DataCloud.pull"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataCloud(object):\n\n def pull(self, cache, jobs=None, remote=None, show_checksums=False):\n \"\"\"Pull data items in a cloud-agnostic way.\n\n Args:\n cache (NamedCache): named checksums to pull from the cloud.\n jobs (int): number of jobs that can be running simultaneously.\n remote (dvc.remote.base.RemoteBASE): optional remote to pull from.\n By default remote from core.remote config option is used.\n show_checksums (bool): show checksums instead of file names in\n information messages.\n \"\"\"\n remote = self.get_remote(remote, \"pull\")\n downloaded_items_num = self.repo.cache.local.pull(\n cache, jobs=jobs, remote=remote, show_checksums=show_checksums\n )\n\n if not remote.verify:\n self._save_pulled_checksums(cache)\n\n return downloaded_items_num", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/base.py_from_dvc_exceptions_impor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/base.py_from_dvc_exceptions_impor_", "embedding": null, "metadata": {"file_path": "dvc/dependency/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["DependencyBase", "DependencyDoesNotExistError", "DependencyDoesNotExistError.__init__", "DependencyIsNotFileOrDirError", "imports", "DependencyIsStageFileError.__init__", "DependencyBase.update", "DependencyIsStageFileError", "DependencyIsNotFileOrDirError.__init__"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.exceptions import DvcException\n\n\nclass DependencyDoesNotExistError(DvcException):\n def __init__(self, path):\n msg = \"dependency '{}' does not exist\".format(path)\n super().__init__(msg)\n\n\nclass DependencyIsNotFileOrDirError(DvcException):\n def __init__(self, path):\n msg = \"dependency '{}' is not a file or directory\".format(path)\n super().__init__(msg)\n\n\nclass DependencyIsStageFileError(DvcException):\n def __init__(self, path):\n super().__init__(\n \"Stage file '{}' cannot be a dependency.\".format(path)\n )\n\n\nclass DependencyBase(object):\n IS_DEPENDENCY = True\n\n DoesNotExistError = DependencyDoesNotExistError\n IsNotFileOrDirError = DependencyIsNotFileOrDirError\n IsStageFileError = DependencyIsStageFileError\n\n def update(self, rev=None):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_os_", "embedding": null, "metadata": {"file_path": "dvc/dependency/repo.py", "file_name": "repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 91, "span_ids": ["DependencyREPO.update", "DependencyREPO", "DependencyREPO._parse_path", "DependencyREPO._get_checksum", "DependencyREPO.dumpd", "imports", "DependencyREPO.download", "DependencyREPO.save", "DependencyREPO.is_in_repo", "DependencyREPO._make_repo", "DependencyREPO.__str__", "DependencyREPO.status", "DependencyREPO.__init__", "DependencyREPO.repo_pair"], "tokens": 610}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom voluptuous import Required\n\nfrom .local import DependencyLOCAL\nfrom dvc.exceptions import OutputNotFoundError\nfrom dvc.path_info import PathInfo\n\n\nclass DependencyREPO(DependencyLOCAL):\n PARAM_REPO = \"repo\"\n PARAM_URL = \"url\"\n PARAM_REV = \"rev\"\n PARAM_REV_LOCK = \"rev_lock\"\n\n REPO_SCHEMA = {\n PARAM_REPO: {\n Required(PARAM_URL): str,\n PARAM_REV: str,\n PARAM_REV_LOCK: str,\n }\n }\n\n def __init__(self, def_repo, stage, *args, **kwargs):\n self.def_repo = def_repo\n super().__init__(stage, *args, **kwargs)\n\n def _parse_path(self, remote, path):\n return None\n\n @property\n def is_in_repo(self):\n return False\n\n @property\n def repo_pair(self):\n d = self.def_repo\n rev = d.get(self.PARAM_REV_LOCK) or d.get(self.PARAM_REV)\n return d[self.PARAM_URL], rev\n\n def __str__(self):\n return \"{} ({})\".format(self.def_path, self.def_repo[self.PARAM_URL])\n\n def _make_repo(self, *, locked=True):\n from dvc.external_repo import external_repo\n\n d = self.def_repo\n rev = (d.get(\"rev_lock\") if locked else None) or d.get(\"rev\")\n return external_repo(d[\"url\"], rev=rev)\n\n def _get_checksum(self, locked=True):\n with self._make_repo(locked=locked) as repo:\n try:\n return repo.find_out_by_relpath(self.def_path).info[\"md5\"]\n except OutputNotFoundError:\n path = PathInfo(os.path.join(repo.root_dir, self.def_path))\n # We are polluting our repo cache with some dir listing here\n return self.repo.cache.local.get_checksum(path)\n\n def status(self):\n current_checksum = self._get_checksum(locked=True)\n updated_checksum = self._get_checksum(locked=False)\n\n if current_checksum != updated_checksum:\n return {str(self): \"update available\"}\n\n return {}\n\n def save(self):\n pass\n\n def dumpd(self):\n return {self.PARAM_PATH: self.def_path, self.PARAM_REPO: self.def_repo}\n\n def download(self, to):\n with self._make_repo() as repo:\n if self.def_repo.get(self.PARAM_REV_LOCK) is None:\n self.def_repo[self.PARAM_REV_LOCK] = repo.scm.get_rev()\n\n if hasattr(repo, \"cache\"):\n repo.cache.local.cache_dir = self.repo.cache.local.cache_dir\n\n repo.pull_to(self.def_path, to.path_info)\n\n def update(self, rev=None):\n if rev:\n self.def_repo[self.PARAM_REV] = rev\n\n with self._make_repo(locked=False) as repo:\n self.def_repo[self.PARAM_REV_LOCK] = repo.scm.get_rev()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py__Exceptions_raised_by_t_OutputDuplicationError.__init__.super___init___msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py__Exceptions_raised_by_t_OutputDuplicationError.__init__.super___init___msg_", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["OutputDuplicationError", "InvalidArgumentError", "OutputDuplicationError.__init__", "DvcException", "docstring"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Exceptions raised by the dvc.\"\"\"\n\nfrom dvc.utils import relpath, format_link\n\n\nclass DvcException(Exception):\n \"\"\"Base class for all dvc exceptions.\"\"\"\n\n\nclass InvalidArgumentError(ValueError, DvcException):\n \"\"\"Thrown if arguments are invalid.\"\"\"\n\n\nclass OutputDuplicationError(DvcException):\n \"\"\"Thrown if a file/directory is specified as an output in more than one\n stage.\n\n Args:\n output (unicode): path to the file/directory.\n stages (list): list of paths to stages.\n \"\"\"\n\n def __init__(self, output, stages):\n assert isinstance(output, str)\n assert all(hasattr(stage, \"relpath\") for stage in stages)\n msg = (\n \"file/directory '{}' is specified as an output in more than one \"\n \"stage: {}\\n\"\n \"This is not allowed. Consider using a different output name.\"\n ).format(output, \"\\n \".join(s.relpath for s in stages))\n super().__init__(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OutputNotFoundError_StagePathAsOutputError.__init__.super___init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OutputNotFoundError_StagePathAsOutputError.__init__.super___init___", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 66, "span_ids": ["StagePathAsOutputError.__init__", "StagePathAsOutputError", "OutputNotFoundError", "OutputNotFoundError.__init__"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputNotFoundError(DvcException):\n \"\"\"Thrown if a file/directory not found in repository pipelines.\n\n Args:\n output (unicode): path to the file/directory.\n \"\"\"\n\n def __init__(self, output, repo=None):\n self.output = output\n self.repo = repo\n super().__init__(\n \"Unable to find DVC-file with output '{path}'\".format(\n path=relpath(self.output)\n )\n )\n\n\nclass StagePathAsOutputError(DvcException):\n \"\"\"Thrown if directory that stage is going to be saved in is specified as\n an output of another stage.\n\n Args:\n stage (Stage): a stage that is in some other stages output\n output (str): an output covering the stage above\n \"\"\"\n\n def __init__(self, stage, output):\n assert isinstance(output, str)\n super().__init__(\n \"'{stage}' is within an output '{output}' of another stage\".format(\n stage=stage.relpath, output=output\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_CircularDependencyError_ArgumentDuplicationError.__init__.super___init___file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_CircularDependencyError_ArgumentDuplicationError.__init__.super___init___file_", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 97, "span_ids": ["ArgumentDuplicationError", "ArgumentDuplicationError.__init__", "CircularDependencyError", "CircularDependencyError.__init__"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CircularDependencyError(DvcException):\n \"\"\"Thrown if a file/directory specified both as an output and as a\n dependency.\n\n Args:\n dependency (str): path to the dependency.\n \"\"\"\n\n def __init__(self, dependency):\n assert isinstance(dependency, str)\n\n msg = (\n \"file/directory '{}' is specified as an output and as a \"\n \"dependency.\"\n )\n super().__init__(msg.format(dependency))\n\n\nclass ArgumentDuplicationError(DvcException):\n \"\"\"Thrown if a file/directory is specified as a dependency/output more\n than once.\n\n Args:\n path (str): path to the file/directory.\n \"\"\"\n\n def __init__(self, path):\n assert isinstance(path, str)\n super().__init__(\"file '{}' is specified more than once.\".format(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_MoveNotDataSourceError_MoveNotDataSourceError.__init__.super___init___msg_form": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_MoveNotDataSourceError_MoveNotDataSourceError.__init__.super___init___msg_form", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 115, "span_ids": ["MoveNotDataSourceError", "MoveNotDataSourceError.__init__"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MoveNotDataSourceError(DvcException):\n \"\"\"Thrown if attempted to move a file/directory that is not an output\n in a data source stage.\n\n Args:\n path (str): path to the file/directory.\n \"\"\"\n\n def __init__(self, path):\n msg = (\n \"move is not permitted for stages that are not data sources. \"\n \"You need to either move '{path}' to a new location and edit \"\n \"it by hand, or remove '{path}' and create a new one at the \"\n \"desired location.\"\n )\n super().__init__(msg.format(path=path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_GitHookAlreadyExistsError.__init__.super___init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_GitHookAlreadyExistsError.__init__.super___init___", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 118, "end_line": 237, "span_ids": ["FileMissingError.__init__", "GitHookAlreadyExistsError", "DvcIgnoreInCollectedDirError.__init__", "ETagMismatchError.__init__", "BadMetricError", "FileMissingError", "ConfirmRemoveError", "DvcIgnoreInCollectedDirError", "RecursiveAddingWhileUsingFilename.__init__", "NotDvcRepoError", "ETagMismatchError", "RecursiveAddingWhileUsingFilename", "CyclicGraphError", "ConfirmRemoveError.__init__", "StageFileCorruptedError.__init__", "InitError", "StageFileCorruptedError", "DvcParserError.__init__", "ReproductionError.__init__", "CheckoutErrorSuggestGit.__init__", "OverlappingOutputPathsError.__init__", "OverlappingOutputPathsError", "BadMetricError.__init__", "NoMetricsError.__init__", "CheckoutErrorSuggestGit", "GitHookAlreadyExistsError.__init__", "DvcParserError", "CyclicGraphError.__init__", "NoMetricsError", "ReproductionError"], "tokens": 780}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NotDvcRepoError(DvcException):\n \"\"\"Thrown if a directory is not a DVC repo\"\"\"\n\n\nclass DvcParserError(DvcException):\n \"\"\"Base class for CLI parser errors.\"\"\"\n\n def __init__(self):\n super().__init__(\"parser error\")\n\n\nclass CyclicGraphError(DvcException):\n def __init__(self, stages):\n assert isinstance(stages, list)\n stages = \"\\n\".join(\"\\t- {}\".format(stage.relpath) for stage in stages)\n msg = (\n \"you've introduced a cycle in your pipeline that involves \"\n \"the following stages:\"\n \"\\n\"\n \"{stages}\".format(stages=stages)\n )\n super().__init__(msg)\n\n\nclass ConfirmRemoveError(DvcException):\n def __init__(self, path):\n super().__init__(\n \"unable to remove '{}' without a confirmation from the user. Use \"\n \"`-f` to force.\".format(path)\n )\n\n\nclass InitError(DvcException):\n pass\n\n\nclass ReproductionError(DvcException):\n def __init__(self, dvc_file_name):\n self.path = dvc_file_name\n super().__init__(\"failed to reproduce '{}'\".format(dvc_file_name))\n\n\nclass BadMetricError(DvcException):\n def __init__(self, paths):\n super().__init__(\n \"the following metrics do not exist, \"\n \"are not metric files or are malformed: {paths}\".format(\n paths=\", \".join(\"'{}'\".format(path) for path in paths)\n )\n )\n\n\nclass NoMetricsError(DvcException):\n def __init__(self):\n super().__init__(\n \"no metric files in this repository. \"\n \"Use `dvc metrics add` to add a metric file to track.\"\n )\n\n\nclass StageFileCorruptedError(DvcException):\n def __init__(self, path):\n path = relpath(path)\n super().__init__(\n \"unable to read DVC-file: {} \"\n \"YAML file structure is corrupted\".format(path)\n )\n\n\nclass RecursiveAddingWhileUsingFilename(DvcException):\n def __init__(self):\n super().__init__(\n \"cannot use `fname` with multiple targets or `-R|--recursive`\"\n )\n\n\nclass OverlappingOutputPathsError(DvcException):\n def __init__(self, parent, overlapping_out, message):\n self.parent = parent\n self.overlapping_out = overlapping_out\n super().__init__(message)\n\n\nclass CheckoutErrorSuggestGit(DvcException):\n def __init__(self, target):\n super().__init__(\"Did you mean `git checkout {}`?\".format(target))\n\n\nclass ETagMismatchError(DvcException):\n def __init__(self, etag, cached_etag):\n super().__init__(\n \"ETag mismatch detected when copying file to cache! \"\n \"(expected: '{}', actual: '{}')\".format(etag, cached_etag)\n )\n\n\nclass FileMissingError(DvcException):\n def __init__(self, path):\n self.path = path\n super().__init__(\n \"Can't find '{}' neither locally nor on remote\".format(path)\n )\n\n\nclass DvcIgnoreInCollectedDirError(DvcException):\n def __init__(self, ignore_dirname):\n super().__init__(\n \".dvcignore file should not be in collected dir path: \"\n \"'{}'\".format(ignore_dirname)\n )\n\n\nclass GitHookAlreadyExistsError(DvcException):\n def __init__(self, hook_name):\n super().__init__(\n \"Hook '{}' already exists. Please refer to {} for more \"\n \"info.\".format(\n hook_name, format_link(\"https://man.dvc.org/install\")\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_DownloadError_HTTPError.__init__.super___init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_DownloadError_HTTPError.__init__.super___init___", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 240, "end_line": 292, "span_ids": ["NoOutputInExternalRepoError", "HTTPError.__init__", "DownloadError.__init__", "UploadError", "NoRemoteInExternalRepoError.__init__", "DownloadError", "UploadError.__init__", "CheckoutError.__init__", "NoRemoteInExternalRepoError", "NoOutputInExternalRepoError.__init__", "CollectCacheError", "HTTPError", "CheckoutError"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DownloadError(DvcException):\n def __init__(self, amount):\n self.amount = amount\n\n super().__init__(\n \"{amount} files failed to download\".format(amount=amount)\n )\n\n\nclass UploadError(DvcException):\n def __init__(self, amount):\n self.amount = amount\n\n super().__init__(\n \"{amount} files failed to upload\".format(amount=amount)\n )\n\n\nclass CheckoutError(DvcException):\n def __init__(self, target_infos, stats=None):\n self.target_infos = target_infos\n self.stats = stats\n targets = [str(t) for t in target_infos]\n m = (\n \"Checkout failed for following targets:\\n{}\\nDid you \"\n \"forget to fetch?\".format(\"\\n\".join(targets))\n )\n super().__init__(m)\n\n\nclass CollectCacheError(DvcException):\n pass\n\n\nclass NoRemoteInExternalRepoError(DvcException):\n def __init__(self, url):\n super().__init__(\n \"No DVC remote is specified in target repository '{}'.\".format(url)\n )\n\n\nclass NoOutputInExternalRepoError(DvcException):\n def __init__(self, path, external_repo_path, external_repo_url):\n super().__init__(\n \"Output '{}' not found in target repository '{}'\".format(\n relpath(path, external_repo_path), external_repo_url\n )\n )\n\n\nclass HTTPError(DvcException):\n def __init__(self, code, reason):\n super().__init__(\"'{} {}'\".format(code, reason))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_PathMissingError_PathMissingError.__init__.self.output_only.output_only": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_PathMissingError_PathMissingError.__init__.self.output_only.output_only", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 295, "end_line": 312, "span_ids": ["PathMissingError", "PathMissingError.__init__"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PathMissingError(DvcException):\n default_msg = (\n \"The path '{}' does not exist in the target repository '{}'\"\n \" neither as a DVC output nor as a Git-tracked file.\"\n )\n default_msg_output_only = (\n \"The path '{}' does not exist in the target repository '{}'\"\n \" as an DVC output.\"\n )\n\n def __init__(self, path, repo, output_only=False):\n msg = (\n self.default_msg\n if not output_only\n else self.default_msg_output_only\n )\n super().__init__(msg.format(path, repo))\n self.output_only = output_only", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_RemoteCacheRequiredError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_RemoteCacheRequiredError_", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 315, "end_line": 332, "span_ids": ["IsADirectoryError", "RemoteCacheRequiredError.__init__", "RemoteCacheRequiredError"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteCacheRequiredError(DvcException):\n def __init__(self, path_info):\n super().__init__(\n (\n \"Current operation was unsuccessful because '{}' requires \"\n \"existing cache on '{}' remote. See {} for information on how \"\n \"to set up remote cache.\"\n ).format(\n path_info,\n path_info.scheme,\n format_link(\"https://man.dvc.org/config#cache\"),\n )\n )\n\n\nclass IsADirectoryError(DvcException):\n \"\"\"Raised when a file operation is requested on a directory.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_logging_logger.logging_getLogger___name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_logging_logger.logging_getLogger___name_", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\nimport tempfile\nfrom contextlib import contextmanager\nfrom distutils.dir_util import copy_tree\nimport threading\n\nfrom funcy import retry, suppress, wrap_with, cached_property\n\nfrom dvc.path_info import PathInfo\nfrom dvc.compat import fspath\nfrom dvc.repo import Repo\nfrom dvc.config import NoRemoteError, NotDvcRepoError\nfrom dvc.exceptions import NoRemoteInExternalRepoError, CheckoutError\nfrom dvc.exceptions import OutputNotFoundError, NoOutputInExternalRepoError\nfrom dvc.exceptions import FileMissingError, PathMissingError\nfrom dvc.utils.fs import remove, fs_copy, move\nfrom dvc.utils import tmp_fname\nfrom dvc.scm.git import Git\n\n\nlogger = logging.getLogger(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_external_repo_clean_repos.for_path_in_paths_._remove_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_external_repo_clean_repos.for_path_in_paths_._remove_path_", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 61, "span_ids": ["clean_repos", "impl:3", "external_repo"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextmanager\ndef external_repo(url, rev=None, for_write=False):\n logger.debug(\"Creating external repo %s@%s\", url, rev)\n path = _cached_clone(url, rev, for_write=for_write)\n try:\n repo = ExternalRepo(path, url)\n except NotDvcRepoError:\n repo = ExternalGitRepo(path, url)\n\n try:\n yield repo\n except NoRemoteError:\n raise NoRemoteInExternalRepoError(url)\n except OutputNotFoundError as exc:\n if exc.repo is repo:\n raise NoOutputInExternalRepoError(exc.output, repo.root_dir, url)\n raise\n except FileMissingError as exc:\n raise PathMissingError(exc.path, url)\n finally:\n repo.close()\n if for_write:\n _remove(path)\n\n\nCLONES = {}\nCACHE_DIRS = {}\n\n\ndef clean_repos():\n # Outside code should not see cache while we are removing\n paths = list(CLONES.values()) + list(CACHE_DIRS.values())\n CLONES.clear()\n CACHE_DIRS.clear()\n\n for path in paths:\n _remove(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo_ExternalRepo.pull_to.try_.except_FileNotFoundError_.raise_PathMissingError_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo_ExternalRepo.pull_to.try_.except_FileNotFoundError_.raise_PathMissingError_pa", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 96, "span_ids": ["ExternalRepo.pull_to", "ExternalRepo", "ExternalRepo.__init__"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExternalRepo(Repo):\n def __init__(self, root_dir, url):\n super().__init__(root_dir)\n self.url = url\n self._set_cache_dir()\n self._fix_upstream()\n\n def pull_to(self, path, to_info):\n \"\"\"\n Pull the corresponding file or directory specified by `path` and\n checkout it into `to_info`.\n\n It works with files tracked by Git and DVC, and also local files\n outside the repository.\n \"\"\"\n out = None\n path_info = PathInfo(self.root_dir) / path\n\n with suppress(OutputNotFoundError):\n (out,) = self.find_outs_by_path(fspath(path_info), strict=False)\n\n try:\n if out and out.use_cache:\n self._pull_cached(out, path_info, to_info)\n return\n\n # Check if it is handled by Git (it can't have an absolute path)\n if os.path.isabs(path):\n raise FileNotFoundError\n\n fs_copy(fspath(path_info), fspath(to_info))\n except FileNotFoundError:\n raise PathMissingError(path, self.url)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._pull_cached_ExternalRepo._set_cache_dir.self.cache.local.cache_dir.cache_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._pull_cached_ExternalRepo._set_cache_dir.self.cache.local.cache_dir.cache_dir", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 124, "span_ids": ["ExternalRepo._set_cache_dir", "ExternalRepo._pull_cached"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExternalRepo(Repo):\n\n def _pull_cached(self, out, path_info, dest):\n with self.state:\n tmp = PathInfo(tmp_fname(dest))\n src = tmp / path_info.relative_to(out.path_info)\n\n out.path_info = tmp\n\n # Only pull unless all needed cache is present\n if out.changed_cache(filter_info=src):\n self.cloud.pull(out.get_used_cache(filter_info=src))\n\n try:\n out.checkout(filter_info=src)\n except CheckoutError:\n raise FileNotFoundError\n\n move(src, dest)\n remove(tmp)\n\n @wrap_with(threading.Lock())\n def _set_cache_dir(self):\n try:\n cache_dir = CACHE_DIRS[self.url]\n except KeyError:\n cache_dir = CACHE_DIRS[self.url] = tempfile.mkdtemp(\"dvc-cache\")\n\n self.cache.local.cache_dir = cache_dir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._fix_upstream_ExternalRepo._fix_upstream.None_1.finally_.src_repo_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._fix_upstream_ExternalRepo._fix_upstream.None_1.finally_.src_repo_close_", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 146, "span_ids": ["ExternalRepo._fix_upstream"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExternalRepo(Repo):\n\n def _fix_upstream(self):\n if not os.path.isdir(self.url):\n return\n\n try:\n src_repo = Repo(self.url)\n except NotDvcRepoError:\n # If ExternalRepo does not throw NotDvcRepoError and Repo does,\n # the self.url might be a bare git repo.\n # NOTE: This will fail to resolve remote with relative path,\n # same as if it was a remote DVC repo.\n return\n\n try:\n remote_name = self.config[\"core\"].get(\"remote\")\n if remote_name:\n self._fix_local_remote(src_repo, remote_name)\n else:\n self._add_upstream(src_repo)\n finally:\n src_repo.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._fix_local_remote_ExternalRepo._add_upstream.self_config_core_remo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo._fix_local_remote_ExternalRepo._add_upstream.self_config_core_remo", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 162, "span_ids": ["ExternalRepo._add_upstream", "ExternalRepo._fix_local_remote"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExternalRepo(Repo):\n\n def _fix_local_remote(self, src_repo, remote_name):\n # If a remote URL is relative to the source repo,\n # it will have changed upon config load and made\n # relative to this new repo. Restore the old one here.\n new_remote = self.config[\"remote\"][remote_name]\n old_remote = src_repo.config[\"remote\"][remote_name]\n if new_remote[\"url\"] != old_remote[\"url\"]:\n new_remote[\"url\"] = old_remote[\"url\"]\n\n def _add_upstream(self, src_repo):\n # Fill the empty upstream entry with a new remote pointing to the\n # original repo's cache location.\n cache_dir = src_repo.cache.local.cache_dir\n self.config[\"remote\"][\"auto-generated-upstream\"] = {\"url\": cache_dir}\n self.config[\"core\"][\"remote\"] = \"auto-generated-upstream\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalGitRepo_ExternalGitRepo.open_by_relpath.try_.except_FileNotFoundError_.raise_PathMissingError_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalGitRepo_ExternalGitRepo.open_by_relpath.try_.except_FileNotFoundError_.raise_PathMissingError_pa", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 199, "span_ids": ["ExternalGitRepo.open_by_relpath", "ExternalGitRepo", "ExternalGitRepo.pull_to", "ExternalGitRepo.__init__", "ExternalGitRepo.find_out_by_relpath", "ExternalGitRepo.close", "ExternalGitRepo.scm"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExternalGitRepo:\n def __init__(self, root_dir, url):\n self.root_dir = root_dir\n self.url = url\n\n @cached_property\n def scm(self):\n return Git(self.root_dir)\n\n def close(self):\n if \"scm\" in self.__dict__:\n self.scm.close()\n\n def find_out_by_relpath(self, path):\n raise OutputNotFoundError(path, self)\n\n def pull_to(self, path, to_info):\n try:\n # Git handled files can't have absolute path\n if os.path.isabs(path):\n raise FileNotFoundError\n\n fs_copy(os.path.join(self.root_dir, path), fspath(to_info))\n except FileNotFoundError:\n raise PathMissingError(path, self.url)\n\n @contextmanager\n def open_by_relpath(self, path, mode=\"r\", encoding=None, **kwargs):\n \"\"\"Opens a specified resource as a file object.\"\"\"\n try:\n abs_path = os.path.join(self.root_dir, path)\n with open(abs_path, mode, encoding=encoding) as fd:\n yield fd\n except FileNotFoundError:\n raise PathMissingError(path, self.url)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__cached_clone__cached_clone.return.repo_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__cached_clone__cached_clone.return.repo_path", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 229, "span_ids": ["_cached_clone"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _cached_clone(url, rev, for_write=False):\n \"\"\"Clone an external git repo to a temporary directory.\n\n Returns the path to a local temporary directory with the specified\n revision checked out. If for_write is set prevents reusing this dir via\n cache.\n \"\"\"\n if not for_write and Git.is_sha(rev) and (url, rev) in CLONES:\n return CLONES[url, rev]\n\n clone_path = _clone_default_branch(url, rev)\n rev_sha = Git(clone_path).resolve_rev(rev or \"HEAD\")\n\n if not for_write and (url, rev_sha) in CLONES:\n return CLONES[url, rev_sha]\n\n # Copy to a new dir to keep the clone clean\n repo_path = tempfile.mkdtemp(\"dvc-erepo\")\n logger.debug(\"erepo: making a copy of %s clone\", url)\n copy_tree(clone_path, repo_path)\n\n # Check out the specified revision\n if rev is not None:\n _git_checkout(repo_path, rev)\n\n if not for_write:\n CLONES[url, rev_sha] = repo_path\n return repo_path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__clone_default_branch__clone_default_branch.return.clone_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__clone_default_branch__clone_default_branch.return.clone_path", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 232, "end_line": 257, "span_ids": ["_clone_default_branch"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@wrap_with(threading.Lock())\ndef _clone_default_branch(url, rev):\n \"\"\"Get or create a clean clone of the url.\n\n The cloned is reactualized with git pull unless rev is a known sha.\n \"\"\"\n clone_path = CLONES.get(url)\n\n git = None\n try:\n if clone_path:\n git = Git(clone_path)\n # Do not pull for known shas, branches and tags might move\n if not Git.is_sha(rev) or not git.has_rev(rev):\n logger.debug(\"erepo: git pull %s\", url)\n git.pull()\n else:\n logger.debug(\"erepo: git clone %s to a temporary dir\", url)\n clone_path = tempfile.mkdtemp(\"dvc-clone\")\n git = Git.clone(url, clone_path)\n CLONES[url] = clone_path\n finally:\n if git:\n git.close()\n\n return clone_path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__git_checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__git_checkout_", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 260, "end_line": 276, "span_ids": ["_git_checkout", "_remove"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _git_checkout(repo_path, rev):\n logger.debug(\"erepo: git checkout %s@%s\", repo_path, rev)\n git = Git(repo_path)\n try:\n git.checkout(rev)\n finally:\n git.close()\n\n\ndef _remove(path):\n if os.name == \"nt\":\n # git.exe may hang for a while not permitting to remove temp dir\n os_retry = retry(5, errors=OSError, timeout=0.1)\n os_retry(remove)(path)\n else:\n remove(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_logging_DvcIgnorePatterns.__eq__.return.self_ignore_file_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_logging_DvcIgnorePatterns.__eq__.return.self_ignore_file_path_", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 52, "span_ids": ["DvcIgnorePatterns.matches", "DvcIgnorePatterns.__call__", "DvcIgnorePatterns", "imports", "DvcIgnorePatterns.__eq__", "DvcIgnore", "DvcIgnorePatterns.__init__", "DvcIgnore.__call__", "DvcIgnorePatterns.__hash__"], "tokens": 345}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nfrom funcy import cached_property\nfrom pathspec import PathSpec\nfrom pathspec.patterns import GitWildMatchPattern\n\nfrom dvc.scm.tree import BaseTree\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\n\n\nclass DvcIgnore(object):\n DVCIGNORE_FILE = \".dvcignore\"\n\n def __call__(self, root, dirs, files):\n raise NotImplementedError\n\n\nclass DvcIgnorePatterns(DvcIgnore):\n def __init__(self, ignore_file_path, tree):\n assert os.path.isabs(ignore_file_path)\n\n self.ignore_file_path = ignore_file_path\n self.dirname = os.path.normpath(os.path.dirname(ignore_file_path))\n\n with tree.open(ignore_file_path, encoding=\"utf-8\") as fobj:\n self.ignore_spec = PathSpec.from_lines(GitWildMatchPattern, fobj)\n\n def __call__(self, root, dirs, files):\n files = [f for f in files if not self.matches(root, f)]\n dirs = [d for d in dirs if not self.matches(root, d)]\n\n return dirs, files\n\n def matches(self, dirname, basename):\n abs_path = os.path.join(dirname, basename)\n rel_path = relpath(abs_path, self.dirname)\n\n if os.pardir + os.sep in rel_path:\n return False\n return self.ignore_spec.match_file(rel_path)\n\n def __hash__(self):\n return hash(self.ignore_file_path)\n\n def __eq__(self, other):\n if not isinstance(other, DvcIgnorePatterns):\n return NotImplemented\n\n return self.ignore_file_path == other.ignore_file_path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreDirs_DvcIgnoreRepo.__call__.return.dirs_files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreDirs_DvcIgnoreRepo.__call__.return.dirs_files", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 83, "span_ids": ["DvcIgnoreDirs.__init__", "DvcIgnoreRepo", "DvcIgnoreDirs.__hash__", "DvcIgnoreDirs.__call__", "DvcIgnoreRepo.__call__", "DvcIgnoreDirs.__eq__", "DvcIgnoreDirs"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DvcIgnoreDirs(DvcIgnore):\n def __init__(self, basenames):\n self.basenames = set(basenames)\n\n def __call__(self, root, dirs, files):\n dirs = [d for d in dirs if d not in self.basenames]\n\n return dirs, files\n\n def __hash__(self):\n return hash(tuple(self.basenames))\n\n def __eq__(self, other):\n if not isinstance(other, DvcIgnoreDirs):\n return NotImplemented\n\n return self.basenames == other.basenames\n\n\nclass DvcIgnoreRepo(DvcIgnore):\n def __call__(self, root, dirs, files):\n def is_dvc_repo(directory):\n from dvc.repo import Repo\n\n return os.path.isdir(os.path.join(directory, Repo.DVC_DIR))\n\n dirs = [d for d in dirs if not is_dvc_repo(d)]\n\n return dirs, files", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreFilter_DvcIgnoreFilter.__call__.return.dirs_files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreFilter_DvcIgnoreFilter.__call__.return.dirs_files", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 106, "span_ids": ["DvcIgnoreFilter.__call__", "DvcIgnoreFilter", "DvcIgnoreFilter._update", "DvcIgnoreFilter.__init__"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DvcIgnoreFilter(object):\n def __init__(self, tree):\n self.tree = tree\n self.ignores = {\n DvcIgnoreDirs([\".git\", \".hg\", \".dvc\"]),\n DvcIgnoreRepo(),\n }\n for root, dirs, files in self.tree.walk(self.tree.tree_root):\n self._update(root)\n dirs[:], files[:] = self(root, dirs, files)\n\n def _update(self, dirname):\n ignore_file_path = os.path.join(dirname, DvcIgnore.DVCIGNORE_FILE)\n if self.tree.exists(ignore_file_path):\n self.ignores.add(DvcIgnorePatterns(ignore_file_path, self.tree))\n\n def __call__(self, root, dirs, files):\n for ignore in self.ignores:\n dirs, files = ignore(root, dirs, files)\n\n return dirs, files", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree_", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 146, "span_ids": ["CleanTree.exists", "CleanTree", "CleanTree.walk_files", "CleanTree.isfile", "CleanTree.tree_root", "CleanTree.walk", "CleanTree.dvcignore", "CleanTree.isexec", "CleanTree.open", "CleanTree.isdir", "CleanTree.__init__"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CleanTree(BaseTree):\n def __init__(self, tree):\n self.tree = tree\n\n @cached_property\n def dvcignore(self):\n return DvcIgnoreFilter(self.tree)\n\n @property\n def tree_root(self):\n return self.tree.tree_root\n\n def open(self, path, mode=\"r\", encoding=\"utf-8\"):\n return self.tree.open(path, mode, encoding)\n\n def exists(self, path):\n return self.tree.exists(path)\n\n def isdir(self, path):\n return self.tree.isdir(path)\n\n def isfile(self, path):\n return self.tree.isfile(path)\n\n def isexec(self, path):\n return self.tree.isexec(path)\n\n def walk(self, top, topdown=True):\n for root, dirs, files in self.tree.walk(top, topdown):\n dirs[:], files[:] = self.dvcignore(root, dirs, files)\n\n yield root, dirs, files\n\n def walk_files(self, top):\n for root, _, files in self.walk(top):\n for file in files:\n yield os.path.join(root, file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/istextfile.py__Use_heuristics_to_gues_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/istextfile.py__Use_heuristics_to_gues_", "embedding": null, "metadata": {"file_path": "dvc/istextfile.py", "file_name": "istextfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["istextfile", "docstring"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Use heuristics to guess if it is a text file or a binary file.\"\"\"\n\n# Based on https://eli.thegreenplace.net/2011/10/19/\n# perls-guess-if-file-is-text-or-binary-implemented-in-python\n\n\nTEXT_CHARS = bytes(range(32, 127)) + b\"\\n\\r\\t\\f\\b\"\n\n\ndef istextfile(fname, blocksize=512):\n \"\"\" Uses heuristics to guess whether the given file is text or binary,\n by reading a single block of bytes from the file.\n If more than 30% of the chars in the block are non-text, or there\n are NUL ('\\x00') bytes in the block, assume this is a binary file.\n \"\"\"\n with open(fname, \"rb\") as fobj:\n block = fobj.read(blocksize)\n\n if not block:\n # An empty file is considered a valid text file\n return True\n\n if b\"\\x00\" in block:\n # Files with null bytes are binary\n return False\n\n # Use translate's 'deletechars' argument to efficiently remove all\n # occurrences of TEXT_CHARS from the block\n nontext = block.translate(None, TEXT_CHARS)\n return float(len(nontext)) / len(block) <= 0.30", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py__Manages_dvc_lock_file__LockError._Thrown_when_unable_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py__Manages_dvc_lock_file__LockError._Thrown_when_unable_to_", "embedding": null, "metadata": {"file_path": "dvc/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["LockError", "docstring"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages dvc lock file.\"\"\"\n\nimport hashlib\nimport os\nimport time\nfrom datetime import timedelta\n\nimport zc.lockfile\nimport flufl.lock\n\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import format_link\nfrom dvc.progress import Tqdm\n\nDEFAULT_TIMEOUT = 5\n\nFAILED_TO_LOCK_MESSAGE = (\n \"cannot perform the command because another DVC process seems to be \"\n \"running on this project. If that is not the case, manually remove \"\n \"`.dvc/lock` and try again.\"\n)\n\n\nclass LockError(DvcException):\n \"\"\"Thrown when unable to acquire the lock for DVC repo.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py_Lock_Lock.__exit__.self_unlock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py_Lock_Lock.__exit__.self_unlock_", "embedding": null, "metadata": {"file_path": "dvc/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 79, "span_ids": ["Lock.lock", "Lock.unlock", "Lock._do_lock", "Lock.is_locked", "Lock", "Lock.__enter__", "Lock.files", "Lock.__exit__", "Lock.__init__"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Lock(object):\n \"\"\"Class for DVC repo lock.\n\n Uses zc.lockfile as backend.\n \"\"\"\n\n def __init__(self, lockfile, friendly=False, **kwargs):\n self._friendly = friendly\n self.lockfile = lockfile\n self._lock = None\n\n @property\n def files(self):\n return [self.lockfile]\n\n def _do_lock(self):\n try:\n with Tqdm(\n bar_format=\"{desc}\",\n disable=not self._friendly,\n desc=(\n \"If DVC froze, see `hardlink_lock` in {}\".format(\n format_link(\"man.dvc.org/config#core\")\n )\n ),\n ):\n self._lock = zc.lockfile.LockFile(self.lockfile)\n except zc.lockfile.LockError:\n raise LockError(FAILED_TO_LOCK_MESSAGE)\n\n def lock(self):\n try:\n self._do_lock()\n return\n except LockError:\n time.sleep(DEFAULT_TIMEOUT)\n\n self._do_lock()\n\n def unlock(self):\n self._lock.close()\n self._lock = None\n\n @property\n def is_locked(self):\n return bool(self._lock)\n\n def __enter__(self):\n self.lock()\n\n def __exit__(self, typ, value, tbck):\n self.unlock()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py_HardlinkLock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py_HardlinkLock_", "embedding": null, "metadata": {"file_path": "dvc/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 149, "span_ids": ["HardlinkLock.__del__", "make_lock", "HardlinkLock.lockfile", "HardlinkLock._set_claimfile", "HardlinkLock.lock", "HardlinkLock", "HardlinkLock.__init__"], "tokens": 597}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HardlinkLock(flufl.lock.Lock):\n \"\"\"Class for DVC repo lock.\n\n Args:\n lockfile (str): the lock filename\n in.\n tmp_dir (str): a directory to store claim files.\n \"\"\"\n\n def __init__(self, lockfile, tmp_dir=None, **kwargs):\n import socket\n\n self._tmp_dir = tmp_dir\n\n # NOTE: this is basically Lock.__init__ copy-paste, except that\n # instead of using `socket.getfqdn()` we use `socket.gethostname()`\n # to speed this up. We've seen [1] `getfqdn()` take ~5sec to return\n # anything, which is way too slow. `gethostname()` is actually a\n # fallback for `getfqdn()` when it is not able to resolve a\n # canonical hostname through network. The claimfile that uses\n # `self._hostname` is still usable, as it uses `pid` and random\n # number to generate the resulting lock file name, which is unique\n # enough for our application.\n #\n # [1] https://github.com/iterative/dvc/issues/2582\n self._hostname = socket.gethostname()\n\n self._lockfile = lockfile\n self._lifetime = timedelta(days=365) # Lock for good by default\n self._separator = flufl.lock.SEP\n self._set_claimfile()\n self._owned = True\n self._retry_errnos = []\n\n @property\n def lockfile(self):\n return self._lockfile\n\n def lock(self):\n try:\n super().lock(timedelta(seconds=DEFAULT_TIMEOUT))\n except flufl.lock.TimeOutError:\n raise LockError(FAILED_TO_LOCK_MESSAGE)\n\n def _set_claimfile(self, pid=None):\n super()._set_claimfile(pid)\n\n if self._tmp_dir is not None:\n # Under Windows file path length is limited so we hash it\n filename = hashlib.md5(self._claimfile.encode()).hexdigest()\n self._claimfile = os.path.join(self._tmp_dir, filename + \".lock\")\n\n # Fix for __del__ bug in flufl.lock [1] which is causing errors on\n # Python shutdown [2].\n # [1] https://gitlab.com/warsaw/flufl.lock/issues/7\n # [2] https://github.com/iterative/dvc/issues/2573\n def __del__(self):\n try:\n if self._owned:\n self.finalize()\n except ImportError:\n pass\n\n\ndef make_lock(lockfile, tmp_dir=None, friendly=False, hardlink_lock=False):\n cls = HardlinkLock if hardlink_lock else Lock\n return cls(lockfile, tmp_dir=tmp_dir, friendly=friendly)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logging_config_ExcludeInfoFilter.filter.return.record_levelno_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logging_config_ExcludeInfoFilter.filter.return.record_levelno_logging_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["ExcludeErrorsFilter", "docstring", "ExcludeInfoFilter.filter", "ExcludeInfoFilter", "LoggingException.__init__", "ExcludeErrorsFilter.filter", "LoggingException"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages logging configuration for DVC repo.\"\"\"\n\nimport logging.config\nimport logging.handlers\n\nimport colorama\n\nfrom dvc.progress import Tqdm\n\n\nFOOTER = (\n \"\\n{yellow}Having any troubles?{nc}\"\n \" Hit us up at {blue}https://dvc.org/support{nc},\"\n \" we are always happy to help!\"\n).format(\n blue=colorama.Fore.BLUE,\n nc=colorama.Fore.RESET,\n yellow=colorama.Fore.YELLOW,\n)\n\n\nclass LoggingException(Exception):\n def __init__(self, record):\n msg = \"failed to log {}\".format(str(record))\n super().__init__(msg)\n\n\nclass ExcludeErrorsFilter(logging.Filter):\n def filter(self, record):\n return record.levelno < logging.WARNING\n\n\nclass ExcludeInfoFilter(logging.Filter):\n def filter(self, record):\n return record.levelno < logging.INFO", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter_ColorFormatter.color_code._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter_ColorFormatter.color_code._", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 55, "span_ids": ["ColorFormatter"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ColorFormatter(logging.Formatter):\n \"\"\"Spit out colored text in supported terminals.\n\n colorama__ makes ANSI escape character sequences work under Windows.\n See the colorama documentation for details.\n\n __ https://pypi.python.org/pypi/colorama\n\n If record has an extra `tb_only` attribute, it will not show the\n exception cause, just the message and the traceback.\n \"\"\"\n\n color_code = {\n \"DEBUG\": colorama.Fore.BLUE,\n \"WARNING\": colorama.Fore.YELLOW,\n \"ERROR\": colorama.Fore.RED,\n \"CRITICAL\": colorama.Fore.RED,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter.format_ColorFormatter.formatTime.return._green_date_nc_form": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter.format_ColorFormatter.formatTime.return._green_date_nc_form", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 97, "span_ids": ["ColorFormatter.formatTime", "ColorFormatter.format"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ColorFormatter(logging.Formatter):\n\n def format(self, record):\n record.message = record.getMessage()\n msg = self.formatMessage(record)\n\n if record.levelname == \"INFO\":\n return msg\n\n if record.exc_info:\n if getattr(record, \"tb_only\", False):\n cause = \"\"\n else:\n cause = \": \".join(_iter_causes(record.exc_info[1]))\n\n msg = \"{message}{separator}{cause}\".format(\n message=msg or \"\",\n separator=\" - \" if msg and cause else \"\",\n cause=cause,\n )\n\n if _is_verbose():\n msg += _stack_trace(record.exc_info)\n\n return \"{asctime}{color}{levelname}{nc}: {msg}\".format(\n asctime=self.formatTime(record, self.datefmt),\n color=self.color_code[record.levelname],\n nc=colorama.Fore.RESET,\n levelname=record.levelname,\n msg=msg,\n )\n\n def formatTime(self, record, datefmt=None):\n # only show if current level is set to DEBUG\n # also, skip INFO as it is used for UI\n if not _is_verbose() or record.levelno == logging.INFO:\n return \"\"\n\n return \"{green}{date}{nc} \".format(\n green=colorama.Fore.GREEN,\n date=super().formatTime(record, datefmt),\n nc=colorama.Fore.RESET,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_LoggerHandler_disable_other_loggers.for_logger_name_logger_.if_logger_name_dvc_a.logger.disabled.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_LoggerHandler_disable_other_loggers.for_logger_name_logger_.if_logger_name_dvc_a.logger.disabled.True", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 150, "span_ids": ["LoggerHandler.handleError", "LoggerHandler", "_is_verbose", "LoggerHandler.emit", "_stack_trace", "disable_other_loggers", "_iter_causes"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LoggerHandler(logging.StreamHandler):\n def handleError(self, record):\n super().handleError(record)\n raise LoggingException(record)\n\n def emit(self, record):\n \"\"\"Write to Tqdm's stream so as to not break progress-bars\"\"\"\n try:\n msg = self.format(record)\n Tqdm.write(\n msg, file=self.stream, end=getattr(self, \"terminator\", \"\\n\")\n )\n self.flush()\n except RecursionError:\n raise\n except Exception:\n self.handleError(record)\n\n\ndef _is_verbose():\n return logging.getLogger(\"dvc\").getEffectiveLevel() == logging.DEBUG\n\n\ndef _iter_causes(exc):\n while exc:\n yield str(exc)\n exc = exc.__cause__\n\n\ndef _stack_trace(exc_info):\n import traceback\n\n return (\n \"\\n\"\n \"{red}{line}{nc}\\n\"\n \"{trace}\"\n \"{red}{line}{nc}\".format(\n red=colorama.Fore.RED,\n line=\"-\" * 60,\n trace=\"\".join(traceback.format_exception(*exc_info)),\n nc=colorama.Fore.RESET,\n )\n )\n\n\ndef disable_other_loggers():\n logging.captureWarnings(True)\n root = logging.root\n for (logger_name, logger) in root.manager.loggerDict.items():\n if logger_name != \"dvc\" and not logger_name.startswith(\"dvc.\"):\n logger.disabled = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/main.py__Main_entry_point_for_d_logger.logging_getLogger_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/main.py__Main_entry_point_for_d_logger.logging_getLogger_dvc_", "embedding": null, "metadata": {"file_path": "dvc/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["docstring"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Main entry point for dvc CLI.\"\"\"\n\nimport errno\nimport logging\n\nfrom dvc import analytics\nfrom dvc.cli import parse_args\nfrom dvc.config import ConfigError\nfrom dvc.exceptions import DvcParserError\nfrom dvc.exceptions import NotDvcRepoError\nfrom dvc.external_repo import clean_repos\nfrom dvc.logger import disable_other_loggers, FOOTER\nfrom dvc.utils import format_link\nfrom dvc.remote.pool import close_pools\n\n# Workaround for CPython bug. See [1] and [2] for more info.\n# [1] https://github.com/aws/aws-cli/blob/1.16.277/awscli/clidriver.py#L55\n# [2] https://bugs.python.org/issue29288\n\n\"\".encode(\"idna\")\n\n\nlogger = logging.getLogger(\"dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/main.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/main.py_main_", "embedding": null, "metadata": {"file_path": "dvc/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 93, "span_ids": ["main"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main(argv=None):\n \"\"\"Run dvc CLI command.\n\n Args:\n argv: optional list of arguments to parse. sys.argv is used by default.\n\n Returns:\n int: command's return code.\n \"\"\"\n args = None\n disable_other_loggers()\n\n outerLogLevel = logger.level\n try:\n args = parse_args(argv)\n\n if args.quiet:\n logger.setLevel(logging.CRITICAL)\n\n elif args.verbose:\n logger.setLevel(logging.DEBUG)\n\n cmd = args.func(args)\n ret = cmd.run()\n except ConfigError:\n logger.exception(\"configuration error\")\n ret = 251\n except KeyboardInterrupt:\n logger.exception(\"interrupted by the user\")\n ret = 252\n except NotDvcRepoError:\n logger.exception(\"\")\n ret = 253\n except DvcParserError:\n ret = 254\n except Exception as exc: # pylint: disable=broad-except\n if isinstance(exc, OSError) and exc.errno == errno.EMFILE:\n logger.exception(\n \"too many open files, please visit \"\n \"{} to see how to handle this \"\n \"problem\".format(\n format_link(\"https://error.dvc.org/many-files\")\n ),\n extra={\"tb_only\": True},\n )\n else:\n logger.exception(\"unexpected error\")\n ret = 255\n finally:\n logger.setLevel(outerLogLevel)\n\n # Closing pools by-hand to prevent wierd messages when closing SSH\n # connections. See https://github.com/iterative/dvc/issues/3248 for\n # more info.\n close_pools()\n\n # Remove cached repos in the end of the call, these are anonymous\n # so won't be reused by any other subsequent run anyway.\n clean_repos()\n\n if ret != 0:\n logger.info(FOOTER)\n\n if analytics.is_enabled():\n analytics.collect_and_send_report(args, ret)\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_from_urllib_parse_import__SCHEMA_OutputBase_PARAM_P": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_from_urllib_parse_import__SCHEMA_OutputBase_PARAM_P", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 59, "span_ids": ["imports"], "tokens": 460}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from urllib.parse import urlparse\nfrom voluptuous import Any, Required, Lower, Length, Coerce, And, SetTo\n\nfrom dvc.output.base import OutputBase\nfrom dvc.output.gs import OutputGS\nfrom dvc.output.hdfs import OutputHDFS\nfrom dvc.output.local import OutputLOCAL\nfrom dvc.output.s3 import OutputS3\nfrom dvc.output.ssh import OutputSSH\nfrom dvc.remote import Remote\nfrom dvc.remote.hdfs import RemoteHDFS\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.scheme import Schemes\n\nOUTS = [\n OutputHDFS,\n OutputS3,\n OutputGS,\n OutputSSH,\n # NOTE: OutputLOCAL is the default choice\n]\n\nOUTS_MAP = {\n Schemes.HDFS: OutputHDFS,\n Schemes.S3: OutputS3,\n Schemes.GS: OutputGS,\n Schemes.SSH: OutputSSH,\n Schemes.LOCAL: OutputLOCAL,\n}\n\nCHECKSUM_SCHEMA = Any(\n None,\n And(str, Length(max=0), SetTo(None)),\n And(Any(str, And(int, Coerce(str))), Length(min=3), Lower),\n)\n\n# NOTE: currently there are only 3 possible checksum names:\n#\n# 1) md5 (LOCAL, SSH, GS);\n# 2) etag (S3);\n# 3) checksum (HDFS);\n#\n# so when a few types of outputs share the same name, we only need\n# specify it once.\nCHECKSUMS_SCHEMA = {\n RemoteLOCAL.PARAM_CHECKSUM: CHECKSUM_SCHEMA,\n RemoteS3.PARAM_CHECKSUM: CHECKSUM_SCHEMA,\n RemoteHDFS.PARAM_CHECKSUM: CHECKSUM_SCHEMA,\n}\n\nTAGS_SCHEMA = {str: CHECKSUMS_SCHEMA}\n\nSCHEMA = CHECKSUMS_SCHEMA.copy()\nSCHEMA[Required(OutputBase.PARAM_PATH)] = str\nSCHEMA[OutputBase.PARAM_CACHE] = bool\nSCHEMA[OutputBase.PARAM_METRIC] = OutputBase.METRIC_SCHEMA\nSCHEMA[OutputBase.PARAM_TAGS] = TAGS_SCHEMA\nSCHEMA[OutputBase.PARAM_PERSIST] = bool", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_logging_OutputIsStageFileError.__init__.super___init___Stage_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_logging_OutputIsStageFileError.__init__.super___init___Stage_f", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["OutputIsNotFileOrDirError.__init__", "OutputIsStageFileError", "imports", "OutputDoesNotExistError.__init__", "OutputIsNotFileOrDirError", "OutputDoesNotExistError", "OutputAlreadyTrackedError.__init__", "OutputAlreadyTrackedError", "OutputIsStageFileError.__init__"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\nfrom urllib.parse import urlparse\nfrom copy import copy\n\nfrom voluptuous import Any\n\nimport dvc.prompt as prompt\nfrom dvc.cache import NamedCache\nfrom dvc.exceptions import CollectCacheError, RemoteCacheRequiredError\nfrom dvc.exceptions import DvcException\nfrom dvc.remote.base import RemoteBASE\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass OutputDoesNotExistError(DvcException):\n def __init__(self, path):\n msg = \"output '{}' does not exist\".format(path)\n super().__init__(msg)\n\n\nclass OutputIsNotFileOrDirError(DvcException):\n def __init__(self, path):\n msg = \"output '{}' is not a file or directory\".format(path)\n super().__init__(msg)\n\n\nclass OutputAlreadyTrackedError(DvcException):\n def __init__(self, path):\n msg = \"output '{}' is already tracked by SCM (e.g. Git)\".format(path)\n super().__init__(msg)\n\n\nclass OutputIsStageFileError(DvcException):\n def __init__(self, path):\n super().__init__(\"Stage file '{}' cannot be an output.\".format(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.verify_metric_OutputBase.checkout.return.self_cache_checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.verify_metric_OutputBase.checkout.return.self_cache_checkout_", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 267, "end_line": 302, "span_ids": ["OutputBase.verify_metric", "OutputBase.checkout", "OutputBase.download"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def verify_metric(self):\n raise DvcException(\n \"verify metric is not supported for {}\".format(self.scheme)\n )\n\n def download(self, to):\n self.remote.download(self.path_info, to.path_info)\n\n def checkout(\n self,\n force=False,\n progress_callback=None,\n tag=None,\n relink=False,\n filter_info=None,\n ):\n if not self.use_cache:\n if progress_callback:\n progress_callback(\n str(self.path_info), self.get_files_number(filter_info)\n )\n return None\n\n if tag:\n info = self.tags[tag]\n else:\n info = self.info\n\n return self.cache.checkout(\n self.path_info,\n info,\n force=force,\n progress_callback=progress_callback,\n relink=relink,\n filter_info=filter_info,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.remove_OutputBase.unprotect.if_self_exists_.self_remote_unprotect_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.remove_OutputBase.unprotect.if_self_exists_.self_remote_unprotect_sel", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 335, "span_ids": ["OutputBase.remove", "OutputBase.unprotect", "OutputBase.move", "OutputBase.get_files_number"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def remove(self, ignore_remove=False):\n self.remote.remove(self.path_info)\n if self.scheme != \"local\":\n return\n\n if ignore_remove and self.use_scm_ignore:\n self.repo.scm.ignore_remove(self.fspath)\n\n def move(self, out):\n if self.scheme == \"local\" and self.use_scm_ignore:\n self.repo.scm.ignore_remove(self.fspath)\n\n self.remote.move(self.path_info, out.path_info)\n self.def_path = out.def_path\n self.path_info = out.path_info\n self.save()\n self.commit()\n\n if self.scheme == \"local\" and self.use_scm_ignore:\n self.repo.scm.ignore(self.fspath)\n\n def get_files_number(self, filter_info=None):\n if not self.use_cache:\n return 0\n\n return self.cache.get_files_number(\n self.path_info, self.checksum, filter_info\n )\n\n def unprotect(self):\n if self.exists:\n self.remote.unprotect(self.path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase._collect_used_dir_cache_OutputBase._collect_used_dir_cache.return.cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase._collect_used_dir_cache_OutputBase._collect_used_dir_cache.return.cache", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 345, "end_line": 410, "span_ids": ["OutputBase._collect_used_dir_cache"], "tokens": 468}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def _collect_used_dir_cache(\n self, remote=None, force=False, jobs=None, filter_info=None\n ):\n \"\"\"Get a list of `info`s related to the given directory.\n\n - Pull the directory entry from the remote cache if it was changed.\n\n Example:\n\n Given the following commands:\n\n $ echo \"foo\" > directory/foo\n $ echo \"bar\" > directory/bar\n $ dvc add directory\n\n It will return a NamedCache like:\n\n nc = NamedCache()\n nc.add(self.scheme, 'c157a79031e1', 'directory/foo')\n nc.add(self.scheme, 'd3b07384d113', 'directory/bar')\n \"\"\"\n\n cache = NamedCache()\n\n if self.cache.changed_cache_file(self.checksum):\n try:\n self.repo.cloud.pull(\n NamedCache.make(\"local\", self.checksum, str(self)),\n jobs=jobs,\n remote=remote,\n show_checksums=False,\n )\n except DvcException:\n logger.debug(\"failed to pull cache for '{}'\".format(self))\n\n if self.cache.changed_cache_file(self.checksum):\n msg = (\n \"Missing cache for directory '{}'. \"\n \"Cache for files inside will be lost. \"\n \"Would you like to continue? Use '-f' to force.\"\n )\n if not force and not prompt.confirm(msg.format(self.path_info)):\n raise CollectCacheError(\n \"unable to fully collect used cache\"\n \" without cache for directory '{}'\".format(self)\n )\n else:\n return cache\n\n path = str(self.path_info)\n filter_path = str(filter_info) if filter_info else None\n is_win = os.name == \"nt\"\n for entry in self.dir_cache:\n checksum = entry[self.remote.PARAM_CHECKSUM]\n entry_relpath = entry[self.remote.PARAM_RELPATH]\n if is_win:\n entry_relpath = entry_relpath.replace(\"/\", os.sep)\n entry_path = os.path.join(path, entry_relpath)\n if (\n not filter_path\n or entry_path == filter_path\n or entry_path.startswith(filter_path + os.sep)\n ):\n cache.add(self.scheme, checksum, entry_path)\n\n return cache", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_logging_OutputLOCAL._parse_path.return.self_REMOTE_path_cls_abs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_logging_OutputLOCAL._parse_path.return.self_REMOTE_path_cls_abs_", "embedding": null, "metadata": {"file_path": "dvc/output/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 43, "span_ids": ["imports", "OutputLOCAL._parse_path", "OutputLOCAL", "OutputLOCAL.__init__"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\nfrom urllib.parse import urlparse\n\nfrom dvc.exceptions import DvcException\nfrom dvc.istextfile import istextfile\nfrom dvc.output.base import OutputBase\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.utils import relpath\nfrom dvc.compat import fspath_py35\nfrom dvc.utils.fs import path_isin\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass OutputLOCAL(OutputBase):\n REMOTE = RemoteLOCAL\n sep = os.sep\n\n def __init__(self, stage, path, *args, **kwargs):\n if stage and path_isin(path, stage.repo.root_dir):\n path = relpath(path, stage.wdir)\n\n super().__init__(stage, path, *args, **kwargs)\n\n def _parse_path(self, remote, path):\n parsed = urlparse(path)\n if parsed.scheme == \"remote\":\n p = remote.path_info / parsed.path.lstrip(\"/\")\n else:\n # NOTE: we can path either from command line or .dvc file,\n # so we should expect both posix and windows style paths.\n # PathInfo accepts both, i.e. / works everywhere, \\ only on win.\n #\n # FIXME: if we have Windows path containing / or posix one with \\\n # then we have #2059 bug and can't really handle that.\n p = self.REMOTE.path_cls(path)\n if not p.is_absolute():\n p = self.stage.wdir / p\n\n abs_p = os.path.abspath(os.path.normpath(fspath_py35(p)))\n return self.REMOTE.path_cls(abs_p)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_os_PathInfo.isin.return.len_self__cparts_n_and": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_os_PathInfo.isin.return.len_self__cparts_n_and", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 73, "span_ids": ["_BasePath", "PathInfo.as_posix", "PathInfo:7", "_BasePath.overlaps", "imports", "PathInfo.__str__", "PathInfo.__repr__", "PathInfo.fspath", "_BasePath.isin_or_eq", "PathInfo.isin", "PathInfo.__fspath__", "PathInfo.__new__", "PathInfo", "PathInfo.relpath"], "tokens": 577}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport posixpath\nimport pathlib\nfrom urllib.parse import urlparse\n\nfrom funcy import cached_property\n\nfrom dvc.utils import relpath\n\n\nclass _BasePath(object):\n def overlaps(self, other):\n if isinstance(other, (str, bytes)):\n other = self.__class__(other)\n elif self.__class__ != other.__class__:\n return False\n return self.isin_or_eq(other) or other.isin(self)\n\n def isin_or_eq(self, other):\n return self == other or self.isin(other)\n\n\nclass PathInfo(pathlib.PurePath, _BasePath):\n # Use __slots__ in PathInfo objects following PurePath implementation.\n # This makes objects smaller and speeds up attribute access.\n # We don't add any fields so it's empty.\n __slots__ = ()\n scheme = \"local\"\n\n def __new__(cls, *args):\n # Construct a proper subclass depending on current os\n if cls is PathInfo:\n cls = WindowsPathInfo if os.name == \"nt\" else PosixPathInfo\n return cls._from_parts(args)\n\n def as_posix(self):\n f = self._flavour\n # Unlike original implementation [1] that uses `str()` we actually need\n # to use `fspath`, because we've overridden `__str__` method to return\n # relative paths, which will break original `as_posix`.\n #\n # [1] https://github.com/python/cpython/blob/v3.7.0/Lib/pathlib.py#L692\n return self.fspath.replace(f.sep, \"/\")\n\n def __str__(self):\n path = self.__fspath__()\n return relpath(path)\n\n def __repr__(self):\n return \"{}: '{}'\".format(type(self).__name__, self)\n\n # This permits passing it to file utils directly in Python 3.6+\n # With Python 2.7, Python 3.5+ we are stuck with path_info.fspath for now\n def __fspath__(self):\n return pathlib.PurePath.__str__(self)\n\n @property\n def fspath(self):\n return self.__fspath__()\n\n url = fspath\n\n def relpath(self, other):\n return self.__class__(relpath(self, other))\n\n def isin(self, other):\n if isinstance(other, (str, bytes)):\n other = self.__class__(other)\n elif self.__class__ != other.__class__:\n return False\n # Use cached casefolded parts to compare paths\n n = len(other._cparts)\n return len(self._cparts) > n and self._cparts[:n] == other._cparts", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo_URLInfo.from_parts.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo_URLInfo.from_parts.return.obj", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 131, "span_ids": ["URLInfo.__init__", "URLInfo.from_parts", "URLInfo"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class URLInfo(_BasePath):\n DEFAULT_PORTS = {\"http\": 80, \"https\": 443, \"ssh\": 22, \"hdfs\": 0}\n\n def __init__(self, url):\n p = urlparse(url)\n assert not p.query and not p.params and not p.fragment\n assert p.password is None\n\n self._fill_parts(p.scheme, p.hostname, p.username, p.port, p.path)\n\n @classmethod\n def from_parts(\n cls, scheme=None, host=None, user=None, port=None, path=\"\", netloc=None\n ):\n assert bool(host) ^ bool(netloc)\n\n if netloc is not None:\n return cls(\"{}://{}{}\".format(scheme, netloc, path))\n\n obj = cls.__new__(cls)\n obj._fill_parts(scheme, host, user, port, path)\n return obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo._base_parts_URLInfo.isin.return.self__base_parts_other": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo._base_parts_URLInfo.isin.return.self__base_parts_other", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 237, "span_ids": ["URLInfo.name", "URLInfo:4", "URLInfo.replace", "URLInfo.__eq__", "URLInfo.__hash__", "URLInfo._base_parts", "URLInfo.__repr__", "URLInfo.netloc", "URLInfo.bucket", "URLInfo.__div__", "URLInfo.parent", "URLInfo._path", "URLInfo.relative_to", "URLInfo.isin", "URLInfo.path", "URLInfo.url", "URLInfo.parts", "URLInfo.__str__", "URLInfo.parents"], "tokens": 593}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class URLInfo(_BasePath):\n\n @property\n def _base_parts(self):\n return (self.scheme, self.host, self.user, self.port)\n\n @property\n def parts(self):\n return self._base_parts + self._path.parts\n\n def replace(self, path=None):\n return self.from_parts(*self._base_parts, path=path)\n\n @cached_property\n def url(self):\n return \"{}://{}{}\".format(self.scheme, self.netloc, self._spath)\n\n def __str__(self):\n return self.url\n\n def __repr__(self):\n return \"{}: '{}'\".format(type(self).__name__, self)\n\n def __eq__(self, other):\n if isinstance(other, (str, bytes)):\n other = self.__class__(other)\n return (\n self.__class__ == other.__class__\n and self._base_parts == other._base_parts\n and self._path == other._path\n )\n\n def __hash__(self):\n return hash(self.parts)\n\n def __div__(self, other):\n return self.replace(path=posixpath.join(self._spath, other))\n\n __truediv__ = __div__\n\n @property\n def path(self):\n return self._spath\n\n @cached_property\n def _path(self):\n return _URLPathInfo(self._spath)\n\n @property\n def name(self):\n return self._path.name\n\n @cached_property\n def netloc(self):\n netloc = self.host\n if self.user:\n netloc = self.user + \"@\" + netloc\n if self.port and int(self.port) != self.DEFAULT_PORTS.get(self.scheme):\n netloc += \":\" + str(self.port)\n return netloc\n\n @property\n def bucket(self):\n return self.netloc\n\n @property\n def parent(self):\n return self.replace(path=self._path.parent)\n\n @property\n def parents(self):\n return _URLPathParents(self)\n\n def relative_to(self, other):\n if isinstance(other, (str, bytes)):\n other = self.__class__(other)\n if self.__class__ != other.__class__:\n msg = \"'{}' has incompatible class with '{}'\".format(self, other)\n raise ValueError(msg)\n if self._base_parts != other._base_parts:\n msg = \"'{}' does not start with '{}'\".format(self, other)\n raise ValueError(msg)\n return self._path.relative_to(other._path)\n\n def isin(self, other):\n if isinstance(other, (str, bytes)):\n other = self.__class__(other)\n elif self.__class__ != other.__class__:\n return False\n return self._base_parts == other._base_parts and self._path.isin(\n other._path\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_CloudURLInfo_HTTPURLInfo.from_parts.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_CloudURLInfo_HTTPURLInfo.from_parts.return.obj", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 240, "end_line": 289, "span_ids": ["HTTPURLInfo", "HTTPURLInfo.from_parts", "CloudURLInfo.path", "HTTPURLInfo.__init__", "CloudURLInfo"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CloudURLInfo(URLInfo):\n @property\n def path(self):\n return self._spath.lstrip(\"/\")\n\n\nclass HTTPURLInfo(URLInfo):\n __hash__ = URLInfo.__hash__\n\n def __init__(self, url):\n p = urlparse(url)\n stripped = p._replace(params=None, query=None, fragment=None)\n super().__init__(stripped.geturl())\n self.params = p.params\n self.query = p.query\n self.fragment = p.fragment\n\n @classmethod\n def from_parts(\n cls,\n scheme=None,\n host=None,\n user=None,\n port=None,\n path=\"\",\n netloc=None,\n params=None,\n query=None,\n fragment=None,\n ):\n assert bool(host) ^ bool(netloc)\n\n if netloc is not None:\n return cls(\n \"{}://{}{}{}{}{}\".format(\n scheme,\n netloc,\n path,\n (\";\" + params) if params else \"\",\n (\"?\" + query) if query else \"\",\n (\"#\" + fragment) if fragment else \"\",\n )\n )\n\n obj = cls.__new__(cls)\n obj._fill_parts(scheme, host, user, port, path)\n obj.params = params\n obj.query = query\n obj.fragment = fragment\n return obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_HTTPURLInfo._extra_parts_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_HTTPURLInfo._extra_parts_", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 291, "end_line": 319, "span_ids": ["HTTPURLInfo.__eq__", "HTTPURLInfo.url", "HTTPURLInfo.parts", "HTTPURLInfo._extra_parts"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HTTPURLInfo(URLInfo):\n\n @property\n def _extra_parts(self):\n return (self.params, self.query, self.fragment)\n\n @property\n def parts(self):\n return self._base_parts + self._path.parts + self._extra_parts\n\n @cached_property\n def url(self):\n return \"{}://{}{}{}{}{}\".format(\n self.scheme,\n self.netloc,\n self._spath,\n (\";\" + self.params) if self.params else \"\",\n (\"?\" + self.query) if self.query else \"\",\n (\"#\" + self.fragment) if self.fragment else \"\",\n )\n\n def __eq__(self, other):\n if isinstance(other, (str, bytes)):\n other = self.__class__(other)\n return (\n self.__class__ == other.__class__\n and self._base_parts == other._base_parts\n and self._path == other._path\n and self._extra_parts == other._extra_parts\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py__Manages_progress_bars__Tqdm.update_to.self_update_current_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py__Manages_progress_bars__Tqdm.update_to.self_update_current_sel", "embedding": null, "metadata": {"file_path": "dvc/progress.py", "file_name": "progress.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 115, "span_ids": ["Tqdm.update_to", "Tqdm.__init__", "Tqdm", "Tqdm.update_desc", "docstring"], "tokens": 810}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages progress bars for DVC repo.\"\"\"\n\nimport logging\nimport sys\nfrom threading import RLock\n\nfrom tqdm import tqdm\n\nfrom dvc.utils import env2bool\n\nlogger = logging.getLogger(__name__)\ntqdm.set_lock(RLock())\n\n\nclass Tqdm(tqdm):\n \"\"\"\n maximum-compatibility tqdm-based progressbars\n \"\"\"\n\n BAR_FMT_DEFAULT = (\n \"{percentage:3.0f}% {desc}|{bar}|\"\n \"{n_fmt}/{total_fmt}\"\n \" [{elapsed}<{remaining}, {rate_fmt:>11}{postfix}]\"\n )\n # nested bars should have fixed bar widths to align nicely\n BAR_FMT_DEFAULT_NESTED = (\n \"{percentage:3.0f}%|{bar:10}|{desc:{ncols_desc}.{ncols_desc}}\"\n \"{n_fmt}/{total_fmt}\"\n \" [{elapsed}<{remaining}, {rate_fmt:>11}{postfix}]\"\n )\n BAR_FMT_NOTOTAL = (\n \"{desc:{ncols_desc}.{ncols_desc}}{n_fmt}\"\n \" [{elapsed}, {rate_fmt:>11}{postfix}]\"\n )\n BYTES_DEFAULTS = dict(\n unit=\"B\", unit_scale=True, unit_divisor=1024, miniters=1\n )\n\n def __init__(\n self,\n iterable=None,\n disable=None,\n level=logging.ERROR,\n desc=None,\n leave=False,\n bar_format=None,\n bytes=False, # pylint: disable=W0622\n file=None,\n total=None,\n **kwargs\n ):\n \"\"\"\n bytes : shortcut for\n `unit='B', unit_scale=True, unit_divisor=1024, miniters=1`\n desc : persists after `close()`\n level : effective logging level for determining `disable`;\n used only if `disable` is unspecified\n disable : If (default: None) or False,\n will be determined by logging level.\n May be overridden to `True` due to non-TTY status.\n Skip override by specifying env var `DVC_IGNORE_ISATTY`.\n kwargs : anything accepted by `tqdm.tqdm()`\n \"\"\"\n kwargs = kwargs.copy()\n if bytes:\n kwargs = {**self.BYTES_DEFAULTS, **kwargs}\n else:\n kwargs.setdefault(\"unit_scale\", total > 999 if total else True)\n if file is None:\n file = sys.stderr\n self.desc_persist = desc\n # auto-disable based on `logger.level`\n if not disable:\n disable = logger.getEffectiveLevel() > level\n # auto-disable based on TTY\n if (\n not disable\n and not env2bool(\"DVC_IGNORE_ISATTY\")\n and hasattr(file, \"isatty\")\n ):\n disable = not file.isatty()\n super().__init__(\n iterable=iterable,\n disable=disable,\n leave=leave,\n desc=desc,\n bar_format=\"!\",\n lock_args=(False,),\n total=total,\n **kwargs\n )\n if bar_format is None:\n if self.__len__():\n self.bar_format = (\n self.BAR_FMT_DEFAULT_NESTED\n if self.pos\n else self.BAR_FMT_DEFAULT\n )\n else:\n self.bar_format = self.BAR_FMT_NOTOTAL\n else:\n self.bar_format = bar_format\n self.refresh()\n\n def update_desc(self, desc, n=1):\n \"\"\"\n Calls `set_description_str(desc)` and `update(n)`\n \"\"\"\n self.set_description_str(desc, refresh=False)\n self.update(n)\n\n def update_to(self, current, total=None):\n if total:\n self.total = total # pylint: disable=W0613,W0201\n self.update(current - self.n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py_posixpath_Remote.return._get_remote_conf_repo_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py_posixpath_Remote.return._get_remote_conf_repo_r", "embedding": null, "metadata": {"file_path": "dvc/remote/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["imports", "Remote", "_get"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import posixpath\nfrom urllib.parse import urlparse\n\nfrom dvc.remote.azure import RemoteAZURE\nfrom dvc.remote.gdrive import RemoteGDrive\nfrom dvc.remote.gs import RemoteGS\nfrom dvc.remote.hdfs import RemoteHDFS\nfrom dvc.remote.http import RemoteHTTP\nfrom dvc.remote.https import RemoteHTTPS\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.remote.oss import RemoteOSS\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.remote.ssh import RemoteSSH\n\n\nREMOTES = [\n RemoteAZURE,\n RemoteGDrive,\n RemoteGS,\n RemoteHDFS,\n RemoteHTTP,\n RemoteHTTPS,\n RemoteS3,\n RemoteSSH,\n RemoteOSS,\n # NOTE: RemoteLOCAL is the default\n]\n\n\ndef _get(remote_conf):\n for remote in REMOTES:\n if remote.supported(remote_conf):\n return remote\n return RemoteLOCAL\n\n\ndef Remote(repo, **kwargs):\n name = kwargs.get(\"name\")\n if name:\n remote_conf = repo.config[\"remote\"][name.lower()]\n else:\n remote_conf = kwargs\n remote_conf = _resolve_remote_refs(repo.config, remote_conf)\n return _get(remote_conf)(repo, remote_conf)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py__resolve_remote_refs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py__resolve_remote_refs_", "embedding": null, "metadata": {"file_path": "dvc/remote/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 76, "span_ids": ["_resolve_remote_refs"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _resolve_remote_refs(config, remote_conf):\n # Support for cross referenced remotes.\n # This will merge the settings, shadowing base ref with remote_conf.\n # For example, having:\n #\n # dvc remote add server ssh://localhost\n # dvc remote modify server user root\n # dvc remote modify server ask_password true\n #\n # dvc remote add images remote://server/tmp/pictures\n # dvc remote modify images user alice\n # dvc remote modify images ask_password false\n # dvc remote modify images password asdf1234\n #\n # Results on a config dictionary like:\n #\n # {\n # \"url\": \"ssh://localhost/tmp/pictures\",\n # \"user\": \"alice\",\n # \"password\": \"asdf1234\",\n # \"ask_password\": False,\n # }\n parsed = urlparse(remote_conf[\"url\"])\n if parsed.scheme != \"remote\":\n return remote_conf\n\n base = config[\"remote\"][parsed.netloc]\n url = posixpath.join(base[\"url\"], parsed.path.lstrip(\"/\"))\n return {**base, **remote_conf, \"url\": url}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_logging_RemoteAZURE.__init__.self.path_info._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_logging_RemoteAZURE.__init__.self.path_info._", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["imports", "RemoteAZURE.__init__", "RemoteAZURE"], "tokens": 412}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\nimport posixpath\nimport re\nfrom datetime import datetime, timedelta\nfrom urllib.parse import urlparse\nimport threading\n\nfrom funcy import cached_property, wrap_prop\n\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.scheme import Schemes\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteAZURE(RemoteBASE):\n scheme = Schemes.AZURE\n path_cls = CloudURLInfo\n REGEX = (\n r\"azure://((?P[^=;]*)?|(\"\n # backward compatibility\n r\"(ContainerName=(?P[^;]+);?)?\"\n r\"(?P.+)?)?)$\"\n )\n REQUIRES = {\"azure-storage-blob\": \"azure.storage.blob\"}\n PARAM_CHECKSUM = \"etag\"\n COPY_POLL_SECONDS = 5\n LIST_OBJECT_PAGE_SIZE = 5000\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n\n url = config.get(\"url\", \"azure://\")\n\n match = re.match(self.REGEX, url) # backward compatibility\n path = match.group(\"path\")\n bucket = (\n urlparse(url if path else \"\").netloc\n or match.group(\"container_name\") # backward compatibility\n or os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\")\n )\n\n self.connection_string = (\n config.get(\"connection_string\")\n or match.group(\"connection_string\") # backward compatibility\n or os.getenv(\"AZURE_STORAGE_CONNECTION_STRING\")\n )\n\n if not bucket:\n raise ValueError(\"azure storage container name missing\")\n\n if not self.connection_string:\n raise ValueError(\"azure storage connection string missing\")\n\n self.path_info = (\n self.path_cls(url)\n if path\n else self.path_cls.from_parts(scheme=self.scheme, netloc=bucket)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.blob_service_RemoteAZURE.blob_service.return.blob_service": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.blob_service_RemoteAZURE.blob_service.return.blob_service", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 81, "span_ids": ["RemoteAZURE.blob_service"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteAZURE(RemoteBASE):\n\n @wrap_prop(threading.Lock())\n @cached_property\n def blob_service(self):\n from azure.storage.blob import BlockBlobService\n from azure.common import AzureMissingResourceHttpError\n\n logger.debug(\"URL {}\".format(self.path_info))\n logger.debug(\"Connection string {}\".format(self.connection_string))\n blob_service = BlockBlobService(\n connection_string=self.connection_string\n )\n logger.debug(\"Container name {}\".format(self.path_info.bucket))\n try: # verify that container exists\n blob_service.list_blobs(\n self.path_info.bucket, delimiter=\"/\", num_results=1\n )\n except AzureMissingResourceHttpError:\n blob_service.create_container(self.path_info.bucket)\n return blob_service", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.remove_RemoteAZURE.exists.return.any_path_info_path_pat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.remove_RemoteAZURE.exists.return.any_path_info_path_pat", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 145, "span_ids": ["RemoteAZURE._upload", "RemoteAZURE.list_cache_paths", "RemoteAZURE.remove", "RemoteAZURE._list_paths", "RemoteAZURE._download", "RemoteAZURE.exists"], "tokens": 418}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteAZURE(RemoteBASE):\n\n def remove(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n logger.debug(\"Removing {}\".format(path_info))\n self.blob_service.delete_blob(path_info.bucket, path_info.path)\n\n def _list_paths(self, bucket, prefix, progress_callback=None):\n blob_service = self.blob_service\n next_marker = None\n while True:\n blobs = blob_service.list_blobs(\n bucket, prefix=prefix, marker=next_marker\n )\n\n for blob in blobs:\n if progress_callback:\n progress_callback()\n yield blob.name\n\n if not blobs.next_marker:\n break\n\n next_marker = blobs.next_marker\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n if prefix:\n prefix = posixpath.join(\n self.path_info.path, prefix[:2], prefix[2:]\n )\n else:\n prefix = self.path_info.path\n return self._list_paths(\n self.path_info.bucket, prefix, progress_callback\n )\n\n def _upload(\n self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs\n ):\n with Tqdm(desc=name, disable=no_progress_bar, bytes=True) as pbar:\n self.blob_service.create_blob_from_path(\n to_info.bucket,\n to_info.path,\n from_file,\n progress_callback=pbar.update_to,\n )\n\n def _download(\n self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs\n ):\n with Tqdm(desc=name, disable=no_progress_bar, bytes=True) as pbar:\n self.blob_service.get_blob_to_path(\n from_info.bucket,\n from_info.path,\n to_file,\n progress_callback=pbar.update_to,\n )\n\n def exists(self, path_info):\n paths = self._list_paths(path_info.bucket, path_info.path)\n return any(path_info.path == path for path in paths)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE._generate_download_url_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE._generate_download_url_", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 150, "span_ids": ["RemoteAZURE._generate_download_url"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteAZURE(RemoteBASE):\n\n def _generate_download_url(self, path_info, expires=3600):\n from azure.storage.blob import BlobPermissions\n\n expires_at = datetime.utcnow() + timedelta(seconds=expires)\n\n sas_token = self.blob_service.generate_blob_shared_access_signature(\n path_info.bucket,\n path_info.path,\n permission=BlobPermissions.READ,\n expiry=expires_at,\n )\n download_url = self.blob_service.make_blob_url(\n path_info.bucket, path_info.path, sas_token=sas_token\n )\n return download_url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE_RemoteBASE.get_missing_deps.return.missing": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE_RemoteBASE.get_missing_deps.return.missing", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 147, "span_ids": ["RemoteBASE.__init__", "RemoteBASE", "RemoteBASE.get_missing_deps"], "tokens": 439}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n scheme = \"base\"\n path_cls = URLInfo\n REQUIRES = {}\n JOBS = 4 * cpu_count()\n INDEX_CLS = RemoteIndex\n\n PARAM_RELPATH = \"relpath\"\n CHECKSUM_DIR_SUFFIX = \".dir\"\n CHECKSUM_JOBS = max(1, min(4, cpu_count() // 2))\n DEFAULT_CACHE_TYPES = [\"copy\"]\n DEFAULT_VERIFY = False\n LIST_OBJECT_PAGE_SIZE = 1000\n TRAVERSE_WEIGHT_MULTIPLIER = 20\n TRAVERSE_PREFIX_LEN = 3\n TRAVERSE_THRESHOLD_SIZE = 500000\n CAN_TRAVERSE = True\n\n CACHE_MODE = None\n SHARED_MODE_MAP = {None: (None, None), \"group\": (None, None)}\n\n state = StateNoop()\n\n def __init__(self, repo, config):\n self.repo = repo\n\n self._check_requires(config)\n\n shared = config.get(\"shared\")\n self._file_mode, self._dir_mode = self.SHARED_MODE_MAP[shared]\n\n self.checksum_jobs = (\n config.get(\"checksum_jobs\")\n or (self.repo and self.repo.config[\"core\"].get(\"checksum_jobs\"))\n or self.CHECKSUM_JOBS\n )\n self.verify = config.get(\"verify\", self.DEFAULT_VERIFY)\n self._dir_info = {}\n\n self.cache_types = config.get(\"type\") or copy(self.DEFAULT_CACHE_TYPES)\n self.cache_type_confirmed = False\n\n url = config.get(\"url\")\n if url:\n index_name = hashlib.sha256(url.encode(\"utf-8\")).hexdigest()\n self.index = self.INDEX_CLS(\n self.repo, index_name, dir_suffix=self.CHECKSUM_DIR_SUFFIX\n )\n else:\n self.index = RemoteIndexNoop()\n\n @classmethod\n def get_missing_deps(cls):\n import importlib\n\n missing = []\n for package, module in cls.REQUIRES.items():\n try:\n importlib.import_module(module)\n except ImportError:\n missing.append(package)\n\n return missing", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._check_requires_RemoteBASE._check_requires.raise_RemoteMissingDepsEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._check_requires_RemoteBASE._check_requires.raise_RemoteMissingDepsEr", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 148, "span_ids": ["RemoteBASE._check_requires"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _check_requires(self, config):\n missing = self.get_missing_deps()\n if not missing:\n return\n\n url = config.get(\"url\", \"{}://\".format(self.scheme))\n msg = (\n \"URL '{}' is supported but requires these missing \"\n \"dependencies: {}. If you have installed dvc using pip, \"\n \"choose one of these options to proceed: \\n\"\n \"\\n\"\n \" 1) Install specific missing dependencies:\\n\"\n \" pip install {}\\n\"\n \" 2) Install dvc package that includes those missing \"\n \"dependencies: \\n\"\n \" pip install 'dvc[{}]'\\n\"\n \" 3) Install dvc package with all possible \"\n \"dependencies included: \\n\"\n \" pip install 'dvc[all]'\\n\"\n \"\\n\"\n \"If you have installed dvc from a binary package and you \"\n \"are still seeing this message, please report it to us \"\n \"using https://github.com/iterative/dvc/issues. Thank you!\"\n ).format(url, missing, \" \".join(missing), self.scheme)\n raise RemoteMissingDepsError(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._collect_dir_RemoteBASE._collect_dir.return.sorted_result_key_itemge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._collect_dir_RemoteBASE._collect_dir.return.sorted_result_key_itemge", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 222, "span_ids": ["RemoteBASE._collect_dir"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _collect_dir(self, path_info):\n file_infos = set()\n\n for fname in self.walk_files(path_info):\n if DvcIgnore.DVCIGNORE_FILE == fname.name:\n raise DvcIgnoreInCollectedDirError(fname.parent)\n\n file_infos.add(fname)\n\n checksums = {fi: self.state.get(fi) for fi in file_infos}\n not_in_state = {\n fi for fi, checksum in checksums.items() if checksum is None\n }\n\n new_checksums = self._calculate_checksums(not_in_state)\n\n checksums.update(new_checksums)\n\n result = [\n {\n self.PARAM_CHECKSUM: checksums[fi],\n # NOTE: this is lossy transformation:\n # \"hey\\there\" -> \"hey/there\"\n # \"hey/there\" -> \"hey/there\"\n # The latter is fine filename on Windows, which\n # will transform to dir/file on back transform.\n #\n # Yes, this is a BUG, as long as we permit \"/\" in\n # filenames on Windows and \"\\\" on Unix\n self.PARAM_RELPATH: fi.relative_to(path_info).as_posix(),\n }\n for fi in file_infos\n ]\n\n # Sorting the list by path to ensure reproducibility\n return sorted(result, key=itemgetter(self.PARAM_RELPATH))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.get_dir_checksum_RemoteBASE.get_dir_checksum.return.checksum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.get_dir_checksum_RemoteBASE.get_dir_checksum.return.checksum", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 224, "end_line": 238, "span_ids": ["RemoteBASE.get_dir_checksum"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def get_dir_checksum(self, path_info):\n if not self.cache:\n raise RemoteCacheRequiredError(path_info)\n\n dir_info = self._collect_dir(path_info)\n checksum, tmp_info = self._get_dir_info_checksum(dir_info)\n new_info = self.cache.checksum_to_path_info(checksum)\n if self.cache.changed_cache_file(checksum):\n self.cache.makedirs(new_info.parent)\n self.cache.move(tmp_info, new_info, mode=self.CACHE_MODE)\n\n self.state.save(path_info, checksum)\n self.state.save(new_info, checksum)\n\n return checksum", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._get_dir_info_checksum_RemoteBASE.get_dir_cache.return.dir_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._get_dir_info_checksum_RemoteBASE.get_dir_cache.return.dir_info", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 240, "end_line": 265, "span_ids": ["RemoteBASE._get_dir_info_checksum", "RemoteBASE.get_dir_cache"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _get_dir_info_checksum(self, dir_info):\n tmp = tempfile.NamedTemporaryFile(delete=False).name\n with open(tmp, \"w+\") as fobj:\n json.dump(dir_info, fobj, sort_keys=True)\n\n from_info = PathInfo(tmp)\n to_info = self.cache.path_info / tmp_fname(\"\")\n self.cache.upload(from_info, to_info, no_progress_bar=True)\n\n checksum = self.get_file_checksum(to_info) + self.CHECKSUM_DIR_SUFFIX\n return checksum, to_info\n\n def get_dir_cache(self, checksum):\n assert checksum\n\n dir_info = self._dir_info.get(checksum)\n if dir_info:\n return dir_info\n\n try:\n dir_info = self.load_dir_cache(checksum)\n except DirCacheError:\n dir_info = []\n\n self._dir_info[checksum] = dir_info\n return dir_info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.link_RemoteBASE._verify_link.self.cache_type_confirmed.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.link_RemoteBASE._verify_link.self.cache_type_confirmed.True", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 377, "end_line": 396, "span_ids": ["RemoteBASE._verify_link", "RemoteBASE._link", "RemoteBASE.link"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def link(self, from_info, to_info):\n self._link(from_info, to_info, self.cache_types)\n\n def _link(self, from_info, to_info, link_types):\n assert self.isfile(from_info)\n\n self.makedirs(to_info.parent)\n\n self._try_links(from_info, to_info, link_types)\n\n def _verify_link(self, path_info, link_type):\n if self.cache_type_confirmed:\n return\n\n is_link = getattr(self, \"is_{}\".format(link_type), None)\n if is_link and not is_link(path_info):\n self.remove(path_info)\n raise DvcException(\"failed to verify {}\".format(link_type))\n\n self.cache_type_confirmed = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._try_links_RemoteBASE._do_link.logger_debug_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._try_links_RemoteBASE._do_link.logger_debug_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 398, "end_line": 423, "span_ids": ["RemoteBASE._do_link", "RemoteBASE._try_links"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n @slow_link_guard\n def _try_links(self, from_info, to_info, link_types):\n while link_types:\n link_method = getattr(self, link_types[0])\n try:\n self._do_link(from_info, to_info, link_method)\n self._verify_link(to_info, link_types[0])\n return\n\n except DvcException as exc:\n logger.debug(\n \"Cache type '%s' is not supported: %s\", link_types[0], exc\n )\n del link_types[0]\n\n raise DvcException(\"no possible cache types left to try out.\")\n\n def _do_link(self, from_info, to_info, link_method):\n if self.exists(to_info):\n raise DvcException(\"Link '{}' already exists!\".format(to_info))\n\n link_method(from_info, to_info)\n\n logger.debug(\n \"Created '%s': %s -> %s\", self.cache_types[0], from_info, to_info,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_file_RemoteBASE._save_file.self_state_save_cache_inf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_file_RemoteBASE._save_file.self_state_save_cache_inf", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 425, "end_line": 446, "span_ids": ["RemoteBASE._save_file"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _save_file(self, path_info, checksum, save_link=True):\n assert checksum\n\n cache_info = self.checksum_to_path_info(checksum)\n if self.changed_cache(checksum):\n self.move(path_info, cache_info, mode=self.CACHE_MODE)\n self.link(cache_info, path_info)\n elif self.iscopy(path_info) and self._cache_is_copy(path_info):\n # Default relink procedure involves unneeded copy\n self.unprotect(path_info)\n else:\n self.remove(path_info)\n self.link(cache_info, path_info)\n\n if save_link:\n self.state.save_link(path_info)\n\n # we need to update path and cache, since in case of reflink,\n # or copy cache type moving original file results in updates on\n # next executed command, which causes md5 recalculation\n self.state.save(path_info, checksum)\n self.state.save(cache_info, checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_is_copy_RemoteBASE._cache_is_copy.return.self_cache_types_0_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_is_copy_RemoteBASE._cache_is_copy.return.self_cache_types_0_c", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 448, "end_line": 468, "span_ids": ["RemoteBASE._cache_is_copy"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _cache_is_copy(self, path_info):\n \"\"\"Checks whether cache uses copies.\"\"\"\n if self.cache_type_confirmed:\n return self.cache_types[0] == \"copy\"\n\n if set(self.cache_types) <= {\"copy\"}:\n return True\n\n workspace_file = path_info.with_name(\".\" + uuid())\n test_cache_file = self.path_info / \".cache_type_test_file\"\n if not self.exists(test_cache_file):\n with self.open(test_cache_file, \"wb\") as fobj:\n fobj.write(bytes(1))\n try:\n self.link(test_cache_file, workspace_file)\n finally:\n self.remove(workspace_file)\n self.remove(test_cache_file)\n\n self.cache_type_confirmed = True\n return self.cache_types[0] == \"copy\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_dir_RemoteBASE._save_dir.self_state_save_path_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_dir_RemoteBASE._save_dir.self_state_save_path_info", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 473, "end_line": 488, "span_ids": ["RemoteBASE._save_dir"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _save_dir(self, path_info, checksum, save_link=True):\n cache_info = self.checksum_to_path_info(checksum)\n dir_info = self.get_dir_cache(checksum)\n\n for entry in Tqdm(\n dir_info, desc=\"Saving \" + path_info.name, unit=\"file\"\n ):\n entry_info = path_info / entry[self.PARAM_RELPATH]\n entry_checksum = entry[self.PARAM_CHECKSUM]\n self._save_file(entry_info, entry_checksum, save_link=False)\n\n if save_link:\n self.state.save_link(path_info)\n\n self.state.save(cache_info, checksum)\n self.state.save(path_info, checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_empty_RemoteBASE._handle_transfer_exception.return.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_empty_RemoteBASE._handle_transfer_exception.return.1", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 490, "end_line": 544, "span_ids": ["RemoteBASE.iscopy", "RemoteBASE.protect", "RemoteBASE.isdir", "RemoteBASE.is_empty", "RemoteBASE._save", "RemoteBASE._handle_transfer_exception", "RemoteBASE.isfile", "RemoteBASE.save", "RemoteBASE.walk_files"], "tokens": 400}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def is_empty(self, path_info):\n return False\n\n def isfile(self, path_info):\n \"\"\"Optional: Overwrite only if the remote has a way to distinguish\n between a directory and a file.\n \"\"\"\n return True\n\n def isdir(self, path_info):\n \"\"\"Optional: Overwrite only if the remote has a way to distinguish\n between a directory and a file.\n \"\"\"\n return False\n\n def iscopy(self, path_info):\n \"\"\"Check if this file is an independent copy.\"\"\"\n return False # We can't be sure by default\n\n def walk_files(self, path_info):\n \"\"\"Return a generator with `PathInfo`s to all the files\"\"\"\n raise NotImplementedError\n\n @staticmethod\n def protect(path_info):\n pass\n\n def save(self, path_info, checksum_info, save_link=True):\n if path_info.scheme != self.scheme:\n raise RemoteActionNotImplemented(\n \"save {} -> {}\".format(path_info.scheme, self.scheme),\n self.scheme,\n )\n\n checksum = checksum_info[self.PARAM_CHECKSUM]\n self._save(path_info, checksum, save_link)\n\n def _save(self, path_info, checksum, save_link=True):\n to_info = self.checksum_to_path_info(checksum)\n logger.debug(\"Saving '%s' to '%s'.\", path_info, to_info)\n if self.isdir(path_info):\n self._save_dir(path_info, checksum, save_link)\n return\n self._save_file(path_info, checksum, save_link)\n\n def _handle_transfer_exception(\n self, from_info, to_info, exception, operation\n ):\n if isinstance(exception, OSError) and exception.errno == errno.EMFILE:\n raise exception\n\n logger.exception(\n \"failed to %s '%s' to '%s'\", operation, from_info, to_info\n )\n return 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.upload_RemoteBASE.upload.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.upload_RemoteBASE.upload.return.0", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 541, "end_line": 567, "span_ids": ["RemoteBASE.upload"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def upload(self, from_info, to_info, name=None, no_progress_bar=False):\n if not hasattr(self, \"_upload\"):\n raise RemoteActionNotImplemented(\"upload\", self.scheme)\n\n if to_info.scheme != self.scheme:\n raise NotImplementedError\n\n if from_info.scheme != \"local\":\n raise NotImplementedError\n\n logger.debug(\"Uploading '%s' to '%s'\", from_info, to_info)\n\n name = name or from_info.name\n\n try:\n self._upload(\n from_info.fspath,\n to_info,\n name=name,\n no_progress_bar=no_progress_bar,\n )\n except Exception as e:\n return self._handle_transfer_exception(\n from_info, to_info, e, \"upload\"\n )\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.download_RemoteBASE.download.return.self__download_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.download_RemoteBASE.download.return.self__download_file_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 569, "end_line": 597, "span_ids": ["RemoteBASE.download"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def download(\n self,\n from_info,\n to_info,\n name=None,\n no_progress_bar=False,\n file_mode=None,\n dir_mode=None,\n ):\n if not hasattr(self, \"_download\"):\n raise RemoteActionNotImplemented(\"download\", self.scheme)\n\n if from_info.scheme != self.scheme:\n raise NotImplementedError\n\n if to_info.scheme == self.scheme != \"local\":\n self.copy(from_info, to_info)\n return 0\n\n if to_info.scheme != \"local\":\n raise NotImplementedError\n\n if self.isdir(from_info):\n return self._download_dir(\n from_info, to_info, name, no_progress_bar, file_mode, dir_mode\n )\n return self._download_file(\n from_info, to_info, name, no_progress_bar, file_mode, dir_mode\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._download_file_RemoteBASE._download_file.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._download_file_RemoteBASE._download_file.return.0", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 625, "end_line": 646, "span_ids": ["RemoteBASE._download_file"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _download_file(\n self, from_info, to_info, name, no_progress_bar, file_mode, dir_mode\n ):\n makedirs(to_info.parent, exist_ok=True, mode=dir_mode)\n\n logger.debug(\"Downloading '%s' to '%s'\", from_info, to_info)\n name = name or to_info.name\n\n tmp_file = tmp_fname(to_info)\n\n try:\n self._download(\n from_info, tmp_file, name=name, no_progress_bar=no_progress_bar\n )\n except Exception as e:\n return self._handle_transfer_exception(\n from_info, to_info, e, \"download\"\n )\n\n move(tmp_file, to_info, mode=file_mode)\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_file_RemoteBASE.makedirs._Optional_Implement_on": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_file_RemoteBASE.makedirs._Optional_Implement_on", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 867, "end_line": 889, "span_ids": ["RemoteBASE.makedirs", "RemoteBASE._checkout_file"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _checkout_file(\n self, path_info, checksum, force, progress_callback=None, relink=False\n ):\n \"\"\"The file is changed we need to checkout a new copy\"\"\"\n added, modified = True, False\n cache_info = self.checksum_to_path_info(checksum)\n if self.exists(path_info):\n logger.debug(\"data '%s' will be replaced.\", path_info)\n self.safe_remove(path_info, force=force)\n added, modified = False, True\n\n self.link(cache_info, path_info)\n self.state.save_link(path_info)\n self.state.save(path_info, checksum)\n if progress_callback:\n progress_callback(str(path_info))\n\n return added, modified and not relink\n\n def makedirs(self, path_info):\n \"\"\"Optional: Implement only if the remote needs to create\n directories before copying/linking/moving data\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_dir_RemoteBASE._remove_redundant_files.return.bool_redundant_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_dir_RemoteBASE._remove_redundant_files.return.bool_redundant_files_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 891, "end_line": 950, "span_ids": ["RemoteBASE._checkout_dir", "RemoteBASE._remove_redundant_files"], "tokens": 421}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _checkout_dir(\n self,\n path_info,\n checksum,\n force,\n progress_callback=None,\n relink=False,\n filter_info=None,\n ):\n added, modified = False, False\n # Create dir separately so that dir is created\n # even if there are no files in it\n if not self.exists(path_info):\n added = True\n self.makedirs(path_info)\n\n dir_info = self.get_dir_cache(checksum)\n\n logger.debug(\"Linking directory '%s'.\", path_info)\n\n for entry in dir_info:\n relative_path = entry[self.PARAM_RELPATH]\n entry_checksum = entry[self.PARAM_CHECKSUM]\n entry_cache_info = self.checksum_to_path_info(entry_checksum)\n entry_info = path_info / relative_path\n\n if filter_info and not entry_info.isin_or_eq(filter_info):\n continue\n\n entry_checksum_info = {self.PARAM_CHECKSUM: entry_checksum}\n if relink or self.changed(entry_info, entry_checksum_info):\n modified = True\n self.safe_remove(entry_info, force=force)\n self.link(entry_cache_info, entry_info)\n self.state.save(entry_info, entry_checksum)\n if progress_callback:\n progress_callback(str(entry_info))\n\n modified = (\n self._remove_redundant_files(path_info, dir_info, force)\n or modified\n )\n\n self.state.save_link(path_info)\n self.state.save(path_info, checksum)\n\n # relink is not modified, assume it as nochange\n return added, not added and modified and not relink\n\n def _remove_redundant_files(self, path_info, dir_info, force):\n existing_files = set(self.walk_files(path_info))\n\n needed_files = {\n path_info / entry[self.PARAM_RELPATH] for entry in dir_info\n }\n redundant_files = existing_files - needed_files\n for path in redundant_files:\n self.safe_remove(path, force)\n\n return bool(redundant_files)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.checkout_RemoteBASE.checkout.return.self__checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.checkout_RemoteBASE.checkout.return.self__checkout_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 952, "end_line": 1006, "span_ids": ["RemoteBASE.checkout"], "tokens": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def checkout(\n self,\n path_info,\n checksum_info,\n force=False,\n progress_callback=None,\n relink=False,\n filter_info=None,\n ):\n if path_info.scheme not in [\"local\", self.scheme]:\n raise NotImplementedError\n\n checksum = checksum_info.get(self.PARAM_CHECKSUM)\n failed = None\n skip = False\n if not checksum:\n logger.warning(\n \"No file hash info found for '%s'. \" \"It won't be created.\",\n path_info,\n )\n self.safe_remove(path_info, force=force)\n failed = path_info\n\n elif not relink and not self.changed(path_info, checksum_info):\n logger.debug(\"Data '%s' didn't change.\", path_info)\n skip = True\n\n elif self.changed_cache(\n checksum, path_info=path_info, filter_info=filter_info\n ):\n logger.warning(\n \"Cache '%s' not found. File '%s' won't be created.\",\n checksum,\n path_info,\n )\n self.safe_remove(path_info, force=force)\n failed = path_info\n\n if failed or skip:\n if progress_callback:\n progress_callback(\n str(path_info),\n self.get_files_number(\n self.path_info, checksum, filter_info\n ),\n )\n if failed:\n raise CheckoutError([failed])\n return\n\n logger.debug(\"Checking out '%s' with cache '%s'.\", path_info, checksum)\n\n return self._checkout(\n path_info, checksum, force, progress_callback, relink, filter_info,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_logging_dynamic_chunk_size.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_logging_dynamic_chunk_size.return.wrapper", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["imports", "dynamic_chunk_size"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nfrom datetime import timedelta\nfrom functools import wraps\nimport io\nimport os.path\nimport posixpath\nimport threading\n\nfrom funcy import cached_property, wrap_prop\n\nfrom dvc.exceptions import DvcException\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.scheme import Schemes\n\nlogger = logging.getLogger(__name__)\n\n\ndef dynamic_chunk_size(func):\n @wraps(func)\n def wrapper(*args, **kwargs):\n import requests\n from google.cloud.storage.blob import Blob\n\n # `ConnectionError` may be due to too large `chunk_size`\n # (see [#2572]) so try halving on error.\n # Note: start with 40 * [default: 256K] = 10M.\n # Note: must be multiple of 256K.\n #\n # [#2572]: https://github.com/iterative/dvc/issues/2572\n\n # skipcq: PYL-W0212\n multiplier = 40\n while True:\n try:\n # skipcq: PYL-W0212\n chunk_size = Blob._CHUNK_SIZE_MULTIPLE * multiplier\n return func(*args, chunk_size=chunk_size, **kwargs)\n except requests.exceptions.ConnectionError:\n multiplier //= 2\n if not multiplier:\n raise\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py__upload_to_bucket__upload_to_bucket.with_io_open_from_file_m.with_Tqdm_wrapattr_.blob_upload_from_file_wra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py__upload_to_bucket__upload_to_bucket.with_io_open_from_file_m.with_Tqdm_wrapattr_.blob_upload_from_file_wra", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 65, "span_ids": ["_upload_to_bucket"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@dynamic_chunk_size\ndef _upload_to_bucket(\n bucket,\n from_file,\n to_info,\n chunk_size=None,\n name=None,\n no_progress_bar=False,\n):\n blob = bucket.blob(to_info.path, chunk_size=chunk_size)\n with io.open(from_file, mode=\"rb\") as fobj:\n with Tqdm.wrapattr(\n fobj,\n \"read\",\n desc=name or to_info.path,\n total=os.path.getsize(from_file),\n disable=no_progress_bar,\n ) as wrapped:\n blob.upload_from_file(wrapped)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_io_RemoteHDFS.hdfs.return.get_connection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_io_RemoteHDFS.hdfs.return.get_connection_", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 52, "span_ids": ["RemoteHDFS.__init__", "imports", "RemoteHDFS.hdfs", "RemoteHDFS"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import io\nimport logging\nimport os\nimport posixpath\nimport re\nimport subprocess\nfrom collections import deque\nfrom contextlib import closing, contextmanager\nfrom urllib.parse import urlparse\n\nfrom .base import RemoteBASE, RemoteCmdError\nfrom .pool import get_connection\nfrom dvc.scheme import Schemes\nfrom dvc.utils import fix_env, tmp_fname\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteHDFS(RemoteBASE):\n scheme = Schemes.HDFS\n REGEX = r\"^hdfs://((?P.*)@)?.*$\"\n PARAM_CHECKSUM = \"checksum\"\n REQUIRES = {\"pyarrow\": \"pyarrow\"}\n TRAVERSE_PREFIX_LEN = 2\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n self.path_info = None\n url = config.get(\"url\")\n if not url:\n return\n\n parsed = urlparse(url)\n user = parsed.username or config.get(\"user\")\n\n self.path_info = self.path_cls.from_parts(\n scheme=self.scheme,\n host=parsed.hostname,\n user=user,\n port=parsed.port,\n path=parsed.path,\n )\n\n def hdfs(self, path_info):\n import pyarrow\n\n return get_connection(\n pyarrow.hdfs.connect,\n path_info.host,\n path_info.port,\n user=path_info.user,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS._group_RemoteHDFS.get_file_checksum.return.self__group_regex_stdout": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS._group_RemoteHDFS.get_file_checksum.return.self__group_regex_stdout", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 90, "span_ids": ["RemoteHDFS._group", "RemoteHDFS.get_file_checksum"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHDFS(RemoteBASE):\n\n @staticmethod\n def _group(regex, s, gname):\n match = re.match(regex, s)\n assert match is not None\n return match.group(gname)\n\n def get_file_checksum(self, path_info):\n # NOTE: pyarrow doesn't support checksum, so we need to use hadoop\n regex = r\".*\\t.*\\t(?P.*)\"\n stdout = self.hadoop_fs(\n \"checksum {}\".format(path_info.path), user=path_info.user\n )\n return self._group(regex, stdout, \"checksum\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.copy_RemoteHDFS.copy.with_self_hdfs_to_info_a.with_hdfs_open_from_info_.try_.except_Exception_.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.copy_RemoteHDFS.copy.with_self_hdfs_to_info_a.with_hdfs_open_from_info_.try_.except_Exception_.raise", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 106, "span_ids": ["RemoteHDFS.copy"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHDFS(RemoteBASE):\n\n def copy(self, from_info, to_info, **_kwargs):\n dname = posixpath.dirname(to_info.path)\n with self.hdfs(to_info) as hdfs:\n hdfs.mkdir(dname)\n # NOTE: this is how `hadoop fs -cp` works too: it copies through\n # your local machine.\n with hdfs.open(from_info.path, \"rb\") as from_fobj:\n tmp_info = to_info.parent / tmp_fname(to_info.name)\n try:\n with hdfs.open(tmp_info.path, \"wb\") as tmp_fobj:\n tmp_fobj.upload(from_fobj)\n hdfs.rename(tmp_info.path, to_info.path)\n except Exception:\n self.remove(tmp_info)\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.remove_RemoteHDFS._download.with_self_hdfs_from_info_.with_open_to_file_wb_.hdfs_download_from_info_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.remove_RemoteHDFS._download.with_self_hdfs_from_info_.with_open_to_file_wb_.hdfs_download_from_info_p", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 134, "span_ids": ["RemoteHDFS._upload", "RemoteHDFS.remove", "RemoteHDFS.exists", "RemoteHDFS._download"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHDFS(RemoteBASE):\n\n def remove(self, path_info):\n if path_info.scheme != \"hdfs\":\n raise NotImplementedError\n\n if self.exists(path_info):\n logger.debug(\"Removing {}\".format(path_info.path))\n with self.hdfs(path_info) as hdfs:\n hdfs.rm(path_info.path)\n\n def exists(self, path_info):\n assert not isinstance(path_info, list)\n assert path_info.scheme == \"hdfs\"\n with self.hdfs(path_info) as hdfs:\n return hdfs.exists(path_info.path)\n\n def _upload(self, from_file, to_info, **_kwargs):\n with self.hdfs(to_info) as hdfs:\n hdfs.mkdir(posixpath.dirname(to_info.path))\n tmp_file = tmp_fname(to_info.path)\n with open(from_file, \"rb\") as fobj:\n hdfs.upload(tmp_file, fobj)\n hdfs.rename(tmp_file, to_info.path)\n\n def _download(self, from_info, to_file, **_kwargs):\n with self.hdfs(from_info) as hdfs:\n with open(to_file, \"wb+\") as fobj:\n hdfs.download(from_info.path, fobj)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_logging_ask_password.return.prompt_password_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_logging_ask_password.return.prompt_password_", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["imports", "ask_password"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os.path\nimport threading\n\nfrom funcy import cached_property, memoize, wrap_prop, wrap_with\n\nfrom dvc.path_info import HTTPURLInfo\nimport dvc.prompt as prompt\nfrom dvc.exceptions import DvcException, HTTPError\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.scheme import Schemes\n\nlogger = logging.getLogger(__name__)\n\n\n@wrap_with(threading.Lock())\n@memoize\ndef ask_password(host, user):\n return prompt.password(\n \"Enter a password for \"\n \"host '{host}' user '{user}'\".format(host=host, user=user)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP_RemoteHTTP.__init__.self.headers._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP_RemoteHTTP.__init__.self.headers._", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 52, "span_ids": ["RemoteHTTP.__init__", "RemoteHTTP"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHTTP(RemoteBASE):\n scheme = Schemes.HTTP\n path_cls = HTTPURLInfo\n SESSION_RETRIES = 5\n SESSION_BACKOFF_FACTOR = 0.1\n REQUEST_TIMEOUT = 10\n CHUNK_SIZE = 2 ** 16\n PARAM_CHECKSUM = \"etag\"\n CAN_TRAVERSE = False\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n\n url = config.get(\"url\")\n if url:\n self.path_info = self.path_cls(url)\n user = config.get(\"user\", None)\n if user:\n self.path_info.user = user\n else:\n self.path_info = None\n\n self.auth = config.get(\"auth\", None)\n self.custom_auth_header = config.get(\"custom_auth_header\", None)\n self.password = config.get(\"password\", None)\n self.ask_password = config.get(\"ask_password\", False)\n self.headers = {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.auth_method_RemoteHTTP._session.return.session": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.auth_method_RemoteHTTP._session.return.session", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 159, "span_ids": ["RemoteHTTP._session", "RemoteHTTP.auth_method"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHTTP(RemoteBASE):\n\n def auth_method(self, path_info=None):\n from requests.auth import HTTPBasicAuth, HTTPDigestAuth\n\n if path_info is None:\n path_info = self.path_info\n\n if self.auth:\n if self.ask_password and self.password is None:\n host, user = path_info.host, path_info.user\n self.password = ask_password(host, user)\n if self.auth == \"basic\":\n return HTTPBasicAuth(path_info.user, self.password)\n if self.auth == \"digest\":\n return HTTPDigestAuth(path_info.user, self.password)\n if self.auth == \"custom\" and self.custom_auth_header:\n self.headers.update({self.custom_auth_header: self.password})\n return None\n\n @wrap_prop(threading.Lock())\n @cached_property\n def _session(self):\n import requests\n from requests.adapters import HTTPAdapter\n from urllib3.util.retry import Retry\n\n session = requests.Session()\n\n retries = Retry(\n total=self.SESSION_RETRIES,\n backoff_factor=self.SESSION_BACKOFF_FACTOR,\n )\n\n session.mount(\"http://\", HTTPAdapter(max_retries=retries))\n session.mount(\"https://\", HTTPAdapter(max_retries=retries))\n\n return session", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._request_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._request_", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 195, "span_ids": ["RemoteHTTP._request", "RemoteHTTP.gc"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHTTP(RemoteBASE):\n\n def _request(self, method, url, **kwargs):\n import requests\n\n kwargs.setdefault(\"allow_redirects\", True)\n kwargs.setdefault(\"timeout\", self.REQUEST_TIMEOUT)\n\n try:\n res = self._session.request(\n method,\n url,\n auth=self.auth_method(),\n headers=self.headers,\n **kwargs,\n )\n\n redirect_no_location = (\n kwargs[\"allow_redirects\"]\n and res.status_code in (301, 302)\n and \"location\" not in res.headers\n )\n\n if redirect_no_location:\n # AWS s3 doesn't like to add a location header to its redirects\n # from https://s3.amazonaws.com//* type URLs.\n # This should be treated as an error\n raise requests.exceptions.RequestException\n\n return res\n\n except requests.exceptions.RequestException:\n raise DvcException(\"could not perform a {} request\".format(method))\n\n def gc(self):\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_errno_logger.logging_getLogger___name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_errno_logger.logging_getLogger___name_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["imports"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import errno\nimport logging\nimport os\nimport stat\nfrom concurrent.futures import as_completed, ThreadPoolExecutor\nfrom functools import partial\n\nfrom funcy import concat\n\nfrom shortuuid import uuid\n\nfrom dvc.compat import fspath_py35\nfrom dvc.exceptions import DvcException, DownloadError, UploadError\nfrom dvc.path_info import PathInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import (\n index_locked,\n RemoteBASE,\n STATUS_MAP,\n STATUS_DELETED,\n STATUS_MISSING,\n STATUS_NEW,\n)\nfrom dvc.remote.index import RemoteIndexNoop\nfrom dvc.scheme import Schemes\nfrom dvc.scm.tree import is_working_tree\nfrom dvc.system import System\nfrom dvc.utils import file_md5, relpath, tmp_fname\nfrom dvc.utils.fs import copyfile, move, makedirs, remove, walk_files\n\nlogger = logging.getLogger(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._fill_statuses_RemoteLOCAL._get_plans.return.from_infos_to_infos_nam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._fill_statuses_RemoteLOCAL._get_plans.return.from_infos_to_infos_nam", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 310, "span_ids": ["RemoteLOCAL._fill_statuses", "RemoteLOCAL._get_plans"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n @staticmethod\n def _fill_statuses(checksum_info_dir, local_exists, remote_exists):\n # Using sets because they are way faster for lookups\n local = set(local_exists)\n remote = set(remote_exists)\n\n for md5, info in checksum_info_dir.items():\n status = STATUS_MAP[(md5 in local, md5 in remote)]\n info[\"status\"] = status\n\n def _get_plans(self, download, remote, status_info, status):\n cache = []\n path_infos = []\n names = []\n for md5, info in Tqdm(\n status_info.items(), desc=\"Analysing status\", unit=\"file\"\n ):\n if info[\"status\"] == status:\n cache.append(self.checksum_to_path_info(md5))\n path_infos.append(remote.checksum_to_path_info(md5))\n names.append(info[\"name\"])\n\n if download:\n to_infos = cache\n from_infos = path_infos\n else:\n to_infos = path_infos\n from_infos = cache\n\n return from_infos, to_infos, names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_file_RemoteLOCAL._unprotect_file.os_chmod_path_self__file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_file_RemoteLOCAL._unprotect_file.os_chmod_path_self__file", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 403, "end_line": 423, "span_ids": ["RemoteLOCAL._unprotect_file"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _unprotect_file(self, path):\n if System.is_symlink(path) or System.is_hardlink(path):\n logger.debug(\"Unprotecting '{}'\".format(path))\n tmp = os.path.join(os.path.dirname(path), \".\" + uuid())\n\n # The operations order is important here - if some application\n # would access the file during the process of copyfile then it\n # would get only the part of file. So, at first, the file should be\n # copied with the temporary name, and then original file should be\n # replaced by new.\n copyfile(path, tmp, name=\"Unprotecting '{}'\".format(relpath(path)))\n remove(path)\n os.rename(tmp, path)\n\n else:\n logger.debug(\n \"Skipping copying for '{}', since it is not \"\n \"a symlink or a hardlink.\".format(path)\n )\n\n os.chmod(path, self._file_mode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._create_unpacked_dir_RemoteLOCAL._create_unpacked_dir.self_state_save_unpacked_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._create_unpacked_dir_RemoteLOCAL._create_unpacked_dir.self_state_save_unpacked_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 488, "end_line": 505, "span_ids": ["RemoteLOCAL._create_unpacked_dir"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _create_unpacked_dir(self, checksum, dir_info, unpacked_dir_info):\n self.makedirs(unpacked_dir_info)\n\n for entry in Tqdm(dir_info, desc=\"Creating unpacked dir\", unit=\"file\"):\n entry_cache_info = self.checksum_to_path_info(\n entry[self.PARAM_CHECKSUM]\n )\n relative_path = entry[self.PARAM_RELPATH]\n # In shared cache mode some cache files might not be owned by the\n # user, so we need to use symlinks because, unless\n # /proc/sys/fs/protected_hardlinks is disabled, the user is not\n # allowed to create hardlinks to files that he doesn't own.\n link_types = [\"hardlink\", \"symlink\"]\n self._link(\n entry_cache_info, unpacked_dir_info / relative_path, link_types\n )\n\n self.state.save(unpacked_dir_info, checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._changed_unpacked_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._changed_unpacked_dir_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 507, "end_line": 526, "span_ids": ["RemoteLOCAL._changed_unpacked_dir", "RemoteLOCAL.is_protected", "RemoteLOCAL._get_unpacked_dir_names"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _changed_unpacked_dir(self, checksum):\n status_unpacked_dir_info = self._get_unpacked_dir_path_info(checksum)\n\n return not self.state.get(status_unpacked_dir_info)\n\n def _get_unpacked_dir_names(self, checksums):\n unpacked = set()\n for c in checksums:\n if self.is_dir_checksum(c):\n unpacked.add(c + self.UNPACKED_DIR_SUFFIX)\n return unpacked\n\n def is_protected(self, path_info):\n if not self.exists(path_info):\n return False\n\n mode = os.stat(fspath_py35(path_info)).st_mode\n\n return stat.S_IMODE(mode) == self.CACHE_MODE", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_logging_RemoteOSS.__init__.self.key_secret._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_logging_RemoteOSS.__init__.self.key_secret._", "embedding": null, "metadata": {"file_path": "dvc/remote/oss.py", "file_name": "oss.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 61, "span_ids": ["imports", "RemoteOSS", "RemoteOSS.__init__"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\nimport posixpath\nimport threading\n\nfrom funcy import cached_property, wrap_prop\n\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.scheme import Schemes\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteOSS(RemoteBASE):\n \"\"\"\n oss2 document:\n https://www.alibabacloud.com/help/doc-detail/32026.htm\n\n\n Examples\n ----------\n $ dvc remote add myremote oss://my-bucket/path\n Set key id, key secret and endpoint using modify command\n $ dvc remote modify myremote oss_key_id my-key-id\n $ dvc remote modify myremote oss_key_secret my-key-secret\n $ dvc remote modify myremote oss_endpoint endpoint\n or environment variables\n $ export OSS_ACCESS_KEY_ID=\"my-key-id\"\n $ export OSS_ACCESS_KEY_SECRET=\"my-key-secret\"\n $ export OSS_ENDPOINT=\"endpoint\"\n \"\"\"\n\n scheme = Schemes.OSS\n path_cls = CloudURLInfo\n REQUIRES = {\"oss2\": \"oss2\"}\n PARAM_CHECKSUM = \"etag\"\n COPY_POLL_SECONDS = 5\n LIST_OBJECT_PAGE_SIZE = 100\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n\n url = config.get(\"url\")\n self.path_info = self.path_cls(url) if url else None\n\n self.endpoint = config.get(\"oss_endpoint\") or os.getenv(\"OSS_ENDPOINT\")\n\n self.key_id = (\n config.get(\"oss_key_id\")\n or os.getenv(\"OSS_ACCESS_KEY_ID\")\n or \"defaultId\"\n )\n\n self.key_secret = (\n config.get(\"oss_key_secret\")\n or os.getenv(\"OSS_ACCESS_KEY_SECRET\")\n or \"defaultSecret\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.oss_service_RemoteOSS.oss_service.return.bucket": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.oss_service_RemoteOSS.oss_service.return.bucket", "embedding": null, "metadata": {"file_path": "dvc/remote/oss.py", "file_name": "oss.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 83, "span_ids": ["RemoteOSS.oss_service"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteOSS(RemoteBASE):\n\n @wrap_prop(threading.Lock())\n @cached_property\n def oss_service(self):\n import oss2\n\n logger.debug(\"URL: {}\".format(self.path_info))\n logger.debug(\"key id: {}\".format(self.key_id))\n logger.debug(\"key secret: {}\".format(self.key_secret))\n\n auth = oss2.Auth(self.key_id, self.key_secret)\n bucket = oss2.Bucket(auth, self.endpoint, self.path_info.bucket)\n\n # Ensure bucket exists\n try:\n bucket.get_bucket_info()\n except oss2.exceptions.NoSuchBucket:\n bucket.create_bucket(\n oss2.BUCKET_ACL_PUBLIC_READ,\n oss2.models.BucketCreateConfig(\n oss2.BUCKET_STORAGE_CLASS_STANDARD\n ),\n )\n return bucket", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/pool.py_from_collections_import_d_close_pools.get_pool_memory_clear_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/pool.py_from_collections_import_d_close_pools.get_pool_memory_clear_", "embedding": null, "metadata": {"file_path": "dvc/remote/pool.py", "file_name": "pool.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["close_pools", "imports", "get_connection", "get_pool"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import deque\nfrom contextlib import contextmanager\nimport threading\n\nfrom funcy import memoize, wrap_with\n\n\n@contextmanager\ndef get_connection(conn_func, *args, **kwargs):\n pool = get_pool(conn_func, *args, **kwargs)\n conn = pool.get_connection()\n try:\n yield conn\n except BaseException:\n conn.close()\n raise\n else:\n pool.release(conn)\n\n\n@wrap_with(threading.Lock())\n@memoize\ndef get_pool(conn_func, *args, **kwargs):\n return Pool(conn_func, *args, **kwargs)\n\n\ndef close_pools():\n for pool in get_pool.memory.values():\n pool.close()\n get_pool.memory.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/pool.py_Pool_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/pool.py_Pool_", "embedding": null, "metadata": {"file_path": "dvc/remote/pool.py", "file_name": "pool.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 60, "span_ids": ["Pool.release", "Pool.get_connection", "Pool", "Pool.close", "Pool.__del__", "Pool.__init__"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Pool(object):\n def __init__(self, conn_func, *conn_args, **conn_kwargs):\n self._conn_func = conn_func\n self._conn_args = conn_args\n self._conn_kwargs = conn_kwargs\n self._conns = deque()\n self._closed = False\n\n def __del__(self):\n self.close()\n\n def close(self):\n while self._conns:\n self._conns.pop().close()\n self._closed = True\n\n def get_connection(self):\n try:\n return self._conns.popleft()\n except IndexError:\n return self._conn_func(*self._conn_args, **self._conn_kwargs)\n\n def release(self, conn):\n if self._closed:\n conn.close()\n else:\n self._conns.append(conn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py__coding_utf_8__RemoteS3.get_head_object.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py__coding_utf_8__RemoteS3.get_head_object.return.obj", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 91, "span_ids": ["RemoteS3", "RemoteS3.s3", "RemoteS3.__init__", "RemoteS3.get_file_checksum", "RemoteS3.get_head_object", "docstring", "RemoteS3.get_etag"], "tokens": 597}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# -*- coding: utf-8 -*-\n\nimport logging\nimport os\nimport posixpath\nimport threading\n\nfrom funcy import cached_property, wrap_prop\n\nfrom dvc.config import ConfigError\nfrom dvc.exceptions import DvcException\nfrom dvc.exceptions import ETagMismatchError\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.scheme import Schemes\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteS3(RemoteBASE):\n scheme = Schemes.S3\n path_cls = CloudURLInfo\n REQUIRES = {\"boto3\": \"boto3\"}\n PARAM_CHECKSUM = \"etag\"\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n\n url = config.get(\"url\", \"s3://\")\n self.path_info = self.path_cls(url)\n\n self.region = config.get(\"region\")\n self.profile = config.get(\"profile\")\n self.endpoint_url = config.get(\"endpointurl\")\n\n if config.get(\"listobjects\"):\n self.list_objects_api = \"list_objects\"\n else:\n self.list_objects_api = \"list_objects_v2\"\n\n self.use_ssl = config.get(\"use_ssl\", True)\n\n self.extra_args = {}\n\n self.sse = config.get(\"sse\")\n if self.sse:\n self.extra_args[\"ServerSideEncryption\"] = self.sse\n\n self.acl = config.get(\"acl\")\n if self.acl:\n self.extra_args[\"ACL\"] = self.acl\n\n self._append_aws_grants_to_extra_args(config)\n\n shared_creds = config.get(\"credentialpath\")\n if shared_creds:\n os.environ.setdefault(\"AWS_SHARED_CREDENTIALS_FILE\", shared_creds)\n\n @wrap_prop(threading.Lock())\n @cached_property\n def s3(self):\n import boto3\n\n session = boto3.session.Session(\n profile_name=self.profile, region_name=self.region\n )\n\n return session.client(\n \"s3\", endpoint_url=self.endpoint_url, use_ssl=self.use_ssl\n )\n\n @classmethod\n def get_etag(cls, s3, bucket, path):\n obj = cls.get_head_object(s3, bucket, path)\n\n return obj[\"ETag\"].strip('\"')\n\n def get_file_checksum(self, path_info):\n return self.get_etag(self.s3, path_info.bucket, path_info.path)\n\n @staticmethod\n def get_head_object(s3, bucket, path, *args, **kwargs):\n\n try:\n obj = s3.head_object(Bucket=bucket, Key=path, *args, **kwargs)\n except Exception as exc:\n raise DvcException(\n \"s3://{}/{} does not exist\".format(bucket, path)\n ) from exc\n return obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.isdir_RemoteS3.isdir.return.bool_list_self__list_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.isdir_RemoteS3.isdir.return.bool_list_self__list_path", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 266, "span_ids": ["RemoteS3.isdir"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n def isdir(self, path_info):\n # S3 doesn't have a concept for directories.\n #\n # Using `head_object` with a path pointing to a directory\n # will throw a 404 error.\n #\n # A reliable way to know if a given path is a directory is by\n # checking if there are more files sharing the same prefix\n # with a `list_objects` call.\n #\n # We need to make sure that the path ends with a forward slash,\n # since we can end with false-positives like the following example:\n #\n # bucket\n # \u2514\u2500\u2500 data\n # \u251c\u2500\u2500 alice\n # \u2514\u2500\u2500 alpha\n #\n # Using `data/al` as prefix will return `[data/alice, data/alpha]`,\n # While `data/al/` will return nothing.\n #\n dir_path = path_info / \"\"\n return bool(list(self._list_paths(dir_path, max_items=1)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._upload_RemoteS3.walk_files.for_fname_in_self__list_p.yield_path_info_replace_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._upload_RemoteS3.walk_files.for_fname_in_self__list_p.yield_path_info_replace_p", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 268, "end_line": 306, "span_ids": ["RemoteS3.walk_files", "RemoteS3._download", "RemoteS3._generate_download_url", "RemoteS3._upload"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n def _upload(self, from_file, to_info, name=None, no_progress_bar=False):\n total = os.path.getsize(from_file)\n with Tqdm(\n disable=no_progress_bar, total=total, bytes=True, desc=name\n ) as pbar:\n self.s3.upload_file(\n from_file,\n to_info.bucket,\n to_info.path,\n Callback=pbar.update,\n ExtraArgs=self.extra_args,\n )\n\n def _download(self, from_info, to_file, name=None, no_progress_bar=False):\n if no_progress_bar:\n total = None\n else:\n total = self.s3.head_object(\n Bucket=from_info.bucket, Key=from_info.path\n )[\"ContentLength\"]\n with Tqdm(\n disable=no_progress_bar, total=total, bytes=True, desc=name\n ) as pbar:\n self.s3.download_file(\n from_info.bucket, from_info.path, to_file, Callback=pbar.update\n )\n\n def _generate_download_url(self, path_info, expires=3600):\n params = {\"Bucket\": path_info.bucket, \"Key\": path_info.path}\n return self.s3.generate_presigned_url(\n ClientMethod=\"get_object\", Params=params, ExpiresIn=int(expires)\n )\n\n def walk_files(self, path_info, max_items=None):\n for fname in self._list_paths(path_info / \"\", max_items):\n if fname.endswith(\"/\"):\n continue\n\n yield path_info.replace(path=fname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._append_aws_grants_to_extra_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._append_aws_grants_to_extra_args_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 338, "span_ids": ["RemoteS3._append_aws_grants_to_extra_args"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n def _append_aws_grants_to_extra_args(self, config):\n # Keys for extra_args can be one of the following list:\n # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/customizations/s3.html#boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS\n \"\"\"\n ALLOWED_UPLOAD_ARGS = [\n 'ACL', 'CacheControl', 'ContentDisposition', 'ContentEncoding',\n 'ContentLanguage', 'ContentType', 'Expires', 'GrantFullControl',\n 'GrantRead', 'GrantReadACP', 'GrantWriteACP', 'Metadata',\n 'RequestPayer', 'ServerSideEncryption', 'StorageClass',\n 'SSECustomerAlgorithm', 'SSECustomerKey', 'SSECustomerKeyMD5',\n 'SSEKMSKeyId', 'WebsiteRedirectLocation'\n ]\n \"\"\"\n\n grants = {\n \"grant_full_control\": \"GrantFullControl\",\n \"grant_read\": \"GrantRead\",\n \"grant_read_acp\": \"GrantReadACP\",\n \"grant_write_acp\": \"GrantWriteACP\",\n }\n\n for grant_option, extra_args_key in grants.items():\n if config.get(grant_option):\n if self.acl:\n raise ConfigError(\n \"`acl` and `grant_*` AWS S3 config options \"\n \"are mutually exclusive\"\n )\n\n self.extra_args[extra_args_key] = config.get(grant_option)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/slow_link_detection.py_logging_this.message._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/slow_link_detection.py_logging_this.message._", "embedding": null, "metadata": {"file_path": "dvc/remote/slow_link_detection.py", "file_name": "slow_link_detection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["imports"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport sys\nimport time\n\nfrom functools import wraps\nimport colorama\n\n\nlogger = logging.getLogger(__name__)\nthis = sys.modules[__name__]\n\nthis.timeout_seconds = 10.0\nthis.already_displayed = False\nthis.message = (\n \"You can cut execution time considerably by using a different \"\n \"`cache.type` configuration.\\n\"\n \"See {blue}https://dvc.org/doc/commands-reference/config#cache{reset} \"\n \"for more information.\\n\"\n \"To disable this message, run:\\n\"\n \"`dvc config cache.slow_link_warning false`\".format(\n blue=colorama.Fore.BLUE, reset=colorama.Fore.RESET\n )\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/slow_link_detection.py_slow_link_guard_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/slow_link_detection.py_slow_link_guard_", "embedding": null, "metadata": {"file_path": "dvc/remote/slow_link_detection.py", "file_name": "slow_link_detection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 48, "span_ids": ["slow_link_guard"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def slow_link_guard(f):\n @wraps(f)\n def wrapper(remote, *args, **kwargs):\n if this.already_displayed:\n return f(remote, *args, **kwargs)\n\n cache_conf = remote.repo.config[\"cache\"]\n slow_link_warning = cache_conf.get(\"slow_link_warning\", True)\n if not slow_link_warning or cache_conf.get(\"type\"):\n return f(remote, *args, **kwargs)\n\n start = time.time()\n result = f(remote, *args, **kwargs)\n delta = time.time() - start\n\n if delta >= this.timeout_seconds:\n logger.warning(this.message)\n this.already_displayed = True\n\n return result\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_errno_ask_password.return.prompt_password_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_errno_ask_password.return.prompt_password_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["imports", "ask_password"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import errno\nimport getpass\nimport io\nimport itertools\nimport logging\nimport os\nimport posixpath\nimport threading\nfrom concurrent.futures import ThreadPoolExecutor\nfrom contextlib import closing, contextmanager\nfrom urllib.parse import urlparse\n\nfrom funcy import memoize, wrap_with, silent, first\n\nimport dvc.prompt as prompt\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.remote.pool import get_connection\nfrom dvc.scheme import Schemes\nfrom dvc.utils import to_chunks\n\nlogger = logging.getLogger(__name__)\n\n\n@wrap_with(threading.Lock())\n@memoize\ndef ask_password(host, user, port):\n return prompt.password(\n \"Enter a private key passphrase or a password for \"\n \"host '{host}' port '{port}' user '{user}'\".format(\n host=host, port=port, user=user\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.hardlink_RemoteSSH.hardlink.with_self_ssh_from_info_.ssh_hardlink_from_info_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.hardlink_RemoteSSH.hardlink.with_self_ssh_from_info_.ssh_hardlink_from_info_pa", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 196, "span_ids": ["RemoteSSH.hardlink"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteSSH(RemoteBASE):\n\n def hardlink(self, from_info, to_info):\n if not from_info.scheme == to_info.scheme == self.scheme:\n raise NotImplementedError\n\n # See dvc/remote/local/__init__.py - hardlink()\n if self.getsize(from_info) == 0:\n\n with self.ssh(to_info) as ssh:\n ssh.sftp.open(to_info.path, \"w\").close()\n\n logger.debug(\n \"Created empty file: {src} -> {dest}\".format(\n src=str(from_info), dest=str(to_info)\n )\n )\n return\n\n with self.ssh(from_info) as ssh:\n ssh.hardlink(from_info.path, to_info.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.reflink_RemoteSSH.makedirs.with_self_ssh_path_info_.ssh_makedirs_path_info_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.reflink_RemoteSSH.makedirs.with_self_ssh_path_info_.ssh_makedirs_path_info_pa", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 283, "span_ids": ["RemoteSSH.open", "RemoteSSH._upload", "RemoteSSH.move", "RemoteSSH.makedirs", "RemoteSSH.reflink", "RemoteSSH.remove", "RemoteSSH._download", "RemoteSSH.list_cache_paths", "RemoteSSH.walk_files"], "tokens": 567}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteSSH(RemoteBASE):\n\n def reflink(self, from_info, to_info):\n if from_info.scheme != self.scheme or to_info.scheme != self.scheme:\n raise NotImplementedError\n\n with self.ssh(from_info) as ssh:\n ssh.reflink(from_info.path, to_info.path)\n\n def remove(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n with self.ssh(path_info) as ssh:\n ssh.remove(path_info.path)\n\n def move(self, from_info, to_info, mode=None):\n assert mode is None\n if from_info.scheme != self.scheme or to_info.scheme != self.scheme:\n raise NotImplementedError\n\n with self.ssh(from_info) as ssh:\n ssh.move(from_info.path, to_info.path)\n\n def _download(self, from_info, to_file, name=None, no_progress_bar=False):\n assert from_info.isin(self.path_info)\n with self.ssh(self.path_info) as ssh:\n ssh.download(\n from_info.path,\n to_file,\n progress_title=name,\n no_progress_bar=no_progress_bar,\n )\n\n def _upload(self, from_file, to_info, name=None, no_progress_bar=False):\n assert to_info.isin(self.path_info)\n with self.ssh(self.path_info) as ssh:\n ssh.upload(\n from_file,\n to_info.path,\n progress_title=name,\n no_progress_bar=no_progress_bar,\n )\n\n @contextmanager\n def open(self, path_info, mode=\"r\", encoding=None):\n assert mode in {\"r\", \"rt\", \"rb\", \"wb\"}\n\n with self.ssh(path_info) as ssh, closing(\n ssh.sftp.open(path_info.path, mode)\n ) as fd:\n if \"b\" in mode:\n yield fd\n else:\n yield io.TextIOWrapper(fd, encoding=encoding)\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n if prefix:\n root = posixpath.join(self.path_info.path, prefix[:2])\n else:\n root = self.path_info.path\n with self.ssh(self.path_info) as ssh:\n # If we simply return an iterator then with above closes instantly\n if progress_callback:\n for path in ssh.walk_files(root):\n progress_callback()\n yield path\n else:\n yield from ssh.walk_files(root)\n\n def walk_files(self, path_info):\n with self.ssh(path_info) as ssh:\n for fname in ssh.walk_files(path_info.path):\n yield path_info.replace(path=fname)\n\n def makedirs(self, path_info):\n with self.ssh(path_info) as ssh:\n ssh.makedirs(path_info.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.cache_exists_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.cache_exists_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 295, "end_line": 324, "span_ids": ["RemoteSSH.cache_exists"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteSSH(RemoteBASE):\n\n def cache_exists(self, checksums, jobs=None, name=None):\n \"\"\"This is older implementation used in remote/base.py\n We are reusing it in RemoteSSH, because SSH's batch_exists proved to be\n faster than current approach (relying on exists(path_info)) applied in\n remote/base.\n \"\"\"\n if not self.CAN_TRAVERSE:\n return list(set(checksums) & set(self.all()))\n\n # possibly prompt for credentials before \"Querying\" progress output\n self.ensure_credentials()\n\n with Tqdm(\n desc=\"Querying \"\n + (\"cache in \" + name if name else \"remote cache\"),\n total=len(checksums),\n unit=\"file\",\n ) as pbar:\n\n def exists_with_progress(chunks):\n return self.batch_exists(chunks, callback=pbar.update_desc)\n\n with ThreadPoolExecutor(max_workers=jobs or self.JOBS) as executor:\n path_infos = [self.checksum_to_path_info(x) for x in checksums]\n chunks = to_chunks(path_infos, num_chunks=self.JOBS)\n results = executor.map(exists_with_progress, chunks)\n in_remote = itertools.chain.from_iterable(results)\n ret = list(itertools.compress(checksums, in_remote))\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_errno_sizeof_fmt.return._1f_s_s_num_Y_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_errno_sizeof_fmt.return._1f_s_s_num_Y_s", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["imports", "sizeof_fmt"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import errno\nimport logging\nimport os\nimport posixpath\nimport stat\nfrom contextlib import suppress\n\nfrom funcy import cached_property\n\ntry:\n import paramiko\nexcept ImportError:\n paramiko = None\n\nfrom dvc.utils import tmp_fname\nfrom dvc.progress import Tqdm\nfrom dvc.exceptions import DvcException\nfrom dvc.remote.base import RemoteCmdError\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef sizeof_fmt(num, suffix=\"B\"):\n \"\"\" Convert number of bytes to human-readable string \"\"\"\n for unit in [\"\", \"K\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\"]:\n if abs(num) < 1024.0:\n return \"%3.1f%s%s\" % (num, unit, suffix)\n num /= 1024.0\n return \"%.1f%s%s\" % (num, \"Y\", suffix)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.makedirs_SSHConnection.makedirs.if_tail_.try_.except_IOError_as_exc_.if_exc_errno_errno_EAC.raise_DvcException_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.makedirs_SSHConnection.makedirs.if_tail_.try_.except_IOError_as_exc_.if_exc_errno_errno_EAC.raise_DvcException_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 112, "span_ids": ["SSHConnection.makedirs"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n def makedirs(self, path):\n # Single stat call will say whether this is a dir, a file or a link\n st_mode = self.st_mode(path)\n\n if stat.S_ISDIR(st_mode):\n return\n\n if stat.S_ISREG(st_mode) or stat.S_ISLNK(st_mode):\n raise DvcException(\n \"a file with the same name '{}' already exists\".format(path)\n )\n\n head, tail = posixpath.split(path)\n\n if head:\n self.makedirs(head)\n\n if tail:\n try:\n self.sftp.mkdir(path)\n except IOError as exc:\n # Since paramiko errors are very vague we need to recheck\n # whether it's because path already exists or something else\n if exc.errno == errno.EACCES or not self.exists(path):\n raise DvcException(\n \"unable to create remote directory '{}'\".format(path)\n ) from exc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_files_SSHConnection.upload.self_sftp_rename_tmp_file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_files_SSHConnection.upload.self_sftp_rename_tmp_file", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 147, "end_line": 216, "span_ids": ["SSHConnection.download", "SSHConnection.walk_files", "SSHConnection.upload", "SSHConnection._remove_dir", "SSHConnection.move", "SSHConnection._remove_file", "SSHConnection.atomic_copy", "SSHConnection.remove"], "tokens": 481}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n def walk_files(self, directory):\n for root, dirs, files in self.walk(directory):\n for fname in files:\n yield posixpath.join(root, fname)\n\n def _remove_file(self, path):\n with suppress(FileNotFoundError):\n self.sftp.remove(path)\n\n def _remove_dir(self, path):\n for root, dirs, files in self.walk(path, topdown=False):\n for fname in files:\n with suppress(FileNotFoundError):\n self._remove_file(posixpath.join(root, fname))\n\n for dname in dirs:\n with suppress(FileNotFoundError):\n self.sftp.rmdir(posixpath.join(root, dname))\n\n with suppress(FileNotFoundError):\n self.sftp.rmdir(path)\n\n def remove(self, path):\n if self.isdir(path):\n self._remove_dir(path)\n else:\n self._remove_file(path)\n\n def download(self, src, dest, no_progress_bar=False, progress_title=None):\n with Tqdm(\n desc=progress_title or os.path.basename(src),\n disable=no_progress_bar,\n bytes=True,\n ) as pbar:\n self.sftp.get(src, dest, callback=pbar.update_to)\n\n def move(self, src, dst):\n \"\"\"Rename src to dst, if it is not possible (in case src and dst are\n on different filesystems) and actual physical copying of data is\n happening.\n \"\"\"\n self.makedirs(posixpath.dirname(dst))\n\n try:\n self.sftp.rename(src, dst)\n except OSError:\n self.atomic_copy(src, dst)\n self.remove(src)\n\n def atomic_copy(self, src, dst):\n tmp = tmp_fname(dst)\n\n try:\n self.copy(src, tmp)\n self.sftp.rename(tmp, dst)\n finally:\n self.remove(tmp)\n\n def upload(self, src, dest, no_progress_bar=False, progress_title=None):\n self.makedirs(posixpath.dirname(dest))\n tmp_file = tmp_fname(dest)\n if not progress_title:\n progress_title = posixpath.basename(dest)\n\n with Tqdm(\n desc=progress_title, disable=no_progress_bar, bytes=True\n ) as pbar:\n self.sftp.put(src, tmp_file, callback=pbar.update_to)\n\n self.sftp.rename(tmp_file, dest)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.uname_SSHConnection.md5.return.md5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.uname_SSHConnection.md5.return.md5", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 267, "end_line": 291, "span_ids": ["SSHConnection.uname", "SSHConnection.md5"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n @cached_property\n def uname(self):\n return self.execute(\"uname\").strip()\n\n def md5(self, path):\n \"\"\"\n Use different md5 commands depending on the OS:\n\n - Darwin's `md5` returns BSD-style checksums by default\n - Linux's `md5sum` needs the `--tag` flag for a similar output\n\n Example:\n MD5 (foo.txt) = f3d220a856b52aabbf294351e8a24300\n \"\"\"\n if self.uname == \"Linux\":\n md5 = self.execute(\"md5sum \" + path).split()[0]\n elif self.uname == \"Darwin\":\n md5 = self.execute(\"md5 \" + path).split()[-1]\n else:\n raise DvcException(\n \"'{}' is not supported as a SSH remote\".format(self.uname)\n )\n\n assert len(md5) == 32\n return md5", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.copy_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 293, "end_line": 327, "span_ids": ["SSHConnection.symlink", "SSHConnection.reflink", "SSHConnection.copy", "SSHConnection.open", "SSHConnection.open_max_sftp_channels", "SSHConnection.hardlink"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n def copy(self, src, dest):\n self.execute(\"cp {} {}\".format(src, dest))\n\n def open_max_sftp_channels(self):\n # If there are more than 1 it means we've already opened max amount\n if len(self._sftp_channels) <= 1:\n while True:\n try:\n self._sftp_channels.append(self._ssh.open_sftp())\n except paramiko.ssh_exception.ChannelException:\n if not self._sftp_channels:\n raise\n break\n return self._sftp_channels\n\n def open(self, *args, **kwargs):\n return self.sftp.open(*args, **kwargs)\n\n def symlink(self, src, dest):\n self.sftp.symlink(src, dest)\n\n def reflink(self, src, dest):\n if self.uname == \"Linux\":\n return self.execute(\"cp --reflink {} {}\".format(src, dest))\n\n if self.uname == \"Darwin\":\n return self.execute(\"cp -c {} {}\".format(src, dest))\n\n raise DvcException(\n \"'{}' is not supported as a SSH remote\".format(self.uname)\n )\n\n def hardlink(self, src, dest):\n self.execute(\"ln {} {}\".format(src, dest))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_os_locked.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_os_locked.return.wrapper", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["locked", "imports"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom contextlib import contextmanager\nfrom functools import wraps\n\nfrom dvc.ignore import CleanTree\nfrom dvc.compat import fspath_py35\n\nfrom funcy import cached_property, cat, first\n\nfrom dvc.config import Config\nfrom dvc.exceptions import (\n FileMissingError,\n IsADirectoryError,\n NotDvcRepoError,\n OutputNotFoundError,\n)\nfrom dvc.path_info import PathInfo\nfrom dvc.remote.base import RemoteActionNotImplemented\nfrom dvc.utils.fs import path_isin\nfrom .graph import check_acyclic, get_pipeline, get_pipelines\n\n\ndef locked(f):\n @wraps(f)\n def wrapper(repo, *args, **kwargs):\n with repo.lock, repo.state:\n repo._reset()\n ret = f(repo, *args, **kwargs)\n # Our graph cache is no longer valid after we release the repo.lock\n repo._reset()\n return ret\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo_Repo.__repr__.return._format_self___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo_Repo.__repr__.return._format_self___", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 124, "span_ids": ["Repo.tree_1", "Repo.__repr__", "Repo", "Repo.tree", "Repo.__init__"], "tokens": 715}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n DVC_DIR = \".dvc\"\n\n from dvc.repo.destroy import destroy\n from dvc.repo.install import install\n from dvc.repo.add import add\n from dvc.repo.remove import remove\n from dvc.repo.ls import ls\n from dvc.repo.lock import lock as lock_stage\n from dvc.repo.move import move\n from dvc.repo.run import run\n from dvc.repo.imp import imp\n from dvc.repo.imp_url import imp_url\n from dvc.repo.reproduce import reproduce\n from dvc.repo.checkout import _checkout\n from dvc.repo.push import push\n from dvc.repo.fetch import _fetch\n from dvc.repo.pull import pull\n from dvc.repo.status import status\n from dvc.repo.gc import gc\n from dvc.repo.commit import commit\n from dvc.repo.diff import diff\n from dvc.repo.brancher import brancher\n from dvc.repo.get import get\n from dvc.repo.get_url import get_url\n from dvc.repo.update import update\n\n def __init__(self, root_dir=None):\n from dvc.state import State\n from dvc.lock import make_lock\n from dvc.scm import SCM\n from dvc.cache import Cache\n from dvc.data_cloud import DataCloud\n from dvc.repo.metrics import Metrics\n from dvc.repo.params import Params\n from dvc.scm.tree import WorkingTree\n from dvc.repo.tag import Tag\n from dvc.utils.fs import makedirs\n\n root_dir = self.find_root(root_dir)\n\n self.root_dir = os.path.abspath(os.path.realpath(root_dir))\n self.dvc_dir = os.path.join(self.root_dir, self.DVC_DIR)\n\n self.config = Config(self.dvc_dir)\n\n no_scm = self.config[\"core\"].get(\"no_scm\", False)\n self.scm = SCM(self.root_dir, no_scm=no_scm)\n\n self.tree = WorkingTree(self.root_dir)\n\n self.tmp_dir = os.path.join(self.dvc_dir, \"tmp\")\n self.index_dir = os.path.join(self.tmp_dir, \"index\")\n makedirs(self.index_dir, exist_ok=True)\n\n hardlink_lock = self.config[\"core\"].get(\"hardlink_lock\", False)\n self.lock = make_lock(\n os.path.join(self.dvc_dir, \"lock\"),\n tmp_dir=os.path.join(self.dvc_dir, \"tmp\"),\n hardlink_lock=hardlink_lock,\n friendly=True,\n )\n\n # NOTE: storing state and link_state in the repository itself to avoid\n # any possible state corruption in 'shared cache dir' scenario.\n self.state = State(self)\n\n self.cache = Cache(self)\n self.cloud = DataCloud(self)\n\n self.metrics = Metrics(self)\n self.params = Params(self)\n self.tag = Tag(self)\n\n self._ignore()\n\n @property\n def tree(self):\n return self._tree\n\n @tree.setter\n def tree(self, tree):\n self._tree = tree if isinstance(tree, CleanTree) else CleanTree(tree)\n # Our graph cache is no longer valid, as it was based on the previous\n # tree.\n self._reset()\n\n def __repr__(self):\n return \"{}: '{}'\".format(self.__class__.__name__, self.root_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_root_Repo.find_root.raise_NotDvcRepoError_mes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_root_Repo.find_root.raise_NotDvcRepoError_mes", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 142, "span_ids": ["Repo.find_root"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n @classmethod\n def find_root(cls, root=None):\n root_dir = os.path.realpath(root or os.curdir)\n\n if not os.path.isdir(root_dir):\n raise NotDvcRepoError(\"directory '{}' does not exist\".format(root))\n\n while True:\n dvc_dir = os.path.join(root_dir, cls.DVC_DIR)\n if os.path.isdir(dvc_dir):\n return root_dir\n if os.path.ismount(root_dir):\n break\n root_dir = os.path.dirname(root_dir)\n\n message = (\n \"you are not inside of a DVC repository \"\n \"(checked up to mount point '{}')\"\n ).format(root_dir)\n raise NotDvcRepoError(message)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.collect_Repo.collect.return.list_nx_dfs_postorder_nod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.collect_Repo.collect.return.list_nx_dfs_postorder_nod", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 217, "end_line": 236, "span_ids": ["Repo.collect"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def collect(self, target, with_deps=False, recursive=False, graph=None):\n import networkx as nx\n from ..dvcfile import Dvcfile\n\n if not target:\n return list(graph) if graph else self.stages\n\n target = os.path.abspath(target)\n\n if recursive and os.path.isdir(target):\n return self._collect_inside(target, graph or self.graph)\n\n stage = Dvcfile(self, target).stage\n\n # Optimization: do not collect the graph for a specific target\n if not with_deps:\n return [stage]\n\n pipeline = get_pipeline(get_pipelines(graph or self.graph), stage)\n return list(nx.dfs_postorder_nodes(pipeline, stage))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.collect_granular_Repo.collect_granular.try_.except_OutputNotFoundErro.return._stage_None_for_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.collect_granular_Repo.collect_granular.try_.except_OutputNotFoundErro.return._stage_None_for_stage_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 238, "end_line": 254, "span_ids": ["Repo.collect_granular"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def collect_granular(self, target, *args, **kwargs):\n from ..dvcfile import Dvcfile\n\n if not target:\n return [(stage, None) for stage in self.stages]\n\n # Optimization: do not collect the graph for a specific .dvc target\n if Dvcfile.is_valid_filename(target) and not kwargs.get(\"with_deps\"):\n return [(Dvcfile(self, target).stage, None)]\n\n try:\n (out,) = self.find_outs_by_path(target, strict=False)\n filter_info = PathInfo(os.path.abspath(target))\n return [(out.stage, filter_info)]\n except OutputNotFoundError:\n stages = self.collect(target, *args, **kwargs)\n return [(stage, None) for stage in stages]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_graph_Repo._collect_graph.return.G": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_graph_Repo._collect_graph.return.G", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 312, "end_line": 414, "span_ids": ["Repo._collect_graph"], "tokens": 716}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def _collect_graph(self, stages):\n \"\"\"Generate a graph by using the given stages on the given directory\n\n The nodes of the graph are the stage's path relative to the root.\n\n Edges are created when the output of one stage is used as a\n dependency in other stage.\n\n The direction of the edges goes from the stage to its dependency:\n\n For example, running the following:\n\n $ dvc run -o A \"echo A > A\"\n $ dvc run -d A -o B \"echo B > B\"\n $ dvc run -d B -o C \"echo C > C\"\n\n Will create the following graph:\n\n ancestors <--\n |\n C.dvc -> B.dvc -> A.dvc\n | |\n | --> descendants\n |\n ------- pipeline ------>\n |\n v\n (weakly connected components)\n\n Args:\n stages (list): used to build a graph, if None given, collect stages\n in the repository.\n\n Raises:\n OutputDuplicationError: two outputs with the same path\n StagePathAsOutputError: stage inside an output directory\n OverlappingOutputPathsError: output inside output directory\n CyclicGraphError: resulting graph has cycles\n \"\"\"\n import networkx as nx\n from pygtrie import Trie\n from dvc.exceptions import (\n OutputDuplicationError,\n StagePathAsOutputError,\n OverlappingOutputPathsError,\n )\n\n G = nx.DiGraph()\n stages = stages or self.stages\n outs = Trie() # Use trie to efficiently find overlapping outs and deps\n\n for stage in filter(bool, stages):\n for out in stage.outs:\n out_key = out.path_info.parts\n\n # Check for dup outs\n if out_key in outs:\n dup_stages = [stage, outs[out_key].stage]\n raise OutputDuplicationError(str(out), dup_stages)\n\n # Check for overlapping outs\n if outs.has_subtrie(out_key):\n parent = out\n overlapping = first(outs.values(prefix=out_key))\n else:\n parent = outs.shortest_prefix(out_key).value\n overlapping = out\n if parent and overlapping:\n msg = (\n \"Paths for outs:\\n'{}'('{}')\\n'{}'('{}')\\n\"\n \"overlap. To avoid unpredictable behaviour, \"\n \"rerun command with non overlapping outs paths.\"\n ).format(\n str(parent),\n parent.stage.relpath,\n str(overlapping),\n overlapping.stage.relpath,\n )\n raise OverlappingOutputPathsError(parent, overlapping, msg)\n\n outs[out_key] = out\n\n for stage in stages:\n out = outs.shortest_prefix(PathInfo(stage.path).parts).value\n if out:\n raise StagePathAsOutputError(stage, str(out))\n\n # Building graph\n G.add_nodes_from(stages)\n for stage in stages:\n for dep in stage.deps:\n if dep.path_info is None:\n continue\n\n dep_key = dep.path_info.parts\n overlapping = list(n.value for n in outs.prefixes(dep_key))\n if outs.has_subtrie(dep_key):\n overlapping.extend(outs.values(prefix=dep_key))\n\n G.add_edges_from((stage, out.stage) for out in overlapping)\n check_acyclic(G)\n\n return G", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_outs_by_path_Repo.is_dvc_internal.return.self_DVC_DIR_in_path_part": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_outs_by_path_Repo.is_dvc_internal.return.self_DVC_DIR_in_path_part", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 420, "end_line": 450, "span_ids": ["Repo.is_dvc_internal", "Repo.find_outs_by_path", "Repo.find_out_by_relpath"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def find_outs_by_path(self, path, outs=None, recursive=False, strict=True):\n if not outs:\n outs = [out for stage in self.stages for out in stage.outs]\n\n abs_path = os.path.abspath(path)\n path_info = PathInfo(abs_path)\n match = path_info.__eq__ if strict else path_info.isin_or_eq\n\n def func(out):\n if out.scheme == \"local\" and match(out.path_info):\n return True\n\n if recursive and out.path_info.isin(path_info):\n return True\n\n return False\n\n matched = list(filter(func, outs))\n if not matched:\n raise OutputNotFoundError(path, self)\n\n return matched\n\n def find_out_by_relpath(self, relpath):\n path = os.path.join(self.root_dir, relpath)\n (out,) = self.find_outs_by_path(path)\n return out\n\n def is_dvc_internal(self, path):\n path_parts = os.path.normpath(path).split(os.path.sep)\n return self.DVC_DIR in path_parts", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.open_by_relpath_Repo.open_by_relpath.raise_FileMissingError_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.open_by_relpath_Repo.open_by_relpath.raise_FileMissingError_pa", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 452, "end_line": 476, "span_ids": ["Repo.open_by_relpath"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n @contextmanager\n def open_by_relpath(self, path, remote=None, mode=\"r\", encoding=None):\n \"\"\"Opens a specified resource as a file descriptor\"\"\"\n cause = None\n try:\n out = self.find_out_by_relpath(path)\n except OutputNotFoundError as exc:\n out = None\n cause = exc\n\n if out and out.use_cache:\n try:\n with self._open_cached(out, remote, mode, encoding) as fd:\n yield fd\n return\n except FileNotFoundError as exc:\n raise FileMissingError(path) from exc\n\n abs_path = os.path.join(self.root_dir, path)\n if os.path.exists(abs_path):\n with open(abs_path, mode=mode, encoding=encoding) as fd:\n yield fd\n return\n\n raise FileMissingError(path) from cause", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._open_cached_Repo._open_cached.try_.except_RemoteActionNotImp.return.open_cache_file_mode_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._open_cached_Repo._open_cached.try_.except_RemoteActionNotImp.return.open_cache_file_mode_mod", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 478, "end_line": 497, "span_ids": ["Repo._open_cached"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def _open_cached(self, out, remote=None, mode=\"r\", encoding=None):\n if out.isdir():\n raise IsADirectoryError(\"Can't open a dir\")\n\n cache_file = self.cache.local.checksum_to_path_info(out.checksum)\n cache_file = fspath_py35(cache_file)\n\n if os.path.exists(cache_file):\n return open(cache_file, mode=mode, encoding=encoding)\n\n try:\n remote_obj = self.cloud.get_remote(remote)\n remote_info = remote_obj.checksum_to_path_info(out.checksum)\n return remote_obj.open(remote_info, mode=mode, encoding=encoding)\n except RemoteActionNotImplemented:\n with self.state:\n cache_info = out.get_used_cache(remote=remote)\n self.cloud.pull(cache_info, remote=remote)\n\n return open(cache_file, mode=mode, encoding=encoding)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.close_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 569, "end_line": 587, "span_ids": ["Repo.checkout", "Repo._reset", "Repo.fetch", "Repo.close"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def close(self):\n self.scm.close()\n\n @locked\n def checkout(self, *args, **kwargs):\n return self._checkout(*args, **kwargs)\n\n @locked\n def fetch(self, *args, **kwargs):\n return self._fetch(*args, **kwargs)\n\n def _reset(self):\n self.__dict__.pop(\"graph\", None)\n self.__dict__.pop(\"stages\", None)\n self.__dict__.pop(\"pipelines\", None)\n self.__dict__.pop(\"dvcignore\", None)\n self.__dict__.pop(\"pipeline_graph\", None)\n self.__dict__.pop(\"pipeline_stages\", None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py_logging_add.return.stages_list": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py_logging_add.return.stages_list", "embedding": null, "metadata": {"file_path": "dvc/repo/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 96, "span_ids": ["add", "imports"], "tokens": 649}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nimport colorama\n\nfrom . import locked\nfrom ..dvcfile import Dvcfile\nfrom ..exceptions import (\n RecursiveAddingWhileUsingFilename,\n OverlappingOutputPathsError,\n)\nfrom ..output.base import OutputDoesNotExistError\nfrom ..progress import Tqdm\nfrom ..repo.scm_context import scm_context\nfrom ..utils import LARGE_DIR_SIZE, resolve_paths\n\nlogger = logging.getLogger(__name__)\n\n\n@locked\n@scm_context\ndef add(repo, targets, recursive=False, no_commit=False, fname=None):\n if recursive and fname:\n raise RecursiveAddingWhileUsingFilename()\n\n if isinstance(targets, str):\n targets = [targets]\n\n stages_list = []\n num_targets = len(targets)\n with Tqdm(total=num_targets, desc=\"Add\", unit=\"file\", leave=True) as pbar:\n if num_targets == 1:\n # clear unneeded top-level progress bar for single target\n pbar.bar_format = \"Adding...\"\n pbar.refresh()\n for target in targets:\n sub_targets = _find_all_targets(repo, target, recursive)\n pbar.total += len(sub_targets) - 1\n\n if os.path.isdir(target) and len(sub_targets) > LARGE_DIR_SIZE:\n logger.warning(\n \"You are adding a large directory '{target}' recursively,\"\n \" consider tracking it as a whole instead.\\n\"\n \"{purple}HINT:{nc} Remove the generated DVC-file and then\"\n \" run `{cyan}dvc add {target}{nc}`\".format(\n purple=colorama.Fore.MAGENTA,\n cyan=colorama.Fore.CYAN,\n nc=colorama.Style.RESET_ALL,\n target=target,\n )\n )\n\n stages = _create_stages(repo, sub_targets, fname, pbar=pbar)\n\n try:\n repo.check_modified_graph(stages)\n except OverlappingOutputPathsError as exc:\n msg = (\n \"Cannot add '{out}', because it is overlapping with other \"\n \"DVC tracked output: '{parent}'.\\n\"\n \"To include '{out}' in '{parent}', run \"\n \"'dvc commit {parent_stage}'\"\n ).format(\n out=exc.overlapping_out.path_info,\n parent=exc.parent.path_info,\n parent_stage=exc.parent.stage.relpath,\n )\n raise OverlappingOutputPathsError(\n exc.parent, exc.overlapping_out, msg\n )\n\n with Tqdm(\n total=len(stages),\n desc=\"Processing\",\n unit=\"file\",\n disable=len(stages) == 1,\n ) as pbar_stages:\n for stage in stages:\n try:\n stage.save()\n except OutputDoesNotExistError:\n pbar.n -= 1\n raise\n\n if not no_commit:\n stage.commit()\n\n Dvcfile(repo, stage.path).dump(stage)\n pbar_stages.update()\n\n stages_list += stages\n\n if num_targets == 1: # restore bar format for stats\n pbar.bar_format = pbar.BAR_FMT_DEFAULT\n\n return stages_list", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__find_all_targets__find_all_targets.return._target_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__find_all_targets__find_all_targets.return._target_", "embedding": null, "metadata": {"file_path": "dvc/repo/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 114, "span_ids": ["_find_all_targets"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _find_all_targets(repo, target, recursive):\n if os.path.isdir(target) and recursive:\n return [\n fname\n for fname in Tqdm(\n repo.tree.walk_files(target),\n desc=\"Searching \" + target,\n bar_format=Tqdm.BAR_FMT_NOTOTAL,\n unit=\"file\",\n )\n if not repo.is_dvc_internal(fname)\n if not Dvcfile.is_stage_file(fname)\n if not repo.scm.belongs_to_scm(fname)\n if not repo.scm.is_tracked(fname)\n ]\n return [target]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__create_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__create_stages_", "embedding": null, "metadata": {"file_path": "dvc/repo/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 145, "span_ids": ["_create_stages"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _create_stages(repo, targets, fname, pbar=None):\n from dvc.stage import Stage, create_stage\n\n stages = []\n\n for out in Tqdm(\n targets,\n desc=\"Creating DVC-files\",\n disable=len(targets) < LARGE_DIR_SIZE,\n unit=\"file\",\n ):\n path, wdir, out = resolve_paths(repo, out)\n stage = create_stage(Stage, repo, fname or path, wdir=wdir, outs=[out])\n if stage:\n Dvcfile(repo, stage.path).remove_with_prompt(force=True)\n\n repo._reset()\n\n if not stage:\n if pbar is not None:\n pbar.total -= 1\n continue\n\n stages.append(stage)\n if pbar is not None:\n pbar.update_desc(out)\n\n return stages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/brancher.py_from_funcy_import_group_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/brancher.py_from_funcy_import_group_b_", "embedding": null, "metadata": {"file_path": "dvc/repo/brancher.py", "file_name": "brancher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 51, "span_ids": ["brancher", "imports"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from funcy import group_by\n\nfrom dvc.scm.tree import WorkingTree\n\n\ndef brancher( # noqa: E302\n self, revs=None, all_branches=False, all_tags=False, all_commits=False\n):\n \"\"\"Generator that iterates over specified revisions.\n\n Args:\n revs (list): a list of revisions to iterate over.\n all_branches (bool): iterate over all available branches.\n all_commits (bool): iterate over all commits.\n all_tags (bool): iterate over all available tags.\n\n Yields:\n str: the display name for the currently selected tree, it could be:\n - a git revision identifier\n - empty string it there is no branches to iterate over\n - \"Working Tree\" if there are uncommitted changes in the SCM repo\n \"\"\"\n if not any([revs, all_branches, all_tags, all_commits]):\n yield \"\"\n return\n\n saved_tree = self.tree\n revs = revs or []\n\n scm = self.scm\n\n self.tree = WorkingTree(self.root_dir)\n yield \"working tree\"\n\n if all_commits:\n revs = scm.list_all_commits()\n else:\n if all_branches:\n revs.extend(scm.list_branches())\n\n if all_tags:\n revs.extend(scm.list_tags())\n\n try:\n if revs:\n for sha, names in group_by(scm.resolve_rev, revs).items():\n self.tree = scm.get_tree(sha)\n yield \", \".join(names)\n finally:\n self.tree = saved_tree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py_logging_get_all_files_numbers.return.sum_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py_logging_get_all_files_numbers.return.sum_", "embedding": null, "metadata": {"file_path": "dvc/repo/checkout.py", "file_name": "checkout.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["imports", "_get_unused_links", "_fspath_dir", "get_all_files_numbers"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nfrom dvc.compat import fspath\nfrom dvc.exceptions import CheckoutError, CheckoutErrorSuggestGit\nfrom dvc.progress import Tqdm\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\n\n\ndef _get_unused_links(repo):\n used = [\n out.fspath\n for stage in repo.stages\n for out in stage.outs\n if out.scheme == \"local\"\n ]\n return repo.state.get_unused_links(used)\n\n\ndef _fspath_dir(path, root):\n if not os.path.exists(str(path)):\n return str(path)\n\n path = relpath(fspath(path), root)\n return os.path.join(path, \"\") if os.path.isdir(path) else path\n\n\ndef get_all_files_numbers(pairs):\n return sum(\n stage.get_all_files_number(filter_info) for stage, filter_info in pairs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py__checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py__checkout_", "embedding": null, "metadata": {"file_path": "dvc/repo/checkout.py", "file_name": "checkout.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 97, "span_ids": ["_checkout"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _checkout(\n self,\n targets=None,\n with_deps=False,\n force=False,\n relink=False,\n recursive=False,\n):\n from dvc.stage.exceptions import (\n StageFileBadNameError,\n StageFileDoesNotExistError,\n )\n\n unused = []\n stats = {\n \"added\": [],\n \"deleted\": [],\n \"modified\": [],\n \"failed\": [],\n }\n if not targets:\n targets = [None]\n unused = _get_unused_links(self)\n\n stats[\"deleted\"] = [_fspath_dir(u, self.root_dir) for u in unused]\n self.state.remove_links(unused)\n\n pairs = set()\n for target in targets:\n try:\n pairs.update(\n self.collect_granular(\n target, with_deps=with_deps, recursive=recursive\n )\n )\n except (StageFileDoesNotExistError, StageFileBadNameError) as exc:\n if not target:\n raise\n raise CheckoutErrorSuggestGit(target) from exc\n\n total = get_all_files_numbers(pairs)\n with Tqdm(\n total=total, unit=\"file\", desc=\"Checkout\", disable=total == 0\n ) as pbar:\n for stage, filter_info in pairs:\n result = stage.checkout(\n force=force,\n progress_callback=pbar.update_desc,\n relink=relink,\n filter_info=filter_info,\n )\n for data in [\"failed\", \"added\", \"modified\"]:\n stats[data].extend(\n _fspath_dir(path, self.root_dir) for path in result[data]\n )\n\n if stats.get(\"failed\"):\n raise CheckoutError(stats[\"failed\"], stats)\n\n del stats[\"failed\"]\n return stats", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_os_diff._paths_checksums.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_os_diff._paths_checksums.return._", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["imports", "diff"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.repo import locked\nfrom dvc.scm.tree import is_working_tree\n\n\n@locked\ndef diff(self, a_rev=\"HEAD\", b_rev=None):\n \"\"\"\n By default, it compares the working tree with the last commit's tree.\n\n This implementation differs from `git diff` since DVC doesn't have\n the concept of `index`, but it keeps the same interface, thus,\n `dvc diff` would be the same as `dvc diff HEAD`.\n \"\"\"\n\n def _paths_checksums():\n \"\"\"\n A dictionary of checksums addressed by relpaths collected from\n the current tree outputs.\n\n To help distinguish between a directory and a file output,\n the former one will come with a trailing slash in the path:\n\n directory: \"data/\"\n file: \"data\"\n \"\"\"\n\n def _to_path(output):\n return (\n str(output)\n if not output.is_dir_checksum\n else os.path.join(str(output), \"\")\n )\n\n on_working_tree = is_working_tree(self.tree)\n\n def _to_checksum(output):\n if on_working_tree:\n return self.cache.local.get_checksum(output.path_info)\n return output.checksum\n\n def _exists(output):\n if on_working_tree:\n return output.exists\n return True\n\n return {\n _to_path(output): _to_checksum(output)\n for stage in self.stages\n for output in stage.outs\n if _exists(output)\n }\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_diff.working_tree_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_diff.working_tree_", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 73, "span_ids": ["diff"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@locked\ndef diff(self, a_rev=\"HEAD\", b_rev=None):\n # ... other code\n\n working_tree = self.tree\n a_tree = self.scm.get_tree(a_rev)\n b_tree = self.scm.get_tree(b_rev) if b_rev else working_tree\n\n try:\n self.tree = a_tree\n old = _paths_checksums()\n\n self.tree = b_tree\n new = _paths_checksums()\n finally:\n self.tree = working_tree\n\n # Compare paths between the old and new tree.\n # set() efficiently converts dict keys to a set\n added = sorted(set(new) - set(old))\n deleted = sorted(set(old) - set(new))\n modified = sorted(set(old) & set(new))\n\n return {\n \"added\": [{\"path\": path, \"hash\": new[path]} for path in added],\n \"deleted\": [{\"path\": path, \"hash\": old[path]} for path in deleted],\n \"modified\": [\n {\"path\": path, \"hash\": {\"old\": old[path], \"new\": new[path]}}\n for path in modified\n if old[path] != new[path]\n ],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py_logging__fetch.return.downloaded": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py_logging__fetch.return.downloaded", "embedding": null, "metadata": {"file_path": "dvc/repo/fetch.py", "file_name": "fetch.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 69, "span_ids": ["imports", "_fetch"], "tokens": 376}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.cache import NamedCache\nfrom dvc.config import NoRemoteError\nfrom dvc.exceptions import DownloadError, OutputNotFoundError\nfrom dvc.scm.base import CloneError\nfrom dvc.path_info import PathInfo\n\nlogger = logging.getLogger(__name__)\n\n\ndef _fetch(\n self,\n targets=None,\n jobs=None,\n remote=None,\n all_branches=False,\n show_checksums=False,\n with_deps=False,\n all_tags=False,\n recursive=False,\n all_commits=False,\n):\n \"\"\"Download data items from a cloud and imported repositories\n\n Returns:\n int: number of successfully downloaded files\n\n Raises:\n DownloadError: thrown when there are failed downloads, either\n during `cloud.pull` or trying to fetch imported files\n\n config.NoRemoteError: thrown when downloading only local files and no\n remote is configured\n \"\"\"\n used = self.used_cache(\n targets,\n all_branches=all_branches,\n all_tags=all_tags,\n all_commits=all_commits,\n with_deps=with_deps,\n force=True,\n remote=remote,\n jobs=jobs,\n recursive=recursive,\n )\n\n downloaded = 0\n failed = 0\n\n try:\n downloaded += self.cloud.pull(\n used, jobs, remote=remote, show_checksums=show_checksums\n )\n except NoRemoteError:\n if not used.external and used[\"local\"]:\n raise\n except DownloadError as exc:\n failed += exc.amount\n\n for (repo_url, repo_rev), files in used.external.items():\n d, f = _fetch_external(self, repo_url, repo_rev, files, jobs)\n downloaded += d\n failed += f\n\n if failed:\n raise DownloadError(failed)\n\n return downloaded", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_logging__raise_error_if_all_disabled.if_not_any_kwargs_values_.raise_InvalidArgumentErro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_logging__raise_error_if_all_disabled.if_not_any_kwargs_values_.raise_InvalidArgumentErro", "embedding": null, "metadata": {"file_path": "dvc/repo/gc.py", "file_name": "gc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports", "_raise_error_if_all_disabled", "_do_gc"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom . import locked\nfrom dvc.cache import NamedCache\nfrom dvc.exceptions import InvalidArgumentError\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _do_gc(typ, func, clist, jobs=None):\n removed = func(clist, jobs=jobs)\n if not removed:\n logger.info(\"No unused '{}' cache to remove.\".format(typ))\n\n\ndef _raise_error_if_all_disabled(**kwargs):\n if not any(kwargs.values()):\n raise InvalidArgumentError(\n \"Either of `-w|--workspace`, `-a|--all-branches`, `-T|--all-tags` \"\n \"or `--all-commits` needs to be set.\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get.py_logging_", "embedding": null, "metadata": {"file_path": "dvc/repo/get.py", "file_name": "get.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 58, "span_ids": ["imports", "get", "GetDVCFileError.__init__", "GetDVCFileError"], "tokens": 442}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nimport shortuuid\n\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import resolve_output\nfrom dvc.utils.fs import remove\nfrom dvc.path_info import PathInfo\n\nlogger = logging.getLogger(__name__)\n\n\nclass GetDVCFileError(DvcException):\n def __init__(self):\n super().__init__(\n \"the given path is a DVC-file, you must specify a data file \"\n \"or a directory\"\n )\n\n\n@staticmethod\ndef get(url, path, out=None, rev=None):\n from dvc.external_repo import external_repo\n from dvc.dvcfile import Dvcfile\n\n out = resolve_output(path, out)\n\n if Dvcfile.is_valid_filename(out):\n raise GetDVCFileError()\n\n # Creating a directory right beside the output to make sure that they\n # are on the same filesystem, so we could take the advantage of\n # reflink and/or hardlink. Not using tempfile.TemporaryDirectory\n # because it will create a symlink to tmpfs, which defeats the purpose\n # and won't work with reflink/hardlink.\n dpath = os.path.dirname(os.path.abspath(out))\n tmp_dir = os.path.join(dpath, \".\" + str(shortuuid.uuid()))\n try:\n with external_repo(url=url, rev=rev) as repo:\n if hasattr(repo, \"cache\"):\n repo.cache.local.cache_dir = tmp_dir\n\n # Try any links possible to avoid data duplication.\n #\n # Not using symlink, because we need to remove cache after we\n # are done, and to make that work we would have to copy data\n # over anyway before removing the cache, so we might just copy\n # it right away.\n #\n # Also, we can't use theoretical \"move\" link type here, because\n # the same cache file might be used a few times in a directory.\n repo.cache.local.cache_types = [\"reflink\", \"hardlink\", \"copy\"]\n\n repo.pull_to(path, PathInfo(out))\n finally:\n remove(tmp_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/graph.py_check_acyclic_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/graph.py_check_acyclic_", "embedding": null, "metadata": {"file_path": "dvc/repo/graph.py", "file_name": "graph.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["check_acyclic", "get_pipelines", "get_pipeline"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_acyclic(graph):\n import networkx as nx\n from dvc.exceptions import CyclicGraphError\n\n try:\n edges = nx.find_cycle(graph, orientation=\"original\")\n except nx.NetworkXNoCycle:\n return\n\n stages = set()\n for from_node, to_node, _ in edges:\n stages.add(from_node)\n stages.add(to_node)\n\n raise CyclicGraphError(list(stages))\n\n\ndef get_pipeline(pipelines, node):\n found = [i for i in pipelines if i.has_node(node)]\n assert len(found) == 1\n return found[0]\n\n\ndef get_pipelines(G):\n import networkx as nx\n\n return [G.subgraph(c).copy() for c in nx.weakly_connected_components(G)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_logging__welcome_message.logger_info_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_logging__welcome_message.logger_info_msg_", "embedding": null, "metadata": {"file_path": "dvc/repo/init.py", "file_name": "init.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["imports", "_welcome_message"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nimport colorama\n\nfrom dvc import analytics\nfrom dvc.config import Config\nfrom dvc.exceptions import InitError, InvalidArgumentError\nfrom dvc.repo import Repo\nfrom dvc.scm import SCM\nfrom dvc.scm.base import SCMError\nfrom dvc.utils import boxify\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import remove\n\nlogger = logging.getLogger(__name__)\n\n\ndef _welcome_message():\n if analytics.is_enabled():\n logger.info(\n boxify(\n \"DVC has enabled anonymous aggregate usage analytics.\\n\"\n \"Read the analytics documentation (and how to opt-out) here:\\n\"\n \"{blue}https://dvc.org/doc/user-guide/analytics{nc}\".format(\n blue=colorama.Fore.BLUE, nc=colorama.Fore.RESET\n ),\n border_color=\"red\",\n )\n )\n\n msg = (\n \"{yellow}What's next?{nc}\\n\"\n \"{yellow}------------{nc}\\n\"\n \"- Check out the documentation: {blue}https://dvc.org/doc{nc}\\n\"\n \"- Get help and share ideas: {blue}https://dvc.org/chat{nc}\\n\"\n \"- Star us on GitHub: {blue}https://github.com/iterative/dvc{nc}\"\n ).format(\n yellow=colorama.Fore.YELLOW,\n blue=colorama.Fore.BLUE,\n nc=colorama.Fore.RESET,\n )\n\n logger.info(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pull.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pull.py_logging_", "embedding": null, "metadata": {"file_path": "dvc/repo/pull.py", "file_name": "pull.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["imports", "pull"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.repo import locked\n\n\nlogger = logging.getLogger(__name__)\n\n\n@locked\ndef pull(\n self,\n targets=None,\n jobs=None,\n remote=None,\n all_branches=False,\n with_deps=False,\n all_tags=False,\n force=False,\n recursive=False,\n all_commits=False,\n):\n processed_files_count = self._fetch(\n targets,\n jobs,\n remote=remote,\n all_branches=all_branches,\n all_tags=all_tags,\n all_commits=all_commits,\n with_deps=with_deps,\n recursive=recursive,\n )\n stats = self._checkout(\n targets=targets, with_deps=with_deps, force=force, recursive=recursive\n )\n\n stats[\"downloaded\"] = processed_files_count\n return stats", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/push.py_locked_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/push.py_locked_", "embedding": null, "metadata": {"file_path": "dvc/repo/push.py", "file_name": "push.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["imports", "push"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from . import locked\n\n\n@locked\ndef push(\n self,\n targets=None,\n jobs=None,\n remote=None,\n all_branches=False,\n with_deps=False,\n all_tags=False,\n recursive=False,\n all_commits=False,\n):\n used = self.used_cache(\n targets,\n all_branches=all_branches,\n all_tags=all_tags,\n all_commits=all_commits,\n with_deps=with_deps,\n force=True,\n remote=remote,\n jobs=jobs,\n recursive=recursive,\n )\n return self.cloud.push(used, jobs, remote=remote)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_logging__reproduce_stage.return._stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_logging__reproduce_stage.return._stage_", "embedding": null, "metadata": {"file_path": "dvc/repo/reproduce.py", "file_name": "reproduce.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["imports", "_reproduce_stage"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.exceptions import ReproductionError, InvalidArgumentError\nfrom dvc.repo.scm_context import scm_context\nfrom . import locked\nfrom .graph import get_pipeline, get_pipelines\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _reproduce_stage(stage, **kwargs):\n if stage.locked:\n logger.warning(\n \"DVC-file '{path}' is locked. Its dependencies are\"\n \" not going to be reproduced.\".format(path=stage.relpath)\n )\n\n stage = stage.reproduce(**kwargs)\n if not stage:\n return []\n\n if not kwargs.get(\"dry\", False):\n from ..dvcfile import Dvcfile\n\n dvcfile = Dvcfile(stage.repo, stage.path)\n dvcfile.dump(stage)\n\n return [stage]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__get_active_graph__get_active_graph.return.active": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__get_active_graph__get_active_graph.return.active", "embedding": null, "metadata": {"file_path": "dvc/repo/reproduce.py", "file_name": "reproduce.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 48, "span_ids": ["_get_active_graph"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_active_graph(G):\n import networkx as nx\n\n active = G.copy()\n for stage in G:\n if not stage.locked:\n continue\n active.remove_edges_from(G.out_edges(stage))\n for edge in G.out_edges(stage):\n _, to_stage = edge\n for node in nx.dfs_preorder_nodes(G, to_stage):\n # NOTE: `in_degree` will return InDegreeView({}) if stage\n # no longer exists in the `active` DAG.\n if not active.in_degree(node):\n # NOTE: if some edge no longer exists `remove_edges_from`\n # will ignore it without error.\n active.remove_edges_from(G.out_edges(node))\n active.remove_node(node)\n\n return active", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_logging__local_status.return._joint_status_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_logging__local_status.return._joint_status_stages_", "embedding": null, "metadata": {"file_path": "dvc/repo/status.py", "file_name": "status.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["imports", "_local_status", "_joint_status"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nfrom itertools import compress\n\nfrom funcy.py3 import cat\n\nfrom dvc.exceptions import InvalidArgumentError\nfrom . import locked\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _joint_status(stages):\n status = {}\n\n for stage in stages:\n if stage.locked and not stage.is_repo_import:\n logger.warning(\n \"DVC-file '{path}' is locked. Its dependencies are\"\n \" not going to be shown in the status output.\".format(\n path=stage.relpath\n )\n )\n\n status.update(stage.status(check_updates=True))\n\n return status\n\n\ndef _local_status(self, targets=None, with_deps=False):\n if targets:\n stages = cat(self.collect(t, with_deps=with_deps) for t in targets)\n else:\n stages = self.collect(None, with_deps=with_deps)\n\n return _joint_status(stages)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/add.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/add.py_logging_", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["add", "imports"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nfrom copy import copy\n\nfrom dvc.repo import locked\nfrom dvc.dvcfile import Dvcfile\n\n\nlogger = logging.getLogger(__name__)\n\n\n@locked\ndef add(self, tag, target=None, with_deps=False, recursive=False):\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n for stage in stages:\n changed = False\n for out in stage.outs:\n if not out.info:\n logger.warning(\"missing checksum info for '{}'\".format(out))\n continue\n out.tags[tag] = copy(out.info)\n changed = True\n if changed:\n dvcfile = Dvcfile(self, stage.path)\n dvcfile.dump(stage)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/remove.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/remove.py_logging_", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["imports", "remove"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.repo import locked\nfrom dvc.dvcfile import Dvcfile\n\n\nlogger = logging.getLogger(__name__)\n\n\n@locked\ndef remove(self, tag, target=None, with_deps=False, recursive=False):\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n for stage in stages:\n changed = False\n for out in stage.outs:\n if tag not in out.tags.keys():\n logger.warning(\"tag '{}' not found for '{}'\".format(tag, out))\n continue\n del out.tags[tag]\n changed = True\n if changed:\n dvcfile = Dvcfile(self, stage.path)\n dvcfile.dump(stage)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py_os_RWLockFileFormatError.__init__.super___init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py_os_RWLockFileFormatError.__init__.super___init___", "embedding": null, "metadata": {"file_path": "dvc/rwlock.py", "file_name": "rwlock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["RWLockFileCorruptedError", "imports", "RWLockFileFormatError.__init__", "RWLockFileCorruptedError.__init__", "RWLockFileFormatError"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport json\n\nfrom collections import defaultdict\nfrom contextlib import contextmanager\n\nfrom voluptuous import Schema, Invalid, Required, Optional\n\nfrom .exceptions import DvcException\nfrom .lock import LockError\nfrom .utils import relpath\n\nINFO_SCHEMA = {Required(\"pid\"): int, Required(\"cmd\"): str}\n\nSCHEMA = Schema(\n {\n Optional(\"write\", default={}): {str: INFO_SCHEMA},\n Optional(\"read\", default={}): {str: [INFO_SCHEMA]},\n }\n)\n\n\nclass RWLockFileCorruptedError(DvcException):\n def __init__(self, path):\n super().__init__(\n \"Unable to read RWLock-file '{}'. JSON structure is \"\n \"corrupted\".format(relpath(path))\n )\n\n\nclass RWLockFileFormatError(DvcException):\n def __init__(self, path):\n super().__init__(\n \"RWLock-file '{}' format error.\".format(relpath(path))\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__edit_rwlock__infos_to_str.return._n_join_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__edit_rwlock__infos_to_str.return._n_join_", "embedding": null, "metadata": {"file_path": "dvc/rwlock.py", "file_name": "rwlock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 63, "span_ids": ["_edit_rwlock", "_infos_to_str"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextmanager\ndef _edit_rwlock(lock_dir):\n path = os.path.join(lock_dir, \"rwlock\")\n try:\n with open(path, \"r\") as fobj:\n lock = SCHEMA(json.load(fobj))\n except FileNotFoundError:\n lock = SCHEMA({})\n except json.JSONDecodeError as exc:\n raise RWLockFileCorruptedError(path) from exc\n except Invalid as exc:\n raise RWLockFileFormatError(path) from exc\n lock[\"read\"] = defaultdict(list, lock[\"read\"])\n lock[\"write\"] = defaultdict(dict, lock[\"write\"])\n yield lock\n with open(path, \"w+\") as fobj:\n json.dump(lock, fobj)\n # NOTE: flush and fsync to ensure that rwlock contents are saved\n fobj.flush()\n os.fsync(fobj.fileno())\n\n\ndef _infos_to_str(infos):\n return \"\\n\".join(\n \" (PID {}): {}\".format(info[\"pid\"], info[\"cmd\"]) for info in infos\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__check_blockers__check_blockers.for_path_info_in_waiters_.raise_LockError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__check_blockers__check_blockers.for_path_info_in_waiters_.raise_LockError_", "embedding": null, "metadata": {"file_path": "dvc/rwlock.py", "file_name": "rwlock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 87, "span_ids": ["_check_blockers"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _check_blockers(lock, info, *, mode, waiters):\n for path_info in waiters:\n blockers = [\n blocker\n for path, infos in lock[mode].items()\n if path_info.overlaps(path)\n for blocker in (infos if isinstance(infos, list) else [infos])\n if blocker != info\n ]\n\n if not blockers:\n continue\n\n raise LockError(\n \"'{path}' is busy, it is being blocked by:\\n\"\n \"{blockers}\\n\"\n \"\\n\"\n \"If there are no processes with such PIDs, you can manually remove\"\n \"'.dvc/tmp/rwlock' and try again.\".format(\n path=str(path_info), blockers=_infos_to_str(blockers)\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__acquire_read__release_read.for_url_in_changes_.if_not_lock_read_.del_lock_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py__acquire_read__release_read.for_url_in_changes_.if_not_lock_read_.del_lock_read_", "embedding": null, "metadata": {"file_path": "dvc/rwlock.py", "file_name": "rwlock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 140, "span_ids": ["_acquire_read", "_acquire_write", "_release_read", "_release_write"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _acquire_read(lock, info, path_infos):\n changes = []\n\n for path_info in path_infos:\n url = path_info.url\n\n readers = lock[\"read\"][url]\n if info in readers:\n continue\n\n changes.append(url)\n readers.append(info)\n\n return changes\n\n\ndef _acquire_write(lock, info, path_infos):\n changes = []\n\n for path_info in path_infos:\n url = path_info.url\n\n if lock[\"write\"][url] == info:\n continue\n\n changes.append(url)\n lock[\"write\"][url] = info\n\n return changes\n\n\ndef _release_write(lock, info, changes):\n for url in changes:\n assert \"write\" in lock\n assert url in lock[\"write\"]\n assert lock[\"write\"][url] == info\n del lock[\"write\"][url]\n if not lock[\"write\"]:\n del lock[\"write\"]\n\n\ndef _release_read(lock, info, changes):\n for url in changes:\n assert \"read\" in lock\n assert url in lock[\"read\"]\n assert info in lock[\"read\"][url]\n lock[\"read\"][url].remove(info)\n if not lock[\"read\"][url]:\n del lock[\"read\"][url]\n if not lock[\"read\"]:\n del lock[\"read\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py_rwlock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py_rwlock_", "embedding": null, "metadata": {"file_path": "dvc/rwlock.py", "file_name": "rwlock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 177, "span_ids": ["rwlock"], "tokens": 322}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextmanager\ndef rwlock(tmp_dir, cmd, read, write):\n \"\"\"Create non-thread-safe RWLock for PathInfos.\n\n Args:\n tmp_dir (str): existing directory where to create the rwlock file.\n cmd (str): command that will be working on these PathInfos.\n read ([PathInfo]): PathInfos that are going to be read.\n write ([PathInfo]): PathInfos that are going to be written.\n\n Raises:\n LockError: raised if PathInfo we want to read is being written to by\n another command or if PathInfo we want to write is being written\n to or read from by another command.\n RWLockFileCorruptedError: raised if rwlock file is not a valid JSON.\n RWLockFileFormatError: raised if rwlock file is a valid JSON, but\n has internal format that doesn't pass our schema validation.\n \"\"\"\n info = {\"pid\": os.getpid(), \"cmd\": cmd}\n\n with _edit_rwlock(tmp_dir) as lock:\n\n _check_blockers(lock, info, mode=\"write\", waiters=read + write)\n _check_blockers(lock, info, mode=\"read\", waiters=write)\n\n rchanges = _acquire_read(lock, info, read)\n wchanges = _acquire_write(lock, info, write)\n\n try:\n yield\n finally:\n with _edit_rwlock(tmp_dir) as lock:\n _release_write(lock, info, wchanges)\n _release_read(lock, info, rchanges)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py__Manages_Git__logger.logging_getLogger___name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py__Manages_Git__logger.logging_getLogger___name_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["docstring"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages Git.\"\"\"\n\nimport logging\nimport os\nimport yaml\nimport shlex\n\nfrom funcy import cached_property\nfrom pathspec.patterns import GitWildMatchPattern\n\nfrom dvc.exceptions import GitHookAlreadyExistsError\nfrom dvc.progress import Tqdm\nfrom dvc.scm.base import Base\nfrom dvc.scm.base import CloneError, FileNotInRepoError, RevError, SCMError\nfrom dvc.scm.git.tree import GitTree\nfrom dvc.utils import fix_env, is_binary, relpath\nfrom dvc.utils.fs import path_isin\n\nlogger = logging.getLogger(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git_Git.root_dir.return.self_repo_working_tree_di": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git_Git.root_dir.return.self_repo_working_tree_di", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 54, "span_ids": ["Git", "Git.__init__", "Git.root_dir"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n \"\"\"Class for managing Git.\"\"\"\n\n GITIGNORE = \".gitignore\"\n GIT_DIR = \".git\"\n\n def __init__(self, root_dir=os.curdir, search_parent_directories=True):\n \"\"\"Git class constructor.\n Requires `Repo` class from `git` module (from gitpython package).\n \"\"\"\n super().__init__(root_dir)\n\n import git\n from git.exc import InvalidGitRepositoryError\n\n try:\n self.repo = git.Repo(\n root_dir, search_parent_directories=search_parent_directories\n )\n except InvalidGitRepositoryError:\n msg = \"{} is not a git repository\"\n raise SCMError(msg.format(root_dir))\n\n # NOTE: fixing LD_LIBRARY_PATH for binary built by PyInstaller.\n # http://pyinstaller.readthedocs.io/en/stable/runtime-information.html\n env = fix_env(None)\n libpath = env.get(\"LD_LIBRARY_PATH\", None)\n self.repo.git.update_environment(LD_LIBRARY_PATH=libpath)\n\n self.ignored_paths = []\n self.files_to_track = set()\n\n @property\n def root_dir(self):\n return self.repo.working_tree_dir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.clone_Git.clone.return.repo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.clone_Git.clone.return.repo", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 135, "span_ids": ["Git.clone"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n @staticmethod\n def clone(url, to_path, rev=None):\n import git\n\n ld_key = \"LD_LIBRARY_PATH\"\n\n env = fix_env(None)\n if is_binary() and ld_key not in env.keys():\n # In fix_env, we delete LD_LIBRARY_PATH key if it was empty before\n # PyInstaller modified it. GitPython, in git.Repo.clone_from, uses\n # env to update its own internal state. When there is no key in\n # env, this value is not updated and GitPython re-uses\n # LD_LIBRARY_PATH that has been set by PyInstaller.\n # See [1] for more info.\n # [1] https://github.com/gitpython-developers/GitPython/issues/924\n env[ld_key] = \"\"\n\n try:\n with TqdmGit(desc=\"Cloning\", unit=\"obj\") as pbar:\n tmp_repo = git.Repo.clone_from(\n url,\n to_path,\n env=env, # needed before we can fix it in __init__\n no_single_branch=True,\n progress=pbar.update_git,\n )\n tmp_repo.close()\n except git.exc.GitCommandError as exc:\n raise CloneError(url, to_path) from exc\n\n # NOTE: using our wrapper to make sure that env is fixed in __init__\n repo = Git(to_path)\n\n if rev:\n try:\n repo.checkout(rev)\n except git.exc.GitCommandError as exc:\n raise RevError(\n \"failed to access revision '{}' for repo '{}'\".format(\n rev, url\n )\n ) from exc\n\n return repo", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.is_sha_Git._get_gitignore.return.entry_gitignore": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.is_sha_Git._get_gitignore.return.entry_gitignore", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 133, "span_ids": ["Git.dir", "Git._get_gitignore", "Git.is_sha", "Git._get_git_dir", "Git.ignore_file"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n @staticmethod\n def is_sha(rev):\n import git\n\n return rev and git.Repo.re_hexsha_shortened.search(rev)\n\n @staticmethod\n def _get_git_dir(root_dir):\n return os.path.join(root_dir, Git.GIT_DIR)\n\n @property\n def dir(self):\n return self.repo.git_dir\n\n @property\n def ignore_file(self):\n return self.GITIGNORE\n\n def _get_gitignore(self, path):\n ignore_file_dir = os.path.dirname(path)\n\n assert os.path.isabs(path)\n assert os.path.isabs(ignore_file_dir)\n\n entry = relpath(path, ignore_file_dir).replace(os.sep, \"/\")\n # NOTE: using '/' prefix to make path unambiguous\n if len(entry) > 0 and entry[0] != \"/\":\n entry = \"/\" + entry\n\n gitignore = os.path.join(ignore_file_dir, self.GITIGNORE)\n\n if not path_isin(gitignore, os.path.realpath(self.root_dir)):\n raise FileNotInRepoError(path)\n\n return entry, gitignore", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.commit_Git._install_hook.os_chmod_hook_0o777_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.commit_Git._install_hook.os_chmod_hook_0o777_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 262, "span_ids": ["Git.is_tracked", "Git.is_dirty", "Git.commit", "Git.list_branches", "Git.checkout", "Git._install_hook", "Git.pull", "Git.untracked_files", "Git.list_tags", "Git.push", "Git.tag", "Git.branch", "Git.list_all_commits", "Git.active_branch"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def commit(self, msg):\n self.repo.index.commit(msg)\n\n def checkout(self, branch, create_new=False):\n if create_new:\n self.repo.git.checkout(\"HEAD\", b=branch)\n else:\n self.repo.git.checkout(branch)\n\n def pull(self):\n infos = self.repo.remote().pull()\n for info in infos:\n if info.flags & info.ERROR:\n raise SCMError(\"pull failed: {}\".format(info.note))\n\n def push(self):\n infos = self.repo.remote().push()\n for info in infos:\n if info.flags & info.ERROR:\n raise SCMError(\"push failed: {}\".format(info.summary))\n\n def branch(self, branch):\n self.repo.git.branch(branch)\n\n def tag(self, tag):\n self.repo.git.tag(tag)\n\n def untracked_files(self):\n files = self.repo.untracked_files\n return [os.path.join(self.repo.working_dir, fname) for fname in files]\n\n def is_tracked(self, path):\n # it is equivalent to `bool(self.repo.git.ls_files(path))` by\n # functionality, but ls_files fails on unicode filenames\n path = relpath(path, self.root_dir)\n # There are 4 stages, see BaseIndexEntry.stage\n return any((path, i) in self.repo.index.entries for i in (0, 1, 2, 3))\n\n def is_dirty(self):\n return self.repo.is_dirty()\n\n def active_branch(self):\n return self.repo.active_branch.name\n\n def list_branches(self):\n return [h.name for h in self.repo.heads]\n\n def list_tags(self):\n return [t.name for t in self.repo.tags]\n\n def list_all_commits(self):\n return [c.hexsha for c in self.repo.iter_commits(\"--all\")]\n\n def _install_hook(self, name):\n hook = self._hook_path(name)\n with open(hook, \"w+\") as fobj:\n fobj.write(\"#!/bin/sh\\nexec dvc git-hook {} $@\\n\".format(name))\n\n os.chmod(hook, 0o777)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.install_Git.install.with_open_config_path_w.yaml_dump_config_fobj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.install_Git.install.with_open_config_path_w.yaml_dump_config_fobj_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 264, "end_line": 307, "span_ids": ["Git.install"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def install(self, use_pre_commit_tool=False):\n if not use_pre_commit_tool:\n self._verify_dvc_hooks()\n self._install_hook(\"post-checkout\")\n self._install_hook(\"pre-commit\")\n self._install_hook(\"pre-push\")\n return\n\n config_path = os.path.join(self.root_dir, \".pre-commit-config.yaml\")\n\n config = {}\n if os.path.exists(config_path):\n with open(config_path, \"r\") as fobj:\n config = yaml.safe_load(fobj)\n\n entry = {\n \"repo\": \"https://github.com/iterative/dvc\",\n \"rev\": \"master\",\n \"hooks\": [\n {\n \"id\": \"dvc-pre-commit\",\n \"language_version\": \"python3\",\n \"stages\": [\"commit\"],\n },\n {\n \"id\": \"dvc-pre-push\",\n \"language_version\": \"python3\",\n \"stages\": [\"push\"],\n },\n {\n \"id\": \"dvc-post-checkout\",\n \"language_version\": \"python3\",\n \"stages\": [\"post-checkout\"],\n \"always_run\": True,\n },\n ],\n }\n\n if entry in config[\"repos\"]:\n return\n\n config[\"repos\"].append(entry)\n with open(config_path, \"w+\") as fobj:\n yaml.dump(config, fobj)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.cleanup_ignores_Git.get_rev.return.self_repo_rev_parse_HEAD": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.cleanup_ignores_Git.get_rev.return.self_repo_rev_parse_HEAD", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 346, "span_ids": ["Git.cleanup_ignores", "Git.reset_ignores", "Git.track_file", "Git.get_rev", "Git.belongs_to_scm", "Git.remind_to_track", "Git.reset_tracked_files", "Git.get_tree"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def cleanup_ignores(self):\n for path in self.ignored_paths:\n self.ignore_remove(path)\n self.reset_ignores()\n\n def reset_ignores(self):\n self.ignored_paths = []\n\n def reset_tracked_files(self):\n self.files_to_track = set()\n\n def remind_to_track(self):\n if not self.files_to_track:\n return\n\n files = \" \".join(shlex.quote(path) for path in self.files_to_track)\n\n logger.info(\n \"\\n\"\n \"To track the changes with git, run:\\n\"\n \"\\n\"\n \"\\tgit add {files}\".format(files=files)\n )\n\n def track_file(self, path):\n self.files_to_track.add(path)\n\n def belongs_to_scm(self, path):\n basename = os.path.basename(path)\n path_parts = os.path.normpath(path).split(os.path.sep)\n return basename == self.ignore_file or Git.GIT_DIR in path_parts\n\n def get_tree(self, rev):\n return GitTree(self.repo, self.resolve_rev(rev))\n\n def get_rev(self):\n return self.repo.rev_parse(\"HEAD\").hexsha", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.resolve_rev_Git.resolve_rev.raise_RevError_unknown_G": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.resolve_rev_Git.resolve_rev.raise_RevError_unknown_G", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 345, "end_line": 374, "span_ids": ["Git.resolve_rev"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def resolve_rev(self, rev):\n from git.exc import BadName, GitCommandError\n from contextlib import suppress\n\n def _resolve_rev(name):\n with suppress(BadName, GitCommandError):\n try:\n # Try python implementation of rev-parse first, it's faster\n return self.repo.rev_parse(name).hexsha\n except NotImplementedError:\n # Fall back to `git rev-parse` for advanced features\n return self.repo.git.rev_parse(name)\n\n # Resolve across local names\n sha = _resolve_rev(rev)\n if sha:\n return sha\n\n # Try all the remotes and if it resolves unambiguously then take it\n if not Git.is_sha(rev):\n shas = {\n _resolve_rev(\"{}/{}\".format(remote.name, rev))\n for remote in self.repo.remotes\n } - {None}\n if len(shas) > 1:\n raise RevError(\"ambiguous Git revision '{}'\".format(rev))\n if len(shas) == 1:\n return shas.pop()\n\n raise RevError(\"unknown Git revision '{}'\".format(rev))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.has_rev_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.has_rev_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 376, "end_line": 401, "span_ids": ["Git._verify_dvc_hooks", "Git.has_rev", "Git._hook_path", "Git.close", "Git._verify_hook", "Git._hooks_home"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def has_rev(self, rev):\n try:\n self.resolve_rev(rev)\n return True\n except RevError:\n return False\n\n def close(self):\n self.repo.close()\n\n @cached_property\n def _hooks_home(self):\n return os.path.join(self.root_dir, self.GIT_DIR, \"hooks\")\n\n def _hook_path(self, name):\n return os.path.join(self._hooks_home, name)\n\n def _verify_hook(self, name):\n if os.path.exists(self._hook_path(name)):\n raise GitHookAlreadyExistsError(name)\n\n def _verify_dvc_hooks(self):\n self._verify_hook(\"post-checkout\")\n self._verify_hook(\"pre-commit\")\n self._verify_hook(\"pre-push\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_io__item_basename.return.os_path_basename_item_pat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_io__item_basename.return.os_path_basename_item_pat", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["_item_basename", "imports"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import io\nimport errno\nimport os\n\nfrom dvc.exceptions import DvcException\nfrom dvc.scm.tree import BaseTree\nfrom dvc.utils import relpath\n\n\n# see git-fast-import(1)\nGIT_MODE_DIR = 0o40000\nGIT_MODE_FILE = 0o644\n\n\ndef _item_basename(item):\n # NOTE: `item.name` is not always a basename. See [1] for more details.\n #\n # [1] https://github.com/iterative/dvc/issues/3481#issuecomment-600693884\n return os.path.basename(item.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree_GitTree.open.return.io_StringIO_data_decode_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree_GitTree.open.return.io_StringIO_data_decode_e", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 58, "span_ids": ["GitTree", "GitTree.open", "GitTree.__init__", "GitTree.tree_root"], "tokens": 292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GitTree(BaseTree):\n \"\"\"Proxies the repo file access methods to Git objects\"\"\"\n\n def __init__(self, git, rev):\n \"\"\"Create GitTree instance\n\n Args:\n git (dvc.scm.Git):\n branch:\n \"\"\"\n self.git = git\n self.rev = rev\n\n @property\n def tree_root(self):\n return self.git.working_dir\n\n def open(self, path, mode=\"r\", encoding=\"utf-8\"):\n assert mode in {\"r\", \"rb\"}\n\n relative_path = relpath(path, self.git.working_dir)\n\n obj = self.git_object_by_path(path)\n if obj is None:\n msg = \"No such file in branch '{}'\".format(self.rev)\n raise IOError(errno.ENOENT, msg, relative_path)\n if obj.mode == GIT_MODE_DIR:\n raise IOError(errno.EISDIR, \"Is a directory\", relative_path)\n\n # GitPython's obj.data_stream is a fragile thing, it is better to\n # read it immediately, also it needs to be to decoded if we follow\n # the `open()` behavior (since data_stream.read() returns bytes,\n # and `open` with default \"r\" mode returns str)\n data = obj.data_stream.read()\n if mode == \"rb\":\n return io.BytesIO(data)\n return io.StringIO(data.decode(encoding))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database_logger.logging_getLogger___name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database_logger.logging_getLogger___name_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["docstring"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages state database used for checksum caching.\"\"\"\n\nimport logging\nimport os\nimport re\nimport sqlite3\nfrom urllib.parse import urlunparse, urlencode\n\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import current_timestamp\nfrom dvc.utils import relpath\nfrom dvc.utils import to_chunks\nfrom dvc.compat import fspath_py35\nfrom dvc.utils.fs import get_inode\nfrom dvc.utils.fs import get_mtime_and_size\nfrom dvc.utils.fs import remove\n\n\nSQLITE_MAX_VARIABLES_NUMBER = 999\n\nlogger = logging.getLogger(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_StateVersionTooNewError_StateNoop.__exit__.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_StateVersionTooNewError_StateNoop.__exit__.pass", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 54, "span_ids": ["StateNoop.get", "StateNoop.__enter__", "StateNoop.save", "StateVersionTooNewError.__init__", "StateNoop", "StateNoop.save_link", "StateVersionTooNewError", "StateNoop.__exit__"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StateVersionTooNewError(DvcException):\n \"\"\"Thrown when DVC version is older than the state database version.\"\"\"\n\n def __init__(self, dvc_version, expected, actual):\n super().__init__(\n \"you are using an old version '{dvc_version}' of DVC that is \"\n \"using state file version '{expected}', which is not compatible \"\n \"with the state file version '{actual}', that is used in this \"\n \"repo. Please upgrade right now!\".format(\n dvc_version=dvc_version, expected=expected, actual=actual\n )\n )\n\n\nclass StateNoop(object):\n files = []\n\n def save(self, path_info, checksum):\n pass\n\n def get(self, path_info):\n return None\n\n def save_link(self, path_info):\n pass\n\n def __enter__(self):\n pass\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_unused_links_State.remove_links.for_chunk_unused_in_to_ch.self__execute_cmd_tuple_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_unused_links_State.remove_links.for_chunk_unused_in_to_ch.self__execute_cmd_tuple_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 442, "end_line": 478, "span_ids": ["State.get_unused_links", "State.remove_links"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def get_unused_links(self, used):\n \"\"\"Removes all saved links except the ones that are used.\n\n Args:\n used (list): list of used links that should not be removed.\n \"\"\"\n unused = []\n\n self._execute(\"SELECT * FROM {}\".format(self.LINK_STATE_TABLE))\n for row in self.cursor:\n relpath, inode, mtime = row\n inode = self._from_sqlite(inode)\n path = os.path.join(self.root_dir, relpath)\n\n if path in used or not os.path.exists(path):\n continue\n\n actual_inode = get_inode(path)\n actual_mtime, _ = get_mtime_and_size(path, self.repo.tree)\n\n if (inode, mtime) == (actual_inode, actual_mtime):\n logger.debug(\"Removing '%s' as unused link.\", path)\n unused.append(relpath)\n\n return unused\n\n def remove_links(self, unused):\n for path in unused:\n remove(path)\n\n for chunk_unused in to_chunks(\n unused, chunk_size=SQLITE_MAX_VARIABLES_NUMBER\n ):\n cmd = \"DELETE FROM {} WHERE path IN ({})\".format(\n self.LINK_STATE_TABLE, \",\".join([\"?\"] * len(chunk_unused))\n )\n self._execute(cmd, tuple(chunk_unused))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__connect_sqlite_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__connect_sqlite_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 481, "end_line": 507, "span_ids": ["_connect_sqlite", "_build_sqlite_uri"], "tokens": 315}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _connect_sqlite(filename, options):\n # Connect by URI was added in Python 3.4 and sqlite 3.7.7,\n # we ignore options, which should be fine unless repo is on old NFS/CIFS\n if sqlite3.sqlite_version_info < (3, 7, 7):\n return sqlite3.connect(filename)\n\n uri = _build_sqlite_uri(filename, options)\n return sqlite3.connect(uri, uri=True)\n\n\ndef _build_sqlite_uri(filename, options):\n # In the doc mentioned below we only need to replace ? -> %3f and\n # # -> %23, but, if present, we also need to replace % -> %25 first\n # (happens when we are on a weird FS that shows urlencoded filenames\n # instead of proper ones) to not confuse sqlite.\n uri_path = filename.replace(\"%\", \"%25\")\n\n # Convert filename to uri according to https://www.sqlite.org/uri.html, 3.1\n uri_path = uri_path.replace(\"?\", \"%3f\").replace(\"#\", \"%23\")\n if os.name == \"nt\":\n uri_path = uri_path.replace(\"\\\\\", \"/\")\n uri_path = re.sub(r\"^([a-z]:)\", \"/\\\\1\", uri_path, flags=re.I)\n uri_path = re.sub(r\"/+\", \"/\", uri_path)\n\n # Empty netloc, params and fragment\n return urlunparse((\"file\", \"\", uri_path, \"\", urlencode(options), \"\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_errno_System.symlink.try_.except_OSError_as_exc_.raise_DvcException_faile": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_errno_System.symlink.try_.except_OSError_as_exc_.raise_DvcException_faile", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 50, "span_ids": ["System", "imports", "System.is_unix", "System.hardlink", "System.symlink", "System.copy"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import errno\nimport logging\nimport os\nimport platform\nimport shutil\nimport sys\n\nfrom dvc.compat import fspath\nfrom dvc.exceptions import DvcException\n\nlogger = logging.getLogger(__name__)\n\nif (\n platform.system() == \"Windows\"\n and sys.version_info < (3, 8)\n and sys.getwindowsversion() >= (6, 2)\n):\n try:\n import speedcopy\n\n speedcopy.patch_copyfile()\n except ImportError:\n pass\n\n\nclass System(object):\n @staticmethod\n def is_unix():\n return os.name != \"nt\"\n\n @staticmethod\n def copy(src, dest):\n src, dest = fspath(src), fspath(dest)\n return shutil.copyfile(src, dest)\n\n @staticmethod\n def hardlink(source, link_name):\n source, link_name = fspath(source), fspath(link_name)\n try:\n os.link(source, link_name)\n except OSError as exc:\n raise DvcException(\"failed to link\") from exc\n\n @staticmethod\n def symlink(source, link_name):\n source, link_name = fspath(source), fspath(link_name)\n try:\n os.symlink(source, link_name)\n except OSError as exc:\n raise DvcException(\"failed to symlink\") from exc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._getdirinfo_System._getdirinfo.return.Info_GetFileInformationB": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._getdirinfo_System._getdirinfo.return.Info_GetFileInformationB", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 158, "span_ids": ["System._getdirinfo"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def _getdirinfo(path):\n from collections import namedtuple\n from win32file import (\n CreateFileW,\n GetFileInformationByHandle,\n FILE_FLAG_BACKUP_SEMANTICS,\n FILE_FLAG_OPEN_REPARSE_POINT,\n FILE_SHARE_READ,\n OPEN_EXISTING,\n )\n\n # NOTE: use FILE_FLAG_OPEN_REPARSE_POINT to open symlink itself and not\n # the target See https://docs.microsoft.com/en-us/windows/desktop/api/\n # fileapi/nf-fileapi-createfilew#symbolic-link-behavior\n flags = FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT\n\n hfile = CreateFileW(\n path, 0, FILE_SHARE_READ, None, OPEN_EXISTING, flags, None\n )\n\n # See BY_HANDLE_FILE_INFORMATION structure from fileapi.h\n Info = namedtuple(\n \"BY_HANDLE_FILE_INFORMATION\",\n [\n \"dwFileAttributes\",\n \"ftCreationTime\",\n \"ftLastAccessTime\",\n \"ftLastWriteTime\",\n \"dwVolumeSerialNumber\",\n \"nFileSizeHigh\",\n \"nFileSizeLow\",\n \"nNumberOfLinks\",\n \"nFileIndexHigh\",\n \"nFileIndexLow\",\n ],\n )\n\n return Info(*GetFileInformationByHandle(hfile))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.is_symlink_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.is_symlink_", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 188, "end_line": 213, "span_ids": ["System.is_hardlink", "System.is_symlink"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def is_symlink(path):\n path = fspath(path)\n\n if System.is_unix():\n return os.path.islink(path)\n\n # https://docs.microsoft.com/en-us/windows/desktop/fileio/\n # file-attribute-constants\n from winnt import FILE_ATTRIBUTE_REPARSE_POINT\n\n if os.path.lexists(path):\n info = System._getdirinfo(path)\n return info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT\n return False\n\n @staticmethod\n def is_hardlink(path):\n path = fspath(path)\n\n if System.is_unix():\n return os.stat(path).st_nlink > 1\n\n info = System._getdirinfo(path)\n return info.nNumberOfLinks > 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_logging_Updater.check.self__with_lock_self__che": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_logging_Updater.check.self__with_lock_self__che", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 54, "span_ids": ["Updater._with_lock", "Updater.__init__", "imports", "Updater", "Updater.check", "Updater._is_outdated_file"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\nimport sys\nimport time\n\nimport colorama\nfrom packaging import version\n\nfrom dvc import __version__\nfrom dvc.lock import make_lock, LockError\nfrom dvc.utils import boxify\nfrom dvc.utils import env2bool\nfrom dvc.utils.pkg import PKG\n\nlogger = logging.getLogger(__name__)\n\n\nclass Updater(object): # pragma: no cover\n URL = \"https://updater.dvc.org\"\n UPDATER_FILE = \"updater\"\n TIMEOUT = 24 * 60 * 60 # every day\n TIMEOUT_GET = 10\n\n def __init__(self, dvc_dir, friendly=False, hardlink_lock=False):\n self.dvc_dir = dvc_dir\n self.updater_file = os.path.join(dvc_dir, self.UPDATER_FILE)\n self.lock = make_lock(\n self.updater_file + \".lock\",\n tmp_dir=os.path.join(dvc_dir, \"tmp\"),\n friendly=friendly,\n hardlink_lock=hardlink_lock,\n )\n self.current = version.parse(__version__).base_version\n\n def _is_outdated_file(self):\n ctime = os.path.getmtime(self.updater_file)\n outdated = time.time() - ctime >= self.TIMEOUT\n if outdated:\n logger.debug(\"'{}' is outdated(\".format(self.updater_file))\n return outdated\n\n def _with_lock(self, func, action):\n try:\n with self.lock:\n func()\n except LockError:\n msg = \"Failed to acquire '{}' before {} updates\"\n logger.debug(msg.format(self.lock.lockfile, action))\n\n def check(self):\n if os.getenv(\"CI\") or env2bool(\"DVC_TEST\") or PKG == \"snap\":\n return\n\n self._with_lock(self._check, \"checking\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.version_parse_self_curren": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.version_parse_self_curren", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 101, "span_ids": ["Updater.fetch", "Updater._get_latest_version", "Updater._is_outdated"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Updater(object):\n\n def fetch(self, detach=True):\n from dvc.daemon import daemon\n\n if detach:\n daemon([\"updater\"])\n return\n\n self._with_lock(self._get_latest_version, \"fetching\")\n\n def _get_latest_version(self):\n import json\n import requests\n\n try:\n r = requests.get(self.URL, timeout=self.TIMEOUT_GET)\n info = r.json()\n except requests.exceptions.RequestException as exc:\n msg = \"Failed to retrieve latest version: {}\"\n logger.debug(msg.format(exc))\n return\n\n with open(self.updater_file, \"w+\") as fobj:\n json.dump(info, fobj)\n\n def _is_outdated(self):\n return version.parse(self.current) < version.parse(self.latest)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_update_instructions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_update_instructions_", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 152, "span_ids": ["Updater._get_update_instructions"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Updater(object):\n\n def _get_update_instructions(self):\n instructions = {\n \"pip\": \"Run `{yellow}pip{reset} install dvc \"\n \"{blue}--upgrade{reset}`\",\n \"rpm\": \"Run `{yellow}yum{reset} update dvc`\",\n \"brew\": \"Run `{yellow}brew{reset} upgrade dvc`\",\n \"deb\": (\n \"Run `{yellow}apt-get{reset} install\"\n \" {blue}--only-upgrade{reset} dvc`\"\n ),\n \"binary\": (\n \"To upgrade follow these steps:\\n\"\n \"1. Uninstall dvc binary\\n\"\n \"2. Go to {blue}https://dvc.org{reset}\\n\"\n \"3. Download and install new binary\"\n ),\n \"conda\": \"Run `{yellow}conda{reset} update dvc`\",\n \"choco\": \"Run `{yellow}choco{reset} upgrade dvc`\",\n None: (\n \"Find the latest release at\\n\"\n \"{blue}https://github.com/iterative/dvc/releases/latest{reset}\"\n ),\n }\n\n package_manager = PKG\n if package_manager in (\"osxpkg\", \"exe\"):\n package_manager = \"binary\"\n\n return instructions[package_manager]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_file_md5_file_md5.return._None_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_file_md5_file_md5.return._None_None_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 75, "span_ids": ["file_md5"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def file_md5(fname):\n \"\"\" get the (md5 hexdigest, md5 digest) of a file \"\"\"\n from dvc.progress import Tqdm\n from dvc.istextfile import istextfile\n\n fname = fspath_py35(fname)\n\n if os.path.exists(fname):\n hash_md5 = hashlib.md5()\n binary = not istextfile(fname)\n size = os.path.getsize(fname)\n no_progress_bar = True\n if size >= LARGE_FILE_SIZE:\n no_progress_bar = False\n msg = (\n \"Computing md5 for a large file '{}'. This is only done once.\"\n )\n logger.info(msg.format(relpath(fname)))\n name = relpath(fname)\n\n with Tqdm(\n desc=name,\n disable=no_progress_bar,\n total=size,\n bytes=True,\n leave=False,\n ) as pbar:\n with open(fname, \"rb\") as fobj:\n while True:\n data = fobj.read(LOCAL_CHUNK_SIZE)\n if not data:\n break\n\n if binary:\n chunk = data\n else:\n chunk = dos2unix(data)\n\n hash_md5.update(chunk)\n pbar.update(len(data))\n\n return (hash_md5.hexdigest(), hash_md5.digest())\n\n return (None, None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_bytes_md5_is_binary.return.getattr_sys_frozen_Fa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_bytes_md5_is_binary.return.getattr_sys_frozen_Fa", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 140, "span_ids": ["to_chunks", "is_binary", "dict_filter", "_split", "bytes_md5", "_to_chunks_by_chunks_number", "dict_md5"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bytes_md5(byts):\n hasher = hashlib.md5()\n hasher.update(byts)\n return hasher.hexdigest()\n\n\ndef dict_filter(d, exclude=()):\n \"\"\"\n Exclude specified keys from a nested dict\n \"\"\"\n\n if isinstance(d, list):\n return [dict_filter(e, exclude) for e in d]\n\n if isinstance(d, dict):\n return {\n k: dict_filter(v, exclude)\n for k, v in d.items()\n if k not in exclude\n }\n\n return d\n\n\ndef dict_md5(d, exclude=()):\n filtered = dict_filter(d, exclude)\n byts = json.dumps(filtered, sort_keys=True).encode(\"utf-8\")\n return bytes_md5(byts)\n\n\ndef _split(list_to_split, chunk_size):\n return [\n list_to_split[i : i + chunk_size]\n for i in range(0, len(list_to_split), chunk_size)\n ]\n\n\ndef _to_chunks_by_chunks_number(list_to_split, num_chunks):\n chunk_size = int(math.ceil(float(len(list_to_split)) / num_chunks))\n\n if len(list_to_split) == 1:\n return [list_to_split]\n\n if chunk_size == 0:\n chunk_size = 1\n\n return _split(list_to_split, chunk_size)\n\n\ndef to_chunks(list_to_split, num_chunks=None, chunk_size=None):\n if (num_chunks and chunk_size) or (not num_chunks and not chunk_size):\n raise ValueError(\n \"Only one among `num_chunks` or `chunk_size` must be defined.\"\n )\n if chunk_size:\n return _split(list_to_split, chunk_size)\n return _to_chunks_by_chunks_number(list_to_split, num_chunks)\n\n\n# NOTE: Check if we are in a bundle\n# https://pythonhosted.org/PyInstaller/runtime-information.html\ndef is_binary():\n return getattr(sys, \"frozen\", False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_fix_env_fix_env.return.env": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_fix_env_fix_env.return.env", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 210, "span_ids": ["fix_env"], "tokens": 647}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fix_env(env=None):\n \"\"\"Fix env variables modified by PyInstaller [1] and pyenv [2].\n [1] http://pyinstaller.readthedocs.io/en/stable/runtime-information.html\n [2] https://github.com/pyenv/pyenv/issues/985\n \"\"\"\n if env is None:\n env = os.environ.copy()\n else:\n env = env.copy()\n\n if is_binary():\n lp_key = \"LD_LIBRARY_PATH\"\n lp_orig = env.get(lp_key + \"_ORIG\", None)\n if lp_orig is not None:\n env[lp_key] = lp_orig\n else:\n env.pop(lp_key, None)\n\n # Unlike PyInstaller, pyenv doesn't leave backups of original env vars\n # when it modifies them. If we look into the shim, pyenv and pyenv-exec,\n # we can figure out that the PATH is modified like this:\n #\n # PATH=$PYENV_BIN_PATH:${bin_path}:${plugin_bin}:$PATH\n #\n # where\n #\n # PYENV_BIN_PATH - might not start with $PYENV_ROOT if we are running\n # `system` version of the command, see pyenv-exec source code.\n # bin_path - might not start with $PYENV_ROOT as it runs realpath on\n # it, but always has `libexec` part in it, see pyenv source code.\n # plugin_bin - might contain more than 1 entry, which start with\n # $PYENV_ROOT, see pyenv source code.\n #\n # Also, we know that whenever pyenv is running, it exports these env vars:\n #\n # PYENV_DIR\n # PYENV_HOOK_PATH\n # PYENV_VERSION\n # PYENV_ROOT\n #\n # So having this, we can make a rightful assumption about what parts of the\n # PATH we need to remove in order to get the original PATH.\n path = env.get(\"PATH\", \"\")\n parts = path.split(\":\")\n bin_path = parts[1] if len(parts) > 2 else \"\"\n pyenv_dir = env.get(\"PYENV_DIR\")\n pyenv_hook_path = env.get(\"PYENV_HOOK_PATH\")\n pyenv_version = env.get(\"PYENV_VERSION\")\n pyenv_root = env.get(\"PYENV_ROOT\")\n\n env_matches = all([pyenv_dir, pyenv_hook_path, pyenv_version, pyenv_root])\n\n bin_path_matches = os.path.basename(bin_path) == \"libexec\"\n\n # NOTE: we don't support pyenv-win\n if os.name != \"nt\" and env_matches and bin_path_matches:\n # removing PYENV_BIN_PATH and bin_path\n parts = parts[2:]\n\n if parts:\n # removing plugin_bin from the left\n plugin_bin = os.path.join(pyenv_root, \"plugins\")\n while parts[0].startswith(plugin_bin):\n del parts[0]\n\n env[\"PATH\"] = \":\".join(parts)\n\n return env", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_tmp_fname_colorize.return._color_message_nc_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_tmp_fname_colorize.return._color_message_nc_fo", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 248, "span_ids": ["from_yaml_string", "current_timestamp", "tmp_fname", "colorize", "to_yaml_string"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def tmp_fname(fname):\n \"\"\" Temporary name for a partial download \"\"\"\n return fspath(fname) + \".\" + uuid() + \".tmp\"\n\n\ndef current_timestamp():\n return int(nanotime.timestamp(time.time()))\n\n\ndef from_yaml_string(s):\n return YAML().load(io.StringIO(s))\n\n\ndef to_yaml_string(data):\n stream = io.StringIO()\n yaml = YAML()\n yaml.default_flow_style = False\n yaml.dump(data, stream)\n return stream.getvalue()\n\n\ndef colorize(message, color=None):\n \"\"\"Returns a message in a specified color.\"\"\"\n if not color:\n return message\n\n colors = {\n \"green\": colorama.Fore.GREEN,\n \"yellow\": colorama.Fore.YELLOW,\n \"blue\": colorama.Fore.BLUE,\n \"red\": colorama.Fore.RED,\n }\n\n return \"{color}{message}{nc}\".format(\n color=colors.get(color, \"\"), message=message, nc=colorama.Fore.RESET\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/collections.py_from_collections_abc_impo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/collections.py_from_collections_abc_impo_", "embedding": null, "metadata": {"file_path": "dvc/utils/collections.py", "file_name": "collections.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["imports", "apply_diff"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections.abc import Mapping\n\n\ndef apply_diff(src, dest):\n \"\"\"Recursively apply changes from src to dest.\n\n Preserves dest type and hidden info in dest structure,\n like ruamel.yaml leaves when parses files. This includes comments,\n ordering and line foldings.\n\n Used in Stage load/dump cycle to preserve comments and custom formatting.\n \"\"\"\n Seq = (list, tuple)\n Container = (Mapping, list, tuple)\n\n def is_same_type(a, b):\n return any(\n isinstance(a, t) and isinstance(b, t)\n for t in [str, Mapping, Seq, bool]\n )\n\n if isinstance(src, Mapping) and isinstance(dest, Mapping):\n for key, value in src.items():\n if isinstance(value, Container) and is_same_type(\n value, dest.get(key)\n ):\n apply_diff(value, dest[key])\n elif key not in dest or value != dest[key]:\n dest[key] = value\n for key in set(dest) - set(src):\n del dest[key]\n elif isinstance(src, Seq) and isinstance(dest, Seq):\n if len(src) != len(dest):\n dest[:] = src\n else:\n for i, value in enumerate(src):\n if isinstance(value, Container) and is_same_type(\n value, dest[i]\n ):\n apply_diff(value, dest[i])\n elif value != dest[i]:\n dest[i] = value\n else:\n raise AssertionError(\n \"Can't apply diff from {} to {}\".format(\n src.__class__.__name__, dest.__class__.__name__\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_get_mtime_and_size_get_mtime_and_size.return.str_mtime_str_size_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_get_mtime_and_size_get_mtime_and_size.return.str_mtime_str_size_", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 65, "span_ids": ["get_mtime_and_size"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_mtime_and_size(path, tree):\n\n if os.path.isdir(fspath_py35(path)):\n assert is_working_tree(tree)\n\n size = 0\n files_mtimes = {}\n for file_path in tree.walk_files(path):\n try:\n stat = os.stat(file_path)\n except OSError as exc:\n # NOTE: broken symlink case.\n if exc.errno != errno.ENOENT:\n raise\n continue\n size += stat.st_size\n files_mtimes[file_path] = stat.st_mtime\n\n # We track file changes and moves, which cannot be detected with simply\n # max(mtime(f) for f in non_ignored_files)\n mtime = dict_md5(files_mtimes)\n else:\n base_stat = os.stat(fspath_py35(path))\n size = base_stat.st_size\n mtime = base_stat.st_mtime\n mtime = int(nanotime.timestamp(mtime))\n\n # State of files handled by dvc is stored in db as TEXT.\n # We cast results to string for later comparisons with stored values.\n return str(mtime), str(size)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_BasePathNotInCheckedPathException_contains_symlink_up_to.return.contains_symlink_up_to_os": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_BasePathNotInCheckedPathException_contains_symlink_up_to.return.contains_symlink_up_to_os", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 89, "span_ids": ["BasePathNotInCheckedPathException.__init__", "BasePathNotInCheckedPathException", "contains_symlink_up_to"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BasePathNotInCheckedPathException(DvcException):\n def __init__(self, path, base_path):\n msg = \"Path: {} does not overlap with base path: {}\".format(\n path, base_path\n )\n super().__init__(msg)\n\n\ndef contains_symlink_up_to(path, base_path):\n base_path = fspath(base_path)\n path = fspath(path)\n\n if base_path not in path:\n raise BasePathNotInCheckedPathException(path, base_path)\n\n if path == base_path:\n return False\n if System.is_symlink(path):\n return True\n if os.path.dirname(path) == path:\n return False\n return contains_symlink_up_to(os.path.dirname(path), base_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_move_move.shutil_move_tmp_dst_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_move_move.shutil_move_tmp_dst_", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 115, "span_ids": ["move"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def move(src, dst, mode=None):\n \"\"\"Atomically move src to dst and chmod it with mode.\n\n Moving is performed in two stages to make the whole operation atomic in\n case src and dst are on different filesystems and actual physical copying\n of data is happening.\n \"\"\"\n\n src = fspath(src)\n dst = fspath(dst)\n\n dst = os.path.abspath(dst)\n tmp = \"{}.{}\".format(dst, uuid())\n\n if os.path.islink(src):\n shutil.copy(os.readlink(src), tmp)\n os.unlink(src)\n else:\n shutil.move(src, tmp)\n\n if mode is not None:\n os.chmod(tmp, mode)\n\n shutil.move(tmp, dst)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py__chmod_path_isin.return.child_parent_and_child": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py__chmod_path_isin.return.child_parent_and_child", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 162, "span_ids": ["_chmod", "path_isin", "_unlink", "remove"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _chmod(func, p, excinfo):\n perm = os.lstat(p).st_mode\n perm |= stat.S_IWRITE\n\n try:\n os.chmod(p, perm)\n except OSError as exc:\n # broken symlink or file is not owned by us\n if exc.errno not in [errno.ENOENT, errno.EPERM]:\n raise\n\n func(p)\n\n\ndef _unlink(path, onerror):\n try:\n os.unlink(path)\n except OSError:\n onerror(os.unlink, path, sys.exc_info())\n\n\ndef remove(path):\n logger.debug(\"Removing '%s'\", path)\n\n path = fspath_py35(path)\n try:\n if os.path.isdir(path):\n shutil.rmtree(path, onerror=_chmod)\n else:\n _unlink(path, _chmod)\n except OSError as exc:\n if exc.errno != errno.ENOENT:\n raise\n\n\ndef path_isin(child, parent):\n \"\"\"Check if given `child` path is inside `parent`.\"\"\"\n\n def normalize_path(path):\n return os.path.normpath(fspath_py35(path))\n\n parent = os.path.join(normalize_path(parent), \"\")\n child = normalize_path(child)\n return child != parent and child.startswith(parent)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_makedirs_makedirs.try_.finally_.os_umask_umask_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_makedirs_makedirs.try_.finally_.os_umask_umask_", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 171, "span_ids": ["makedirs"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def makedirs(path, exist_ok=False, mode=None):\n path = fspath_py35(path)\n\n if mode is None:\n os.makedirs(path, exist_ok=exist_ok)\n return\n\n # utilize umask to set proper permissions since Python 3.7 the `mode`\n # `makedirs` argument no longer affects the file permission bits of\n # newly-created intermediate-level directories.\n umask = os.umask(0o777 - mode)\n try:\n os.makedirs(path, exist_ok=exist_ok)\n finally:\n os.umask(umask)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_copyfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_copyfile_", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 212, "span_ids": ["walk_files", "copyfile"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def copyfile(src, dest, no_progress_bar=False, name=None):\n \"\"\"Copy file with progress bar\"\"\"\n from dvc.exceptions import DvcException\n from dvc.progress import Tqdm\n from dvc.system import System\n\n src = fspath_py35(src)\n dest = fspath_py35(dest)\n\n name = name if name else os.path.basename(dest)\n total = os.stat(src).st_size\n\n if os.path.isdir(dest):\n dest = os.path.join(dest, os.path.basename(src))\n\n try:\n System.reflink(src, dest)\n except DvcException:\n with open(src, \"rb\") as fsrc, open(dest, \"wb+\") as fdest:\n with Tqdm.wrapattr(\n fdest,\n \"write\",\n desc=name,\n disable=no_progress_bar,\n total=total,\n bytes=True,\n ) as fdest_wrapped:\n while True:\n buf = fsrc.read(LOCAL_CHUNK_SIZE)\n if not buf:\n break\n fdest_wrapped.write(buf)\n\n\ndef walk_files(directory):\n for root, _, files in os.walk(fspath(directory)):\n for f in files:\n yield os.path.join(root, f)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_io_open_url.with_iter_url_url_as_re.if_mode_rb_.else_.yield_io_TextIOWrapper_by": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_io_open_url.with_iter_url_url_as_re.if_mode_rb_.else_.yield_io_TextIOWrapper_by", "embedding": null, "metadata": {"file_path": "dvc/utils/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["imports", "open_url"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import io\nfrom contextlib import contextmanager\n\n\n@contextmanager\ndef open_url(url, mode=\"r\", encoding=None):\n \"\"\"Opens an url as a readable stream.\n\n Resumes on connection error.\n Url could be a string or a callable returning a string.\n \"\"\"\n assert mode in {\"r\", \"rt\", \"rb\"}\n\n with iter_url(url) as (response, it):\n bytes_stream = IterStream(it)\n\n if mode == \"rb\":\n yield bytes_stream\n else:\n encoding = encoding or response.encoding\n yield io.TextIOWrapper(bytes_stream, encoding=encoding)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_iter_url_iter_url.try_.finally_.it_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_iter_url_iter_url.try_.finally_.it_close_", "embedding": null, "metadata": {"file_path": "dvc/utils/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 63, "span_ids": ["iter_url"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextmanager\ndef iter_url(url, chunk_size=io.DEFAULT_BUFFER_SIZE):\n \"\"\"Iterate over chunks requested from url.\"\"\"\n import requests\n\n def request(headers=None):\n the_url = url() if callable(url) else url\n response = requests.get(the_url, stream=True, headers=headers)\n if response.status_code == 404:\n raise FileNotFoundError(\"Can't open {}\".format(the_url))\n response.raise_for_status()\n return response\n\n def gen(response):\n try:\n pos = 0\n while True:\n try:\n for chunk in response.iter_content(chunk_size):\n pos += len(chunk)\n yield chunk\n break\n except requests.ConnectionError:\n response.close()\n if response.headers.get(\"Accept-Ranges\") != \"bytes\":\n raise\n\n # Reopen request from where we stopped\n headers = {\"Range\": \"bytes={}-\".format(pos)}\n response = request(headers)\n finally:\n response.close()\n\n response = request()\n it = gen(response)\n try:\n yield response, it\n finally:\n # Ensure connection is closed\n it.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_IterStream_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_IterStream_", "embedding": null, "metadata": {"file_path": "dvc/utils/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 108, "span_ids": ["IterStream.read1", "IterStream:3", "IterStream.__init__", "IterStream", "IterStream.readable", "IterStream.readinto"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IterStream(io.RawIOBase):\n \"\"\"Wraps an iterator yielding bytes as a file object\"\"\"\n\n def __init__(self, iterator):\n self.iterator = iterator\n self.leftover = None\n\n def readable(self):\n return True\n\n # Python 3 requires only .readinto() method, it still uses other ones\n # under some circumstances and falls back if those are absent. Since\n # iterator already constructs byte strings for us, .readinto() is not the\n # most optimal, so we provide .read1() too.\n\n def readinto(self, b):\n try:\n n = len(b) # We're supposed to return at most this much\n chunk = self.leftover or next(self.iterator)\n output, self.leftover = chunk[:n], chunk[n:]\n\n n_out = len(output)\n b[:n_out] = output\n return n_out\n except StopIteration:\n return 0 # indicate EOF\n\n readinto1 = readinto\n\n def read1(self, n=-1):\n try:\n chunk = self.leftover or next(self.iterator)\n except StopIteration:\n return b\"\"\n\n # Return an arbitrary number or bytes\n if n <= 0:\n self.leftover = None\n return chunk\n\n output, self.leftover = chunk[:n], chunk[n:]\n return output", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/pkg.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/pkg.py__", "embedding": null, "metadata": {"file_path": "dvc/utils/pkg.py", "file_name": "pkg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["impl"], "tokens": 26}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "try:\n from .build import PKG # file created during dvc build\nexcept ImportError:\n PKG = None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_yaml_parse_stage.try_.except_yaml_error_YAMLErr.raise_StageFileCorruptedE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_yaml_parse_stage.try_.except_yaml_error_YAMLErr.raise_StageFileCorruptedE", "embedding": null, "metadata": {"file_path": "dvc/utils/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["load_stage_file", "imports", "parse_stage"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import yaml\nfrom ruamel.yaml import YAML\nfrom ruamel.yaml.error import YAMLError\n\ntry:\n from yaml import CSafeLoader as SafeLoader\nexcept ImportError:\n from yaml import SafeLoader\n\nfrom dvc.exceptions import StageFileCorruptedError\n\n\ndef load_stage_file(path):\n with open(path, \"r\", encoding=\"utf-8\") as fd:\n return parse_stage(fd.read(), path)\n\n\ndef parse_stage(text, path):\n try:\n return yaml.load(text, Loader=SafeLoader) or {}\n except yaml.error.YAMLError as exc:\n raise StageFileCorruptedError(path) from exc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_parse_stage_for_update_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_parse_stage_for_update_", "embedding": null, "metadata": {"file_path": "dvc/utils/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 46, "span_ids": ["dump_stage_file", "parse_stage_for_update"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_stage_for_update(text, path):\n \"\"\"Parses text into Python structure.\n\n Unlike `parse_stage()` this returns ordered dicts, values have special\n attributes to store comments and line breaks. This allows us to preserve\n all of those upon dump.\n\n This one is, however, several times slower than simple `parse_stage()`.\n \"\"\"\n try:\n yaml = YAML()\n return yaml.load(text) or {}\n except YAMLError as exc:\n raise StageFileCorruptedError(path) from exc\n\n\ndef dump_stage_file(path, data):\n with open(path, \"w\", encoding=\"utf-8\") as fd:\n yaml = YAML()\n yaml.default_flow_style = False\n yaml.dump(data, fd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py__noqa_D300_D400_TEMPLATE.r_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py__noqa_D300_D400_TEMPLATE.r_", "embedding": null, "metadata": {"file_path": "fastentrypoints.py", "file_name": "fastentrypoints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 55, "span_ids": ["docstring"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# noqa: D300,D400\nimport re\n\nfrom setuptools.command import easy_install\n\nTEMPLATE = r\"\"\"\n# -*- coding: utf-8 -*-\n# EASY-INSTALL-ENTRY-SCRIPT: '{3}','{4}','{5}'\n__requires__ = '{3}'\nimport re\nimport sys\n\nfrom {0} import {1}\n\nif __name__ == '__main__':\n sys.argv[0] = re.sub(r'(-script\\.pyw?|\\.exe)?$', '', sys.argv[0])\n sys.exit({2}())\n\"\"\".lstrip()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py_get_args_easy_install.ScriptWriter.get_args.get_args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py_get_args_easy_install.ScriptWriter.get_args.get_args", "embedding": null, "metadata": {"file_path": "fastentrypoints.py", "file_name": "fastentrypoints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 89, "span_ids": ["impl:3", "get_args"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@classmethod\ndef get_args(cls, dist, header=None): # noqa: D205,D400\n \"\"\"\n Yield write_script() argument tuples for a distribution's\n console_scripts and gui_scripts entry points.\n \"\"\"\n if header is None:\n # pylint: disable=E1101\n header = cls.get_header()\n spec = str(dist.as_requirement())\n for type_ in \"console\", \"gui\":\n group = type_ + \"_scripts\"\n for name, ep in dist.get_entry_map(group).items():\n # ensure_safe_name\n if re.search(r\"[\\\\/]\", name):\n raise ValueError(\"Path separators not allowed in script names\")\n script_text = TEMPLATE.format(\n ep.module_name,\n ep.attrs[0],\n \".\".join(ep.attrs),\n spec,\n group,\n name,\n )\n # pylint: disable=E1101\n args = cls._get_script_args(type_, name, header, script_text)\n for res in args:\n yield res\n\n\n# pylint: disable=E1101\neasy_install.ScriptWriter.get_args = get_args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py_main_", "embedding": null, "metadata": {"file_path": "fastentrypoints.py", "file_name": "fastentrypoints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 124, "span_ids": ["main"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main():\n import os\n import re\n import shutil\n import sys\n\n dests = sys.argv[1:] or [\".\"]\n filename = re.sub(r\"\\.pyc$\", \".py\", __file__)\n\n for dst in dests:\n shutil.copy(filename, dst)\n manifest_path = os.path.join(dst, \"MANIFEST.in\")\n setup_path = os.path.join(dst, \"setup.py\")\n\n # Insert the include statement to MANIFEST.in if not present\n with open(manifest_path, \"a+\") as manifest:\n manifest.seek(0)\n manifest_content = manifest.read()\n if \"include fastentrypoints.py\" not in manifest_content:\n manifest.write(\n (\"\\n\" if manifest_content else \"\")\n + \"include fastentrypoints.py\"\n )\n\n # Insert the import statement to setup.py if not present\n with open(setup_path, \"a+\") as setup:\n setup.seek(0)\n setup_content = setup.read()\n if \"import fastentrypoints\" not in setup_content:\n setup.seek(0)\n setup.truncate()\n setup.write(\"import fastentrypoints\\n\" + setup_content)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-dvc.system.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-dvc.system.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-dvc.system.py", "file_name": "hook-dvc.system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["imports"], "tokens": 19}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nif os.name == \"nt\":\n hiddenimports = [\"win32file\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-win32file.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-win32file.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-win32file.py", "file_name": "hook-win32file.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 2, "span_ids": ["impl"], "tokens": 8}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "hiddenimports = [\"win32timezone\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_importlib.util_build_py.run._build_py_run_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_importlib.util_build_py.run._build_py_run_self_", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 46, "span_ids": ["build_py", "imports", "build_py.run", "build_py.pin_version"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import importlib.util\nimport os\nimport sys\n\nfrom setuptools import find_packages, setup\nfrom setuptools.command.build_py import build_py as _build_py\n\n# Prevents pkg_resources import in entry point script,\n# see https://github.com/ninjaaron/fast-entry_points.\n# This saves about 200 ms on startup time for non-wheel installs.\ntry:\n import fastentrypoints # noqa: F401\nexcept ImportError:\n pass # not able to import when installing through pre-commit\n\n\n# Read package meta-data from version.py\n# see https://packaging.python.org/guides/single-sourcing-package-version/\npkg_dir = os.path.dirname(os.path.abspath(__file__))\nversion_path = os.path.join(pkg_dir, \"dvc\", \"version.py\")\nspec = importlib.util.spec_from_file_location(\"dvc.version\", version_path)\ndvc_version = importlib.util.module_from_spec(spec)\nspec.loader.exec_module(dvc_version)\nversion = dvc_version.__version__ # noqa: F821\n\n\n# To achieve consistency between the build version and the one provided\n# by your package during runtime, you need to **pin** the build version.\n#\n# This custom class will replace the version.py module with a **static**\n# `__version__` that your package can read at runtime, assuring consistency.\n#\n# References:\n# - https://docs.python.org/3.7/distutils/extending.html\n# - https://github.com/python/mypy\nclass build_py(_build_py):\n def pin_version(self):\n path = os.path.join(self.build_lib, \"dvc\")\n self.mkpath(path)\n with open(os.path.join(path, \"version.py\"), \"w\") as fobj:\n fobj.write(\"# AUTOGENERATED at build time by setup.py\\n\")\n fobj.write('__version__ = \"{}\"\\n'.format(version))\n\n def run(self):\n self.execute(self.pin_version, ())\n _build_py.run(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_install_requires__Extra_dependecies_to_ru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_install_requires__Extra_dependecies_to_ru", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 109, "span_ids": ["impl:23", "impl:15"], "tokens": 755}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "install_requires = [\n \"python-dateutil<2.8.1,>=2.1\", # Consolidates azure-blob-storage and boto3\n \"ply>=3.9\", # See https://github.com/pyinstaller/pyinstaller/issues/1945\n \"colorama>=0.3.9\",\n \"configobj>=5.0.6\",\n \"gitpython>3\",\n \"setuptools>=34.0.0\",\n \"nanotime>=0.5.2\",\n \"pyasn1>=0.4.1\",\n \"voluptuous>=0.11.7\",\n \"jsonpath-ng>=1.5.1\",\n \"requests>=2.22.0\",\n \"grandalf==0.6\",\n \"distro>=1.3.0\",\n \"appdirs>=1.4.3\",\n \"treelib>=1.5.5\",\n \"inflect>=2.1.0,<4\",\n \"humanize>=0.5.1\",\n \"PyYAML>=5.1.2,<5.4\", # Compatibility with awscli\n \"ruamel.yaml>=0.16.1\",\n \"funcy>=1.14\",\n \"pathspec>=0.6.0\",\n \"shortuuid>=0.5.0\",\n \"tqdm>=4.45.0,<5\",\n \"packaging>=19.0\",\n \"zc.lockfile>=1.2.1\",\n \"flufl.lock>=3.2\",\n \"win-unicode-console>=0.5; sys_platform == 'win32'\",\n \"pywin32>=225; sys_platform == 'win32'\",\n \"networkx>=2.1,<2.4\",\n \"pydot>=1.2.4\",\n \"speedcopy>=2.0.1; python_version < '3.8' and sys_platform == 'win32'\",\n \"flatten_json>=0.1.6\",\n \"texttable>=0.5.2\",\n \"pygtrie==2.3.2\",\n \"dpath>=2.0.1,<3\",\n]\n\n\n# Extra dependencies for remote integrations\n\ngs = [\"google-cloud-storage==1.19.0\"]\ngdrive = [\"pydrive2>=1.4.10\"]\ns3 = [\"boto3>=1.9.201\"]\nazure = [\"azure-storage-blob==2.1.0\"]\noss = [\"oss2==2.6.1\"]\nssh = [\"paramiko>=2.5.0\"]\nhdfs = [\n # pyarrow-0.16.0 import fails on 3.5 and 3.7 (works on 3.6 though)\n # due to: https://issues.apache.org/jira/browse/ARROW-7852\n \"pyarrow==0.15.1; python_version < '3.8'\",\n \"pyarrow==0.16.0; python_version == '3.8'\",\n]\n# gssapi should not be included in all_remotes, because it doesn't have wheels\n# for linux and mac, so it will fail to compile if user doesn't have all the\n# requirements, including kerberos itself. Once all the wheels are available,\n# we can start shipping it by default.\nssh_gssapi = [\"paramiko[gssapi]>=2.5.0\"]\nall_remotes = gs + s3 + azure + ssh + oss + gdrive + hdfs\n\n# Extra dependecies to run tests", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitFixture_TestGitFixture.tearDown.super_tearDown_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitFixture_TestGitFixture.tearDown.super_tearDown_", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 141, "span_ids": ["TestGitFixture.setUp", "TestGitFixture", "TestGitFixture.tearDown"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitFixture(TestDirFixture):\n N_RETRIES = 5\n\n def setUp(self):\n super().setUp()\n # NOTE: handles EAGAIN error on BSD systems (osx in our case).\n # Otherwise when running tests you might get this exception:\n #\n # GitCommandNotFound: Cmd('git') not found due to:\n # OSError('[Errno 35] Resource temporarily unavailable')\n retries = self.N_RETRIES\n while True:\n try:\n self.git = Repo.init()\n break\n except GitCommandNotFound:\n retries -= 1\n if not retries:\n raise\n\n self.git.index.add([self.CODE])\n self.git.index.commit(\"add code\")\n\n def tearDown(self):\n self.git.close()\n super().tearDown()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_os_", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 67, "span_ids": ["_close_pools", "impl:4", "imports", "http_server", "ssh_server", "ssh", "reset_loglevel"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport mockssh\nimport pytest\n\nfrom dvc.remote.ssh.connection import SSHConnection\nfrom tests.utils.httpd import PushRequestHandler, StaticFileServer\nfrom .dir_helpers import * # noqa\n\n\n# Prevent updater and analytics from running their processes\nos.environ[\"DVC_TEST\"] = \"true\"\n# Ensure progress output even when not outputting to raw sys.stderr console\nos.environ[\"DVC_IGNORE_ISATTY\"] = \"true\"\n\n\n@pytest.fixture(autouse=True)\ndef reset_loglevel(request, caplog):\n \"\"\"\n Use it to ensure log level at the start of each test\n regardless of dvc.logger.setup(), Repo configs or whatever.\n \"\"\"\n level = request.config.getoption(\"--log-level\")\n if level:\n with caplog.at_level(level.upper(), logger=\"dvc\"):\n yield\n else:\n yield\n\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\nuser = \"user\"\nkey_path = os.path.join(here, \"{0}.key\".format(user))\n\n\n@pytest.fixture\ndef ssh_server():\n users = {user: key_path}\n with mockssh.Server(users) as s:\n s.test_creds = {\n \"host\": s.host,\n \"port\": s.port,\n \"username\": user,\n \"key_filename\": key_path,\n }\n yield s\n\n\n@pytest.fixture\ndef ssh(ssh_server):\n yield SSHConnection(**ssh_server.test_creds)\n\n\n@pytest.fixture(scope=\"session\", autouse=True)\ndef _close_pools():\n from dvc.remote.pool import close_pools\n\n yield\n close_pools()\n\n\n@pytest.fixture\ndef http_server(tmp_dir):\n with StaticFileServer(handler_class=PushRequestHandler) as httpd:\n yield httpd", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py___disable_other_loggers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py___disable_other_loggers_", "embedding": null, "metadata": {"file_path": "tests/dir_helpers.py", "file_name": "dir_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 70, "span_ids": ["docstring:2", "docstring"], "tokens": 560}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nThe goal of this module is making dvc functional tests setup a breeze. This\nincludes a temporary dir, initializing git and DVC repos and bootstrapping some\nfile structure.\n\nThe cornerstone of these fixtures is `tmp_dir`, which creates a temporary dir\nand changes path to it, it might be combined with `scm` and `dvc` to initialize\nempty git and DVC repos. `tmp_dir` returns a Path instance, which should save\nyou from using `open()`, `os` and `os.path` utils many times:\n\n (tmp_dir / \"some_file\").write_text(\"some text\")\n # ...\n assert \"some text\" == (tmp_dir / \"some_file\").read_text()\n assert (tmp_dir / \"some_file\").exists()\n\nAdditionally it provides `.gen()`, `.scm_gen()` and `.dvc_gen()` methods to\nbootstrap a required file structure in a single call:\n\n # Generate a dir with files\n tmp_dir.gen({\"dir\": {\"file\": \"file text\", \"second_file\": \"...\"}})\n\n # Generate a single file, dirs will be created along the way\n tmp_dir.gen(\"dir/file\", \"file text\")\n\n # Generate + git add\n tmp_dir.scm_gen({\"file1\": \"...\", ...})\n\n # Generate + git add + git commit\n tmp_dir.scm_gen({\"file1\": \"...\", ...}, commit=\"add files\")\n\n # Generate + dvc add\n tmp_dir.dvc_gen({\"file1\": \"...\", ...})\n\n # Generate + dvc add + git commit -am \"...\"\n # This commits stages to git not the generated files.\n tmp_dir.dvc_gen({\"file1\": \"...\", ...}, commit=\"add files\")\n\nMaking it easier to bootstrap things has a supergoal of incentivizing a move\nfrom global repo template to creating everything inplace, which:\n\n - makes all path references local to test, enhancing readability\n - allows using telling filenames, e.g. \"git_tracked_file\" instead of \"foo\"\n - does not create unnecessary files\n\"\"\"\n\nimport os\nimport pathlib\nfrom contextlib import contextmanager\n\nimport pytest\nfrom funcy import lmap, retry\n\nfrom dvc.logger import disable_other_loggers\nfrom dvc.utils.fs import makedirs\nfrom dvc.compat import fspath, fspath_py35\n\n\n__all__ = [\n \"make_tmp_dir\",\n \"tmp_dir\",\n \"scm\",\n \"dvc\",\n \"run_copy\",\n \"erepo_dir\",\n \"git_dir\",\n]\n\n\n# see https://github.com/iterative/dvc/issues/3167\ndisable_other_loggers()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir_TmpDir.__fspath__.return.str_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir_TmpDir.__fspath__.return.str_self_", "embedding": null, "metadata": {"file_path": "tests/dir_helpers.py", "file_name": "dir_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 87, "span_ids": ["TmpDir.__new__", "TmpDir.__fspath__", "TmpDir"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TmpDir(pathlib.Path):\n def __new__(cls, *args, **kwargs):\n if cls is TmpDir:\n cls = WindowsTmpDir if os.name == \"nt\" else PosixTmpDir\n self = cls._from_parts(args, init=False)\n if not self._flavour.is_supported:\n raise NotImplementedError(\n \"cannot instantiate %r on your system\" % (cls.__name__,)\n )\n self._init()\n return self\n\n # Not needed in Python 3.6+\n def __fspath__(self):\n return str(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.init_TmpDir.init.if_dvc_and_hasattr_self_.self_scm_commit_init_dvc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.init_TmpDir.init.if_dvc_and_hasattr_self_.self_scm_commit_init_dvc", "embedding": null, "metadata": {"file_path": "tests/dir_helpers.py", "file_name": "dir_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 107, "span_ids": ["TmpDir.init"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TmpDir(pathlib.Path):\n\n def init(self, *, scm=False, dvc=False):\n from dvc.repo import Repo\n from dvc.scm.git import Git\n\n assert not scm or not hasattr(self, \"scm\")\n assert not dvc or not hasattr(self, \"dvc\")\n\n str_path = fspath(self)\n\n if scm:\n _git_init(str_path)\n if dvc:\n self.dvc = Repo.init(\n str_path, no_scm=not scm and not hasattr(self, \"scm\")\n )\n if scm:\n self.scm = self.dvc.scm if hasattr(self, \"dvc\") else Git(str_path)\n if dvc and hasattr(self, \"scm\"):\n self.scm.commit(\"init dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.close_TmpDir.scm_gen.return.self_scm_add_paths_commi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.close_TmpDir.scm_gen.return.self_scm_add_paths_commi", "embedding": null, "metadata": {"file_path": "tests/dir_helpers.py", "file_name": "dir_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 150, "span_ids": ["TmpDir.scm_gen", "TmpDir.close", "TmpDir._gen", "TmpDir.gen", "TmpDir._require", "TmpDir.dvc_gen"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TmpDir(pathlib.Path):\n\n def close(self):\n if hasattr(self, \"scm\"):\n self.scm.close()\n\n def _require(self, name):\n if not hasattr(self, name):\n raise TypeError(\n \"Can't use {name} for this temporary dir. \"\n 'Did you forget to use \"{name}\" fixture?'.format(name=name)\n )\n\n # Bootstrapping methods\n def gen(self, struct, text=\"\"):\n if isinstance(struct, (str, bytes, pathlib.PurePath)):\n struct = {struct: text}\n\n self._gen(struct)\n return struct.keys()\n\n def _gen(self, struct, prefix=None):\n for name, contents in struct.items():\n path = (prefix or self) / name\n\n if isinstance(contents, dict):\n if not contents:\n makedirs(path, exist_ok=True)\n else:\n self._gen(contents, prefix=path)\n else:\n makedirs(path.parent, exist_ok=True)\n if isinstance(contents, bytes):\n path.write_bytes(contents)\n else:\n path.write_text(contents, encoding=\"utf-8\")\n\n def dvc_gen(self, struct, text=\"\", commit=None):\n paths = self.gen(struct, text)\n return self.dvc_add(paths, commit=commit)\n\n def scm_gen(self, struct, text=\"\", commit=None):\n paths = self.gen(struct, text)\n return self.scm_add(paths, commit=commit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.dvc_add_TmpDir.dvc_add.return.stages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.dvc_add_TmpDir.dvc_add.return.stages", "embedding": null, "metadata": {"file_path": "tests/dir_helpers.py", "file_name": "dir_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 172, "span_ids": ["TmpDir.dvc_add"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TmpDir(pathlib.Path):\n\n def dvc_add(self, filenames, commit=None):\n self._require(\"dvc\")\n filenames = _coerce_filenames(filenames)\n\n stages = self.dvc.add(filenames)\n if commit:\n stage_paths = [s.path for s in stages]\n\n def to_gitignore(stage_path):\n from dvc.scm import Git\n\n return os.path.join(os.path.dirname(stage_path), Git.GITIGNORE)\n\n gitignores = [\n to_gitignore(s)\n for s in stage_paths\n if os.path.exists(to_gitignore(s))\n ]\n self.scm_add(stage_paths + gitignores, commit=commit)\n\n return stages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.scm_add_TmpDir.branch.try_.finally_.self_scm_checkout_old_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_TmpDir.scm_add_TmpDir.branch.try_.finally_.self_scm_checkout_old_", "embedding": null, "metadata": {"file_path": "tests/dir_helpers.py", "file_name": "dir_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 200, "span_ids": ["TmpDir.chdir", "TmpDir.branch", "TmpDir.scm_add"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TmpDir(pathlib.Path):\n\n def scm_add(self, filenames, commit=None):\n self._require(\"scm\")\n filenames = _coerce_filenames(filenames)\n\n self.scm.add(filenames)\n if commit:\n self.scm.commit(commit)\n\n # contexts\n @contextmanager\n def chdir(self):\n old = os.getcwd()\n try:\n os.chdir(fspath_py35(self))\n yield\n finally:\n os.chdir(old)\n\n @contextmanager\n def branch(self, name, new=False):\n self._require(\"scm\")\n old = self.scm.active_branch()\n try:\n self.scm.checkout(name, create_new=new)\n yield\n finally:\n self.scm.checkout(old)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py__coerce_filenames_run_copy.return.run_copy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py__coerce_filenames_run_copy.return.run_copy", "embedding": null, "metadata": {"file_path": "tests/dir_helpers.py", "file_name": "dir_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 203, "end_line": 274, "span_ids": ["dvc", "tmp_dir", "_coerce_filenames", "PosixTmpDir", "run_copy", "_git_init", "WindowsTmpDir", "make_tmp_dir", "scm"], "tokens": 462}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _coerce_filenames(filenames):\n if isinstance(filenames, (str, bytes, pathlib.PurePath)):\n filenames = [filenames]\n return lmap(fspath, filenames)\n\n\nclass WindowsTmpDir(TmpDir, pathlib.PureWindowsPath):\n pass\n\n\nclass PosixTmpDir(TmpDir, pathlib.PurePosixPath):\n pass\n\n\n@pytest.fixture(scope=\"session\")\ndef make_tmp_dir(tmp_path_factory, request):\n def make(name, *, scm=False, dvc=False):\n path = tmp_path_factory.mktemp(name) if isinstance(name, str) else name\n new_dir = TmpDir(fspath_py35(path))\n new_dir.init(scm=scm, dvc=dvc)\n request.addfinalizer(new_dir.close)\n return new_dir\n\n return make\n\n\n@pytest.fixture\ndef tmp_dir(tmp_path, make_tmp_dir, request, monkeypatch):\n monkeypatch.chdir(tmp_path)\n fixtures = request.fixturenames\n return make_tmp_dir(tmp_path, scm=\"scm\" in fixtures, dvc=\"dvc\" in fixtures)\n\n\n@pytest.fixture\ndef scm(tmp_dir):\n return tmp_dir.scm\n\n\n@pytest.fixture\ndef dvc(tmp_dir):\n return tmp_dir.dvc\n\n\ndef _git_init(path):\n from git import Repo\n from git.exc import GitCommandNotFound\n\n # NOTE: handles EAGAIN error on BSD systems (osx in our case).\n # Otherwise when running tests you might get this exception:\n #\n # GitCommandNotFound: Cmd('git') not found due to:\n # OSError('[Errno 35] Resource temporarily unavailable')\n git = retry(5, GitCommandNotFound)(Repo.init)(path)\n git.close()\n\n\n@pytest.fixture\ndef run_copy(tmp_dir, dvc):\n tmp_dir.gen(\n \"copy.py\",\n \"import sys, shutil\\nshutil.copyfile(sys.argv[1], sys.argv[2])\",\n )\n\n def run_copy(src, dst, **run_kwargs):\n return dvc.run(\n cmd=\"python copy.py {} {}\".format(src, dst),\n outs=[dst],\n deps=[src, \"copy.py\"],\n **run_kwargs\n )\n\n return run_copy", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_erepo_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/dir_helpers.py_erepo_dir_", "embedding": null, "metadata": {"file_path": "tests/dir_helpers.py", "file_name": "dir_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 277, "end_line": 297, "span_ids": ["erepo_dir", "git_dir"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef erepo_dir(make_tmp_dir):\n path = make_tmp_dir(\"erepo\", scm=True, dvc=True)\n\n # Chdir for git and dvc to work locally\n with path.chdir():\n with path.dvc.config.edit() as conf:\n cache_dir = path.dvc.cache.local.cache_dir\n conf[\"remote\"][\"upstream\"] = {\"url\": cache_dir}\n conf[\"core\"][\"remote\"] = \"upstream\"\n path.scm_add([path.dvc.config.files[\"repo\"]], commit=\"add remote\")\n\n return path\n\n\n@pytest.fixture\ndef git_dir(make_tmp_dir):\n path = make_tmp_dir(\"git-erepo\", scm=True)\n path.scm.commit(\"init repo\")\n return path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_os_test_dont_fail_on_unpacked_create_fail.assert_unpacked_create_sp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_os_test_dont_fail_on_unpacked_create_fail.assert_unpacked_create_sp", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_dont_fail_on_unpacked_create_fail"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport mock\n\nfrom dvc.exceptions import DvcException\nfrom dvc.remote.local import RemoteLOCAL\nfrom tests.utils import trees_equal\n\n\ndef test_dont_fail_on_unpacked_create_fail(tmp_dir, dvc):\n (stage,) = tmp_dir.dvc_gen({\"dir\": {\"file\": \"file_content\"}})\n\n with mock.patch.object(\n RemoteLOCAL, \"_create_unpacked_dir\", side_effect=DvcException(\"msg\")\n ) as unpacked_create_spy, dvc.state:\n assert not dvc.cache.local.changed_cache(stage.outs[0].checksum)\n assert unpacked_create_spy.call_count == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_test_remove_unpacked_on_create_fail_test_create_unpacked_on_status.trees_equal_dir_unpack": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_test_remove_unpacked_on_create_fail_test_create_unpacked_on_status.trees_equal_dir_unpack", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 20, "end_line": 44, "span_ids": ["test_remove_unpacked_on_create_fail", "test_create_unpacked_on_status"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_remove_unpacked_on_create_fail(tmp_dir, dvc):\n (stage,) = tmp_dir.dvc_gen({\"dir\": {\"file\": \"file_content\"}})\n unpacked_dir = stage.outs[0].cache_path + RemoteLOCAL.UNPACKED_DIR_SUFFIX\n\n # artificial unpacked dir for test purpose\n os.makedirs(unpacked_dir)\n assert os.path.exists(unpacked_dir)\n\n with mock.patch.object(\n RemoteLOCAL, \"_create_unpacked_dir\", side_effect=DvcException(\"msg\")\n ), dvc.state:\n assert not dvc.cache.local.changed_cache(stage.outs[0].checksum)\n\n assert not os.path.exists(unpacked_dir)\n\n\ndef test_create_unpacked_on_status(tmp_dir, dvc):\n (stage,) = tmp_dir.dvc_gen({\"dir\": {\"file\": \"file_content\"}})\n unpacked_dir = stage.outs[0].cache_path + RemoteLOCAL.UNPACKED_DIR_SUFFIX\n assert not os.path.exists(unpacked_dir)\n\n with dvc.state:\n assert not dvc.cache.local.changed_cache(stage.outs[0].checksum)\n assert os.path.exists(unpacked_dir)\n trees_equal(\"dir\", unpacked_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_test_dir_cache_changed_on_single_cache_file_modification_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_test_dir_cache_changed_on_single_cache_file_modification_", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 66, "span_ids": ["test_dir_cache_changed_on_single_cache_file_modification"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_dir_cache_changed_on_single_cache_file_modification(tmp_dir, dvc):\n (stage,) = tmp_dir.dvc_gen(\n {\"dir\": {\"file1\": \"file1 content\", \"file2\": \"file2 content\"}}\n )\n unpacked_dir = stage.outs[0].cache_path + RemoteLOCAL.UNPACKED_DIR_SUFFIX\n assert not os.path.exists(unpacked_dir)\n file_md5 = stage.outs[0].dir_cache[0][\"md5\"]\n\n with dvc.state:\n assert not dvc.cache.local.changed_cache(stage.outs[0].checksum)\n assert os.path.exists(unpacked_dir)\n\n cache_file_path = dvc.cache.local.get(file_md5)\n os.chmod(cache_file_path, 0o644)\n with open(cache_file_path, \"a\") as fobj:\n fobj.write(\"modification\")\n\n with dvc.state:\n assert dvc.cache.local.changed_cache(stage.outs[0].checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_filecmp_from_tests_utils_import_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_filecmp_from_tests_utils_import_g", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import filecmp\nimport logging\nimport os\nimport posixpath\nimport shutil\nimport time\n\nimport colorama\nimport pytest\nfrom mock import patch, call\n\nimport dvc as dvc_module\nfrom dvc.cache import Cache\nfrom dvc.dvcfile import DVC_FILE_SUFFIX\nfrom dvc.exceptions import DvcException, OverlappingOutputPathsError\nfrom dvc.exceptions import RecursiveAddingWhileUsingFilename\nfrom dvc.exceptions import StageFileCorruptedError\nfrom dvc.main import main\nfrom dvc.output.base import OutputAlreadyTrackedError\nfrom dvc.remote import RemoteLOCAL\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.stage import Stage\nfrom dvc.system import System\nfrom dvc.utils import file_md5\nfrom dvc.utils import LARGE_DIR_SIZE\nfrom dvc.utils import relpath\nfrom dvc.compat import fspath\nfrom dvc.utils.fs import path_isin\nfrom dvc.utils.stage import load_stage_file\nfrom tests.basic_env import TestDvc\nfrom tests.utils import get_gitignore_content", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_test_add.assert_stage_md5_ee34": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_test_add.assert_stage_md5_ee34", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 45, "span_ids": ["test_add"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_add(tmp_dir, dvc):\n (stage,) = tmp_dir.dvc_gen({\"foo\": \"foo\"})\n md5, _ = file_md5(\"foo\")\n\n assert stage is not None\n\n assert isinstance(stage, Stage)\n assert os.path.isfile(stage.path)\n assert len(stage.outs) == 1\n assert len(stage.deps) == 0\n assert stage.cmd is None\n assert stage.outs[0].info[\"md5\"] == md5\n assert stage.md5 == \"ee343f2482f53efffc109be83cc976ac\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_unicode_TestAddDirectoryRecursive.test.self_assertEqual_len_stag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_unicode_TestAddDirectoryRecursive.test.self_assertEqual_len_stag", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 79, "span_ids": ["test_add_unicode", "test_add_unsupported_file", "TestAddDirectoryRecursive", "TestAddDirectoryRecursive.test", "test_add_directory"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_add_unicode(tmp_dir, dvc):\n with open(\"\\xe1\", \"wb\") as fd:\n fd.write(\"something\".encode(\"utf-8\"))\n\n (stage,) = dvc.add(\"\\xe1\")\n\n assert os.path.isfile(stage.path)\n\n\ndef test_add_unsupported_file(dvc):\n with pytest.raises(DvcException):\n dvc.add(\"unsupported://unsupported\")\n\n\ndef test_add_directory(tmp_dir, dvc):\n (stage,) = tmp_dir.dvc_gen({\"dir\": {\"file\": \"file\"}})\n\n assert stage is not None\n assert len(stage.deps) == 0\n assert len(stage.outs) == 1\n\n md5 = stage.outs[0].info[\"md5\"]\n\n dir_info = dvc.cache.local.load_dir_cache(md5)\n for info in dir_info:\n assert \"\\\\\" not in info[\"relpath\"]\n\n\nclass TestAddDirectoryRecursive(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR, recursive=True)\n self.assertEqual(len(stages), 2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirectoryWithForwardSlash_test_add_tracked_file.with_pytest_raises_Output.dvc_add_tracked_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirectoryWithForwardSlash_test_add_tracked_file.with_pytest_raises_Output.dvc_add_tracked_file_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 112, "end_line": 128, "span_ids": ["test_add_tracked_file", "TestAddDirectoryWithForwardSlash.test", "TestAddDirectoryWithForwardSlash"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddDirectoryWithForwardSlash(TestDvc):\n def test(self):\n dname = \"directory/\"\n os.mkdir(dname)\n self.create(os.path.join(dname, \"file\"), \"file\")\n stages = self.dvc.add(dname)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n self.assertEqual(os.path.abspath(\"directory.dvc\"), stage.path)\n\n\ndef test_add_tracked_file(tmp_dir, scm, dvc):\n tmp_dir.scm_gen(\"tracked_file\", \"...\", commit=\"add tracked file\")\n\n with pytest.raises(OutputAlreadyTrackedError):\n dvc.add(\"tracked_file\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirWithExistingCache_TestAddModifiedDir.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirWithExistingCache_TestAddModifiedDir.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 131, "end_line": 157, "span_ids": ["TestAddModifiedDir.test", "TestAddDirWithExistingCache", "TestAddModifiedDir", "TestAddDirWithExistingCache.test"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddDirWithExistingCache(TestDvc):\n def test(self):\n dname = \"a\"\n fname = os.path.join(dname, \"b\")\n os.mkdir(dname)\n shutil.copyfile(self.FOO, fname)\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n stages = self.dvc.add(dname)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n\nclass TestAddModifiedDir(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n os.unlink(self.DATA)\n\n time.sleep(2)\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_file_in_dir_test_add_file_in_dir.assert_stage_outs_0_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_file_in_dir_test_add_file_in_dir.assert_stage_outs_0_def_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 160, "end_line": 173, "span_ids": ["test_add_file_in_dir"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_add_file_in_dir(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"subdir\": {\"subdata\": \"subdata content\"}}})\n subdir_path = os.path.join(\"dir\", \"subdir\", \"subdata\")\n\n (stage,) = dvc.add(subdir_path)\n\n assert stage is not None\n assert len(stage.deps) == 0\n assert len(stage.outs) == 1\n assert stage.relpath == subdir_path + \".dvc\"\n\n # Current dir should not be taken into account\n assert stage.wdir == os.path.dirname(stage.path)\n assert stage.outs[0].def_path == \"subdata\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_update_state_entry_for_file_after_add_test_should_update_state_entry_for_file_after_add.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_update_state_entry_for_file_after_add_test_should_update_state_entry_for_file_after_add.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 247, "end_line": 273, "span_ids": ["test_should_update_state_entry_for_file_after_add"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_should_update_state_entry_for_file_after_add(mocker, dvc, tmp_dir):\n file_md5_counter = mocker.spy(dvc_module.remote.local, \"file_md5\")\n tmp_dir.gen(\"foo\", \"foo\")\n\n ret = main([\"config\", \"cache.type\", \"copy\"])\n assert ret == 0\n\n ret = main([\"add\", \"foo\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 1\n\n ret = main([\"status\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 1\n\n ret = main([\"run\", \"-d\", \"foo\", \"echo foo\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 1\n\n os.rename(\"foo\", \"foo.back\")\n ret = main([\"checkout\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 1\n\n ret = main([\"status\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_update_state_entry_for_directory_after_add_test_should_update_state_entry_for_directory_after_add.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_update_state_entry_for_directory_after_add_test_should_update_state_entry_for_directory_after_add.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 276, "end_line": 306, "span_ids": ["test_should_update_state_entry_for_directory_after_add"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_should_update_state_entry_for_directory_after_add(\n mocker, dvc, tmp_dir\n):\n file_md5_counter = mocker.spy(dvc_module.remote.local, \"file_md5\")\n\n tmp_dir.gen({\"data/data\": \"foo\", \"data/data_sub/sub_data\": \"foo\"})\n\n ret = main([\"config\", \"cache.type\", \"copy\"])\n assert ret == 0\n\n ret = main([\"add\", \"data\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 3\n\n ret = main([\"status\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 3\n\n ls = \"dir\" if os.name == \"nt\" else \"ls\"\n ret = main([\"run\", \"-d\", \"data\", \"{} {}\".format(ls, \"data\")])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 3\n\n os.rename(\"data\", \"data\" + \".back\")\n ret = main([\"checkout\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 3\n\n ret = main([\"status\"])\n assert ret == 0\n assert file_md5_counter.mock.call_count == 3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCommit_test_should_collect_dir_cache_only_once.assert_get_dir_checksum_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCommit_test_should_collect_dir_cache_only_once.assert_get_dir_checksum_c", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 309, "end_line": 333, "span_ids": ["test_should_collect_dir_cache_only_once", "TestAddCommit", "TestAddCommit.test"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddCommit(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO, \"--no-commit\"])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.FOO))\n self.assertFalse(os.path.exists(self.dvc.cache.local.cache_dir))\n\n ret = main([\"commit\", self.FOO + \".dvc\"])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.FOO))\n self.assertEqual(len(os.listdir(self.dvc.cache.local.cache_dir)), 1)\n\n\ndef test_should_collect_dir_cache_only_once(mocker, tmp_dir, dvc):\n tmp_dir.gen({\"data/data\": \"foo\"})\n get_dir_checksum_counter = mocker.spy(RemoteLOCAL, \"get_dir_checksum\")\n ret = main([\"add\", \"data\"])\n assert ret == 0\n\n ret = main([\"status\"])\n assert ret == 0\n\n ret = main([\"status\"])\n assert ret == 0\n assert get_dir_checksum_counter.mock.call_count == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_failed_add_cleanup_test_should_not_track_git_internal_files.for_fname_in_created_stag.assert_git_not_in_fnam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_failed_add_cleanup_test_should_not_track_git_internal_files.for_fname_in_created_stag.assert_git_not_in_fnam", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 460, "end_line": 484, "span_ids": ["test_should_not_track_git_internal_files", "test_failed_add_cleanup"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_failed_add_cleanup(tmp_dir, scm, dvc):\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n # Add and corrupt a stage file\n dvc.add(\"foo\")\n tmp_dir.gen(\"foo.dvc\", \"- broken\\nyaml\")\n\n with pytest.raises(StageFileCorruptedError):\n dvc.add(\"bar\")\n\n assert not os.path.exists(\"bar.dvc\")\n\n gitignore_content = get_gitignore_content()\n assert \"/bar\" not in gitignore_content\n\n\ndef test_should_not_track_git_internal_files(mocker, dvc, tmp_dir):\n stage_creator_spy = mocker.spy(dvc_module.repo.add, \"_create_stages\")\n\n ret = main([\"add\", \"-R\", dvc.root_dir])\n assert ret == 0\n\n created_stages_filenames = stage_creator_spy.mock.call_args[0][1]\n for fname in created_stages_filenames:\n assert \".git\" not in fname", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddUnprotected_TestAddUnprotected.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddUnprotected_TestAddUnprotected.test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 487, "end_line": 505, "span_ids": ["TestAddUnprotected.test", "TestAddUnprotected"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddUnprotected(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_hardlink(self.FOO))\n\n ret = main([\"unprotect\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_hardlink(self.FOO))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_temporary_windows_drive_temporary_windows_drive.if_tear_down_result_0_.raise_RuntimeError_Could": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_temporary_windows_drive_temporary_windows_drive.if_tear_down_result_0_.raise_RuntimeError_Could", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 508, "end_line": 542, "span_ids": ["temporary_windows_drive"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef temporary_windows_drive(tmp_path_factory):\n import string\n import win32api\n from ctypes import windll\n from win32con import DDD_REMOVE_DEFINITION\n\n drives = [\n s[0].upper()\n for s in win32api.GetLogicalDriveStrings().split(\"\\000\")\n if len(s) > 0\n ]\n\n new_drive_name = [\n letter for letter in string.ascii_uppercase if letter not in drives\n ][0]\n new_drive = \"{}:\".format(new_drive_name)\n\n target_path = tmp_path_factory.mktemp(\"tmp_windows_drive\")\n\n set_up_result = windll.kernel32.DefineDosDeviceW(\n 0, new_drive, fspath(target_path)\n )\n if set_up_result == 0:\n raise RuntimeError(\"Failed to mount windows drive!\")\n\n # NOTE: new_drive has form of `A:` and joining it with some relative\n # path might result in non-existing path (A:path\\\\to)\n yield os.path.join(new_drive, os.sep)\n\n tear_down_result = windll.kernel32.DefineDosDeviceW(\n DDD_REMOVE_DEFINITION, new_drive, fspath(target_path)\n )\n if tear_down_result == 0:\n raise RuntimeError(\"Could not unmount windows drive!\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_windows_should_add_when_cache_on_different_drive_test_windows_should_add_when_cache_on_different_drive.filecmp_cmp_file_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_windows_should_add_when_cache_on_different_drive_test_windows_should_add_when_cache_on_different_drive.filecmp_cmp_file_cache", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 545, "end_line": 557, "span_ids": ["test_windows_should_add_when_cache_on_different_drive"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(os.name != \"nt\", reason=\"Windows specific\")\ndef test_windows_should_add_when_cache_on_different_drive(\n tmp_dir, dvc, temporary_windows_drive\n):\n dvc.config[\"cache\"][\"dir\"] = temporary_windows_drive\n dvc.cache = Cache(dvc)\n\n (stage,) = tmp_dir.dvc_gen({\"file\": \"file\"})\n cache_path = stage.outs[0].cache_path\n\n assert path_isin(cache_path, temporary_windows_drive)\n assert os.path.isfile(cache_path)\n filecmp.cmp(\"file\", cache_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_readding_dir_should_not_unprotect_all_test_should_not_checkout_when_adding_cached_copy.assert_copy_spy_mock_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_readding_dir_should_not_unprotect_all_test_should_not_checkout_when_adding_cached_copy.assert_copy_spy_mock_call", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 560, "end_line": 586, "span_ids": ["test_should_not_checkout_when_adding_cached_copy", "test_readding_dir_should_not_unprotect_all"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_readding_dir_should_not_unprotect_all(tmp_dir, dvc, mocker):\n tmp_dir.gen(\"dir/data\", \"data\")\n\n dvc.cache.local.cache_types = [\"symlink\"]\n\n dvc.add(\"dir\")\n tmp_dir.gen(\"dir/new_file\", \"new_file_content\")\n\n unprotect_spy = mocker.spy(RemoteLOCAL, \"unprotect\")\n dvc.add(\"dir\")\n\n assert not unprotect_spy.mock.called\n assert System.is_symlink(os.path.join(\"dir\", \"new_file\"))\n\n\ndef test_should_not_checkout_when_adding_cached_copy(tmp_dir, dvc, mocker):\n dvc.cache.local.cache_types = [\"copy\"]\n\n tmp_dir.dvc_gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n shutil.copy(\"bar\", \"foo\")\n\n copy_spy = mocker.spy(dvc.cache.local, \"copy\")\n\n dvc.add(\"foo\")\n\n assert copy_spy.mock.call_count == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_relink_on_repeated_add_test_should_relink_on_repeated_add.assert_link_test_func_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_relink_on_repeated_add_test_should_relink_on_repeated_add.assert_link_test_func_fo", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 589, "end_line": 614, "span_ids": ["test_should_relink_on_repeated_add"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"link,new_link,link_test_func\",\n [\n (\"hardlink\", \"copy\", lambda path: not System.is_hardlink(path)),\n (\"symlink\", \"copy\", lambda path: not System.is_symlink(path)),\n (\"copy\", \"hardlink\", System.is_hardlink),\n (\"copy\", \"symlink\", System.is_symlink),\n ],\n)\ndef test_should_relink_on_repeated_add(\n link, new_link, link_test_func, tmp_dir, dvc\n):\n from dvc.path_info import PathInfo\n\n dvc.config[\"cache\"][\"type\"] = link\n\n tmp_dir.dvc_gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n os.remove(\"foo\")\n getattr(dvc.cache.local, link)(PathInfo(\"bar\"), PathInfo(\"foo\"))\n\n dvc.cache.local.cache_types = [new_link]\n\n dvc.add(\"foo\")\n\n assert link_test_func(\"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_protect_on_repeated_add_test_should_protect_on_repeated_add.if_link_copy_or_lin.else_.assert_not_os_access_foo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_should_protect_on_repeated_add_test_should_protect_on_repeated_add.if_link_copy_or_lin.else_.assert_not_os_access_foo", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 617, "end_line": 636, "span_ids": ["test_should_protect_on_repeated_add"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"link\", [\"hardlink\", \"symlink\", \"copy\"])\ndef test_should_protect_on_repeated_add(link, tmp_dir, dvc):\n dvc.cache.local.cache_types = [link]\n\n tmp_dir.dvc_gen({\"foo\": \"foo\"})\n\n dvc.unprotect(\"foo\")\n\n dvc.add(\"foo\")\n\n assert not os.access(\n os.path.join(\".dvc\", \"cache\", \"ac\", \"bd18db4cc2f85cedef654fccc4a4d8\"),\n os.W_OK,\n )\n\n # NOTE: Windows symlink perms don't propagate to the target\n if link == \"copy\" or (link == \"symlink\" and os.name == \"nt\"):\n assert os.access(\"foo\", os.W_OK)\n else:\n assert not os.access(\"foo\", os.W_OK)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_escape_gitignore_entries_test_escape_gitignore_entries.assert_ignored_fname_in_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_escape_gitignore_entries_test_escape_gitignore_entries.assert_ignored_fname_in_g", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 639, "end_line": 650, "span_ids": ["test_escape_gitignore_entries"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_escape_gitignore_entries(tmp_dir, scm, dvc):\n fname = \"file!with*weird#naming_[1].t?t\"\n ignored_fname = r\"/file\\!with\\*weird\\#naming_\\[1\\].t\\?t\"\n\n if os.name == \"nt\":\n # Some characters are not supported by Windows in the filename\n # https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n fname = \"file!with_weird#naming_[1].txt\"\n ignored_fname = r\"/file\\!with_weird\\#naming_\\[1\\].txt\"\n\n tmp_dir.dvc_gen(fname, \"...\")\n assert ignored_fname in get_gitignore_content()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_from_data_dir_test_add_from_data_dir.assert_str_e_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_from_data_dir_test_add_from_data_dir.assert_str_e_value_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 653, "end_line": 664, "span_ids": ["test_add_from_data_dir"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_add_from_data_dir(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen({\"dir\": {\"file1\": \"file1 content\"}})\n\n tmp_dir.gen({\"dir\": {\"file2\": \"file2 content\"}})\n\n with pytest.raises(OverlappingOutputPathsError) as e:\n dvc.add(os.path.join(\"dir\", \"file2\"))\n assert str(e.value) == (\n \"Cannot add '{out}', because it is overlapping with other DVC \"\n \"tracked output: 'dir'.\\n\"\n \"To include '{out}' in 'dir', run 'dvc commit dir.dvc'\"\n ).format(out=os.path.join(\"dir\", \"file2\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_not_raises_on_re_add_test_add_empty_files.assert_os_path_exists_sta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_not_raises_on_re_add_test_add_empty_files.assert_os_path_exists_sta", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 668, "end_line": 683, "span_ids": ["test_add_empty_files", "test_not_raises_on_re_add"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_not_raises_on_re_add(tmp_dir, dvc):\n tmp_dir.dvc_gen(\"file\", \"file content\")\n\n tmp_dir.gen({\"file2\": \"file2 content\", \"file\": \"modified file\"})\n dvc.add([\"file2\", \"file\"])\n\n\n@pytest.mark.parametrize(\"link\", [\"hardlink\", \"symlink\", \"copy\"])\ndef test_add_empty_files(tmp_dir, dvc, link):\n file = \"foo\"\n dvc.cache.local.cache_types = [link]\n stages = tmp_dir.dvc_gen(file, \"\")\n\n assert (tmp_dir / file).exists()\n assert (tmp_dir / (file + DVC_FILE_SUFFIX)).exists()\n assert os.path.exists(stages[0].outs[0].cache_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_optimization_for_hardlink_on_empty_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_optimization_for_hardlink_on_empty_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 685, "end_line": 705, "span_ids": ["test_add_optimization_for_hardlink_on_empty_files"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_add_optimization_for_hardlink_on_empty_files(tmp_dir, dvc, mocker):\n dvc.cache.local.cache_types = [\"hardlink\"]\n tmp_dir.gen({\"foo\": \"\", \"bar\": \"\", \"lorem\": \"lorem\", \"ipsum\": \"ipsum\"})\n m = mocker.spy(RemoteLOCAL, \"is_hardlink\")\n stages = dvc.add([\"foo\", \"bar\", \"lorem\", \"ipsum\"])\n\n assert m.call_count == 1\n assert m.call_args != call(tmp_dir / \"foo\")\n assert m.call_args != call(tmp_dir / \"bar\")\n\n for stage in stages[:2]:\n # hardlinks are not created for empty files\n assert not System.is_hardlink(stage.outs[0].path_info)\n\n for stage in stages[2:]:\n assert System.is_hardlink(stage.outs[0].path_info)\n\n for stage in stages:\n assert os.path.exists(stage.path)\n assert os.path.exists(stage.outs[0].cache_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_mock_", "embedding": null, "metadata": {"file_path": "tests/func/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["test_main_analytics", "test_scm_subrepo", "imports", "test_scm_dvc_only", "test_daemon_analytics", "test_scm_git"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\n\nfrom dvc.analytics import _scm_in_use\nfrom dvc.main import main\nfrom dvc.compat import fspath\nfrom dvc.repo import Repo\n\n\n@mock.patch(\"dvc.analytics.send\")\ndef test_daemon_analytics(mock_send, tmp_path):\n report = fspath(tmp_path)\n assert 0 == main([\"daemon\", \"analytics\", report])\n\n mock_send.assert_called_with(report)\n\n\n@mock.patch(\"dvc.analytics.collect_and_send_report\")\n@mock.patch(\"dvc.analytics.is_enabled\", return_value=True)\ndef test_main_analytics(mock_is_enabled, mock_report, tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"text\")\n assert 0 == main([\"add\", \"foo\"])\n assert mock_is_enabled.called\n assert mock_report.called\n\n\ndef test_scm_dvc_only(tmp_dir, dvc):\n scm = _scm_in_use()\n assert scm == \"NoSCM\"\n\n\ndef test_scm_git(tmp_dir, scm, dvc):\n scm = _scm_in_use()\n assert scm == \"Git\"\n\n\ndef test_scm_subrepo(tmp_dir, scm):\n subdir = tmp_dir / \"subdir\"\n subdir.mkdir()\n\n with subdir.chdir():\n Repo.init(subdir=True)\n scm = _scm_in_use()\n\n assert scm == \"Git\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_os_test_get_url.assert_api_get_url_foo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_os_test_get_url.assert_api_get_url_foo_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["remote_url", "imports", "run_dvc", "test_get_url"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport pytest\n\nfrom dvc import api\nfrom dvc.api import UrlNotDvcRepoError\nfrom dvc.compat import fspath\nfrom dvc.exceptions import FileMissingError\nfrom dvc.main import main\nfrom dvc.path_info import URLInfo\nfrom dvc.utils.fs import remove\n\nfrom tests.remotes import Azure, GCP, HDFS, Local, OSS, S3, SSH\n\n\nremote_params = [S3, GCP, Azure, OSS, SSH, HDFS]\nall_remote_params = [Local] + remote_params\n\n\n@pytest.fixture\ndef remote_url(request):\n if not request.param.should_test():\n raise pytest.skip()\n return request.param.get_url()\n\n\ndef run_dvc(*argv):\n assert main(argv) == 0\n\n\n@pytest.mark.parametrize(\"remote_url\", remote_params, indirect=True)\ndef test_get_url(tmp_dir, dvc, remote_url):\n run_dvc(\"remote\", \"add\", \"-d\", \"upstream\", remote_url)\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n\n expected_url = URLInfo(remote_url) / \"ac/bd18db4cc2f85cedef654fccc4a4d8\"\n assert api.get_url(\"foo\") == expected_url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_external_test_get_url_external.assert_api_get_url_foo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_external_test_get_url_external.assert_api_get_url_foo_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 49, "span_ids": ["test_get_url_external"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote_url\", remote_params, indirect=True)\ndef test_get_url_external(erepo_dir, remote_url):\n _set_remote_url_and_commit(erepo_dir.dvc, remote_url)\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"foo\", commit=\"add foo\")\n\n # Using file url to force clone to tmp repo\n repo_url = \"file://{}\".format(erepo_dir)\n expected_url = URLInfo(remote_url) / \"ac/bd18db4cc2f85cedef654fccc4a4d8\"\n assert api.get_url(\"foo\", repo=repo_url) == expected_url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_requires_dvc_test_open.with_api_open_foo_as_f.assert_fd_read_foo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_requires_dvc_test_open.with_api_open_foo_as_f.assert_fd_read_foo_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 72, "span_ids": ["test_open", "test_get_url_requires_dvc"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_url_requires_dvc(tmp_dir, scm):\n tmp_dir.scm_gen({\"foo\": \"foo\"}, commit=\"initial\")\n\n with pytest.raises(UrlNotDvcRepoError, match=\"not a DVC repository\"):\n api.get_url(\"foo\", repo=fspath(tmp_dir))\n\n with pytest.raises(UrlNotDvcRepoError):\n api.get_url(\"foo\", repo=\"file://{}\".format(tmp_dir))\n\n\n@pytest.mark.parametrize(\"remote_url\", all_remote_params, indirect=True)\ndef test_open(remote_url, tmp_dir, dvc):\n run_dvc(\"remote\", \"add\", \"-d\", \"upstream\", remote_url)\n tmp_dir.dvc_gen(\"foo\", \"foo-text\")\n run_dvc(\"push\")\n\n # Remove cache to force download\n remove(dvc.cache.local.cache_dir)\n\n with api.open(\"foo\") as fd:\n assert fd.read() == \"foo-text\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_missing_test_open_scm_controlled.with_api_open_scm_contro.assert_fd_read_file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_missing_test_open_scm_controlled.with_api_open_scm_contro.assert_fd_read_file", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 99, "end_line": 122, "span_ids": ["test_open_scm_controlled", "_set_remote_url_and_commit", "test_missing"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote_url\", all_remote_params, indirect=True)\ndef test_missing(remote_url, tmp_dir, dvc):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_dvc(\"remote\", \"add\", \"-d\", \"upstream\", remote_url)\n\n # Remove cache to make foo missing\n remove(dvc.cache.local.cache_dir)\n\n with pytest.raises(FileMissingError):\n api.read(\"foo\")\n\n\ndef _set_remote_url_and_commit(repo, remote_url):\n with repo.config.edit() as conf:\n conf[\"remote\"][\"upstream\"][\"url\"] = remote_url\n repo.scm.add([repo.config.files[\"repo\"]])\n repo.scm.commit(\"modify remote\")\n\n\ndef test_open_scm_controlled(tmp_dir, erepo_dir):\n erepo_dir.scm_gen({\"scm_controlled\": \"file content\"}, commit=\"create file\")\n\n with api.open(\"scm_controlled\", repo=fspath(erepo_dir)) as fd:\n assert fd.read() == \"file content\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_not_cached_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_not_cached_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 142, "span_ids": ["test_open_not_cached"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_open_not_cached(dvc):\n metric_file = \"metric.txt\"\n metric_content = \"0.6\"\n metric_code = \"open('{}', 'w').write('{}')\".format(\n metric_file, metric_content\n )\n dvc.run(\n metrics_no_cache=[metric_file],\n cmd=('python -c \"{}\"'.format(metric_code)),\n )\n\n with api.open(metric_file) as fd:\n assert fd.read() == metric_content\n\n os.remove(metric_file)\n with pytest.raises(FileMissingError):\n api.read(metric_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLoadBadDirCache_TestCacheLoadBadDirCache.test.self__do_test_self_dvc_ca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLoadBadDirCache_TestCacheLoadBadDirCache.test.self__do_test_self_dvc_ca", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 44, "end_line": 59, "span_ids": ["TestCacheLoadBadDirCache._do_test", "TestCacheLoadBadDirCache.test", "TestCacheLoadBadDirCache"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCacheLoadBadDirCache(TestDvc):\n def _do_test(self, ret):\n self.assertTrue(isinstance(ret, list))\n self.assertEqual(len(ret), 0)\n\n def test(self):\n checksum = \"123.dir\"\n fname = self.dvc.cache.local.get(checksum)\n self.create(fname, \"not,json\")\n with pytest.raises(DirCacheError):\n self.dvc.cache.local.load_dir_cache(checksum)\n\n checksum = \"234.dir\"\n fname = self.dvc.cache.local.get(checksum)\n self.create(fname, '{\"a\": \"b\"}')\n self._do_test(self.dvc.cache.local.load_dir_cache(checksum))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLinkType_TestCmdCacheDir.test_relative_path.self_assertEqual_len_file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLinkType_TestCmdCacheDir.test_relative_path.self_assertEqual_len_file", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 137, "end_line": 177, "span_ids": ["TestCmdCacheDir", "TestCacheLinkType", "TestCacheLinkType.test", "TestCmdCacheDir.test_relative_path", "TestCmdCacheDir.test_abs_path", "TestCmdCacheDir.test"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCacheLinkType(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.type\", \"reflink,copy\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n\nclass TestCmdCacheDir(TestDvc):\n def test(self):\n ret = main([\"cache\", \"dir\"])\n self.assertEqual(ret, 254)\n\n def test_abs_path(self):\n dname = os.path.join(os.path.dirname(self._root_dir), \"dir\")\n ret = main([\"cache\", \"dir\", dname])\n self.assertEqual(ret, 0)\n\n config = configobj.ConfigObj(self.dvc.config.files[\"repo\"])\n self.assertEqual(config[\"cache\"][\"dir\"], dname.replace(\"\\\\\", \"/\"))\n\n def test_relative_path(self):\n tmpdir = self.mkdtemp()\n dname = relpath(tmpdir)\n ret = main([\"cache\", \"dir\", dname])\n self.assertEqual(ret, 0)\n\n # NOTE: we are in the repo's root and config is in .dvc/, so\n # dir path written to config should be just one level above.\n rel = os.path.join(\"..\", dname)\n config = configobj.ConfigObj(self.dvc.config.files[\"repo\"])\n self.assertEqual(config[\"cache\"][\"dir\"], rel.replace(\"\\\\\", \"/\"))\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n subdirs = os.listdir(tmpdir)\n self.assertEqual(len(subdirs), 1)\n files = os.listdir(os.path.join(tmpdir, subdirs[0]))\n self.assertEqual(len(files), 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_test_default_cache_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_test_default_cache_type_", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 181, "end_line": 207, "span_ids": ["test_default_cache_type", "test_shared_cache"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_default_cache_type(dvc):\n assert dvc.cache.local.cache_types == [\"reflink\", \"copy\"]\n\n\n@pytest.mark.skipif(os.name == \"nt\", reason=\"Not supported for Windows.\")\n@pytest.mark.parametrize(\n \"group, dir_mode\", [(False, 0o755), (True, 0o775)],\n)\ndef test_shared_cache(tmp_dir, dvc, group, dir_mode):\n if group:\n with dvc.config.edit() as conf:\n conf[\"cache\"].update({\"shared\": \"group\"})\n dvc.cache = Cache(dvc)\n\n tmp_dir.dvc_gen(\n {\"file\": \"file content\", \"dir\": {\"file2\": \"file 2 \" \"content\"}}\n )\n\n for root, dnames, fnames in os.walk(dvc.cache.local.cache_dir):\n for dname in dnames:\n path = os.path.join(root, dname)\n assert stat.S_IMODE(os.stat(path).st_mode) == dir_mode\n\n for fname in fnames:\n path = os.path.join(root, fname)\n assert stat.S_IMODE(os.stat(path).st_mode) == 0o444", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_collections_logger.logging_getLogger_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_collections_logger.logging_getLogger_dvc_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["imports"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import collections\nimport filecmp\nimport logging\nimport os\nimport shutil\n\nimport pytest\nfrom mock import patch\n\nfrom dvc.exceptions import CheckoutError\nfrom dvc.exceptions import CheckoutErrorSuggestGit\nfrom dvc.exceptions import ConfirmRemoveError\nfrom dvc.exceptions import DvcException\nfrom dvc.main import main\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.stage import Stage\nfrom dvc.dvcfile import Dvcfile, DVC_FILE_SUFFIX\nfrom dvc.stage.exceptions import (\n StageFileDoesNotExistError,\n StageFileBadNameError,\n)\nfrom dvc.system import System\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import walk_files\nfrom dvc.utils.stage import dump_stage_file\nfrom dvc.utils.stage import load_stage_file\nfrom dvc.remote import RemoteS3\nfrom tests.remotes import S3\nfrom tests.basic_env import TestDvc\nfrom tests.basic_env import TestDvcGit\nfrom tests.func.test_repro import TestRepro\n\nlogger = logging.getLogger(\"dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_1.except_DvcException_as_ex.self_assertIsNone_exc___c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_1.except_DvcException_as_ex.self_assertIsNone_exc___c", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 395, "end_line": 410, "span_ids": ["TestCheckoutSuggestGit", "TestCheckoutSuggestGit.test"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutSuggestGit(TestRepro):\n def test(self):\n\n try:\n self.dvc.checkout(targets=[\"gitbranch\"])\n except DvcException as exc:\n self.assertIsInstance(exc, CheckoutErrorSuggestGit)\n self.assertIsInstance(exc.__cause__, StageFileDoesNotExistError)\n self.assertIsNone(exc.__cause__.__cause__)\n\n try:\n self.dvc.checkout(targets=[self.FOO])\n except DvcException as exc:\n self.assertIsInstance(exc, CheckoutErrorSuggestGit)\n self.assertIsInstance(exc.__cause__, StageFileBadNameError)\n self.assertIsNone(exc.__cause__.__cause__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_TestCheckoutRecursiveNotDirectory.test.assert_stats_added_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_TestCheckoutRecursiveNotDirectory.test.assert_stats_added_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 413, "end_line": 431, "span_ids": ["TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles", "TestCheckoutRecursiveNotDirectory", "TestCheckoutRecursiveNotDirectory.test", "TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles.test"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles(TestDvc):\n def test(self):\n ret = main([\"add\", self.DATA_DIR, self.FOO, self.BAR])\n self.assertEqual(0, ret)\n\n ret = main([\"checkout\", \"-R\", self.DATA_DIR])\n self.assertEqual(0, ret)\n\n self.assertTrue(os.path.exists(self.FOO))\n self.assertTrue(os.path.exists(self.BAR))\n\n\nclass TestCheckoutRecursiveNotDirectory(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(0, ret)\n\n stats = self.dvc.checkout(targets=[self.FOO + \".dvc\"], recursive=True)\n assert stats == {\"added\": [], \"modified\": [], \"deleted\": []}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMovedCacheDirWithSymlinks_TestCheckoutMovedCacheDirWithSymlinks.test.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMovedCacheDirWithSymlinks_TestCheckoutMovedCacheDirWithSymlinks.test.None_11", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 434, "end_line": 475, "span_ids": ["TestCheckoutMovedCacheDirWithSymlinks.test", "TestCheckoutMovedCacheDirWithSymlinks"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutMovedCacheDirWithSymlinks(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.type\", \"symlink\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n self.assertTrue(System.is_symlink(self.FOO))\n old_foo_link = os.path.realpath(self.FOO)\n\n self.assertTrue(System.is_symlink(self.DATA))\n old_data_link = os.path.realpath(self.DATA)\n\n old_cache_dir = self.dvc.cache.local.cache_dir\n new_cache_dir = old_cache_dir + \"_new\"\n os.rename(old_cache_dir, new_cache_dir)\n\n ret = main([\"cache\", \"dir\", new_cache_dir])\n self.assertEqual(ret, 0)\n\n ret = main([\"checkout\", \"-f\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(System.is_symlink(self.FOO))\n new_foo_link = os.path.realpath(self.FOO)\n\n self.assertTrue(System.is_symlink(self.DATA))\n new_data_link = os.path.realpath(self.DATA)\n\n self.assertEqual(\n relpath(old_foo_link, old_cache_dir),\n relpath(new_foo_link, new_cache_dir),\n )\n\n self.assertEqual(\n relpath(old_data_link, old_cache_dir),\n relpath(new_data_link, new_cache_dir),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_no_checksum_test_checkout_relink.assert_link_test_func_di": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_no_checksum_test_checkout_relink.assert_link_test_func_di", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 478, "end_line": 501, "span_ids": ["test_checkout_no_checksum", "test_checkout_relink"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_checkout_no_checksum(tmp_dir, dvc):\n tmp_dir.gen(\"file\", \"file content\")\n stage = dvc.run(outs=[\"file\"], no_exec=True, cmd=\"somecmd\")\n\n with pytest.raises(CheckoutError):\n dvc.checkout([stage.path], force=True)\n\n assert not os.path.exists(\"file\")\n\n\n@pytest.mark.parametrize(\n \"link, link_test_func\",\n [(\"hardlink\", System.is_hardlink), (\"symlink\", System.is_symlink)],\n)\ndef test_checkout_relink(tmp_dir, dvc, link, link_test_func):\n dvc.cache.local.cache_types = [link]\n\n tmp_dir.dvc_gen({\"dir\": {\"data\": \"text\"}})\n dvc.unprotect(\"dir/data\")\n assert not link_test_func(\"dir/data\")\n\n stats = dvc.checkout([\"dir.dvc\"], relink=True)\n assert stats == empty_checkout\n assert link_test_func(\"dir/data\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_relink_protected_test_checkout_relink_protected.if_link_copy_or_lin.else_.assert_not_os_access_foo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_relink_protected_test_checkout_relink_protected.if_link_copy_or_lin.else_.assert_not_os_access_foo", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 504, "end_line": 519, "span_ids": ["test_checkout_relink_protected"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"link\", [\"hardlink\", \"symlink\", \"copy\"])\ndef test_checkout_relink_protected(tmp_dir, dvc, link):\n dvc.cache.local.cache_types = [link]\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n dvc.unprotect(\"foo\")\n assert os.access(\"foo\", os.W_OK)\n\n stats = dvc.checkout([\"foo.dvc\"], relink=True)\n assert stats == empty_checkout\n\n # NOTE: Windows symlink perms don't propagate to the target\n if link == \"copy\" or (link == \"symlink\" and os.name == \"nt\"):\n assert os.access(\"foo\", os.W_OK)\n else:\n assert not os.access(\"foo\", os.W_OK)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_partial_checkout_test_stats_on_empty_checkout.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_partial_checkout_test_stats_on_empty_checkout.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 522, "end_line": 543, "span_ids": ["test_partial_checkout", "impl:3", "test_stats_on_empty_checkout"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"target\",\n [os.path.join(\"dir\", \"subdir\"), os.path.join(\"dir\", \"subdir\", \"file\")],\n)\ndef test_partial_checkout(tmp_dir, dvc, target):\n tmp_dir.dvc_gen({\"dir\": {\"subdir\": {\"file\": \"file\"}, \"other\": \"other\"}})\n shutil.rmtree(\"dir\")\n stats = dvc.checkout([target])\n assert stats[\"added\"] == [\"dir\" + os.sep]\n assert list(walk_files(\"dir\")) == [os.path.join(\"dir\", \"subdir\", \"file\")]\n\n\nempty_checkout = {\"added\": [], \"deleted\": [], \"modified\": []}\n\n\ndef test_stats_on_empty_checkout(tmp_dir, dvc, scm):\n assert dvc.checkout() == empty_checkout\n tmp_dir.dvc_gen(\n {\"dir\": {\"subdir\": {\"file\": \"file\"}, \"other\": \"other\"}},\n commit=\"initial\",\n )\n assert dvc.checkout() == empty_checkout", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_checkout_test_stats_on_checkout.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_checkout_test_stats_on_checkout.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 546, "end_line": 578, "span_ids": ["test_stats_on_checkout"], "tokens": 322}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stats_on_checkout(tmp_dir, dvc, scm):\n tmp_dir.dvc_gen(\n {\n \"dir\": {\"subdir\": {\"file\": \"file\"}, \"other\": \"other\"},\n \"foo\": \"foo\",\n \"bar\": \"bar\",\n },\n commit=\"initial\",\n )\n scm.checkout(\"HEAD~\")\n stats = dvc.checkout()\n assert set(stats[\"deleted\"]) == {\"dir\" + os.sep, \"foo\", \"bar\"}\n\n scm.checkout(\"-\")\n stats = dvc.checkout()\n assert set(stats[\"added\"]) == {\"bar\", \"dir\" + os.sep, \"foo\"}\n\n tmp_dir.gen({\"lorem\": \"lorem\", \"bar\": \"new bar\", \"dir2\": {\"file\": \"file\"}})\n (tmp_dir / \"foo\").unlink()\n scm.repo.git.rm(\"foo.dvc\")\n tmp_dir.dvc_add([\"bar\", \"lorem\", \"dir2\"], commit=\"second\")\n\n scm.checkout(\"HEAD~\")\n stats = dvc.checkout()\n assert set(stats[\"modified\"]) == {\"bar\"}\n assert set(stats[\"added\"]) == {\"foo\"}\n assert set(stats[\"deleted\"]) == {\"lorem\", \"dir2\" + os.sep}\n\n scm.checkout(\"-\")\n stats = dvc.checkout()\n assert set(stats[\"modified\"]) == {\"bar\"}\n assert set(stats[\"added\"]) == {\"dir2\" + os.sep, \"lorem\"}\n assert set(stats[\"deleted\"]) == {\"foo\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_stats_on_failure_test_checkout_stats_on_failure.assert_exc_value_stats_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_stats_on_failure_test_checkout_stats_on_failure.assert_exc_value_stats_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 584, "end_line": 606, "span_ids": ["test_checkout_stats_on_failure"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_checkout_stats_on_failure(tmp_dir, dvc, scm):\n tmp_dir.dvc_gen(\n {\"foo\": \"foo\", \"dir\": {\"subdir\": {\"file\": \"file\"}}, \"other\": \"other\"},\n commit=\"initial\",\n )\n stage = Dvcfile(dvc, \"foo.dvc\").stage\n tmp_dir.dvc_gen({\"foo\": \"foobar\", \"other\": \"other other\"}, commit=\"second\")\n\n # corrupt cache\n cache = stage.outs[0].cache_path\n os.chmod(cache, 0o644)\n with open(cache, \"a\") as fd:\n fd.write(\"destroy cache\")\n\n scm.checkout(\"HEAD~\")\n with pytest.raises(CheckoutError) as exc:\n dvc.checkout(force=True)\n\n assert exc.value.stats == {\n **empty_checkout,\n \"failed\": [\"foo\"],\n \"modified\": [\"other\"],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_added_file_from_tracked_dir_test_stats_on_added_file_from_tracked_dir.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_added_file_from_tracked_dir_test_stats_on_added_file_from_tracked_dir.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 606, "end_line": 620, "span_ids": ["test_stats_on_added_file_from_tracked_dir"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stats_on_added_file_from_tracked_dir(tmp_dir, dvc, scm):\n tmp_dir.dvc_gen(\n {\"dir\": {\"subdir\": {\"file\": \"file\"}, \"other\": \"other\"}},\n commit=\"initial\",\n )\n\n tmp_dir.gen(\"dir/subdir/newfile\", \"newfile\")\n tmp_dir.dvc_add(\"dir\", commit=\"add newfile\")\n scm.checkout(\"HEAD~\")\n assert dvc.checkout() == {**empty_checkout, \"modified\": [\"dir\" + os.sep]}\n assert dvc.checkout() == empty_checkout\n\n scm.checkout(\"-\")\n assert dvc.checkout() == {**empty_checkout, \"modified\": [\"dir\" + os.sep]}\n assert dvc.checkout() == empty_checkout", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_updated_file_from_tracked_dir_test_stats_on_updated_file_from_tracked_dir.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_updated_file_from_tracked_dir_test_stats_on_updated_file_from_tracked_dir.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 623, "end_line": 637, "span_ids": ["test_stats_on_updated_file_from_tracked_dir"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stats_on_updated_file_from_tracked_dir(tmp_dir, dvc, scm):\n tmp_dir.dvc_gen(\n {\"dir\": {\"subdir\": {\"file\": \"file\"}, \"other\": \"other\"}},\n commit=\"initial\",\n )\n\n tmp_dir.gen(\"dir/subdir/file\", \"what file?\")\n tmp_dir.dvc_add(\"dir\", commit=\"update file\")\n scm.checkout(\"HEAD~\")\n assert dvc.checkout() == {**empty_checkout, \"modified\": [\"dir\" + os.sep]}\n assert dvc.checkout() == empty_checkout\n\n scm.checkout(\"-\")\n assert dvc.checkout() == {**empty_checkout, \"modified\": [\"dir\" + os.sep]}\n assert dvc.checkout() == empty_checkout", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_removed_file_from_tracked_dir_test_stats_on_removed_file_from_tracked_dir.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_removed_file_from_tracked_dir_test_stats_on_removed_file_from_tracked_dir.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 640, "end_line": 654, "span_ids": ["test_stats_on_removed_file_from_tracked_dir"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stats_on_removed_file_from_tracked_dir(tmp_dir, dvc, scm):\n tmp_dir.dvc_gen(\n {\"dir\": {\"subdir\": {\"file\": \"file\"}, \"other\": \"other\"}},\n commit=\"initial\",\n )\n\n (tmp_dir / \"dir\" / \"subdir\" / \"file\").unlink()\n tmp_dir.dvc_add(\"dir\", commit=\"removed file from subdir\")\n scm.checkout(\"HEAD~\")\n assert dvc.checkout() == {**empty_checkout, \"modified\": [\"dir\" + os.sep]}\n assert dvc.checkout() == empty_checkout\n\n scm.checkout(\"-\")\n assert dvc.checkout() == {**empty_checkout, \"modified\": [\"dir\" + os.sep]}\n assert dvc.checkout() == empty_checkout", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_show_changes_does_not_show_summary_test_stats_on_show_changes_does_not_show_summary.with_caplog_at_level_logg.assert_added_not_in_cap": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_on_show_changes_does_not_show_summary_test_stats_on_show_changes_does_not_show_summary.with_caplog_at_level_logg.assert_added_not_in_cap", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 657, "end_line": 673, "span_ids": ["test_stats_on_show_changes_does_not_show_summary"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stats_on_show_changes_does_not_show_summary(\n tmp_dir, dvc, scm, caplog\n):\n tmp_dir.dvc_gen(\n {\"dir\": {\"subdir\": {\"file\": \"file\"}}, \"other\": \"other\"},\n commit=\"initial\",\n )\n scm.checkout(\"HEAD~\")\n\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n caplog.clear()\n assert main([\"checkout\"]) == 0\n for out in [\"D\\tdir\" + os.sep, \"D\\tother\"]:\n assert out in caplog.text\n assert \"modified\" not in caplog.text\n assert \"deleted\" not in caplog.text\n assert \"added\" not in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_does_not_show_changes_by_default_test_checkout_with_relink_existing.assert_stats_empty_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_stats_does_not_show_changes_by_default_test_checkout_with_relink_existing.assert_stats_empty_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 676, "end_line": 700, "span_ids": ["test_stats_does_not_show_changes_by_default", "test_checkout_with_relink_existing"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stats_does_not_show_changes_by_default(tmp_dir, dvc, scm, caplog):\n tmp_dir.dvc_gen(\n {\"dir\": {\"subdir\": {\"file\": \"file\"}}, \"other\": \"other\"},\n commit=\"initial\",\n )\n scm.checkout(\"HEAD~\")\n\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n caplog.clear()\n assert main([\"checkout\", \"--summary\"]) == 0\n assert \"2 deleted\" in caplog.text\n assert \"dir\" not in caplog.text\n assert \"other\" not in caplog.text\n\n\n@pytest.mark.parametrize(\"link\", [\"hardlink\", \"symlink\", \"copy\"])\ndef test_checkout_with_relink_existing(tmp_dir, dvc, link):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n (tmp_dir / \"foo\").unlink()\n\n tmp_dir.dvc_gen(\"bar\", \"bar\")\n dvc.cache.local.cache_types = [link]\n\n stats = dvc.checkout(relink=True)\n assert stats == {**empty_checkout, \"added\": [\"foo\"]}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_with_deps_test_checkout_with_deps.assert_set_stats_added_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_with_deps_test_checkout_with_deps.assert_set_stats_added_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 703, "end_line": 717, "span_ids": ["test_checkout_with_deps"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_checkout_with_deps(tmp_dir, dvc):\n tmp_dir.dvc_gen({\"foo\": \"foo\"})\n dvc.run(\n fname=\"copy_file.dvc\", cmd=\"echo foo > bar\", outs=[\"bar\"], deps=[\"foo\"]\n )\n\n (tmp_dir / \"bar\").unlink()\n (tmp_dir / \"foo\").unlink()\n\n stats = dvc.checkout([\"copy_file.dvc\"], with_deps=False)\n assert stats == {**empty_checkout, \"added\": [\"bar\"]}\n\n (tmp_dir / \"bar\").unlink()\n stats = dvc.checkout([\"copy_file.dvc\"], with_deps=True)\n assert set(stats[\"added\"]) == {\"foo\", \"bar\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_recursive_test_checkout_recursive.assert_set_stats_added_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_recursive_test_checkout_recursive.assert_set_stats_added_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 720, "end_line": 731, "span_ids": ["test_checkout_recursive"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_checkout_recursive(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n dvc.add(\"dir\", recursive=True)\n\n (tmp_dir / \"dir\" / \"foo\").unlink()\n (tmp_dir / \"dir\" / \"bar\").unlink()\n\n stats = dvc.checkout([\"dir\"], recursive=True)\n assert set(stats[\"added\"]) == {\n os.path.join(\"dir\", \"foo\"),\n os.path.join(\"dir\", \"bar\"),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_for_external_outputs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkout_for_external_outputs_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 734, "end_line": 758, "span_ids": ["test_checkout_for_external_outputs"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n not S3.should_test(), reason=\"Only run with S3 credentials\"\n)\ndef test_checkout_for_external_outputs(tmp_dir, dvc):\n dvc.cache.s3 = RemoteS3(dvc, {\"url\": S3.get_url()})\n\n remote = RemoteS3(dvc, {\"url\": S3.get_url()})\n file_path = remote.path_info / \"foo\"\n remote.s3.put_object(\n Bucket=remote.path_info.bucket, Key=file_path.path, Body=\"foo\"\n )\n\n dvc.add(str(remote.path_info / \"foo\"))\n\n remote.remove(file_path)\n stats = dvc.checkout(force=True)\n assert stats == {**empty_checkout, \"added\": [str(file_path)]}\n assert remote.exists(file_path)\n\n remote.s3.put_object(\n Bucket=remote.path_info.bucket, Key=file_path.path, Body=\"foo\\nfoo\"\n )\n stats = dvc.checkout(force=True)\n assert stats == {**empty_checkout, \"modified\": [str(file_path)]}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_pytest_test_commit_recursive.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_pytest_test_commit_recursive.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "test_commit_recursive"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.stage.exceptions import StageCommitError\nfrom dvc.utils.stage import dump_stage_file\nfrom dvc.utils.stage import load_stage_file\n\n\ndef test_commit_recursive(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"file\": \"text1\", \"subdir\": {\"file2\": \"text2\"}}})\n stages = dvc.add(\"dir\", recursive=True, no_commit=True)\n\n assert len(stages) == 2\n assert dvc.status() != {}\n\n dvc.commit(\"dir\", recursive=True)\n assert dvc.status() == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_force_test_commit_force.assert_dvc_status_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_force_test_commit_force.assert_dvc_status_stage_", "embedding": null, "metadata": {"file_path": "tests/func/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 19, "end_line": 38, "span_ids": ["test_commit_force"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_commit_force(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"file\": \"text1\", \"file2\": \"text2\"}})\n (stage,) = dvc.add(\"dir\", no_commit=True)\n\n with dvc.state:\n assert stage.outs[0].changed_cache()\n\n tmp_dir.gen(\"dir/file\", \"file content modified\")\n\n with dvc.state:\n assert stage.outs[0].changed_cache()\n\n with pytest.raises(StageCommitError):\n dvc.commit(stage.path)\n\n with dvc.state:\n assert stage.outs[0].changed_cache()\n\n dvc.commit(stage.path, force=True)\n assert dvc.status([stage.path]) == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_with_deps_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_with_deps_", "embedding": null, "metadata": {"file_path": "tests/func/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 73, "span_ids": ["test_commit_changed_md5", "test_commit_with_deps"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_commit_with_deps(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n (foo_stage,) = dvc.add(\"foo\", no_commit=True)\n assert foo_stage is not None\n assert len(foo_stage.outs) == 1\n\n stage = run_copy(\"foo\", \"file\", no_commit=True)\n assert stage is not None\n assert len(stage.outs) == 1\n\n with dvc.state:\n assert foo_stage.outs[0].changed_cache()\n assert stage.outs[0].changed_cache()\n\n dvc.commit(stage.path, with_deps=True)\n with dvc.state:\n assert not foo_stage.outs[0].changed_cache()\n assert not stage.outs[0].changed_cache()\n\n\ndef test_commit_changed_md5(tmp_dir, dvc):\n tmp_dir.gen({\"file\": \"file content\"})\n (stage,) = dvc.add(\"file\", no_commit=True)\n\n stage_file_content = load_stage_file(stage.path)\n stage_file_content[\"md5\"] = \"1111111111\"\n dump_stage_file(stage.path, stage_file_content)\n\n with pytest.raises(StageCommitError):\n dvc.commit(stage.path)\n\n dvc.commit(stage.path, force=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_pytest_TestConfigCLI.test_root.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_pytest_TestConfigCLI.test_root.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "TestConfigCLI.test_root", "TestConfigCLI._contains", "TestConfigCLI"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport configobj\n\nfrom dvc.main import main\nfrom dvc.config import Config, ConfigError\nfrom tests.basic_env import TestDvc\n\n\nclass TestConfigCLI(TestDvc):\n def _contains(self, section, field, value, local=False):\n fname = self.dvc.config.files[\"local\" if local else \"repo\"]\n\n config = configobj.ConfigObj(fname)\n if section not in config.keys():\n return False\n\n if field not in config[section].keys():\n return False\n\n if config[section][field] != value:\n return False\n\n return True\n\n def test_root(self):\n ret = main([\"root\"])\n self.assertEqual(ret, 0)\n\n # NOTE: check that `dvc root` is not blocked with dvc lock\n with self.dvc.lock:\n ret = main([\"root\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_copy_from_tests_remotes_import": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_copy_from_tests_remotes_import", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 43, "span_ids": ["imports"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import copy\nimport logging\nimport os\nimport shutil\nimport uuid\nfrom unittest import SkipTest\n\nimport pytest\n\nfrom dvc.compat import fspath\nfrom dvc.cache import NamedCache\nfrom dvc.data_cloud import DataCloud\nfrom dvc.main import main\nfrom dvc.remote import RemoteAZURE\nfrom dvc.remote import RemoteGDrive\nfrom dvc.remote import RemoteGS\nfrom dvc.remote import RemoteHDFS\nfrom dvc.remote import RemoteHTTP\nfrom dvc.remote import RemoteLOCAL\nfrom dvc.remote import RemoteOSS\nfrom dvc.remote import RemoteS3\nfrom dvc.remote import RemoteSSH\nfrom dvc.remote.base import STATUS_DELETED, STATUS_NEW, STATUS_OK\nfrom dvc.utils import file_md5\nfrom dvc.utils.fs import remove\nfrom dvc.utils.stage import dump_stage_file, load_stage_file\nfrom dvc.external_repo import clean_repos\nfrom tests.basic_env import TestDvc\n\nfrom tests.remotes import (\n Azure,\n GCP,\n GDrive,\n HDFS,\n HTTP,\n Local,\n S3,\n SSHMocked,\n OSS,\n TEST_CONFIG,\n TEST_GCP_CREDS_FILE,\n TEST_REMOTE,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGDrive_TestRemoteLOCAL._get_cloud_class.return.RemoteLOCAL": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGDrive_TestRemoteLOCAL._get_cloud_class.return.RemoteLOCAL", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 205, "end_line": 251, "span_ids": ["TestRemoteGDrive", "TestRemoteAZURE._get_cloud_class", "TestRemoteGS._get_cloud_class", "TestRemoteGS._setup_cloud", "TestRemoteLOCAL._get_cloud_class", "TestRemoteLOCAL", "TestRemoteGDrive._get_cloud_class", "TestRemoteOSS._get_cloud_class", "TestRemoteAZURE", "TestRemoteOSS", "TestRemoteGS", "TestRemoteGDrive._setup_cloud"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteGDrive(GDrive, TestDataCloudBase):\n def _setup_cloud(self):\n self._ensure_should_run()\n\n setup_gdrive_cloud(self.get_url(), self.dvc)\n\n self.cloud = DataCloud(self.dvc)\n remote = self.cloud.get_remote()\n self.assertIsInstance(remote, self._get_cloud_class())\n\n def _get_cloud_class(self):\n return RemoteGDrive\n\n\nclass TestRemoteGS(GCP, TestDataCloudBase):\n def _setup_cloud(self):\n self._ensure_should_run()\n\n repo = self.get_url()\n\n config = copy.deepcopy(TEST_CONFIG)\n config[\"remote\"][TEST_REMOTE] = {\n \"url\": repo,\n \"credentialpath\": TEST_GCP_CREDS_FILE,\n }\n self.dvc.config = config\n self.cloud = DataCloud(self.dvc)\n\n self.assertIsInstance(self.cloud.get_remote(), self._get_cloud_class())\n\n def _get_cloud_class(self):\n return RemoteGS\n\n\nclass TestRemoteAZURE(Azure, TestDataCloudBase):\n def _get_cloud_class(self):\n return RemoteAZURE\n\n\nclass TestRemoteOSS(OSS, TestDataCloudBase):\n def _get_cloud_class(self):\n return RemoteOSS\n\n\nclass TestRemoteLOCAL(Local, TestDataCloudBase):\n def _get_cloud_class(self):\n return RemoteLOCAL", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteSSHMocked_TestRemoteSSHMocked._get_cloud_class.return.RemoteSSH": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteSSHMocked_TestRemoteSSHMocked._get_cloud_class.return.RemoteSSH", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 255, "end_line": 287, "span_ids": ["TestRemoteSSHMocked._get_cloud_class", "TestRemoteSSHMocked.setup_method_fixture", "TestRemoteSSHMocked.get_url", "TestRemoteSSHMocked._get_keyfile", "TestRemoteSSHMocked._setup_cloud", "TestRemoteSSHMocked"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"ssh_server\")\nclass TestRemoteSSHMocked(SSHMocked, TestDataCloudBase):\n @pytest.fixture(autouse=True)\n def setup_method_fixture(self, request, ssh_server):\n self.ssh_server = ssh_server\n self.method_name = request.function.__name__\n\n def _setup_cloud(self):\n self._ensure_should_run()\n\n repo = self.get_url()\n keyfile = self._get_keyfile()\n\n self._get_cloud_class().CAN_TRAVERSE = False\n config = copy.deepcopy(TEST_CONFIG)\n config[\"remote\"][TEST_REMOTE] = {\n \"url\": repo,\n \"keyfile\": keyfile,\n }\n self.dvc.config = config\n self.cloud = DataCloud(self.dvc)\n\n self.assertIsInstance(self.cloud.get_remote(), self._get_cloud_class())\n\n def get_url(self):\n user = self.ssh_server.test_creds[\"username\"]\n return super().get_url(user, self.ssh_server.port)\n\n def _get_keyfile(self):\n return self.ssh_server.test_creds[\"key_filename\"]\n\n def _get_cloud_class(self):\n return RemoteSSH", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteHDFS_TestRemoteHTTP._get_cloud_class.return.RemoteHTTP": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteHDFS_TestRemoteHTTP._get_cloud_class.return.RemoteHTTP", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 289, "end_line": 305, "span_ids": ["TestRemoteHTTP._get_cloud_class", "TestRemoteHTTP.setup_method_fixture", "TestRemoteHTTP.get_url", "TestRemoteHDFS._get_cloud_class", "TestRemoteHDFS", "TestRemoteHTTP"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteHDFS(HDFS, TestDataCloudBase):\n def _get_cloud_class(self):\n return RemoteHDFS\n\n\n@pytest.mark.usefixtures(\"http_server\")\nclass TestRemoteHTTP(HTTP, TestDataCloudBase):\n @pytest.fixture(autouse=True)\n def setup_method_fixture(self, request, http_server):\n self.http_server = http_server\n self.method_name = request.function.__name__\n\n def get_url(self):\n return super().get_url(self.http_server.server_port)\n\n def _get_cloud_class(self):\n return RemoteHTTP", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteLOCALCLI_TestRemoteS3CLI._test.self__test_cloud_TEST_REM": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteLOCALCLI_TestRemoteS3CLI._test.self__test_cloud_TEST_REM", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 397, "end_line": 421, "span_ids": ["TestRemoteLOCALCLI", "TestRemoteS3CLI._test", "TestRemoteHDFSCLI._test", "TestRemoteS3CLI", "TestRemoteHDFSCLI", "TestRemoteLOCALCLI._test"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteLOCALCLI(Local, TestDataCloudCLIBase):\n def _test(self):\n url = self.get_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestRemoteHDFSCLI(HDFS, TestDataCloudCLIBase):\n def _test(self):\n url = self.get_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestRemoteS3CLI(S3, TestDataCloudCLIBase):\n def _test(self):\n url = self.get_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGDriveCLI_TestRemoteGDriveCLI._test.self__test_cloud_TEST_REM": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGDriveCLI_TestRemoteGDriveCLI._test.self__test_cloud_TEST_REM", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 424, "end_line": 460, "span_ids": ["TestRemoteGDriveCLI._test", "TestRemoteGDriveCLI._setup_cloud", "TestRemoteGDriveCLI"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteGDriveCLI(GDrive, TestDataCloudCLIBase):\n def _setup_cloud(self):\n setup_gdrive_cloud(self.get_url(), self.dvc)\n\n def _test(self):\n url = self.get_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n self.main(\n [\n \"remote\",\n \"modify\",\n TEST_REMOTE,\n \"gdrive_service_account_email\",\n \"modified\",\n ]\n )\n self.main(\n [\n \"remote\",\n \"modify\",\n TEST_REMOTE,\n \"gdrive_service_account_p12_file_path\",\n \"modified.p12\",\n ]\n )\n self.main(\n [\n \"remote\",\n \"modify\",\n TEST_REMOTE,\n \"gdrive_use_service_account\",\n \"True\",\n ]\n )\n\n self._test_cloud(TEST_REMOTE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGSCLI_TestDataCloudErrorCLI.test_error.self_main_fail_fetch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteGSCLI_TestDataCloudErrorCLI.test_error.self_main_fail_fetch_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 463, "end_line": 509, "span_ids": ["TestRemoteOSSCLI._test", "TestRemoteOSSCLI", "TestRemoteAZURECLI", "TestRemoteAZURECLI._test", "TestDataCloudErrorCLI", "TestRemoteGSCLI", "TestDataCloudErrorCLI.test_error", "TestDataCloudErrorCLI.main_fail", "TestRemoteGSCLI._test"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteGSCLI(GCP, TestDataCloudCLIBase):\n def _test(self):\n url = self.get_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n self.main(\n [\n \"remote\",\n \"modify\",\n TEST_REMOTE,\n \"credentialpath\",\n TEST_GCP_CREDS_FILE,\n ]\n )\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestRemoteAZURECLI(Azure, TestDataCloudCLIBase):\n def _test(self):\n url = self.get_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestRemoteOSSCLI(OSS, TestDataCloudCLIBase):\n def _test(self):\n url = self.get_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestDataCloudErrorCLI(TestDvc):\n def main_fail(self, args):\n ret = main(args)\n self.assertNotEqual(ret, 0)\n\n def test_error(self):\n f = \"non-existing-file\"\n self.main_fail([\"status\", \"-c\", f])\n self.main_fail([\"push\", f])\n self.main_fail([\"pull\", f])\n self.main_fail([\"fetch\", f])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations_TestRecursiveSyncOperations._clear_local_cache.remove_self_dvc_cache_loc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations_TestRecursiveSyncOperations._clear_local_cache.remove_self_dvc_cache_loc", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 544, "end_line": 576, "span_ids": ["TestRecursiveSyncOperations", "TestRecursiveSyncOperations._get_cloud_class", "TestRecursiveSyncOperations._remove_local_data_files", "TestRecursiveSyncOperations.main", "TestRecursiveSyncOperations._test_recursive_pull", "TestRecursiveSyncOperations._prepare_repo", "TestRecursiveSyncOperations._clear_local_cache"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRecursiveSyncOperations(Local, TestDataCloudBase):\n def main(self, args):\n ret = main(args)\n self.assertEqual(ret, 0)\n\n def _get_cloud_class(self):\n return RemoteLOCAL\n\n def _prepare_repo(self):\n remote = self.cloud.get_remote()\n self.main([\"remote\", \"add\", \"-d\", TEST_REMOTE, remote.cache_dir])\n\n self.dvc.add(self.DATA)\n self.dvc.add(self.DATA_SUB)\n\n def _remove_local_data_files(self):\n os.remove(self.DATA)\n os.remove(self.DATA_SUB)\n\n def _test_recursive_pull(self):\n self._remove_local_data_files()\n self._clear_local_cache()\n\n self.assertFalse(os.path.exists(self.DATA))\n self.assertFalse(os.path.exists(self.DATA_SUB))\n\n self.main([\"pull\", \"-R\", self.DATA_DIR])\n\n self.assertTrue(os.path.exists(self.DATA))\n self.assertTrue(os.path.exists(self.DATA_SUB))\n\n def _clear_local_cache(self):\n remove(self.dvc.cache.local.cache_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_checksum_recalculation_test_checksum_recalculation.assert_test_get_file_chec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_checksum_recalculation_test_checksum_recalculation.assert_test_get_file_chec", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 619, "end_line": 633, "span_ids": ["test_checksum_recalculation"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_checksum_recalculation(mocker, dvc, tmp_dir):\n tmp_dir.gen({\"foo\": \"foo\"})\n test_get_file_checksum = mocker.spy(RemoteLOCAL, \"get_file_checksum\")\n url = Local.get_url()\n ret = main([\"remote\", \"add\", \"-d\", TEST_REMOTE, url])\n assert ret == 0\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n assert ret == 0\n ret = main([\"add\", \"foo\"])\n assert ret == 0\n ret = main([\"push\"])\n assert ret == 0\n ret = main([\"run\", \"-d\", \"foo\", \"echo foo\"])\n assert ret == 0\n assert test_get_file_checksum.mock.call_count == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test.None_8", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 666, "end_line": 683, "span_ids": ["TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldWarnOnNoChecksumInLocalAndRemoteCache(TestDvc):\n\n def test(self):\n self._caplog.clear()\n main([\"push\"])\n assert self.message_header in self._caplog.text\n assert self.message_foo_part in self._caplog.text\n assert self.message_bar_part in self._caplog.text\n\n self._caplog.clear()\n main([\"pull\"])\n assert self.message_header in self._caplog.text\n assert self.message_foo_part in self._caplog.text\n assert self.message_bar_part in self._caplog.text\n\n self._caplog.clear()\n main([\"status\", \"-c\"])\n assert self.message_header in self._caplog.text\n assert self.message_foo_part in self._caplog.text\n assert self.message_bar_part in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dependency.py_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dependency.py_copy_", "embedding": null, "metadata": {"file_path": "tests/func/test_dependency.py", "file_name": "test_dependency.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["_get_dep", "imports", "test_scheme"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import copy\n\nimport pytest\n\nfrom dvc.dependency import _get\nfrom dvc.dependency import DEP_MAP\nfrom dvc.stage import Stage\nfrom tests.func.test_output import TESTS as OUT_TESTS\n\n\nTESTS = copy.copy(OUT_TESTS)\nTESTS.append((\"http://example.com/path/to/file\", \"http\"))\nTESTS.append((\"https://example.com/path/to/file\", \"https\"))\n\n\ndef _get_dep(dvc, path):\n return _get(Stage(dvc), path, None)\n\n\n@pytest.mark.parametrize(\"url,scheme\", TESTS)\ndef test_scheme(dvc, url, scheme):\n assert type(_get_dep(dvc, url)) == DEP_MAP[scheme]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_hashlib_test_added.assert_dvc_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_hashlib_test_added.assert_dvc_diff_", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "digest", "test_no_scm", "test_added"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import hashlib\nimport os\nimport pytest\n\nfrom funcy import first\n\nfrom dvc.compat import fspath\nfrom dvc.utils.fs import remove\nfrom dvc.exceptions import DvcException\n\n\ndef digest(text):\n return hashlib.md5(bytes(text, \"utf-8\")).hexdigest()\n\n\ndef test_no_scm(tmp_dir, dvc):\n from dvc.scm.base import NoSCMError\n\n tmp_dir.dvc_gen(\"file\", \"text\")\n\n with pytest.raises(NoSCMError):\n dvc.diff()\n\n\ndef test_added(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen(\"file\", \"text\")\n\n assert dvc.diff() == {\n \"added\": [{\"path\": \"file\", \"hash\": digest(\"text\")}],\n \"deleted\": [],\n \"modified\": [],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_no_cache_entry_test_no_cache_entry.assert_dvc_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_no_cache_entry_test_no_cache_entry.assert_dvc_diff_", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 53, "span_ids": ["test_no_cache_entry"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_no_cache_entry(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen(\"file\", \"first\", commit=\"add a file\")\n\n tmp_dir.dvc_gen({\"dir\": {\"1\": \"1\", \"2\": \"2\"}})\n tmp_dir.dvc_gen(\"file\", \"second\")\n\n remove(fspath(tmp_dir / \".dvc\" / \"cache\"))\n (tmp_dir / \".dvc\" / \"state\").unlink()\n\n dir_checksum = \"5fb6b29836c388e093ca0715c872fe2a.dir\"\n\n assert dvc.diff() == {\n \"added\": [{\"path\": os.path.join(\"dir\", \"\"), \"hash\": dir_checksum}],\n \"deleted\": [],\n \"modified\": [\n {\n \"path\": \"file\",\n \"hash\": {\"old\": digest(\"first\"), \"new\": digest(\"second\")},\n }\n ],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_deleted_test_modified.assert_dvc_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_deleted_test_modified.assert_dvc_diff_", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 56, "end_line": 80, "span_ids": ["test_modified", "test_deleted"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_deleted(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen(\"file\", \"text\", commit=\"add file\")\n (tmp_dir / \"file.dvc\").unlink()\n\n assert dvc.diff() == {\n \"added\": [],\n \"deleted\": [{\"path\": \"file\", \"hash\": digest(\"text\")}],\n \"modified\": [],\n }\n\n\ndef test_modified(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen(\"file\", \"first\", commit=\"first version\")\n tmp_dir.dvc_gen(\"file\", \"second\")\n\n assert dvc.diff() == {\n \"added\": [],\n \"deleted\": [],\n \"modified\": [\n {\n \"path\": \"file\",\n \"hash\": {\"old\": digest(\"first\"), \"new\": digest(\"second\")},\n }\n ],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_refs_test_refs.with_pytest_raises_DvcExc.dvc_diff_missing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_refs_test_refs.with_pytest_raises_DvcExc.dvc_diff_missing_", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 105, "span_ids": ["test_refs"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_refs(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen(\"file\", \"first\", commit=\"first version\")\n tmp_dir.dvc_gen(\"file\", \"second\", commit=\"second version\")\n tmp_dir.dvc_gen(\"file\", \"third\", commit=\"third version\")\n\n HEAD_2 = digest(\"first\")\n HEAD_1 = digest(\"second\")\n HEAD = digest(\"third\")\n\n assert dvc.diff(\"HEAD~1\") == {\n \"added\": [],\n \"deleted\": [],\n \"modified\": [{\"path\": \"file\", \"hash\": {\"old\": HEAD_1, \"new\": HEAD}}],\n }\n\n assert dvc.diff(\"HEAD~2\", \"HEAD~1\") == {\n \"added\": [],\n \"deleted\": [],\n \"modified\": [{\"path\": \"file\", \"hash\": {\"old\": HEAD_2, \"new\": HEAD_1}}],\n }\n\n with pytest.raises(DvcException, match=r\"unknown Git revision 'missing'\"):\n dvc.diff(\"missing\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_directories_test_directories.assert_dvc_diff_modify": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_directories_test_directories.assert_dvc_diff_modify", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 110, "end_line": 160, "span_ids": ["test_directories"], "tokens": 436}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_directories(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen({\"dir\": {\"1\": \"1\", \"2\": \"2\"}}, commit=\"add a directory\")\n tmp_dir.dvc_gen({\"dir\": {\"3\": \"3\"}}, commit=\"add a file\")\n tmp_dir.dvc_gen({\"dir\": {\"2\": \"two\"}}, commit=\"modify a file\")\n\n (tmp_dir / \"dir\" / \"2\").unlink()\n dvc.add(\"dir\")\n scm.add([\"dir.dvc\"])\n scm.commit(\"delete a file\")\n\n # The \":/\" format is a way to specify revisions by commit message:\n # https://git-scm.com/docs/revisions\n #\n assert dvc.diff(\":/init\", \":/directory\") == {\n \"added\": [\n {\n \"path\": os.path.join(\"dir\", \"\"),\n \"hash\": \"5fb6b29836c388e093ca0715c872fe2a.dir\",\n },\n ],\n \"deleted\": [],\n \"modified\": [],\n }\n\n assert dvc.diff(\":/directory\", \":/modify\") == {\n \"added\": [],\n \"deleted\": [],\n \"modified\": [\n {\n \"path\": os.path.join(\"dir\", \"\"),\n \"hash\": {\n \"old\": \"5fb6b29836c388e093ca0715c872fe2a.dir\",\n \"new\": \"9b5faf37366b3370fd98e3e60ca439c1.dir\",\n },\n },\n ],\n }\n\n assert dvc.diff(\":/modify\", \":/delete\") == {\n \"added\": [],\n \"deleted\": [],\n \"modified\": [\n {\n \"path\": os.path.join(\"dir\", \"\"),\n \"hash\": {\n \"old\": \"9b5faf37366b3370fd98e3e60ca439c1.dir\",\n \"new\": \"83ae82fb367ac9926455870773ff09e6.dir\",\n },\n }\n ],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_os_test_external_repo.with_patch_object_Git_c.assert_mock_call_count_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_os_test_external_repo.with_patch_object_Git_c.assert_mock_call_count_", "embedding": null, "metadata": {"file_path": "tests/func/test_external_repo.py", "file_name": "test_external_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports", "test_external_repo"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom mock import patch\nfrom dvc.compat import fspath\n\nfrom dvc.external_repo import external_repo\nfrom dvc.scm.git import Git\nfrom dvc.remote import RemoteLOCAL\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import remove\n\n\ndef test_external_repo(erepo_dir):\n with erepo_dir.chdir():\n with erepo_dir.branch(\"branch\", new=True):\n erepo_dir.dvc_gen(\"file\", \"branch\", commit=\"create file on branch\")\n erepo_dir.dvc_gen(\"file\", \"master\", commit=\"create file on master\")\n\n url = fspath(erepo_dir)\n\n with patch.object(Git, \"clone\", wraps=Git.clone) as mock:\n with external_repo(url) as repo:\n with repo.open_by_relpath(\"file\") as fd:\n assert fd.read() == \"master\"\n\n with external_repo(url, rev=\"branch\") as repo:\n with repo.open_by_relpath(\"file\") as fd:\n assert fd.read() == \"branch\"\n\n assert mock.call_count == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_source_change_test_cache_reused.with_external_repo_url_.assert_download_spy_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_source_change_test_cache_reused.with_external_repo_url_.assert_download_spy_mock_", "embedding": null, "metadata": {"file_path": "tests/func/test_external_repo.py", "file_name": "test_external_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 62, "span_ids": ["test_cache_reused", "test_source_change"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_source_change(erepo_dir):\n url = fspath(erepo_dir)\n with external_repo(url) as repo:\n old_rev = repo.scm.get_rev()\n\n erepo_dir.scm_gen(\"file\", \"text\", commit=\"a change\")\n\n with external_repo(url) as repo:\n new_rev = repo.scm.get_rev()\n\n assert old_rev != new_rev\n\n\ndef test_cache_reused(erepo_dir, mocker):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"file\", \"text\", commit=\"add file\")\n\n download_spy = mocker.spy(RemoteLOCAL, \"download\")\n\n # Use URL to prevent any fishy optimizations\n url = \"file://{}\".format(erepo_dir)\n with external_repo(url) as repo:\n repo.fetch()\n assert download_spy.mock.call_count == 1\n\n # Should not download second time\n erepo_dir.scm.branch(\"branch\")\n with external_repo(url, \"branch\") as repo:\n repo.fetch()\n assert download_spy.mock.call_count == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_known_sha_test_pull_subdir_file.assert_dest_read_text_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_known_sha_test_pull_subdir_file.assert_dest_read_text_", "embedding": null, "metadata": {"file_path": "tests/func/test_external_repo.py", "file_name": "test_external_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 92, "span_ids": ["test_known_sha", "test_pull_subdir_file"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_known_sha(erepo_dir):\n url = \"file://{}\".format(erepo_dir)\n with external_repo(url) as repo:\n rev = repo.scm.get_rev()\n prev_rev = repo.scm.resolve_rev(\"HEAD^\")\n\n # Hits cache\n with external_repo(url, rev) as repo:\n pass\n\n # No clone, no pull, copies a repo, checks out the known sha\n with external_repo(url, prev_rev) as repo:\n pass\n\n\ndef test_pull_subdir_file(tmp_dir, erepo_dir):\n with erepo_dir.chdir():\n subdir = erepo_dir / \"subdir\"\n subdir.mkdir()\n (subdir / \"file\").write_text(\"contents\")\n erepo_dir.dvc_add(subdir / \"file\", commit=\"create file\")\n\n dest = tmp_dir / \"file\"\n with external_repo(fspath(erepo_dir)) as repo:\n repo.pull_to(os.path.join(\"subdir\", \"file\"), dest)\n\n assert dest.is_file()\n assert dest.read_text() == \"contents\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_relative_remote_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_external_repo.py_test_relative_remote_", "embedding": null, "metadata": {"file_path": "tests/func/test_external_repo.py", "file_name": "test_external_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 95, "end_line": 122, "span_ids": ["test_relative_remote"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_relative_remote(erepo_dir, tmp_dir):\n # these steps reproduce the script on this issue:\n # https://github.com/iterative/dvc/issues/2756\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"file\", \"contents\", commit=\"create file\")\n\n upstream_dir = tmp_dir\n upstream_url = relpath(upstream_dir, erepo_dir)\n with erepo_dir.dvc.config.edit() as conf:\n conf[\"remote\"][\"upstream\"] = {\"url\": upstream_url}\n conf[\"core\"][\"remote\"] = \"upstream\"\n\n erepo_dir.scm_add(\n erepo_dir.dvc.config.files[\"repo\"], commit=\"Update dvc config\"\n )\n erepo_dir.dvc.push()\n\n (erepo_dir / \"file\").unlink()\n remove(erepo_dir.dvc.cache.local.cache_dir)\n\n url = fspath(erepo_dir)\n\n with external_repo(url) as repo:\n assert os.path.isabs(repo.config[\"remote\"][\"upstream\"][\"url\"])\n assert os.path.isdir(repo.config[\"remote\"][\"upstream\"][\"url\"])\n with repo.open_by_relpath(\"file\") as fd:\n assert fd.read() == \"contents\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_fs.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_fs.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["imports", "test_copyfile", "test_makedirs_permissions"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport stat\n\nimport pytest\n\nfrom dvc.utils.fs import makedirs, copyfile\n\n\n@pytest.mark.skipif(os.name == \"nt\", reason=\"Not supported for Windows.\")\ndef test_makedirs_permissions(tmp_dir):\n dir_mode = 0o755\n intermediate_dir = \"\u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f-\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\"\n test_dir = os.path.join(intermediate_dir, \"data\")\n\n assert not os.path.exists(intermediate_dir)\n\n makedirs(test_dir, mode=dir_mode)\n\n assert stat.S_IMODE(os.stat(test_dir).st_mode) == dir_mode\n assert stat.S_IMODE(os.stat(intermediate_dir).st_mode) == dir_mode\n\n\ndef test_copyfile(tmp_dir):\n src = \"file1\"\n dest = \"file2\"\n dest_dir = \"testdir\"\n\n tmp_dir.gen(src, \"file1contents\")\n\n os.mkdir(dest_dir)\n\n copyfile(src, dest)\n assert (tmp_dir / dest).read_text() == \"file1contents\"\n\n copyfile(src, dest_dir)\n assert (tmp_dir / dest_dir / src).read_text() == \"file1contents\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_logging_TestGC._test_gc.for_c_in_self_good_cache_.self_assertTrue_os_path_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_logging_TestGC._test_gc.for_c_in_self_good_cache_.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 48, "span_ids": ["TestGC.test_cli", "imports", "TestGC", "TestGC.setUp", "TestGC.test_api", "TestGC._test_gc"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nimport configobj\nimport pytest\nfrom git import Repo\n\nfrom dvc.compat import fspath\nfrom dvc.exceptions import CollectCacheError\nfrom dvc.main import main\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.utils.fs import remove\nfrom tests.basic_env import TestDir, TestDvcGit\n\n\nclass TestGC(TestDvcGit):\n def setUp(self):\n super().setUp()\n\n self.dvc.add(self.FOO)\n self.dvc.add(self.DATA_DIR)\n self.good_cache = [\n self.dvc.cache.local.get(md5) for md5 in self.dvc.cache.local.all()\n ]\n\n self.bad_cache = []\n for i in [\"123\", \"234\", \"345\"]:\n path = os.path.join(self.dvc.cache.local.cache_dir, i[0:2], i[2:])\n self.create(path, i)\n self.bad_cache.append(path)\n\n def test_api(self):\n self.dvc.gc(workspace=True)\n self._test_gc()\n\n def test_cli(self):\n ret = main([\"gc\", \"-wf\"])\n self.assertEqual(ret, 0)\n self._test_gc()\n\n def _test_gc(self):\n self.assertTrue(os.path.isdir(self.dvc.cache.local.cache_dir))\n for c in self.bad_cache:\n self.assertFalse(os.path.exists(c))\n\n for c in self.good_cache:\n self.assertTrue(os.path.exists(c))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos.test_TestGCMultipleDvcRepos.test.self__check_cache_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos.test_TestGCMultipleDvcRepos.test.self__check_cache_2_", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 135, "end_line": 179, "span_ids": ["TestGCMultipleDvcRepos.test"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGCMultipleDvcRepos(TestDvcGit):\n\n def test(self):\n\n # ADD FILE ONLY IN MAIN PROJECT\n fname = \"only_in_first\"\n with open(fname, \"w+\") as fobj:\n fobj.write(\"only in main repo\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n # ADD FILE IN MAIN PROJECT THAT IS ALSO IN SECOND PROJECT\n fname = \"in_both\"\n with open(fname, \"w+\") as fobj:\n fobj.write(\"in both repos\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n cwd = os.getcwd()\n os.chdir(self.additional_path)\n # ADD FILE ONLY IN SECOND PROJECT\n fname = os.path.join(self.additional_path, \"only_in_second\")\n with open(fname, \"w+\") as fobj:\n fobj.write(\"only in additional repo\")\n\n stages = self.additional_dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n # ADD FILE IN SECOND PROJECT THAT IS ALSO IN MAIN PROJECT\n fname = os.path.join(self.additional_path, \"in_both\")\n with open(fname, \"w+\") as fobj:\n fobj.write(\"in both repos\")\n\n stages = self.additional_dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n os.chdir(cwd)\n\n self._check_cache(3)\n\n self.dvc.gc(repos=[self.additional_path], workspace=True)\n self._check_cache(3)\n\n self.dvc.gc(workspace=True)\n self._check_cache(2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_all_commits_test_all_commits.assert__count_files_dvc_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_all_commits_test_all_commits.assert__count_files_dvc_c", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 182, "end_line": 192, "span_ids": ["test_all_commits"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_all_commits(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen(\"testfile\", \"uncommitted\")\n tmp_dir.dvc_gen(\"testfile\", \"committed\", commit=\"committed\")\n tmp_dir.dvc_gen(\"testfile\", \"modified\", commit=\"modified\")\n tmp_dir.dvc_gen(\"testfile\", \"workspace\")\n\n n = _count_files(dvc.cache.local.cache_dir)\n dvc.gc(all_commits=True)\n\n # Only one uncommitted file should go away\n assert _count_files(dvc.cache.local.cache_dir) == n - 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_no_dir_cache_test_gc_no_dir_cache.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_no_dir_cache_test_gc_no_dir_cache.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 206, "span_ids": ["test_gc_no_dir_cache"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_gc_no_dir_cache(tmp_dir, dvc):\n tmp_dir.dvc_gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n (dir_stage,) = tmp_dir.dvc_gen({\"dir\": {\"x\": \"x\", \"subdir\": {\"y\": \"y\"}}})\n\n remove(dir_stage.outs[0].cache_path)\n\n with pytest.raises(CollectCacheError):\n dvc.gc(workspace=True)\n\n assert _count_files(dvc.cache.local.cache_dir) == 4\n dvc.gc(force=True, workspace=True)\n assert _count_files(dvc.cache.local.cache_dir) == 2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py__count_files_test_gc_without_workspace_raises_error.None_1.dvc_gc_force_True_worksp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py__count_files_test_gc_without_workspace_raises_error.None_1.dvc_gc_force_True_worksp", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 209, "end_line": 237, "span_ids": ["_count_files", "test_gc_no_unpacked_dir", "test_gc_without_workspace_raises_error"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _count_files(path):\n return sum(len(files) for _, _, files in os.walk(path))\n\n\ndef test_gc_no_unpacked_dir(tmp_dir, dvc):\n dir_stages = tmp_dir.dvc_gen({\"dir\": {\"file\": \"text\"}})\n dvc.status()\n\n os.remove(\"dir.dvc\")\n unpackeddir = (\n dir_stages[0].outs[0].cache_path + RemoteLOCAL.UNPACKED_DIR_SUFFIX\n )\n\n assert os.path.exists(unpackeddir)\n\n dvc.gc(force=True, workspace=True)\n assert not os.path.exists(unpackeddir)\n\n\ndef test_gc_without_workspace_raises_error(tmp_dir, dvc):\n dvc.gc(force=True, workspace=True) # works without error\n\n from dvc.exceptions import InvalidArgumentError\n\n with pytest.raises(InvalidArgumentError):\n dvc.gc(force=True)\n\n with pytest.raises(InvalidArgumentError):\n dvc.gc(force=True, workspace=False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_with_or_without_specifier_test_gc_cloud_with_or_without_specifier.with_erepo_dir_chdir_.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_with_or_without_specifier_test_gc_cloud_with_or_without_specifier.with_erepo_dir_chdir_.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 240, "end_line": 251, "span_ids": ["test_gc_cloud_with_or_without_specifier"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_gc_cloud_with_or_without_specifier(tmp_dir, erepo_dir):\n dvc = erepo_dir.dvc\n with erepo_dir.chdir():\n from dvc.exceptions import InvalidArgumentError\n\n with pytest.raises(InvalidArgumentError):\n dvc.gc(force=True, cloud=True)\n\n dvc.gc(cloud=True, all_tags=True)\n dvc.gc(cloud=True, all_commits=True)\n dvc.gc(cloud=True, all_branches=True)\n dvc.gc(cloud=True, all_commits=False, all_branches=True, all_tags=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_without_workspace_on_tags_branches_commits_test_gc_with_possible_args_positive.for_flag_in_.assert_main_gc_vf_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_without_workspace_on_tags_branches_commits_test_gc_with_possible_args_positive.for_flag_in_.assert_main_gc_vf_", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 254, "end_line": 294, "span_ids": ["test_gc_without_workspace", "test_gc_cloud_without_any_specifier", "test_gc_without_workspace_on_tags_branches_commits", "test_gc_with_possible_args_positive"], "tokens": 342}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_gc_without_workspace_on_tags_branches_commits(tmp_dir, dvc):\n dvc.gc(force=True, all_tags=True)\n dvc.gc(force=True, all_commits=True)\n dvc.gc(force=False, all_branches=True)\n\n # even if workspace is disabled, and others are enabled, assume as if\n # workspace is enabled.\n dvc.gc(force=False, all_branches=True, all_commits=False, workspace=False)\n\n\ndef test_gc_without_workspace(tmp_dir, dvc, caplog):\n with caplog.at_level(logging.WARNING, logger=\"dvc\"):\n assert main([\"gc\", \"-vf\"]) == 255\n\n assert (\n \"Either of `-w|--workspace`, `-a|--all-branches`, `-T|--all-tags` \"\n \"or `--all-commits` needs to be set.\"\n ) in caplog.text\n\n\ndef test_gc_cloud_without_any_specifier(tmp_dir, dvc, caplog):\n with caplog.at_level(logging.WARNING, logger=\"dvc\"):\n assert main([\"gc\", \"-cvf\"]) == 255\n\n assert (\n \"Either of `-w|--workspace`, `-a|--all-branches`, `-T|--all-tags` \"\n \"or `--all-commits` needs to be set.\"\n ) in caplog.text\n\n\ndef test_gc_with_possible_args_positive(tmp_dir, dvc):\n for flag in [\n \"-w\",\n \"-a\",\n \"-T\",\n \"--all-commits\",\n \"-aT\",\n \"-wa\",\n \"-waT\",\n ]:\n assert main([\"gc\", \"-vf\", flag]) == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_logging_test_get_git_dir.trees_equal_fspath_erepo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_logging_test_get_git_dir.trees_equal_fspath_erepo_", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 58, "span_ids": ["test_get_git_file", "test_get_git_dir", "imports", "test_get_repo_dir", "test_get_repo_file"], "tokens": 437}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nimport pytest\n\nfrom dvc.cache import Cache\nfrom dvc.main import main\nfrom dvc.exceptions import PathMissingError\nfrom dvc.repo.get import GetDVCFileError\nfrom dvc.repo import Repo\nfrom dvc.system import System\nfrom dvc.utils.fs import makedirs\nfrom dvc.compat import fspath\nfrom tests.utils import trees_equal\n\n\ndef test_get_repo_file(tmp_dir, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"file\", \"contents\", commit=\"create file\")\n\n Repo.get(fspath(erepo_dir), \"file\", \"file_imported\")\n\n assert os.path.isfile(\"file_imported\")\n assert (tmp_dir / \"file_imported\").read_text() == \"contents\"\n\n\ndef test_get_repo_dir(tmp_dir, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen({\"dir\": {\"file\": \"contents\"}}, commit=\"create dir\")\n\n Repo.get(fspath(erepo_dir), \"dir\", \"dir_imported\")\n\n assert os.path.isdir(\"dir_imported\")\n trees_equal(fspath(erepo_dir / \"dir\"), \"dir_imported\")\n\n\ndef test_get_git_file(tmp_dir, erepo_dir):\n src = \"some_file\"\n dst = \"some_file_imported\"\n\n erepo_dir.scm_gen({src: \"hello\"}, commit=\"add a regular file\")\n\n Repo.get(fspath(erepo_dir), src, dst)\n\n assert (tmp_dir / dst).is_file()\n assert (tmp_dir / dst).read_text() == \"hello\"\n\n\ndef test_get_git_dir(tmp_dir, erepo_dir):\n src = \"some_directory\"\n dst = \"some_directory_imported\"\n\n erepo_dir.scm_gen({src: {\"file.txt\": \"hello\"}}, commit=\"add a regular dir\")\n\n Repo.get(fspath(erepo_dir), src, dst)\n\n assert (tmp_dir / dst).is_dir()\n trees_equal(fspath(erepo_dir / src), fspath(tmp_dir / dst))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_cache_type_is_properly_overridden_test_cache_type_is_properly_overridden.assert_tmp_dir_file_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_cache_type_is_properly_overridden_test_cache_type_is_properly_overridden.assert_tmp_dir_file_i", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 75, "span_ids": ["test_cache_type_is_properly_overridden"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_cache_type_is_properly_overridden(tmp_dir, erepo_dir):\n with erepo_dir.chdir():\n with erepo_dir.dvc.config.edit() as conf:\n conf[\"cache\"][\"type\"] = \"symlink\"\n erepo_dir.dvc.cache = Cache(erepo_dir.dvc)\n erepo_dir.scm_add(\n [erepo_dir.dvc.config.files[\"repo\"]], \"set cache type to symlinks\"\n )\n erepo_dir.dvc_gen(\"file\", \"contents\", \"create file\")\n assert System.is_symlink(erepo_dir / \"file\")\n\n Repo.get(fspath(erepo_dir), \"file\", \"file_imported\")\n\n assert not System.is_symlink(\"file_imported\")\n assert (tmp_dir / \"file_imported\").read_text() == \"contents\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_repo_rev_test_get_a_dvc_file.with_pytest_raises_GetDVC.Repo_get_fspath_erepo_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_repo_rev_test_get_a_dvc_file.with_pytest_raises_GetDVC.Repo_get_fspath_erepo_dir", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 78, "end_line": 95, "span_ids": ["test_get_from_non_dvc_repo", "test_get_repo_rev", "test_get_a_dvc_file"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_repo_rev(tmp_dir, erepo_dir):\n with erepo_dir.chdir(), erepo_dir.branch(\"branch\", new=True):\n erepo_dir.dvc_gen(\"file\", \"contents\", commit=\"create file on branch\")\n\n Repo.get(fspath(erepo_dir), \"file\", \"file_imported\", rev=\"branch\")\n assert (tmp_dir / \"file_imported\").read_text() == \"contents\"\n\n\ndef test_get_from_non_dvc_repo(tmp_dir, git_dir):\n git_dir.scm_gen({\"some_file\": \"contents\"}, commit=\"create file\")\n\n Repo.get(fspath(git_dir), \"some_file\", \"file_imported\")\n assert (tmp_dir / \"file_imported\").read_text() == \"contents\"\n\n\ndef test_get_a_dvc_file(tmp_dir, erepo_dir):\n with pytest.raises(GetDVCFileError):\n Repo.get(fspath(erepo_dir), \"some_file.dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py__https_github_com_iter_test_get_full_dvc_path.assert_tmp_dir_ext_da": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py__https_github_com_iter_test_get_full_dvc_path.assert_tmp_dir_ext_da", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 108, "span_ids": ["test_get_full_dvc_path", "test_get_a_dvc_file"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# https://github.com/iterative/dvc/pull/2837#discussion_r352123053\ndef test_get_full_dvc_path(tmp_dir, erepo_dir, tmp_path_factory):\n path = tmp_path_factory.mktemp(\"ext\")\n external_data = path / \"ext_data\"\n external_data.write_text(\"ext_data\")\n\n with erepo_dir.chdir():\n erepo_dir.dvc_add(fspath(external_data), commit=\"add external data\")\n\n Repo.get(fspath(erepo_dir), fspath(external_data), \"ext_data_imported\")\n assert (tmp_dir / \"ext_data_imported\").read_text() == \"ext_data\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_non_cached_output_test_non_cached_output.assert_tmp_dir_dst_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_non_cached_output_test_non_cached_output.assert_tmp_dir_dst_re", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 111, "end_line": 125, "span_ids": ["test_non_cached_output"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_non_cached_output(tmp_dir, erepo_dir):\n src = \"non_cached_file\"\n dst = src + \"_imported\"\n\n with erepo_dir.chdir():\n erepo_dir.dvc.run(\n outs_no_cache=[src], cmd=\"echo hello > non_cached_file\"\n )\n erepo_dir.scm_add([src, src + \".dvc\"], commit=\"add non-cached output\")\n\n Repo.get(fspath(erepo_dir), src, dst)\n\n assert (tmp_dir / dst).is_file()\n # NOTE: using strip() to account for `echo` differences on win and *nix\n assert (tmp_dir / dst).read_text().strip() == \"hello\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_None_1_test_unknown_path.with_pytest_raises_PathMi.Repo_get_fspath_erepo_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_None_1_test_unknown_path.with_pytest_raises_PathMi.Repo_get_fspath_erepo_dir", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 128, "end_line": 141, "span_ids": ["test_unknown_path", "test_non_cached_output", "test_absolute_file_outside_repo", "test_absolute_file_outside_git_repo"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# https://github.com/iterative/dvc/pull/2837#discussion_r352123053\ndef test_absolute_file_outside_repo(tmp_dir, erepo_dir):\n with pytest.raises(PathMissingError):\n Repo.get(fspath(erepo_dir), \"/root/\")\n\n\ndef test_absolute_file_outside_git_repo(tmp_dir, git_dir):\n with pytest.raises(PathMissingError):\n Repo.get(fspath(git_dir), \"/root/\")\n\n\ndef test_unknown_path(tmp_dir, erepo_dir):\n with pytest.raises(PathMissingError):\n Repo.get(fspath(erepo_dir), \"a_non_existing_file\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_to_dir_test_get_to_dir.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_to_dir_test_get_to_dir.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 154, "span_ids": ["test_get_to_dir"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"dname\", [\".\", \"dir\", \"dir/subdir\"])\ndef test_get_to_dir(tmp_dir, erepo_dir, dname):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"file\", \"contents\", commit=\"create file\")\n\n makedirs(dname, exist_ok=True)\n\n Repo.get(fspath(erepo_dir), \"file\", dname)\n\n assert (tmp_dir / dname).is_dir()\n assert (tmp_dir / dname / \"file\").read_text() == \"contents\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_from_non_dvc_master_test_get_from_non_dvc_master.assert_tmp_dir_some_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_from_non_dvc_master_test_get_from_non_dvc_master.assert_tmp_dir_some_d", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 157, "end_line": 168, "span_ids": ["test_get_from_non_dvc_master"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_from_non_dvc_master(tmp_dir, git_dir, caplog):\n with git_dir.chdir(), git_dir.branch(\"branch\", new=True):\n git_dir.init(dvc=True)\n git_dir.dvc_gen(\"some_file\", \"some text\", commit=\"create some file\")\n\n caplog.clear()\n\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n Repo.get(fspath(git_dir), \"some_file\", out=\"some_dst\", rev=\"branch\")\n\n assert caplog.text == \"\"\n assert (tmp_dir / \"some_dst\").read_text() == \"some text\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_file_from_dir_test_get_file_from_dir.assert_tmp_dir_X_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_file_from_dir_test_get_file_from_dir.assert_tmp_dir_X_re", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 171, "end_line": 195, "span_ids": ["test_get_file_from_dir"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_file_from_dir(tmp_dir, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\n {\n \"dir\": {\n \"1\": \"1\",\n \"2\": \"2\",\n \"subdir\": {\"foo\": \"foo\", \"bar\": \"bar\"},\n }\n },\n commit=\"create dir\",\n )\n\n Repo.get(fspath(erepo_dir), os.path.join(\"dir\", \"1\"))\n assert (tmp_dir / \"1\").read_text() == \"1\"\n\n Repo.get(fspath(erepo_dir), os.path.join(\"dir\", \"2\"), out=\"file\")\n assert (tmp_dir / \"file\").read_text() == \"2\"\n\n Repo.get(fspath(erepo_dir), os.path.join(\"dir\", \"subdir\"))\n assert (tmp_dir / \"subdir\" / \"foo\").read_text() == \"foo\"\n assert (tmp_dir / \"subdir\" / \"bar\").read_text() == \"bar\"\n\n Repo.get(fspath(erepo_dir), os.path.join(\"dir\", \"subdir\", \"foo\"), out=\"X\")\n assert (tmp_dir / \"X\").read_text() == \"foo\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_url_positive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_url_positive_", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 198, "end_line": 223, "span_ids": ["test_get_url_not_existing", "test_get_url_positive", "test_get_url_git_only_repo"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_url_positive(tmp_dir, erepo_dir, caplog):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"foo\")\n\n caplog.clear()\n with caplog.at_level(logging.ERROR, logger=\"dvc\"):\n assert main([\"get\", fspath(erepo_dir), \"foo\", \"--show-url\"]) == 0\n assert caplog.text == \"\"\n\n\ndef test_get_url_not_existing(tmp_dir, erepo_dir, caplog):\n with caplog.at_level(logging.ERROR, logger=\"dvc\"):\n assert (\n main([\"get\", fspath(erepo_dir), \"not-existing-file\", \"--show-url\"])\n == 1\n )\n assert \"failed to show URL\" in caplog.text\n\n\ndef test_get_url_git_only_repo(tmp_dir, scm, caplog):\n tmp_dir.scm_gen({\"foo\": \"foo\"}, commit=\"initial\")\n\n with caplog.at_level(logging.ERROR):\n assert main([\"get\", fspath(tmp_dir), \"foo\", \"--show-url\"]) == 1\n assert \"failed to show URL\" in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get_url.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get_url.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/func/test_get_url.py", "file_name": "test_get_url.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "test_get_file", "test_get_url_to_dir"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.repo import Repo\n\n\ndef test_get_file(tmp_dir):\n tmp_dir.gen({\"foo\": \"foo contents\"})\n\n Repo.get_url(\"foo\", \"foo_imported\")\n\n assert (tmp_dir / \"foo_imported\").is_file()\n assert (tmp_dir / \"foo_imported\").read_text() == \"foo contents\"\n\n\n@pytest.mark.parametrize(\"dname\", [\".\", \"dir\", \"dir/subdir\"])\ndef test_get_url_to_dir(tmp_dir, dname):\n tmp_dir.gen({\"foo\": \"foo contents\", \"dir\": {\"subdir\": {}}})\n\n Repo.get_url(\"foo\", dname)\n\n assert (tmp_dir / dname).is_dir()\n assert (tmp_dir / dname / \"foo\").read_text() == \"foo contents\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py__encoding_utf_8_test_ignore_unicode.assert__files_set_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py__encoding_utf_8_test_ignore_unicode.assert__files_set_dir_", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["test_ignore_unicode", "test_ignore", "docstring"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# encoding: utf-8\nimport os\nimport shutil\nimport pytest\n\nfrom dvc.exceptions import DvcIgnoreInCollectedDirError\nfrom dvc.ignore import (\n DvcIgnore,\n DvcIgnoreDirs,\n DvcIgnorePatterns,\n DvcIgnoreRepo,\n)\nfrom dvc.scm.tree import WorkingTree\nfrom dvc.utils import relpath\nfrom dvc.compat import fspath_py35, fspath\nfrom dvc.utils.fs import get_mtime_and_size\nfrom dvc.remote import RemoteLOCAL\n\nfrom tests.dir_helpers import TmpDir\nfrom tests.utils import to_posixpath\n\n\ndef test_ignore(tmp_dir, dvc, monkeypatch):\n tmp_dir.gen({\"dir\": {\"ignored\": \"text\", \"other\": \"text2\"}})\n tmp_dir.gen(DvcIgnore.DVCIGNORE_FILE, \"dir/ignored\")\n\n assert _files_set(\"dir\", dvc.tree) == {\"dir/other\"}\n\n monkeypatch.chdir(\"dir\")\n assert _files_set(\".\", dvc.tree) == {\"./other\"}\n\n\ndef test_ignore_unicode(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"other\": \"text\", \"\u0442\u0435\u0441\u0442\": \"\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\"}})\n tmp_dir.gen(DvcIgnore.DVCIGNORE_FILE, \"dir/\u0442\u0435\u0441\u0442\")\n\n assert _files_set(\"dir\", dvc.tree) == {\"dir/other\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_rename_ignored_file_test_rename_ignored_file.assert_new_mtime_mtime": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_rename_ignored_file_test_rename_ignored_file.assert_new_mtime_mtime", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 49, "span_ids": ["test_rename_ignored_file"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_ignored_file(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"ignored\": \"...\", \"other\": \"text\"}})\n\n tmp_dir.gen(DvcIgnore.DVCIGNORE_FILE, \"ignored*\")\n mtime, size = get_mtime_and_size(\"dir\", dvc.tree)\n\n shutil.move(\"dir/ignored\", \"dir/ignored_new\")\n new_mtime, new_size = get_mtime_and_size(\"dir\", dvc.tree)\n\n assert new_mtime == mtime and new_size == size", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_rename_file_test_dvcignore_in_out_dir.with_pytest_raises_DvcIgn.dvc_add_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_rename_file_test_dvcignore_in_out_dir.with_pytest_raises_DvcIgn.dvc_add_dir_", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 88, "span_ids": ["test_remove_ignored_file", "test_dvcignore_in_out_dir", "test_remove_file", "test_rename_file"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rename_file(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n mtime, size = get_mtime_and_size(\"dir\", dvc.tree)\n\n shutil.move(\"dir/foo\", \"dir/foo_new\")\n new_mtime, new_size = get_mtime_and_size(\"dir\", dvc.tree)\n\n assert new_mtime != mtime and new_size == size\n\n\ndef test_remove_ignored_file(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"ignored\": \"...\", \"other\": \"text\"}})\n tmp_dir.gen(DvcIgnore.DVCIGNORE_FILE, \"dir/ignored\")\n\n mtime, size = get_mtime_and_size(\"dir\", dvc.tree)\n\n os.remove(\"dir/ignored\")\n new_mtime, new_size = get_mtime_and_size(\"dir\", dvc.tree)\n\n assert new_mtime == mtime and new_size == size\n\n\ndef test_remove_file(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n mtime, size = get_mtime_and_size(\"dir\", dvc.tree)\n\n os.remove(\"dir/foo\")\n new_mtime, new_size = get_mtime_and_size(\"dir\", dvc.tree)\n\n assert new_mtime != mtime and new_size != size\n\n\ndef test_dvcignore_in_out_dir(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\", DvcIgnore.DVCIGNORE_FILE: \"\"}})\n\n with pytest.raises(DvcIgnoreInCollectedDirError):\n dvc.add(\"dir\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_collecting_dvcignores_test_ignore_collecting_dvcignores.assert_any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_collecting_dvcignores_test_ignore_collecting_dvcignores.assert_any_", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 109, "span_ids": ["test_ignore_collecting_dvcignores"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"dname\", [\"dir\", \"dir/subdir\"])\ndef test_ignore_collecting_dvcignores(tmp_dir, dvc, dname):\n tmp_dir.gen({\"dir\": {\"subdir\": {}}})\n\n top_ignore_file = (tmp_dir / dname).with_name(DvcIgnore.DVCIGNORE_FILE)\n top_ignore_file.write_text(os.path.basename(dname))\n\n ignore_file = tmp_dir / dname / DvcIgnore.DVCIGNORE_FILE\n ignore_file.write_text(\"foo\")\n\n assert len(dvc.tree.dvcignore.ignores) == 3\n assert DvcIgnoreDirs([\".git\", \".hg\", \".dvc\"]) in dvc.tree.dvcignore.ignores\n assert (\n DvcIgnorePatterns(fspath(top_ignore_file), WorkingTree(dvc.root_dir))\n in dvc.tree.dvcignore.ignores\n )\n assert any(\n i for i in dvc.tree.dvcignore.ignores if isinstance(i, DvcIgnoreRepo)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_on_branch_test_ignore_on_branch.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_on_branch_test_ignore_on_branch.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 112, "end_line": 124, "span_ids": ["test_ignore_on_branch"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ignore_on_branch(tmp_dir, scm, dvc):\n tmp_dir.scm_gen({\"foo\": \"foo\", \"bar\": \"bar\"}, commit=\"add files\")\n\n with tmp_dir.branch(\"branch\", new=True):\n tmp_dir.scm_gen(DvcIgnore.DVCIGNORE_FILE, \"foo\", commit=\"add ignore\")\n\n assert _files_set(\".\", dvc.tree) == {\"./foo\", \"./bar\"}\n\n dvc.tree = scm.get_tree(\"branch\")\n assert _files_set(\".\", dvc.tree) == {\n to_posixpath(os.path.join(dvc.root_dir, DvcIgnore.DVCIGNORE_FILE)),\n to_posixpath(os.path.join(dvc.root_dir, \"bar\")),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py__files_set_test_match_nested.assert_result_dvcig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py__files_set_test_match_nested.assert_result_dvcig", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 127, "end_line": 143, "span_ids": ["_files_set", "test_match_nested"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _files_set(root, tree):\n return {to_posixpath(f) for f in tree.walk_files(root)}\n\n\ndef test_match_nested(tmp_dir, dvc):\n tmp_dir.gen(\n {\n \".dvcignore\": \"*.backup\\ntmp\",\n \"foo\": \"foo\",\n \"tmp\": \"...\",\n \"dir\": {\"x.backup\": \"x backup\", \"tmp\": \"content\"},\n }\n )\n\n remote = RemoteLOCAL(dvc, {})\n result = {fspath(f) for f in remote.walk_files(\".\")}\n assert result == {\".dvcignore\", \"foo\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_external_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_external_", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 146, "end_line": 154, "span_ids": ["test_ignore_external"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ignore_external(tmp_dir, scm, dvc, tmp_path_factory):\n tmp_dir.gen(\".dvcignore\", \"*.backup\\ntmp\")\n ext_dir = TmpDir(fspath_py35(tmp_path_factory.mktemp(\"external_dir\")))\n ext_dir.gen({\"y.backup\": \"y\", \"tmp\": \"ext tmp\"})\n\n remote = RemoteLOCAL(dvc, {})\n result = {relpath(f, ext_dir) for f in remote.walk_files(ext_dir)}\n assert result == {\"y.backup\", \"tmp\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_filecmp_test_import.assert_stage_deps_0_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_filecmp_test_import.assert_stage_deps_0_def_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports", "test_import"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import filecmp\nimport os\nfrom dvc.compat import fspath\n\nimport pytest\nfrom mock import patch\n\nfrom dvc.cache import Cache\nfrom dvc.exceptions import DownloadError, PathMissingError\nfrom dvc.config import NoRemoteError\nfrom dvc.dvcfile import Dvcfile\nfrom dvc.system import System\nfrom dvc.utils.fs import makedirs, remove\nimport dvc.data_cloud as cloud\nfrom tests.utils import trees_equal\n\n\ndef test_import(tmp_dir, scm, dvc, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"foo content\", commit=\"create foo\")\n\n stage = dvc.imp(fspath(erepo_dir), \"foo\", \"foo_imported\")\n\n assert os.path.isfile(\"foo_imported\")\n assert (tmp_dir / \"foo_imported\").read_text() == \"foo content\"\n assert scm.repo.git.check_ignore(\"foo_imported\")\n assert stage.deps[0].def_repo == {\n \"url\": fspath(erepo_dir),\n \"rev_lock\": erepo_dir.scm.get_rev(),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_git_file_test_import_git_file.assert_stage_deps_0_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_git_file_test_import_git_file.assert_stage_deps_0_def_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 47, "span_ids": ["test_import_git_file"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"src_is_dvc\", [True, False])\ndef test_import_git_file(tmp_dir, scm, dvc, git_dir, src_is_dvc):\n if src_is_dvc:\n git_dir.init(dvc=True)\n\n git_dir.scm_gen(\"src\", \"hello\", commit=\"add a git file\")\n\n stage = tmp_dir.dvc.imp(fspath(git_dir), \"src\", \"dst\")\n\n assert (tmp_dir / \"dst\").read_text() == \"hello\"\n assert tmp_dir.scm.repo.git.check_ignore(fspath(tmp_dir / \"dst\"))\n assert stage.deps[0].def_repo == {\n \"url\": fspath(git_dir),\n \"rev_lock\": git_dir.scm.get_rev(),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_cached_file_test_import_cached_file.assert_filecmp_cmp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_cached_file_test_import_cached_file.assert_filecmp_cmp_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 50, "end_line": 67, "span_ids": ["test_import_cached_file"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_import_cached_file(erepo_dir, tmp_dir, dvc, scm, monkeypatch):\n src = \"some_file\"\n dst = \"some_file_imported\"\n\n with erepo_dir.chdir():\n erepo_dir.dvc_gen({src: \"hello\"}, commit=\"add a regular file\")\n\n tmp_dir.dvc_gen({dst: \"hello\"})\n (tmp_dir / dst).unlink()\n\n remote_exception = NoRemoteError(\"dvc import\")\n with patch.object(cloud.DataCloud, \"pull\", side_effect=remote_exception):\n tmp_dir.dvc.imp(fspath(erepo_dir), src, dst)\n\n assert (tmp_dir / dst).is_file()\n assert filecmp.cmp(\n fspath(erepo_dir / src), fspath(tmp_dir / dst), shallow=False\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_git_dir_test_import_git_dir.assert_stage_deps_0_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_git_dir_test_import_git_dir.assert_stage_deps_0_def_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 85, "span_ids": ["test_import_git_dir"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"src_is_dvc\", [True, False])\ndef test_import_git_dir(tmp_dir, scm, dvc, git_dir, src_is_dvc):\n if src_is_dvc:\n git_dir.init(dvc=True)\n\n git_dir.scm_gen({\"src\": {\"file.txt\": \"hello\"}}, commit=\"add a dir\")\n\n stage = dvc.imp(fspath(git_dir), \"src\", \"dst\")\n\n assert (tmp_dir / \"dst\").is_dir()\n trees_equal(fspath(git_dir / \"src\"), fspath(tmp_dir / \"dst\"))\n assert tmp_dir.scm.repo.git.check_ignore(fspath(tmp_dir / \"dst\"))\n assert stage.deps[0].def_repo == {\n \"url\": fspath(git_dir),\n \"rev_lock\": git_dir.scm.get_rev(),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_dir_test_import_dir.assert_stage_deps_0_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_dir_test_import_dir.assert_stage_deps_0_def_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 100, "span_ids": ["test_import_dir"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_import_dir(tmp_dir, scm, dvc, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen({\"dir\": {\"foo\": \"foo content\"}}, commit=\"create dir\")\n\n stage = dvc.imp(fspath(erepo_dir), \"dir\", \"dir_imported\")\n\n assert os.path.isdir(\"dir_imported\")\n trees_equal(fspath(erepo_dir / \"dir\"), \"dir_imported\")\n assert scm.repo.git.check_ignore(\"dir_imported\")\n assert stage.deps[0].def_repo == {\n \"url\": fspath(erepo_dir),\n \"rev_lock\": erepo_dir.scm.get_rev(),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_file_from_dir_test_import_file_from_dir.assert_tmp_dir_X_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_file_from_dir_test_import_file_from_dir.assert_tmp_dir_X_dvc_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 136, "span_ids": ["test_import_file_from_dir"], "tokens": 356}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_import_file_from_dir(tmp_dir, scm, dvc, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\n {\n \"dir\": {\n \"1\": \"1\",\n \"2\": \"2\",\n \"subdir\": {\"foo\": \"foo\", \"bar\": \"bar\"},\n }\n },\n commit=\"create dir\",\n )\n\n stage = dvc.imp(fspath(erepo_dir), os.path.join(\"dir\", \"1\"))\n\n assert (tmp_dir / \"1\").read_text() == \"1\"\n assert scm.repo.git.check_ignore(\"1\")\n assert stage.deps[0].def_repo == {\n \"url\": fspath(erepo_dir),\n \"rev_lock\": erepo_dir.scm.get_rev(),\n }\n\n dvc.imp(fspath(erepo_dir), os.path.join(\"dir\", \"2\"), out=\"file\")\n assert (tmp_dir / \"file\").read_text() == \"2\"\n assert (tmp_dir / \"file.dvc\").exists()\n\n dvc.imp(fspath(erepo_dir), os.path.join(\"dir\", \"subdir\"))\n assert (tmp_dir / \"subdir\" / \"foo\").read_text() == \"foo\"\n assert (tmp_dir / \"subdir\" / \"bar\").read_text() == \"bar\"\n assert (tmp_dir / \"subdir.dvc\").exists()\n\n dvc.imp(fspath(erepo_dir), os.path.join(\"dir\", \"subdir\", \"foo\"), out=\"X\")\n assert (tmp_dir / \"X\").read_text() == \"foo\"\n assert (tmp_dir / \"X.dvc\").exists()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_non_cached_test_import_non_cached.assert_stage_deps_0_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_non_cached_test_import_non_cached.assert_stage_deps_0_def_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 139, "end_line": 160, "span_ids": ["test_import_non_cached"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_import_non_cached(erepo_dir, tmp_dir, dvc, scm):\n src = \"non_cached_output\"\n dst = src + \"_imported\"\n\n with erepo_dir.chdir():\n erepo_dir.dvc.run(\n cmd=\"echo hello > {}\".format(src), outs_no_cache=[src],\n )\n\n erepo_dir.scm_add([fspath(erepo_dir / src)], commit=\"add a non-cached out\")\n\n stage = tmp_dir.dvc.imp(fspath(erepo_dir), src, dst)\n\n assert (tmp_dir / dst).is_file()\n assert filecmp.cmp(\n fspath(erepo_dir / src), fspath(tmp_dir / dst), shallow=False\n )\n assert tmp_dir.scm.repo.git.check_ignore(dst)\n assert stage.deps[0].def_repo == {\n \"url\": fspath(erepo_dir),\n \"rev_lock\": erepo_dir.scm.get_rev(),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_rev_test_import_rev.assert_stage_deps_0_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_rev_test_import_rev.assert_stage_deps_0_def_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 164, "end_line": 178, "span_ids": ["test_import_rev"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_import_rev(tmp_dir, scm, dvc, erepo_dir):\n rev = None\n with erepo_dir.chdir(), erepo_dir.branch(\"branch\", new=True):\n erepo_dir.dvc_gen(\"foo\", \"foo content\", commit=\"create foo on branch\")\n rev = erepo_dir.scm.get_rev()\n\n stage = dvc.imp(fspath(erepo_dir), \"foo\", \"foo_imported\", rev=\"branch\")\n\n assert (tmp_dir / \"foo_imported\").read_text() == \"foo content\"\n assert scm.repo.git.check_ignore(\"foo_imported\")\n assert stage.deps[0].def_repo == {\n \"url\": fspath(erepo_dir),\n \"rev\": \"branch\",\n \"rev_lock\": rev,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_imported_stage_test_pull_imported_stage.assert_os_path_isfile_dst": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_imported_stage_test_pull_imported_stage.assert_os_path_isfile_dst", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 180, "end_line": 193, "span_ids": ["test_pull_imported_stage"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pull_imported_stage(tmp_dir, dvc, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"foo content\", commit=\"create foo\")\n dvc.imp(fspath(erepo_dir), \"foo\", \"foo_imported\")\n\n dst_stage = Dvcfile(dvc, \"foo_imported.dvc\").stage\n dst_cache = dst_stage.outs[0].cache_path\n\n remove(\"foo_imported\")\n remove(dst_cache)\n dvc.pull([\"foo_imported.dvc\"])\n\n assert os.path.isfile(\"foo_imported\")\n assert os.path.isfile(dst_cache)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_cache_type_is_properly_overridden_test_cache_type_is_properly_overridden.assert_scm_repo_git_check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_cache_type_is_properly_overridden_test_cache_type_is_properly_overridden.assert_scm_repo_git_check", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 197, "end_line": 213, "span_ids": ["test_cache_type_is_properly_overridden"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_cache_type_is_properly_overridden(tmp_dir, scm, dvc, erepo_dir):\n with erepo_dir.chdir():\n with erepo_dir.dvc.config.edit() as conf:\n conf[\"cache\"][\"type\"] = \"symlink\"\n erepo_dir.dvc.cache = Cache(erepo_dir.dvc)\n erepo_dir.scm_add(\n [erepo_dir.dvc.config.files[\"repo\"]],\n \"set source repo cache type to symlink\",\n )\n erepo_dir.dvc_gen(\"foo\", \"foo content\", \"create foo\")\n assert System.is_symlink(erepo_dir / \"foo\")\n\n dvc.imp(fspath(erepo_dir), \"foo\", \"foo_imported\")\n\n assert not System.is_symlink(\"foo_imported\")\n assert (tmp_dir / \"foo_imported\").read_text() == \"foo content\"\n assert scm.repo.git.check_ignore(\"foo_imported\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_imported_directory_stage_test_pull_imported_directory_stage.trees_equal_fspath_erepo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_imported_directory_stage_test_pull_imported_directory_stage.trees_equal_fspath_erepo_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 216, "end_line": 228, "span_ids": ["test_pull_imported_directory_stage"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pull_imported_directory_stage(tmp_dir, dvc, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen({\"dir\": {\"foo\": \"foo content\"}}, commit=\"create dir\")\n\n dvc.imp(fspath(erepo_dir), \"dir\", \"dir_imported\")\n\n remove(\"dir_imported\")\n remove(dvc.cache.local.cache_dir)\n\n dvc.pull([\"dir_imported.dvc\"])\n\n assert os.path.isdir(\"dir_imported\")\n trees_equal(fspath(erepo_dir / \"dir\"), \"dir_imported\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_download_error_pulling_imported_stage_test_download_error_pulling_imported_stage.with_patch_.dvc_pull_foo_imported_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_download_error_pulling_imported_stage_test_download_error_pulling_imported_stage.with_patch_.dvc_pull_foo_imported_d", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 244, "span_ids": ["test_download_error_pulling_imported_stage"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_download_error_pulling_imported_stage(tmp_dir, dvc, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"foo content\", commit=\"create foo\")\n dvc.imp(fspath(erepo_dir), \"foo\", \"foo_imported\")\n\n dst_stage = Dvcfile(dvc, \"foo_imported.dvc\").stage\n dst_cache = dst_stage.outs[0].cache_path\n\n remove(\"foo_imported\")\n remove(dst_cache)\n\n with patch(\n \"dvc.remote.RemoteLOCAL._download\", side_effect=Exception\n ), pytest.raises(DownloadError):\n dvc.pull([\"foo_imported.dvc\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_to_dir_test_import_to_dir.assert_tmp_dir_dst_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_to_dir_test_import_to_dir.assert_tmp_dir_dst_re", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 248, "end_line": 261, "span_ids": ["test_import_to_dir"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"dname\", [\".\", \"dir\", \"dir/subdir\"])\ndef test_import_to_dir(dname, tmp_dir, dvc, erepo_dir):\n makedirs(dname, exist_ok=True)\n\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"foo content\", commit=\"create foo\")\n\n stage = dvc.imp(fspath(erepo_dir), \"foo\", dname)\n\n dst = os.path.join(dname, \"foo\")\n\n assert stage.outs[0].fspath == os.path.abspath(dst)\n assert os.path.isdir(dname)\n assert (tmp_dir / dst).read_text() == \"foo content\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_non_workspace_test_pull_non_workspace.assert_os_path_exists_sta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_pull_non_workspace_test_pull_non_workspace.assert_os_path_exists_sta", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 264, "end_line": 280, "span_ids": ["test_pull_non_workspace"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pull_non_workspace(tmp_dir, scm, dvc, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"master content\", commit=\"create foo\")\n\n with erepo_dir.branch(\"branch\", new=True):\n erepo_dir.dvc_gen(\"foo\", \"branch content\", commit=\"modify foo\")\n\n stage = dvc.imp(fspath(erepo_dir), \"foo\", \"foo_imported\", rev=\"branch\")\n tmp_dir.scm_add([stage.relpath], commit=\"imported branch\")\n scm.tag(\"ref-to-branch\")\n\n # Overwrite via import\n dvc.imp(fspath(erepo_dir), \"foo\", \"foo_imported\", rev=\"master\")\n\n remove(stage.outs[0].cache_path)\n dvc.fetch(all_tags=True)\n assert os.path.exists(stage.outs[0].cache_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_non_existing_test_pull_no_rev_lock.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_non_existing_test_pull_no_rev_lock.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 282, "end_line": 307, "span_ids": ["test_import_non_existing", "test_pull_no_rev_lock"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_import_non_existing(erepo_dir, tmp_dir, dvc):\n with pytest.raises(PathMissingError):\n tmp_dir.dvc.imp(fspath(erepo_dir), \"invalid_output\")\n\n # https://github.com/iterative/dvc/pull/2837#discussion_r352123053\n with pytest.raises(PathMissingError):\n tmp_dir.dvc.imp(fspath(erepo_dir), \"/root/\", \"root\")\n\n\ndef test_pull_no_rev_lock(erepo_dir, tmp_dir, dvc):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"contents\", commit=\"create foo\")\n\n stage = dvc.imp(fspath(erepo_dir), \"foo\", \"foo_imported\")\n assert \"rev\" not in stage.deps[0].def_repo\n stage.deps[0].def_repo.pop(\"rev_lock\")\n\n Dvcfile(dvc, stage.path).dump(stage)\n\n remove(stage.outs[0].cache_path)\n (tmp_dir / \"foo_imported\").unlink()\n\n dvc.pull([stage.path])\n\n assert (tmp_dir / \"foo_imported\").is_file()\n assert (tmp_dir / \"foo_imported\").read_text() == \"contents\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_from_bare_git_repo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_from_bare_git_repo_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 310, "end_line": 325, "span_ids": ["test_import_from_bare_git_repo"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_import_from_bare_git_repo(tmp_dir, make_tmp_dir, erepo_dir):\n import git\n\n git.Repo.init(fspath(tmp_dir), bare=True)\n\n with erepo_dir.chdir():\n erepo_dir.dvc_gen({\"foo\": \"foo\"}, commit=\"initial\")\n erepo_dir.dvc.push()\n\n erepo_dir.scm.repo.create_remote(\"origin\", fspath(tmp_dir))\n erepo_dir.scm.repo.remote(\"origin\").push(\"master\")\n\n dvc_repo = make_tmp_dir(\"dvc-repo\", scm=True, dvc=True)\n with dvc_repo.chdir():\n dvc_repo.dvc.imp(fspath(tmp_dir), \"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_os_test_should_remove_outs_before_import.assert_remove_outs_call_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_os_test_should_remove_outs_before_import.assert_remove_outs_call_c", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 50, "span_ids": ["TestDefaultOutput.test", "TestCmdImport.test", "imports", "TestDefaultOutput", "TestCmdImport", "TestCmdImport.test_unsupported", "test_should_remove_outs_before_import"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom uuid import uuid4\n\nimport pytest\n\nfrom dvc.stage import Stage\nfrom dvc.main import main\nfrom dvc.utils.fs import makedirs\nfrom dvc.compat import fspath\nfrom tests.basic_env import TestDvc\n\n\nclass TestCmdImport(TestDvc):\n def test(self):\n ret = main([\"import-url\", self.FOO, \"import\"])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(\"import.dvc\"))\n\n ret = main([\"import-url\", \"non-existing-file\", \"import\"])\n self.assertNotEqual(ret, 0)\n\n def test_unsupported(self):\n ret = main([\"import-url\", \"unsupported://path\", \"import_unsupported\"])\n self.assertNotEqual(ret, 0)\n\n\nclass TestDefaultOutput(TestDvc):\n def test(self):\n tmpdir = self.mkdtemp()\n filename = str(uuid4())\n tmpfile = os.path.join(tmpdir, filename)\n\n with open(tmpfile, \"w\") as fd:\n fd.write(\"content\")\n\n ret = main([\"import-url\", tmpfile])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(filename))\n with open(filename) as fd:\n self.assertEqual(fd.read(), \"content\")\n\n\ndef test_should_remove_outs_before_import(tmp_dir, dvc, mocker, erepo_dir):\n erepo_dir.gen({\"foo\": \"foo\"})\n\n remove_outs_call_counter = mocker.spy(Stage, \"remove_outs\")\n ret = main([\"import-url\", fspath(erepo_dir / \"foo\")])\n\n assert ret == 0\n assert remove_outs_call_counter.mock.call_count == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestImportFilename_TestImportFilename.test.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestImportFilename_TestImportFilename.test.None_8", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 78, "span_ids": ["TestImportFilename.setUp", "TestImportFilename.test", "TestImportFilename"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestImportFilename(TestDvc):\n def setUp(self):\n super().setUp()\n tmp_dir = self.mkdtemp()\n self.external_source = os.path.join(tmp_dir, \"file\")\n with open(self.external_source, \"w\") as fobj:\n fobj.write(\"content\")\n\n def test(self):\n ret = main([\"import-url\", \"-f\", \"bar.dvc\", self.external_source])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n\n os.remove(\"bar.dvc\")\n\n ret = main([\"import-url\", \"--file\", \"bar.dvc\", self.external_source])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n\n os.remove(\"bar.dvc\")\n os.mkdir(\"sub\")\n\n path = os.path.join(\"sub\", \"bar.dvc\")\n ret = main([\"import-url\", \"--file\", path, self.external_source])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_url_to_dir_test_import_url_to_dir.assert_dst_read_text_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_url_to_dir_test_import_url_to_dir.assert_dst_read_text_", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 94, "span_ids": ["test_import_url_to_dir"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"dname\", [\".\", \"dir\", \"dir/subdir\"])\ndef test_import_url_to_dir(dname, tmp_dir, dvc):\n tmp_dir.gen({\"data_dir\": {\"file\": \"file content\"}})\n src = os.path.join(\"data_dir\", \"file\")\n\n makedirs(dname, exist_ok=True)\n\n stage = dvc.imp_url(src, dname)\n\n dst = tmp_dir / dname / \"file\"\n\n assert stage.outs[0].path_info == dst\n assert os.path.isdir(dname)\n assert dst.read_text() == \"file content\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_stage_accompanies_target_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_stage_accompanies_target_", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 97, "end_line": 107, "span_ids": ["test_import_stage_accompanies_target"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_import_stage_accompanies_target(tmp_dir, dvc, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"file1\", \"file1 content\", commit=\"commit file\")\n\n tmp_dir.gen({\"dir\": {}})\n erepo = {\"url\": fspath(erepo_dir)}\n dvc.imp_url(\"file1\", out=os.path.join(\"dir\", \"imported_file\"), erepo=erepo)\n\n assert (tmp_dir / \"dir\" / \"imported_file\").exists()\n assert (tmp_dir / \"dir\" / \"imported_file.dvc\").exists()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_init.py_logging_test_allow_init_dvc_subdir.assert_repo_scm_root_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_init.py_logging_test_allow_init_dvc_subdir.assert_repo_scm_root_dir_", "embedding": null, "metadata": {"file_path": "tests/func/test_init.py", "file_name": "test_init.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 88, "span_ids": ["TestInit", "TestInitNoSCMFail.test_api", "TestDoubleInit", "TestInit._test_init", "imports", "TestInitNoSCMFail", "TestInitNoSCMFail.test_cli", "TestInit.test_api", "test_init_no_scm_api", "TestDoubleInit.test", "test_init_quiet_should_not_display_welcome_screen", "test_allow_init_dvc_subdir", "test_init_no_scm_cli", "TestInit.test_cli"], "tokens": 550}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\n\nfrom dvc.compat import fspath\nfrom dvc.config import Config\nfrom dvc.exceptions import InitError\nfrom dvc.main import main\nfrom dvc.repo import Repo as DvcRepo\nfrom tests.basic_env import TestDir\nfrom tests.basic_env import TestGit\n\n\nclass TestInit(TestGit):\n def _test_init(self):\n self.assertTrue(os.path.exists(DvcRepo.DVC_DIR))\n self.assertTrue(os.path.isdir(DvcRepo.DVC_DIR))\n\n def test_api(self):\n DvcRepo.init()\n\n self._test_init()\n\n def test_cli(self):\n ret = main([\"init\"])\n self.assertEqual(ret, 0)\n\n self._test_init()\n\n\nclass TestDoubleInit(TestInit):\n def test(self):\n ret = main([\"init\"])\n self.assertEqual(ret, 0)\n self._test_init()\n\n ret = main([\"init\"])\n self.assertNotEqual(ret, 0)\n self._test_init()\n\n ret = main([\"init\", \"--force\"])\n self.assertEqual(ret, 0)\n self._test_init()\n\n\nclass TestInitNoSCMFail(TestDir):\n def test_api(self):\n with self.assertRaises(InitError):\n DvcRepo.init()\n\n def test_cli(self):\n ret = main([\"init\"])\n self.assertNotEqual(ret, 0)\n\n\ndef test_init_no_scm_api(tmp_dir):\n repo = DvcRepo.init(no_scm=True)\n\n assert (tmp_dir / DvcRepo.DVC_DIR).is_dir()\n assert repo.config[\"core\"][\"no_scm\"]\n\n\ndef test_init_no_scm_cli(tmp_dir):\n ret = main([\"init\", \"--no-scm\"])\n assert ret == 0\n\n dvc_path = tmp_dir / DvcRepo.DVC_DIR\n assert dvc_path.is_dir()\n assert Config(fspath(dvc_path))[\"core\"][\"no_scm\"]\n\n\ndef test_init_quiet_should_not_display_welcome_screen(tmp_dir, scm, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n ret = main([\"init\", \"--quiet\"])\n\n assert 0 == ret\n assert \"\" == caplog.text\n\n\ndef test_allow_init_dvc_subdir(tmp_dir, scm, monkeypatch):\n tmp_dir.gen({\"subdir\": {}})\n\n with monkeypatch.context() as m:\n m.chdir(\"subdir\")\n assert main([\"init\", \"--subdir\"]) == 0\n\n repo = DvcRepo(\"subdir\")\n assert repo.root_dir == fspath(tmp_dir / \"subdir\")\n assert repo.scm.root_dir == fspath(tmp_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_init.py_test_subdir_init_no_option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_init.py_test_subdir_init_no_option_", "embedding": null, "metadata": {"file_path": "tests/func/test_init.py", "file_name": "test_init.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 105, "span_ids": ["test_subdir_init_no_option"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_subdir_init_no_option(tmp_dir, scm, monkeypatch, caplog):\n tmp_dir.gen({\"subdir\": {}})\n\n caplog.clear()\n with monkeypatch.context() as m:\n m.chdir(\"subdir\")\n with caplog.at_level(logging.ERROR, logger=\"dvc\"):\n assert main([\"init\"]) == 1\n\n assert (\n \"{} is not tracked by any supported SCM tool (e.g. Git). \"\n \"Use `--no-scm` if you don't want to use any SCM or \"\n \"`--subdir` if initializing inside a subdirectory of a parent SCM \"\n \"repository.\".format(fspath(tmp_dir / \"subdir\"))\n ) in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_os_TestInstall.test_post_checkout.assert_os_path_isfile_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_os_TestInstall.test_post_checkout.assert_os_path_isfile_fi", "embedding": null, "metadata": {"file_path": "tests/func/test_install.py", "file_name": "test_install.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["imports", "TestInstall.test_post_checkout", "TestInstall", "TestInstall.test_fail_if_hook_exists", "TestInstall.test_create_hooks", "TestInstall._hook"], "tokens": 292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport pathlib\nimport sys\n\nimport pytest\n\nfrom dvc.exceptions import GitHookAlreadyExistsError\nfrom dvc.utils import file_md5, fspath\n\n\n@pytest.mark.skipif(\n sys.platform == \"win32\", reason=\"Git hooks aren't supported on Windows\"\n)\nclass TestInstall(object):\n def _hook(self, name):\n return pathlib.Path(\".git\") / \"hooks\" / name\n\n def test_create_hooks(self, scm, dvc):\n scm.install()\n\n hooks_with_commands = [\n (\"post-checkout\", \"exec dvc git-hook post-checkout\"),\n (\"pre-commit\", \"exec dvc git-hook pre-commit\"),\n (\"pre-push\", \"exec dvc git-hook pre-push\"),\n ]\n\n for fname, command in hooks_with_commands:\n hook_path = self._hook(fname)\n assert hook_path.is_file()\n assert command in hook_path.read_text()\n\n def test_fail_if_hook_exists(self, scm):\n self._hook(\"post-checkout\").write_text(\"hook content\")\n\n with pytest.raises(GitHookAlreadyExistsError):\n scm.install()\n\n def test_post_checkout(self, tmp_dir, scm, dvc):\n scm.install()\n tmp_dir.dvc_gen({\"file\": \"file content\"}, commit=\"add\")\n\n os.unlink(\"file\")\n scm.checkout(\"new_branch\", create_new=True)\n\n assert os.path.isfile(\"file\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_pre_push_hook_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_pre_push_hook_", "embedding": null, "metadata": {"file_path": "tests/func/test_install.py", "file_name": "test_install.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 71, "span_ids": ["TestInstall.test_pre_push_hook"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n sys.platform == \"win32\", reason=\"Git hooks aren't supported on Windows\"\n)\nclass TestInstall(object):\n\n def test_pre_push_hook(self, tmp_dir, scm, dvc, tmp_path_factory):\n scm.install()\n\n temp = tmp_path_factory.mktemp(\"external\")\n git_remote = temp / \"project.git\"\n storage_path = temp / \"dvc_storage\"\n\n with dvc.config.edit() as conf:\n conf[\"remote\"][\"store\"] = {\"url\": fspath(storage_path)}\n conf[\"core\"][\"remote\"] = \"store\"\n tmp_dir.dvc_gen(\"file\", \"file_content\", \"commit message\")\n\n file_checksum = file_md5(\"file\")[0]\n expected_storage_path = (\n storage_path / file_checksum[:2] / file_checksum[2:]\n )\n\n scm.repo.clone(fspath(git_remote))\n scm.repo.create_remote(\"origin\", fspath(git_remote))\n\n assert not expected_storage_path.is_file()\n scm.repo.git.push(\"origin\", \"master\")\n assert expected_storage_path.is_file()\n assert expected_storage_path.read_text() == \"file_content\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lock.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lock.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_lock.py", "file_name": "test_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 25, "span_ids": ["TestLock.test_cli", "imports", "TestLock.test_with", "TestLock"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.lock import Lock\nfrom dvc.lock import LockError\nfrom dvc.main import main\nfrom tests.basic_env import TestDvc\n\n\nclass TestLock(TestDvc):\n def test_with(self):\n lockfile = os.path.join(self.dvc.dvc_dir, \"lock\")\n lock = Lock(lockfile)\n with lock:\n with self.assertRaises(LockError):\n lock2 = Lock(lockfile)\n with lock2:\n self.assertTrue(False)\n\n def test_cli(self):\n lockfile = os.path.join(self.dvc.dvc_dir, \"lock\")\n lock = Lock(lockfile)\n with lock:\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_os_match_files.assert_left_right": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_os_match_files.assert_left_right", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["imports", "match_files"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport shutil\nimport pytest\n\nfrom dvc.compat import fspath\nfrom dvc.exceptions import PathMissingError\nfrom dvc.scm.base import CloneError\nfrom dvc.repo import Repo\n\nFS_STRUCTURE = {\n \"README.md\": \"content\",\n \"model/script.py\": \"content\",\n \"model/train.py\": \"content\",\n \".gitignore\": \"content\",\n}\n\nDVC_STRUCTURE = {\n \"structure.xml\": \"content\",\n \"data/subcontent/data.xml\": \"content\",\n \"data/subcontent/statistics/data.csv\": \"content\",\n \"model/people.csv\": \"content\",\n}\n\n\ndef match_files(files, expected_files):\n left = {(f[\"path\"], f[\"isout\"]) for f in files}\n right = {(os.path.join(*args), isout) for (args, isout) in expected_files}\n assert left == right", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_create_dvc_pipeline_create_dvc_pipeline.shutil_rmtree_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_create_dvc_pipeline_create_dvc_pipeline.shutil_rmtree_out_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 49, "span_ids": ["create_dvc_pipeline"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_dvc_pipeline(tmp_dir, dvc):\n script = os.linesep.join(\n [\n \"from pathlib import Path\",\n \"Path({}).touch()\".format(os.path.join(\"out\", \"file\")),\n ]\n )\n tmp_dir.scm_gen({\"script.py\": script}, commit=\"init\")\n tmp_dir.dvc_gen({\"dep\": \"content\"}, commit=\"init dvc\")\n dvc.run(\n **{\n \"command\": \"python script.py\",\n \"outs\": [os.path.join(\"out\", \"file\")],\n \"deps\": [\"dep\"],\n \"fname\": \"out.dvc\",\n }\n )\n tmp_dir.scm_add([\"out.dvc\"], commit=\"run\")\n shutil.rmtree(\"out\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_test_ls_repo.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_test_ls_repo.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 67, "span_ids": ["test_ls_repo"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n files = Repo.ls(fspath(tmp_dir))\n match_files(\n files,\n (\n ((\".gitignore\",), False),\n ((\"README.md\",), False),\n ((\"structure.xml.dvc\",), False),\n ((\"model\",), False),\n ((\"data\",), False),\n ((\"structure.xml\",), True),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_color_test_ls_repo_with_color.assert_caplog_records_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_color_test_ls_repo_with_color.assert_caplog_records_1_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 95, "span_ids": ["test_ls_repo_with_color"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_with_color(tmp_dir, dvc, scm, mocker, monkeypatch, caplog):\n import logging\n from dvc.cli import parse_args\n\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n monkeypatch.setenv(\"LS_COLORS\", \"rs=0:di=01;34:*.xml=01;31:*.dvc=01;33:\")\n cli_args = parse_args([\"list\", fspath(tmp_dir)])\n cmd = cli_args.func(cli_args)\n\n caplog.clear()\n mocker.patch(\"sys.stdout.isatty\", return_value=True)\n with caplog.at_level(logging.INFO, logger=\"dvc.command.ls\"):\n assert cmd.run() == 0\n\n assert caplog.records[-1].msg == \"\\n\".join(\n [\n \".gitignore\",\n \"README.md\",\n \"\\x1b[01;34mdata\\x1b[0m\",\n \"\\x1b[01;34mmodel\\x1b[0m\",\n \"\\x1b[01;31mstructure.xml\\x1b[0m\",\n \"\\x1b[01;33mstructure.xml.dvc\\x1b[0m\",\n ]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_recursive_test_ls_repo_recursive.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_recursive_test_ls_repo_recursive.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 122, "span_ids": ["test_ls_repo_recursive"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_recursive(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n files = Repo.ls(fspath(tmp_dir), recursive=True)\n match_files(\n files,\n (\n ((\".gitignore\",), False),\n ((\"README.md\",), False),\n ((\"structure.xml.dvc\",), False),\n ((\"model\", \"script.py\"), False),\n ((\"model\", \"train.py\"), False),\n ((\"model\", \"people.csv.dvc\"), False),\n ((\"data\", \"subcontent\", \"data.xml.dvc\"), False),\n ((\"data\", \"subcontent\", \"statistics\", \"data.csv.dvc\"), False),\n ((\"data\", \"subcontent\", \"statistics\", \"data.csv\"), True),\n ((\"data\", \"subcontent\", \"statistics\", \".gitignore\"), False),\n ((\"data\", \"subcontent\", \"data.xml\"), True),\n ((\"data\", \"subcontent\", \".gitignore\"), False),\n ((\"model\", \"people.csv\"), True),\n ((\"model\", \".gitignore\"), False),\n ((\"structure.xml\",), True),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_outs_only_recursive_test_ls_repo_outs_only_recursive.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_outs_only_recursive_test_ls_repo_outs_only_recursive.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 138, "span_ids": ["test_ls_repo_outs_only_recursive"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_outs_only_recursive(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n files = Repo.ls(fspath(tmp_dir), recursive=True, outs_only=True)\n match_files(\n files,\n (\n ((\"data\", \"subcontent\", \"statistics\", \"data.csv\"), True),\n ((\"data\", \"subcontent\", \"data.xml\"), True),\n ((\"model\", \"people.csv\"), True),\n ((\"structure.xml\",), True),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_dir_test_ls_repo_with_path_dir_outs_only_empty.with_pytest_raises_PathMi.Repo_ls_fspath_tmp_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_dir_test_ls_repo_with_path_dir_outs_only_empty.with_pytest_raises_PathMi.Repo_ls_fspath_tmp_dir_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 141, "end_line": 164, "span_ids": ["test_ls_repo_with_path_dir", "test_ls_repo_with_path_dir_outs_only_empty"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_with_path_dir(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n files = Repo.ls(fspath(tmp_dir), path=\"model\")\n match_files(\n files,\n (\n ((\"script.py\",), False),\n ((\"train.py\",), False),\n ((\"people.csv\",), True),\n ((\"people.csv.dvc\",), False),\n ((\".gitignore\",), False),\n ),\n )\n\n\ndef test_ls_repo_with_path_dir_outs_only_empty(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n tmp_dir.scm_gen({\"folder/.keep\": \"content\"}, commit=\"add .keep\")\n\n with pytest.raises(PathMissingError):\n Repo.ls(fspath(tmp_dir), path=\"folder\", outs_only=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_subdir_test_ls_repo_with_path_subdir.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_subdir_test_ls_repo_with_path_subdir.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 167, "end_line": 181, "span_ids": ["test_ls_repo_with_path_subdir"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_with_path_subdir(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n path = os.path.join(\"data\", \"subcontent\")\n files = Repo.ls(fspath(tmp_dir), path)\n match_files(\n files,\n (\n ((\"data.xml\",), True),\n ((\"data.xml.dvc\",), False),\n ((\"statistics\",), False),\n ((\".gitignore\",), False),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_subdir_outs_only_test_ls_repo_with_path_subdir_outs_only_recursive.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_subdir_outs_only_test_ls_repo_with_path_subdir_outs_only_recursive.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 184, "end_line": 201, "span_ids": ["test_ls_repo_with_path_subdir_outs_only", "test_ls_repo_with_path_subdir_outs_only_recursive"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_with_path_subdir_outs_only(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n path = os.path.join(\"data\", \"subcontent\")\n files = Repo.ls(fspath(tmp_dir), path, outs_only=True)\n match_files(files, (((\"data.xml\",), True), ((\"statistics\",), False),))\n\n\ndef test_ls_repo_with_path_subdir_outs_only_recursive(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n path = os.path.join(\"data\", \"subcontent\")\n files = Repo.ls(fspath(tmp_dir), path, outs_only=True, recursive=True)\n match_files(\n files, (((\"data.xml\",), True), ((\"statistics\", \"data.csv\"), True),)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_file_out_test_ls_repo_with_removed_dvc_dir.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_path_file_out_test_ls_repo_with_removed_dvc_dir.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 204, "end_line": 259, "span_ids": ["test_ls_repo_with_path_file_out", "test_ls_repo_with_file_path_fs", "test_ls_repo_with_removed_dvc_dir", "test_ls_repo_with_missed_path", "test_ls_repo_with_missed_path_outs_only"], "tokens": 445}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_with_path_file_out(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n path = os.path.join(\"data\", \"subcontent\", \"data.xml\")\n files = Repo.ls(fspath(tmp_dir), path)\n match_files(files, (((\"data.xml\",), True),))\n\n\ndef test_ls_repo_with_file_path_fs(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n path = \"README.md\"\n files = Repo.ls(fspath(tmp_dir), path, recursive=True)\n match_files(files, (((\"README.md\",), False),))\n\n\ndef test_ls_repo_with_missed_path(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n with pytest.raises(PathMissingError) as exc_info:\n Repo.ls(fspath(tmp_dir), path=\"missed_path\")\n assert not exc_info.value.output_only\n\n\ndef test_ls_repo_with_missed_path_outs_only(tmp_dir, dvc, scm):\n tmp_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n tmp_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n with pytest.raises(PathMissingError) as exc_info:\n Repo.ls(\n fspath(tmp_dir),\n path=\"missed_path\",\n recursive=True,\n outs_only=True,\n )\n assert exc_info.value.output_only\n\n\ndef test_ls_repo_with_removed_dvc_dir(tmp_dir, dvc, scm):\n create_dvc_pipeline(tmp_dir, dvc)\n\n files = Repo.ls(fspath(tmp_dir))\n match_files(\n files,\n (\n ((\"script.py\",), False),\n ((\"dep.dvc\",), False),\n ((\"out.dvc\",), False),\n ((\"dep\",), True),\n ((\"out\",), False),\n ((\".gitignore\",), False),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_removed_dvc_dir_recursive_test_ls_repo_with_removed_dvc_dir_recursive.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_removed_dvc_dir_recursive_test_ls_repo_with_removed_dvc_dir_recursive.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 262, "end_line": 276, "span_ids": ["test_ls_repo_with_removed_dvc_dir_recursive"], "tokens": 106}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_with_removed_dvc_dir_recursive(tmp_dir, dvc, scm):\n create_dvc_pipeline(tmp_dir, dvc)\n\n files = Repo.ls(fspath(tmp_dir), recursive=True)\n match_files(\n files,\n (\n ((\"script.py\",), False),\n ((\"dep.dvc\",), False),\n ((\"out.dvc\",), False),\n ((\"dep\",), True),\n ((\"out\", \"file\"), True),\n ((\".gitignore\",), False),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_removed_dvc_dir_with_path_dir_test_ls_repo_with_removed_dvc_dir_with_path_file.match_files_files_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_with_removed_dvc_dir_with_path_dir_test_ls_repo_with_removed_dvc_dir_with_path_file.match_files_files_fi", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 279, "end_line": 292, "span_ids": ["test_ls_repo_with_removed_dvc_dir_with_path_file", "test_ls_repo_with_removed_dvc_dir_with_path_dir"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_repo_with_removed_dvc_dir_with_path_dir(tmp_dir, dvc, scm):\n create_dvc_pipeline(tmp_dir, dvc)\n\n path = \"out\"\n files = Repo.ls(fspath(tmp_dir), path)\n match_files(files, (((\"file\",), True),))\n\n\ndef test_ls_repo_with_removed_dvc_dir_with_path_file(tmp_dir, dvc, scm):\n create_dvc_pipeline(tmp_dir, dvc)\n\n path = os.path.join(\"out\", \"file\")\n files = Repo.ls(fspath(tmp_dir), path)\n match_files(files, (((\"file\",), True),))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_test_ls_remote_repo.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_test_ls_remote_repo.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 295, "end_line": 312, "span_ids": ["test_ls_remote_repo"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_remote_repo(erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n erepo_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n url = \"file://{}\".format(erepo_dir)\n files = Repo.ls(url)\n match_files(\n files,\n (\n ((\".gitignore\",), False),\n ((\"README.md\",), False),\n ((\"structure.xml.dvc\",), False),\n ((\"model\",), False),\n ((\"data\",), False),\n ((\"structure.xml\",), True),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_recursive_test_ls_remote_repo_recursive.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_recursive_test_ls_remote_repo_recursive.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 315, "end_line": 341, "span_ids": ["test_ls_remote_repo_recursive"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_remote_repo_recursive(erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n erepo_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n url = \"file://{}\".format(erepo_dir)\n files = Repo.ls(url, recursive=True)\n match_files(\n files,\n (\n ((\".gitignore\",), False),\n ((\"README.md\",), False),\n ((\"structure.xml.dvc\",), False),\n ((\"model\", \"script.py\"), False),\n ((\"model\", \"train.py\"), False),\n ((\"model\", \"people.csv.dvc\"), False),\n ((\"data\", \"subcontent\", \"data.xml.dvc\"), False),\n ((\"data\", \"subcontent\", \"statistics\", \"data.csv.dvc\"), False),\n ((\"data\", \"subcontent\", \"statistics\", \"data.csv\"), True),\n ((\"data\", \"subcontent\", \"statistics\", \".gitignore\"), False),\n ((\"data\", \"subcontent\", \"data.xml\"), True),\n ((\"data\", \"subcontent\", \".gitignore\"), False),\n ((\"model\", \"people.csv\"), True),\n ((\"model\", \".gitignore\"), False),\n ((\"structure.xml\",), True),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_git_only_repo_recursive_test_ls_remote_repo_with_path_dir.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_git_only_repo_recursive_test_ls_remote_repo_with_path_dir.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 344, "end_line": 378, "span_ids": ["test_ls_remote_git_only_repo_recursive", "test_ls_remote_repo_with_path_dir"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_remote_git_only_repo_recursive(git_dir):\n with git_dir.chdir():\n git_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n\n url = \"file://{}\".format(git_dir)\n files = Repo.ls(url, recursive=True)\n match_files(\n files,\n (\n ((\".gitignore\",), False),\n ((\"README.md\",), False),\n ((\"model\", \"script.py\"), False),\n ((\"model\", \"train.py\"), False),\n ),\n )\n\n\ndef test_ls_remote_repo_with_path_dir(erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n erepo_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n url = \"file://{}\".format(erepo_dir)\n path = \"model\"\n files = Repo.ls(url, path)\n match_files(\n files,\n (\n ((\"script.py\",), False),\n ((\"train.py\",), False),\n ((\"people.csv\",), True),\n ((\"people.csv.dvc\",), False),\n ((\".gitignore\",), False),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_with_rev_test_ls_remote_repo_with_rev.match_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_with_rev_test_ls_remote_repo_with_rev.match_files_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 381, "end_line": 396, "span_ids": ["test_ls_remote_repo_with_rev"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_remote_repo_with_rev(erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n erepo_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n\n rev = erepo_dir.scm.list_all_commits()[1]\n url = \"file://{}\".format(erepo_dir)\n files = Repo.ls(url, rev=rev)\n match_files(\n files,\n (\n ((\".gitignore\",), False),\n ((\"README.md\",), False),\n ((\"model\",), False),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_with_rev_recursive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_remote_repo_with_rev_recursive_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 399, "end_line": 432, "span_ids": ["test_ls_not_existed_url", "test_ls_remote_repo_with_rev_recursive"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ls_remote_repo_with_rev_recursive(erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(DVC_STRUCTURE, commit=\"dvc\")\n erepo_dir.scm_gen(FS_STRUCTURE, commit=\"init\")\n\n rev = erepo_dir.scm.list_all_commits()[1]\n url = \"file://{}\".format(erepo_dir)\n files = Repo.ls(url, rev=rev, recursive=True)\n match_files(\n files,\n (\n ((\"structure.xml.dvc\",), False),\n ((\"model\", \"people.csv.dvc\"), False),\n ((\"data\", \"subcontent\", \"data.xml.dvc\"), False),\n ((\"data\", \"subcontent\", \"statistics\", \"data.csv.dvc\"), False),\n ((\"data\", \"subcontent\", \"statistics\", \"data.csv\"), True),\n ((\"data\", \"subcontent\", \"statistics\", \".gitignore\"), False),\n ((\"data\", \"subcontent\", \"data.xml\"), True),\n ((\"data\", \"subcontent\", \".gitignore\"), False),\n ((\"model\", \"people.csv\"), True),\n ((\"model\", \".gitignore\"), False),\n ((\"structure.xml\",), True),\n ((\".gitignore\",), False),\n ),\n )\n\n\ndef test_ls_not_existed_url():\n from time import time\n\n dirname = \"__{}_{}\".format(\"not_existed\", time())\n with pytest.raises(CloneError):\n Repo.ls(dirname, recursive=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileInsideDirectory_TestMoveFileInsideDirectory.test.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileInsideDirectory_TestMoveFileInsideDirectory.test.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 181, "end_line": 195, "span_ids": ["TestMoveFileInsideDirectory", "TestMoveFileInsideDirectory.test"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMoveFileInsideDirectory(TestDvc):\n def test(self):\n ret = main([\"add\", self.DATA])\n self.assertEqual(ret, 0)\n\n with cd(self.DATA_DIR):\n ret = main([\"move\", os.path.basename(self.DATA), \"data.txt\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(self.DATA))\n\n data_fullpath = os.path.join(self.DATA_DIR, \"data.txt\")\n dvc_fullpath = os.path.join(self.DATA_DIR, \"data.txt.dvc\")\n self.assertTrue(os.path.exists(data_fullpath))\n self.assertTrue(os.path.exists(dvc_fullpath))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_test_move_should_save_stage_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_test_move_should_save_stage_info_", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 198, "end_line": 216, "span_ids": ["test_should_move_to_dir_on_non_default_stage_file", "test_move_should_save_stage_info"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_move_should_save_stage_info(tmp_dir, dvc):\n tmp_dir.dvc_gen({\"old_name\": {\"file1\": \"file1\"}})\n\n dvc.move(\"old_name\", \"new_name\")\n\n assert dvc.status() == {}\n\n\ndef test_should_move_to_dir_on_non_default_stage_file(tmp_dir, dvc):\n stage_file_name = \"stage.dvc\"\n tmp_dir.gen({\"file\": \"file_content\"})\n\n dvc.add(\"file\", fname=stage_file_name)\n os.mkdir(\"directory\")\n\n dvc.move(\"file\", \"directory\")\n\n assert os.path.exists(os.path.join(\"directory\", \"file\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_disconnected_stage_test_disconnected_stage.assert_is_tree_is_True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_disconnected_stage_test_disconnected_stage.assert_is_tree_is_True", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 102, "end_line": 120, "span_ids": ["test_disconnected_stage"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_disconnected_stage(tmp_dir, dvc):\n tmp_dir.dvc_gen({\"base\": \"base\"})\n\n dvc.add(\"base\")\n dvc.run(deps=[\"base\"], outs=[\"derived1\"], cmd=\"echo derived1 > derived1\")\n dvc.run(deps=[\"base\"], outs=[\"derived2\"], cmd=\"echo derived2 > derived2\")\n final_stage = dvc.run(\n deps=[\"derived1\"], outs=[\"final\"], cmd=\"echo final > final\"\n )\n\n command = CmdPipelineShow([])\n # Need to test __build_graph directly\n nodes, edges, is_tree = command._build_graph(\n final_stage.path, commands=False, outs=True\n )\n\n assert set(nodes) == {\"final\", \"derived1\", \"base\"}\n assert edges == [(\"final\", \"derived1\"), (\"derived1\", \"base\")]\n assert is_tree is True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_TestDvcRepoPipeline.locked_stage.self_assertEqual_len_pipe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_TestDvcRepoPipeline.locked_stage.self_assertEqual_len_pipe", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 219, "end_line": 239, "span_ids": ["TestDvcRepoPipeline.two_pipelines", "TestDvcRepoPipeline.locked_stage"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDvcRepoPipeline(TestDvc):\n\n def two_pipelines(self):\n self.dvc.add(\"foo\")\n self.dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"\")\n self.dvc.run(deps=[\"bar\"], outs=[\"baz\"], cmd=\"echo baz > baz\")\n\n self.dvc.add(\"code.py\")\n\n pipelines = self.dvc.pipelines\n\n self.assertEqual(len(pipelines), 2)\n self.assertEqual(pipelines[0].nodes, 3)\n self.assertEqual(pipelines[0].edges, 2)\n self.assertEqual(pipelines[1].nodes, 1)\n self.assertEqual(pipelines[1].edges, 0)\n\n def locked_stage(self):\n self.dvc.add(\"foo\")\n self.dvc.lock_stage(\"foo.dvc\")\n\n pipelines = self.dvc.pipelines\n self.assertEqual(len(pipelines), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_errno_TestRemote.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_errno_TestRemote.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 39, "span_ids": ["imports", "TestRemote.test", "TestRemote"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import errno\nimport os\n\nimport configobj\nimport pytest\nfrom mock import patch\n\nfrom dvc.config import Config\nfrom dvc.exceptions import DownloadError, UploadError\nfrom dvc.main import main\nfrom dvc.path_info import PathInfo\nfrom dvc.remote import RemoteLOCAL\nfrom dvc.remote.base import RemoteBASE, RemoteCacheRequiredError\nfrom dvc.compat import fspath\nfrom dvc.utils.fs import remove\nfrom tests.basic_env import TestDvc\nfrom tests.remotes import Local\n\n\nclass TestRemote(TestDvc):\n def test(self):\n remotes = [\"a\", \"b\", \"c\"]\n\n self.assertEqual(main([\"remote\", \"list\"]), 0)\n self.assertNotEqual(main([\"remote\", \"remove\", remotes[0]]), 0)\n\n for r in remotes:\n self.assertEqual(\n main([\"remote\", \"add\", \"--default\", r, \"s3://bucket/name\"]), 0\n )\n\n self.assertEqual(main([\"remote\", \"list\"]), 0)\n\n self.assertEqual(\n main([\"remote\", \"modify\", remotes[0], \"checksum_jobs\", \"1\"]), 0\n )\n self.assertEqual(main([\"remote\", \"remove\", remotes[0]]), 0)\n\n self.assertEqual(main([\"remote\", \"list\"]), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remove_default_test_remove_default.assert_local_config_get_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remove_default_test_remove_default.assert_local_config_get_", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 87, "span_ids": ["test_remove_default"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_remove_default(tmp_dir, dvc):\n remote = \"mys3\"\n assert (\n main([\"remote\", \"add\", \"--default\", remote, \"s3://bucket/name\"]) == 0\n )\n assert main([\"remote\", \"modify\", remote, \"profile\", \"default\"]) == 0\n assert main([\"config\", \"--local\", \"core.remote\", remote]) == 0\n\n config = configobj.ConfigObj(dvc.config.files[\"repo\"])\n local_config = configobj.ConfigObj(dvc.config.files[\"local\"])\n assert config[\"core\"][\"remote\"] == remote\n assert local_config[\"core\"][\"remote\"] == remote\n\n assert main([\"remote\", \"remove\", remote]) == 0\n\n config = configobj.ConfigObj(dvc.config.files[\"repo\"])\n local_config = configobj.ConfigObj(dvc.config.files[\"local\"])\n assert config.get(\"core\", {}).get(\"remote\") is None\n assert local_config.get(\"core\", {}).get(\"remote\") is None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_show_default_TestRemoteShouldHandleUppercaseRemoteName.test.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_show_default_TestRemoteShouldHandleUppercaseRemoteName.test.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 123, "end_line": 142, "span_ids": ["TestRemoteShouldHandleUppercaseRemoteName.test", "TestRemoteShouldHandleUppercaseRemoteName", "test_show_default"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_show_default(dvc, capsys):\n assert main([\"remote\", \"default\", \"foo\"]) == 0\n assert main([\"remote\", \"default\"]) == 0\n out, _ = capsys.readouterr()\n assert out == \"foo\\n\"\n\n\nclass TestRemoteShouldHandleUppercaseRemoteName(TestDvc):\n upper_case_remote_name = \"UPPERCASEREMOTE\"\n\n def test(self):\n remote_url = Local.get_storagepath()\n ret = main([\"remote\", \"add\", self.upper_case_remote_name, remote_url])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"push\", \"-r\", self.upper_case_remote_name])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_partial_push_n_pull_test_partial_push_n_pull.None_1.assert_download_error_inf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_partial_push_n_pull_test_partial_push_n_pull.None_1.assert_download_error_inf", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 209, "span_ids": ["test_partial_push_n_pull"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_partial_push_n_pull(tmp_dir, dvc, tmp_path_factory):\n url = fspath(tmp_path_factory.mktemp(\"upstream\"))\n dvc.config[\"remote\"][\"upstream\"] = {\"url\": url}\n dvc.config[\"core\"][\"remote\"] = \"upstream\"\n\n foo = tmp_dir.dvc_gen({\"foo\": \"foo content\"})[0].outs[0]\n bar = tmp_dir.dvc_gen({\"bar\": \"bar content\"})[0].outs[0]\n baz = tmp_dir.dvc_gen({\"baz\": {\"foo\": \"baz content\"}})[0].outs[0]\n\n # Faulty upload version, failing on foo\n original = RemoteLOCAL._upload\n\n def unreliable_upload(self, from_file, to_info, name=None, **kwargs):\n if \"foo\" in name:\n raise Exception(\"stop foo\")\n return original(self, from_file, to_info, name, **kwargs)\n\n with patch.object(RemoteLOCAL, \"_upload\", unreliable_upload):\n with pytest.raises(UploadError) as upload_error_info:\n dvc.push()\n assert upload_error_info.value.amount == 3\n\n remote = dvc.cloud.get_remote(\"upstream\")\n assert not remote.exists(remote.checksum_to_path_info(foo.checksum))\n assert remote.exists(remote.checksum_to_path_info(bar.checksum))\n assert not remote.exists(remote.checksum_to_path_info(baz.checksum))\n\n # Push everything and delete local cache\n dvc.push()\n remove(dvc.cache.local.cache_dir)\n\n with patch.object(RemoteLOCAL, \"_download\", side_effect=Exception):\n with pytest.raises(DownloadError) as download_error_info:\n dvc.pull()\n # error count should be len(.dir + standalone file checksums)\n # since files inside dir are ignored if dir cache entry is missing\n assert download_error_info.value.amount == 3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_raise_on_too_many_open_files_test_raise_on_too_many_open_files.with_pytest_raises_OSErro.assert_e_errno_errno_E": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_raise_on_too_many_open_files_test_raise_on_too_many_open_files.with_pytest_raises_OSErro.assert_e_errno_errno_E", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 208, "end_line": 223, "span_ids": ["test_raise_on_too_many_open_files"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_raise_on_too_many_open_files(tmp_dir, dvc, tmp_path_factory, mocker):\n storage = fspath(tmp_path_factory.mktemp(\"test_remote_base\"))\n dvc.config[\"remote\"][\"local_remote\"] = {\"url\": storage}\n dvc.config[\"core\"][\"remote\"] = \"local_remote\"\n\n tmp_dir.dvc_gen({\"file\": \"file content\"})\n\n mocker.patch.object(\n RemoteLOCAL,\n \"_upload\",\n side_effect=OSError(errno.EMFILE, \"Too many open files\"),\n )\n\n with pytest.raises(OSError) as e:\n dvc.push()\n assert e.errno == errno.EMFILE", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_os_test_destroy.None_2.assert_not_System_is_syml": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_os_test_destroy.None_2.assert_not_System_is_syml", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["imports", "test_destroy"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.scm.git.tree import GitTree\nfrom dvc.cache import Cache\nfrom dvc.repo import Repo\nfrom dvc.system import System\nfrom dvc.compat import fspath\n\n\ndef test_destroy(tmp_dir, dvc):\n dvc.config[\"cache\"][\"type\"] = [\"symlink\"]\n dvc.cache = Cache(dvc)\n\n tmp_dir.dvc_gen(\"file\", \"text\")\n tmp_dir.dvc_gen({\"dir\": {\"file\": \"lorem\", \"subdir/file\": \"ipsum\"}})\n\n dvc.destroy()\n\n # Remove all the files related to DVC\n for path in [\".dvc\", \"file.dvc\", \"dir.dvc\"]:\n assert not (tmp_dir / path).exists()\n\n # Leave the rest of the files\n for path in [\"file\", \"dir/file\", \"dir/subdir/file\"]:\n assert (tmp_dir / path).is_file()\n\n # Make sure that data was unprotected after `destroy`\n for path in [\"file\", \"dir\", \"dir/file\", \"dir/subdir\", \"dir/subdir/file\"]:\n assert not System.is_symlink(fspath(tmp_dir / path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_test_collect.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_test_collect.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 56, "span_ids": ["test_collect"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_collect(tmp_dir, scm, dvc, run_copy):\n def collect_outs(*args, **kwargs):\n return set(\n str(out)\n for stage in dvc.collect(*args, **kwargs)\n for out in stage.outs\n )\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\")\n scm.add([\".gitignore\", \"foo.dvc\", \"bar.dvc\"])\n scm.commit(\"Add foo and bar\")\n\n scm.checkout(\"new-branch\", create_new=True)\n\n run_copy(\"bar\", \"buzz\")\n scm.add([\".gitignore\", \"buzz.dvc\"])\n scm.commit(\"Add buzz\")\n\n assert collect_outs(\"bar.dvc\", with_deps=True) == {\"foo\", \"bar\"}\n\n dvc.tree = GitTree(scm.repo, \"new-branch\")\n\n assert collect_outs(\"buzz.dvc\", with_deps=True) == {\"foo\", \"bar\", \"buzz\"}\n assert collect_outs(\"buzz.dvc\", with_deps=False) == {\"buzz\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_stages_", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 74, "span_ids": ["test_stages"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stages(tmp_dir, dvc):\n def stages():\n return set(stage.relpath for stage in Repo(fspath(tmp_dir)).stages)\n\n tmp_dir.dvc_gen({\"file\": \"a\", \"dir/file\": \"b\", \"dir/subdir/file\": \"c\"})\n\n assert stages() == {\n \"file.dvc\",\n os.path.join(\"dir\", \"file.dvc\"),\n os.path.join(\"dir\", \"subdir\", \"file.dvc\"),\n }\n\n tmp_dir.gen(\".dvcignore\", \"dir\")\n\n assert stages() == {\"file.dvc\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_nested_TestReproWorkingDirectoryAsOutput.test_nested.with_patch_object_self_dv.with_self_assertRaises_St.self_dvc_reproduce_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_nested_TestReproWorkingDirectoryAsOutput.test_nested.with_patch_object_self_dv.with_self_assertRaises_St.self_dvc_reproduce_error_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 157, "end_line": 201, "span_ids": ["TestReproWorkingDirectoryAsOutput.test_nested"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproWorkingDirectoryAsOutput(TestDvc):\n\n def test_nested(self):\n # .\n # |-- a\n # | |__ nested\n # | |__ dir\n # | |__ error.dvc (stage.cwd == 'a/nested/dir')\n # |__ b\n # |__ nested.dvc (stage.out == 'a/nested')\n dir1 = \"b\"\n dir2 = \"a\"\n\n os.mkdir(dir1)\n os.mkdir(dir2)\n\n nested_dir = os.path.join(dir2, \"nested\")\n out_dir = relpath(nested_dir, dir1)\n\n nested_stage = self.dvc.run(\n fname=os.path.join(dir1, \"b.dvc\"),\n wdir=dir1,\n outs=[out_dir], # ../a/nested\n cmd=\"mkdir {path}\".format(path=out_dir),\n )\n\n os.mkdir(os.path.join(nested_dir, \"dir\"))\n\n error_stage_path = os.path.join(nested_dir, \"dir\", \"error.dvc\")\n\n output = os.path.join(\"..\", \"..\", \"something\")\n stage_dump = {\n \"cmd\": \"echo something > {}\".format(output),\n \"outs\": [{\"path\": output}],\n }\n dump_stage_file(error_stage_path, stage_dump)\n\n # NOTE: os.walk() walks in a sorted order and we need dir2 subdirs to\n # be processed before dir1 to load error.dvc first.\n self.dvc.pipeline_stages = [\n nested_stage,\n Dvcfile(self.dvc, error_stage_path).stage,\n ]\n\n with patch.object(self.dvc, \"_reset\"): # to prevent `stages` resetting\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.reproduce(error_stage_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalBase_TestReproExternalBase.check_already_cached.with_self_dvc_lock_self_.with_patch_download_as_mo.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalBase_TestReproExternalBase.check_already_cached.with_self_dvc_lock_self_.with_patch_download_as_mo.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_call", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 812, "end_line": 858, "span_ids": ["TestReproExternalBase", "TestReproExternalBase.scheme", "TestReproExternalBase.check_already_cached", "TestReproExternalBase.should_test", "TestReproExternalBase.scheme_sep", "TestReproExternalBase.cache_scheme", "TestReproExternalBase.sep"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproExternalBase(TestDvc):\n cache_type = None\n\n @staticmethod\n def should_test():\n return False\n\n @property\n def cache_scheme(self):\n return self.scheme\n\n @property\n def scheme(self):\n return None\n\n @property\n def scheme_sep(self):\n return \"://\"\n\n @property\n def sep(self):\n return \"/\"\n\n def check_already_cached(self, stage):\n stage.outs[0].remove()\n\n patch_download = patch.object(\n stage.deps[0], \"download\", wraps=stage.deps[0].download\n )\n\n patch_checkout = patch.object(\n stage.outs[0], \"checkout\", wraps=stage.outs[0].checkout\n )\n\n patch_run = patch.object(stage, \"_run\", wraps=stage._run)\n\n with self.dvc.lock, self.dvc.state:\n with patch_download as mock_download:\n with patch_checkout as mock_checkout:\n with patch_run as mock_run:\n stage.locked = False\n stage.run()\n stage.locked = True\n\n mock_run.assert_not_called()\n mock_download.assert_not_called()\n mock_checkout.assert_called_once()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.None_28": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.None_28", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 860, "end_line": 961, "span_ids": ["TestReproExternalBase.test"], "tokens": 807}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproExternalBase(TestDvc):\n\n @patch(\"dvc.prompt.confirm\", return_value=True)\n def test(self, mock_prompt):\n if not self.should_test():\n raise SkipTest(\n \"Test {} is disabled\".format(self.__class__.__name__)\n )\n\n cache = (\n self.scheme\n + self.scheme_sep\n + self.bucket\n + self.sep\n + str(uuid.uuid4())\n )\n\n ret = main([\"config\", \"cache.\" + self.cache_scheme, \"myrepo\"])\n self.assertEqual(ret, 0)\n ret = main([\"remote\", \"add\", \"myrepo\", cache])\n self.assertEqual(ret, 0)\n if self.cache_type:\n ret = main([\"remote\", \"modify\", \"myrepo\", \"type\", self.cache_type])\n self.assertEqual(ret, 0)\n\n remote_name = \"myremote\"\n remote_key = str(uuid.uuid4())\n remote = (\n self.scheme + self.scheme_sep + self.bucket + self.sep + remote_key\n )\n\n ret = main([\"remote\", \"add\", remote_name, remote])\n self.assertEqual(ret, 0)\n if self.cache_type:\n ret = main(\n [\"remote\", \"modify\", remote_name, \"type\", self.cache_type]\n )\n self.assertEqual(ret, 0)\n\n self.dvc = DvcRepo(\".\")\n\n foo_key = remote_key + self.sep + self.FOO\n bar_key = remote_key + self.sep + self.BAR\n\n foo_path = (\n self.scheme + self.scheme_sep + self.bucket + self.sep + foo_key\n )\n bar_path = (\n self.scheme + self.scheme_sep + self.bucket + self.sep + bar_key\n )\n\n # Using both plain and remote notation\n out_foo_path = \"remote://\" + remote_name + \"/\" + self.FOO\n out_bar_path = bar_path\n\n self.write(self.bucket, foo_key, self.FOO_CONTENTS)\n\n import_stage = self.dvc.imp_url(out_foo_path, \"import\")\n\n self.assertTrue(os.path.exists(\"import\"))\n self.assertTrue(filecmp.cmp(\"import\", self.FOO, shallow=False))\n self.assertEqual(self.dvc.status([import_stage.path]), {})\n self.check_already_cached(import_stage)\n\n import_remote_stage = self.dvc.imp_url(\n out_foo_path, out_foo_path + \"_imported\"\n )\n self.assertEqual(self.dvc.status([import_remote_stage.path]), {})\n\n cmd_stage = self.dvc.run(\n outs=[out_bar_path],\n deps=[out_foo_path],\n cmd=self.cmd(foo_path, bar_path),\n )\n\n self.assertEqual(self.dvc.status([cmd_stage.path]), {})\n self.assertEqual(self.dvc.status(), {})\n self.check_already_cached(cmd_stage)\n\n self.write(self.bucket, foo_key, self.BAR_CONTENTS)\n\n self.assertNotEqual(self.dvc.status(), {})\n\n self.dvc.update(import_stage.path)\n self.assertTrue(os.path.exists(\"import\"))\n self.assertTrue(filecmp.cmp(\"import\", self.BAR, shallow=False))\n self.assertEqual(self.dvc.status([import_stage.path]), {})\n\n self.dvc.update(import_remote_stage.path)\n self.assertEqual(self.dvc.status([import_remote_stage.path]), {})\n\n stages = self.dvc.reproduce(cmd_stage.path)\n self.assertEqual(len(stages), 1)\n self.assertEqual(self.dvc.status([cmd_stage.path]), {})\n\n self.assertEqual(self.dvc.status(), {})\n self.dvc.gc(workspace=True)\n self.assertEqual(self.dvc.status(), {})\n\n self.dvc.remove(cmd_stage.path, outs_only=True)\n self.assertNotEqual(self.dvc.status([cmd_stage.path]), {})\n\n self.dvc.checkout([cmd_stage.path], force=True)\n self.assertEqual(self.dvc.status([cmd_stage.path]), {})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHTTP_TestReproExternalHTTP.test.None_2.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHTTP_TestReproExternalHTTP.test.None_2.None_9", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1148, "end_line": 1218, "span_ids": ["TestReproExternalHTTP.get_remote", "TestReproExternalHTTP", "TestReproExternalHTTP.test", "TestReproExternalHTTP.local_cache"], "tokens": 532}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproExternalHTTP(TestReproExternalBase):\n _external_cache_id = None\n\n @staticmethod\n def get_remote(port):\n return \"http://localhost:{}/\".format(port)\n\n @property\n def local_cache(self):\n return os.path.join(self.dvc.dvc_dir, \"cache\")\n\n def test(self):\n # Import\n with StaticFileServer() as httpd:\n import_url = urljoin(self.get_remote(httpd.server_port), self.FOO)\n import_output = \"imported_file\"\n import_stage = self.dvc.imp_url(import_url, import_output)\n\n self.assertTrue(os.path.exists(import_output))\n self.assertTrue(filecmp.cmp(import_output, self.FOO, shallow=False))\n\n self.dvc.remove(\"imported_file.dvc\")\n\n with StaticFileServer(handler_class=ContentMD5Handler) as httpd:\n import_url = urljoin(self.get_remote(httpd.server_port), self.FOO)\n import_output = \"imported_file\"\n import_stage = self.dvc.imp_url(import_url, import_output)\n\n self.assertTrue(os.path.exists(import_output))\n self.assertTrue(filecmp.cmp(import_output, self.FOO, shallow=False))\n\n # Run --deps\n with StaticFileServer() as httpd:\n remote = self.get_remote(httpd.server_port)\n\n cache_id = str(uuid.uuid4())\n cache = urljoin(remote, cache_id)\n\n ret1 = main([\"remote\", \"add\", \"mycache\", cache])\n ret2 = main([\"remote\", \"add\", \"myremote\", remote])\n self.assertEqual(ret1, 0)\n self.assertEqual(ret2, 0)\n\n self.dvc = DvcRepo(\".\")\n\n run_dependency = urljoin(remote, self.BAR)\n run_output = \"remote_file\"\n cmd = 'open(\"{}\", \"w+\")'.format(run_output)\n\n with open(\"create-output.py\", \"w\") as fd:\n fd.write(cmd)\n\n run_stage = self.dvc.run(\n deps=[run_dependency],\n outs=[run_output],\n cmd=\"python create-output.py\",\n )\n self.assertTrue(run_stage is not None)\n\n self.assertTrue(os.path.exists(run_output))\n\n # Pull\n self.dvc.remove(import_stage.path, outs_only=True)\n self.assertFalse(os.path.exists(import_output))\n\n shutil.move(self.local_cache, cache_id)\n self.assertFalse(os.path.exists(self.local_cache))\n\n self.dvc.pull([import_stage.path], remote=\"mycache\")\n\n self.assertTrue(os.path.exists(import_output))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_repro_dir_repro_dir.yield_stages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_repro_dir_repro_dir.yield_stages", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1368, "end_line": 1432, "span_ids": ["repro_dir"], "tokens": 555}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef repro_dir(tmp_dir, dvc, run_copy):\n # Creates repo with following structure:\n # data_dir/dir_file origin_data\n # | | |\n # | | origin_copy.dvc\n # unrelated2.dvc | | |\n # | | unrelated1.dvc\n # dir/subdir/dir_file_copy.dvc |\n # | |\n # | dir/origin_copy_2.dvc\n # | |\n # \\ /\n # \\ /\n # dir/Dvcfile\n tmp_dir.gen(\n {\n \"origin_data\": \"origin data content\",\n \"data_dir\": {\"dir_file\": \"dir file content\"},\n \"dir\": {\"subdir\": {}},\n }\n )\n\n stages = {}\n\n origin_copy = tmp_dir / \"origin_copy\"\n stage = run_copy(\"origin_data\", fspath(origin_copy))\n assert stage is not None\n assert origin_copy.read_text() == \"origin data content\"\n stages[\"origin_copy\"] = stage\n\n origin_copy_2 = tmp_dir / \"dir\" / \"origin_copy_2\"\n stage = run_copy(\n fspath(origin_copy),\n fspath(origin_copy_2),\n fname=fspath(origin_copy_2) + \".dvc\",\n )\n assert stage is not None\n assert origin_copy_2.read_text() == \"origin data content\"\n stages[\"origin_copy_2\"] = stage\n\n dir_file_path = tmp_dir / \"data_dir\" / \"dir_file\"\n dir_file_copy = tmp_dir / \"dir\" / \"subdir\" / \"dir_file_copy\"\n stage = run_copy(\n fspath(dir_file_path),\n fspath(dir_file_copy),\n fname=fspath(dir_file_copy) + \".dvc\",\n )\n assert stage is not None\n assert dir_file_copy.read_text() == \"dir file content\"\n stages[\"dir_file_copy\"] = stage\n\n last_stage = tmp_dir / \"dir\" / \"Dvcfile\"\n stage = dvc.run(\n fname=fspath(last_stage),\n deps=[fspath(origin_copy_2), fspath(dir_file_copy)],\n )\n assert stage is not None\n stages[\"last_stage\"] = stage\n\n # Unrelated are to verify that reproducing `dir` will not trigger them too\n assert run_copy(fspath(origin_copy), \"unrelated1\") is not None\n assert run_copy(fspath(dir_file_path), \"unrelated2\") is not None\n\n yield stages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__rewrite_file_test_recursive_repro_default.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__rewrite_file_test_recursive_repro_default.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1435, "end_line": 1463, "span_ids": ["_read_out", "test_recursive_repro_default", "_rewrite_file"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _rewrite_file(path_elements, new_content):\n if isinstance(path_elements, str):\n path_elements = [path_elements]\n file = Path(os.sep.join(path_elements))\n file.unlink()\n file.write_text(new_content)\n\n\ndef _read_out(stage):\n return Path(stage.outs[0].fspath).read_text()\n\n\ndef test_recursive_repro_default(dvc, repro_dir):\n \"\"\"\n Test recursive repro on dir after a dep outside this dir has changed.\n \"\"\"\n _rewrite_file(\"origin_data\", \"new origin data content\")\n\n stages = dvc.reproduce(\"dir\", recursive=True)\n\n # Check that the dependency (\"origin_copy\") and the dependent stages\n # inside the folder have been reproduced (\"origin_copy_2\", \"last_stage\")\n assert stages == [\n repro_dir[\"origin_copy\"],\n repro_dir[\"origin_copy_2\"],\n repro_dir[\"last_stage\"],\n ]\n assert _read_out(repro_dir[\"origin_copy\"]) == \"new origin data content\"\n assert _read_out(repro_dir[\"origin_copy_2\"]) == \"new origin data content\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_test_recursive_repro_single.assert__read_out_repro_di": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_test_recursive_repro_single.assert__read_out_repro_di", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1466, "end_line": 1481, "span_ids": ["test_recursive_repro_single"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_repro_single(dvc, repro_dir):\n \"\"\"\n Test recursive single-item repro on dir\n after a dep outside this dir has changed.\n \"\"\"\n _rewrite_file(\"origin_data\", \"new origin content\")\n _rewrite_file([\"data_dir\", \"dir_file\"], \"new dir file content\")\n\n stages = dvc.reproduce(\"dir\", recursive=True, single_item=True)\n # Check that just stages inside given dir\n # with changed direct deps have been reproduced.\n # This means that \"origin_copy_2\" stage should not be reproduced\n # since it depends on \"origin_copy\".\n # Also check that \"dir_file_copy\" stage was reproduced before \"last_stage\"\n assert stages == [repro_dir[\"dir_file_copy\"], repro_dir[\"last_stage\"]]\n assert _read_out(repro_dir[\"dir_file_copy\"]) == \"new dir file content\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_force_test_recursive_repro_single_force.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_force_test_recursive_repro_single_force.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1484, "end_line": 1504, "span_ids": ["test_recursive_repro_single_force"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_repro_single_force(dvc, repro_dir):\n \"\"\"\n Test recursive single-item force repro on dir\n without any dependencies changing.\n \"\"\"\n stages = dvc.reproduce(\"dir\", recursive=True, single_item=True, force=True)\n # Check that all stages inside given dir have been reproduced\n # Also check that \"dir_file_copy\" stage was reproduced before \"last_stage\"\n # and that \"origin_copy\" stage was reproduced before \"last_stage\" stage\n assert len(stages) == 3\n assert set(stages) == {\n repro_dir[\"origin_copy_2\"],\n repro_dir[\"dir_file_copy\"],\n repro_dir[\"last_stage\"],\n }\n assert stages.index(repro_dir[\"origin_copy_2\"]) < stages.index(\n repro_dir[\"last_stage\"]\n )\n assert stages.index(repro_dir[\"dir_file_copy\"]) < stages.index(\n repro_dir[\"last_stage\"]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_empty_dir_test_recursive_repro_on_stage_file.assert_stages_repro_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_empty_dir_test_recursive_repro_on_stage_file.assert_stages_repro_d", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1507, "end_line": 1534, "span_ids": ["test_recursive_repro_recursive_missing_file", "test_recursive_repro_on_stage_file", "test_recursive_repro_empty_dir"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_repro_empty_dir(tmp_dir, dvc):\n \"\"\"\n Test recursive repro on an empty directory\n \"\"\"\n (tmp_dir / \"emptydir\").mkdir()\n\n stages = dvc.reproduce(\"emptydir\", recursive=True, force=True)\n assert stages == []\n\n\ndef test_recursive_repro_recursive_missing_file(dvc):\n \"\"\"\n Test recursive repro on a missing file\n \"\"\"\n with pytest.raises(StageFileDoesNotExistError):\n dvc.reproduce(\"notExistingStage.dvc\", recursive=True)\n with pytest.raises(StageFileDoesNotExistError):\n dvc.reproduce(\"notExistingDir/\", recursive=True)\n\n\ndef test_recursive_repro_on_stage_file(dvc, repro_dir):\n \"\"\"\n Test recursive repro on a stage file instead of directory\n \"\"\"\n stages = dvc.reproduce(\n repro_dir[\"origin_copy_2\"].relpath, recursive=True, force=True\n )\n assert stages == [repro_dir[\"origin_copy\"], repro_dir[\"origin_copy_2\"]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py_from_functools_import_wra_test_copy_singlepart_preserve_etag.RemoteS3__copy_s3_from_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py_from_functools_import_wra_test_copy_singlepart_preserve_etag.RemoteS3__copy_s3_from_i", "embedding": null, "metadata": {"file_path": "tests/func/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 46, "span_ids": ["imports", "_get_src_dst", "test_copy_singlepart_preserve_etag", "reduced_min_part_size"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from functools import wraps\n\nimport boto3\nimport moto.s3.models as s3model\nimport pytest\nfrom moto import mock_s3\n\nfrom dvc.remote.s3 import RemoteS3\nfrom tests.remotes import S3\n\n\n# from https://github.com/spulec/moto/blob/v1.3.5/tests/test_s3/test_s3.py#L40\nREDUCED_PART_SIZE = 256\n\n\ndef reduced_min_part_size(f):\n \"\"\" speed up tests by temporarily making the multipart minimum part size\n small\n \"\"\"\n orig_size = s3model.UPLOAD_PART_MIN_SIZE\n\n @wraps(f)\n def wrapped(*args, **kwargs):\n try:\n s3model.UPLOAD_PART_MIN_SIZE = REDUCED_PART_SIZE\n return f(*args, **kwargs)\n finally:\n s3model.UPLOAD_PART_MIN_SIZE = orig_size\n\n return wrapped\n\n\ndef _get_src_dst():\n base_info = RemoteS3.path_cls(S3.get_url())\n return base_info / \"from\", base_info / \"to\"\n\n\n@mock_s3\ndef test_copy_singlepart_preserve_etag():\n from_info, to_info = _get_src_dst()\n\n s3 = boto3.client(\"s3\")\n s3.create_bucket(Bucket=from_info.bucket)\n s3.put_object(Bucket=from_info.bucket, Key=from_info.path, Body=\"data\")\n\n RemoteS3._copy(s3, from_info, to_info, {})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_os_test_init_sub_dir.assert_scm_root_dir_fs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_os_test_init_sub_dir.assert_scm_root_dir_fs", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["test_init_none", "test_init_sub_dir", "imports", "test_init_git", "test_init_no_git"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport pytest\nfrom git import Repo\n\nfrom dvc.scm import Git\nfrom dvc.scm import NoSCM\nfrom dvc.scm import SCM\nfrom dvc.scm.base import SCMError\nfrom dvc.system import System\nfrom dvc.compat import fspath\nfrom tests.basic_env import TestGit\nfrom tests.basic_env import TestGitSubmodule\nfrom tests.utils import get_gitignore_content\n\n\ndef test_init_none(tmp_dir):\n assert isinstance(SCM(fspath(tmp_dir), no_scm=True), NoSCM)\n\n\ndef test_init_git(tmp_dir):\n Repo.init(fspath(tmp_dir))\n assert isinstance(SCM(fspath(tmp_dir)), Git)\n\n\ndef test_init_no_git(tmp_dir):\n with pytest.raises(SCMError):\n SCM(fspath(tmp_dir))\n\n\ndef test_init_sub_dir(tmp_dir):\n Repo.init(fspath(tmp_dir))\n subdir = tmp_dir / \"dir\"\n subdir.mkdir()\n\n scm = SCM(fspath(subdir))\n assert scm.root_dir == fspath(tmp_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGitSubmodule_test_ignored.assert_not_scm__ignored_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGitSubmodule_test_ignored.assert_not_scm__ignored_f", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 100, "span_ids": ["test_ignored", "TestSCMGitSubmodule.test_git_submodule", "TestSCMGitSubmodule.test_commit_in_submodule", "_count_gitignore_entries", "test_ignore", "TestSCMGitSubmodule"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSCMGitSubmodule(TestGitSubmodule):\n def test_git_submodule(self):\n self.assertIsInstance(SCM(os.curdir), Git)\n\n def test_commit_in_submodule(self):\n G = Git(self._root_dir)\n G.add([\"foo\"])\n G.commit(\"add\")\n self.assertTrue(\"foo\" in self.git.git.ls_files())\n\n\ndef _count_gitignore_entries(line):\n lines = get_gitignore_content()\n return lines.count(line)\n\n\ndef test_ignore(tmp_dir, scm):\n foo = fspath(tmp_dir / \"foo\")\n target = \"/foo\"\n\n scm.ignore(foo)\n assert (tmp_dir / \".gitignore\").is_file()\n assert _count_gitignore_entries(target) == 1\n\n scm.ignore(foo)\n assert (tmp_dir / \".gitignore\").is_file()\n assert _count_gitignore_entries(target) == 1\n\n scm.ignore_remove(foo)\n assert _count_gitignore_entries(target) == 0\n\n\ndef test_ignored(tmp_dir, scm):\n tmp_dir.gen({\"dir1\": {\"file1.jpg\": \"cont\", \"file2.txt\": \"cont\"}})\n tmp_dir.gen({\".gitignore\": \"dir1/*.jpg\"})\n\n assert scm._ignored(fspath(tmp_dir / \"dir1\" / \"file1.jpg\"))\n assert not scm._ignored(fspath(tmp_dir / \"dir1\" / \"file2.txt\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_get_gitignore_test_get_gitignore_symlink.assert_gitignore_fspat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_get_gitignore_test_get_gitignore_symlink.assert_gitignore_fspat", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 125, "span_ids": ["test_get_gitignore", "test_get_gitignore_symlink"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_gitignore(tmp_dir, scm):\n tmp_dir.gen({\"file1\": \"contents\", \"dir\": {}})\n\n data_dir = fspath(tmp_dir / \"file1\")\n entry, gitignore = scm._get_gitignore(data_dir)\n assert entry == \"/file1\"\n assert gitignore == fspath(tmp_dir / \".gitignore\")\n\n data_dir = fspath(tmp_dir / \"dir\")\n entry, gitignore = scm._get_gitignore(data_dir)\n\n assert entry == \"/dir\"\n assert gitignore == fspath(tmp_dir / \".gitignore\")\n\n\ndef test_get_gitignore_symlink(tmp_dir, scm):\n tmp_dir.gen({\"dir\": {\"subdir\": {\"data\": \"contents\"}}})\n link = fspath(tmp_dir / \"link\")\n target = fspath(tmp_dir / \"dir\" / \"subdir\" / \"data\")\n System.symlink(target, link)\n entry, gitignore = scm._get_gitignore(link)\n assert entry == \"/link\"\n assert gitignore == fspath(tmp_dir / \".gitignore\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_get_gitignore_subdir_test_get_gitignore_subdir.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_get_gitignore_subdir_test_get_gitignore_subdir.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 128, "end_line": 139, "span_ids": ["test_get_gitignore_subdir"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_gitignore_subdir(tmp_dir, scm):\n tmp_dir.gen({\"dir1\": {\"file1\": \"cont\", \"dir2\": {}}})\n\n data_dir = fspath(tmp_dir / \"dir1\" / \"file1\")\n entry, gitignore = scm._get_gitignore(data_dir)\n assert entry == \"/file1\"\n assert gitignore == fspath(tmp_dir / \"dir1\" / \".gitignore\")\n\n data_dir = fspath(tmp_dir / \"dir1\" / \"dir2\")\n entry, gitignore = scm._get_gitignore(data_dir)\n assert entry == \"/dir2\"\n assert gitignore == fspath(tmp_dir / \"dir1\" / \".gitignore\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_gitignore_should_end_with_newline_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_test_gitignore_should_end_with_newline_", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 142, "end_line": 170, "span_ids": ["test_gitignore_should_end_with_newline", "test_gitignore_should_append_newline_to_gitignore"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_gitignore_should_end_with_newline(tmp_dir, scm):\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n foo = fspath(tmp_dir / \"foo\")\n bar = fspath(tmp_dir / \"bar\")\n gitignore = tmp_dir / \".gitignore\"\n\n scm.ignore(foo)\n assert gitignore.read_text().endswith(\"\\n\")\n\n scm.ignore(bar)\n assert gitignore.read_text().endswith(\"\\n\")\n\n\ndef test_gitignore_should_append_newline_to_gitignore(tmp_dir, scm):\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n bar_path = fspath(tmp_dir / \"bar\")\n gitignore = tmp_dir / \".gitignore\"\n\n gitignore.write_text(\"/foo\")\n assert not gitignore.read_text().endswith(\"\\n\")\n\n scm.ignore(bar_path)\n contents = gitignore.read_text()\n assert gitignore.read_text().endswith(\"\\n\")\n\n assert contents.splitlines() == [\"/foo\", \"/bar\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestDefaultWorkingDirectory_TestDefaultWorkingDirectory.test_ignored_in_checksum.with_self_dvc_lock_self_.self_assertFalse_stage_ch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestDefaultWorkingDirectory_TestDefaultWorkingDirectory.test_ignored_in_checksum.with_self_dvc_lock_self_.self_assertFalse_stage_ch", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 94, "end_line": 110, "span_ids": ["TestDefaultWorkingDirectory", "TestDefaultWorkingDirectory.test_ignored_in_checksum"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDefaultWorkingDirectory(TestDvc):\n def test_ignored_in_checksum(self):\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(self.FOO),\n deps=[self.BAR],\n outs=[self.FOO],\n )\n\n d = stage.dumpd()\n self.assertNotIn(Stage.PARAM_WDIR, d.keys())\n\n d = load_stage_file(stage.relpath)\n self.assertNotIn(Stage.PARAM_WDIR, d.keys())\n\n with self.dvc.lock, self.dvc.state:\n stage = Dvcfile(self.dvc, stage.relpath).stage\n self.assertFalse(stage.changed())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_md5_ignores_comments_test_meta_is_preserved.assert_new_data_meta_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_md5_ignores_comments_test_meta_is_preserved.assert_new_data_meta_", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 154, "end_line": 178, "span_ids": ["test_meta_is_preserved", "test_md5_ignores_comments"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_md5_ignores_comments(tmp_dir, dvc):\n (stage,) = tmp_dir.dvc_gen(\"foo\", \"foo content\")\n\n with open(stage.path, \"a\") as f:\n f.write(\"# End comment\\n\")\n\n new_stage = Dvcfile(dvc, stage.path).stage\n assert not new_stage.changed_md5()\n\n\ndef test_meta_is_preserved(tmp_dir, dvc):\n (stage,) = tmp_dir.dvc_gen(\"foo\", \"foo content\")\n\n # Add meta to DVC-file\n data = load_stage_file(stage.path)\n data[\"meta\"] = {\"custom_key\": 42}\n dump_stage_file(stage.path, data)\n\n # Loading and dumping to test that it works and meta is retained\n dvcfile = Dvcfile(dvc, stage.path)\n new_stage = dvcfile.stage\n dvcfile.dump(new_stage)\n\n new_data = load_stage_file(stage.path)\n assert new_data[\"meta\"] == data[\"meta\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_parent_repo_collect_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_parent_repo_collect_stages_", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 185, "end_line": 199, "span_ids": ["test_parent_repo_collect_stages"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_parent_repo_collect_stages(tmp_dir, scm, dvc):\n tmp_dir.gen({\"subdir\": {}})\n subrepo_dir = tmp_dir / \"subdir\"\n\n with subrepo_dir.chdir():\n subrepo = Repo.init(subdir=True)\n subrepo_dir.gen(\"subrepo_file\", \"subrepo file content\")\n subrepo.add(\"subrepo_file\")\n\n stages = dvc.collect(None)\n subrepo_stages = subrepo.collect(None)\n\n assert stages == []\n assert subrepo_stages != []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_mock_test_state.with_state_.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_mock_test_state.with_state_.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "test_state"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\nimport os\n\nfrom dvc.path_info import PathInfo\nfrom dvc.state import State\nfrom dvc.utils import file_md5\n\n\ndef test_state(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo content\")\n path = tmp_dir / \"foo\"\n path_info = PathInfo(path)\n md5 = file_md5(path)[0]\n\n state = State(dvc)\n\n with state:\n state.save(path_info, md5)\n entry_md5 = state.get(path_info)\n assert entry_md5 == md5\n\n path.unlink()\n path.write_text(\"1\")\n\n entry_md5 = state.get(path_info)\n assert entry_md5 is None\n\n md5 = file_md5(path)[0]\n state.save(path_info, md5)\n\n entry_md5 = state.get(path_info)\n assert entry_md5 == md5", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_remove_links_test_remove_links.with_dvc_state_.assert_result_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_remove_links_test_remove_links.with_dvc_state_.assert_result_0", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 86, "span_ids": ["test_remove_links"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_remove_links(tmp_dir, dvc):\n tmp_dir.dvc_gen({\"foo\": \"foo_content\", \"bar\": \"bar_content\"})\n\n with dvc.state:\n cmd_count_links = \"SELECT count(*) FROM {}\".format(\n State.LINK_STATE_TABLE\n )\n result = dvc.state._execute(cmd_count_links).fetchone()[0]\n assert result == 2\n\n dvc.state.remove_links([\"foo\", \"bar\"])\n\n result = dvc.state._execute(cmd_count_links).fetchone()[0]\n assert result == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_unused_links_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_unused_links_", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 103, "span_ids": ["test_get_unused_links"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_unused_links(tmp_dir, dvc):\n tmp_dir.dvc_gen({\"foo\": \"foo_content\", \"bar\": \"bar_content\"})\n\n with dvc.state:\n links = [os.path.join(dvc.root_dir, link) for link in [\"foo\", \"bar\"]]\n assert set(dvc.state.get_unused_links([])) == {\"foo\", \"bar\"}\n assert set(dvc.state.get_unused_links(links[:1])) == {\"bar\"}\n assert set(dvc.state.get_unused_links(links)) == set()\n assert set(\n dvc.state.get_unused_links(\n used=links[:1]\n + [os.path.join(dvc.root_dir, \"not-existing-file\")]\n )\n ) == {\"bar\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_os_TestStatus.test_implied_cloud.mock_status_assert_called": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_os_TestStatus.test_implied_cloud.mock_status_assert_called", "embedding": null, "metadata": {"file_path": "tests/func/test_status.py", "file_name": "test_status.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports", "TestStatus.test_implied_cloud", "TestStatus.test_quiet", "TestStatus"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom mock import patch\n\nfrom dvc.main import main\nfrom dvc.compat import fspath\nfrom tests.basic_env import TestDvc\n\n\nclass TestStatus(TestDvc):\n def test_quiet(self):\n self.dvc.add(self.FOO)\n\n ret = main([\"status\", \"--quiet\"])\n self.assertEqual(ret, 0)\n\n os.remove(self.FOO)\n os.rename(self.BAR, self.FOO)\n\n ret = main([\"status\", \"--quiet\"])\n self.assertEqual(ret, 1)\n\n @patch(\"dvc.repo.status._cloud_status\", return_value=True)\n def test_implied_cloud(self, mock_status):\n main([\"status\", \"--remote\", \"something\"])\n mock_status.assert_called()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_non_dvc_repo_import_test_status_non_dvc_repo_import.assert_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_non_dvc_repo_import_test_status_non_dvc_repo_import.assert_status_", "embedding": null, "metadata": {"file_path": "tests/func/test_status.py", "file_name": "test_status.py", "file_type": "text/x-python", "category": "test", "start_line": 29, "end_line": 43, "span_ids": ["test_status_non_dvc_repo_import"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_status_non_dvc_repo_import(tmp_dir, dvc, git_dir):\n with git_dir.branch(\"branch\", new=True):\n git_dir.scm_gen(\"file\", \"first version\", commit=\"first version\")\n\n dvc.imp(fspath(git_dir), \"file\", \"file\", rev=\"branch\")\n\n assert dvc.status([\"file.dvc\"]) == {}\n\n with git_dir.branch(\"branch\", new=False):\n git_dir.scm_gen(\"file\", \"second version\", commit=\"update file\")\n\n (status,) = dvc.status([\"file.dvc\"])[\"file.dvc\"]\n assert status == {\n \"changed deps\": {\"file ({})\".format(git_dir): \"update available\"}\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_before_and_after_dvc_init_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_before_and_after_dvc_init_", "embedding": null, "metadata": {"file_path": "tests/func/test_status.py", "file_name": "test_status.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 69, "span_ids": ["test_status_before_and_after_dvc_init"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_status_before_and_after_dvc_init(tmp_dir, dvc, git_dir):\n git_dir.scm_gen(\"file\", \"first version\", commit=\"first verison\")\n old_rev = git_dir.scm.get_rev()\n\n dvc.imp(fspath(git_dir), \"file\", \"file\")\n\n assert dvc.status([\"file.dvc\"]) == {}\n\n with git_dir.chdir():\n git_dir.init(dvc=True)\n git_dir.scm.repo.index.remove([\"file\"])\n os.remove(\"file\")\n git_dir.dvc_gen(\"file\", \"second version\", commit=\"with dvc\")\n new_rev = git_dir.scm.get_rev()\n\n assert old_rev != new_rev\n\n (status,) = dvc.status([\"file.dvc\"])[\"file.dvc\"]\n assert status == {\n \"changed deps\": {\n \"file ({})\".format(fspath(git_dir)): \"update available\"\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_filecmp_TestTag.test.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_filecmp_TestTag.test.None_12", "embedding": null, "metadata": {"file_path": "tests/func/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 44, "span_ids": ["TestTag", "imports", "TestTag.test"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import filecmp\nimport logging\nimport os\nimport shutil\n\nfrom dvc.main import main\nfrom dvc.utils import from_yaml_string\nfrom tests.basic_env import TestDvc\n\n\nclass TestTag(TestDvc):\n def test(self):\n fname = \"file\"\n shutil.copyfile(self.FOO, fname)\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n\n ret = main([\"tag\", \"add\", \"v1\", stage.path])\n self.assertEqual(ret, 0)\n\n os.unlink(fname)\n shutil.copyfile(self.BAR, fname)\n\n ret = main([\"repro\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"tag\", \"add\", \"v2\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"tag\", \"list\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"checkout\", stage.path + \"@v1\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(filecmp.cmp(fname, self.FOO, shallow=False))\n\n ret = main([\"checkout\", stage.path + \"@v2\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(filecmp.cmp(fname, self.BAR, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAll_TestTagAll.test.with_self__caplog_at_leve.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAll_TestTagAll.test.with_self__caplog_at_leve.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 92, "span_ids": ["TestTagAll.test", "TestTagAll"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestTagAll(TestDvc):\n def test(self):\n with self._caplog.at_level(logging.INFO, logger=\"dvc\"):\n ret = main([\"add\", self.FOO, self.BAR])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\"\", self._caplog.text)\n\n ret = main([\"tag\", \"add\", \"v1\"])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n expected = {\n \"foo.dvc\": {\n \"foo\": {\"v1\": {\"md5\": \"acbd18db4cc2f85cedef654fccc4a4d8\"}}\n },\n \"bar.dvc\": {\n \"bar\": {\"v1\": {\"md5\": \"8978c98bb5a48c2fb5f2c4c905768afa\"}}\n },\n }\n\n stdout = \"\\n\".join(\n record.message for record in self._caplog.records\n )\n received = from_yaml_string(stdout)\n\n assert expected == received\n\n ret = main([\"tag\", \"remove\", \"v1\"])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\"\", self._caplog.text)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_GitTreeTests_GitTreeTests.test_isfile.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_GitTreeTests_GitTreeTests.test_isfile.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 77, "span_ids": ["GitTreeTests", "GitTreeTests.test_isfile", "GitTreeTests.test_exists", "GitTreeTests.test_isdir", "GitTreeTests.test_open"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GitTreeTests(object):\n def test_open(self):\n self.scm.add([self.FOO, self.UNICODE, self.DATA_DIR])\n self.scm.commit(\"add\")\n with self.tree.open(self.FOO) as fd:\n self.assertEqual(fd.read(), self.FOO_CONTENTS)\n with self.tree.open(self.UNICODE) as fd:\n self.assertEqual(fd.read(), self.UNICODE_CONTENTS)\n with self.assertRaises(IOError):\n self.tree.open(\"not-existing-file\")\n with self.assertRaises(IOError):\n self.tree.open(self.DATA_DIR)\n\n def test_exists(self):\n self.assertFalse(self.tree.exists(self.FOO))\n self.assertFalse(self.tree.exists(self.UNICODE))\n self.assertFalse(self.tree.exists(self.DATA_DIR))\n self.scm.add([self.FOO, self.UNICODE, self.DATA])\n self.scm.commit(\"add\")\n self.assertTrue(self.tree.exists(self.FOO))\n self.assertTrue(self.tree.exists(self.UNICODE))\n self.assertTrue(self.tree.exists(self.DATA_DIR))\n self.assertFalse(self.tree.exists(\"non-existing-file\"))\n\n def test_isdir(self):\n self.scm.add([self.FOO, self.DATA_DIR])\n self.scm.commit(\"add\")\n self.assertTrue(self.tree.isdir(self.DATA_DIR))\n self.assertFalse(self.tree.isdir(self.FOO))\n self.assertFalse(self.tree.isdir(\"non-existing-file\"))\n\n def test_isfile(self):\n self.scm.add([self.FOO, self.DATA_DIR])\n self.scm.commit(\"add\")\n self.assertTrue(self.tree.isfile(self.FOO))\n self.assertFalse(self.tree.isfile(self.DATA_DIR))\n self.assertFalse(self.tree.isfile(\"not-existing-file\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestGitTree_AssertWalkEqualMixin.assertWalkEqual.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestGitTree_AssertWalkEqualMixin.assertWalkEqual.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 80, "end_line": 105, "span_ids": ["TestGitTree.setUp", "TestGitTree", "AssertWalkEqualMixin", "AssertWalkEqualMixin.assertWalkEqual", "TestGitSubmoduleTree", "TestGitSubmoduleTree.setUp"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitTree(TestGit, GitTreeTests):\n def setUp(self):\n super().setUp()\n self.scm = SCM(self._root_dir)\n self.tree = GitTree(self.git, \"master\")\n\n\nclass TestGitSubmoduleTree(TestGitSubmodule, GitTreeTests):\n def setUp(self):\n super().setUp()\n self.scm = SCM(self._root_dir)\n self.tree = GitTree(self.git, \"master\")\n self._pushd(self._root_dir)\n\n\nclass AssertWalkEqualMixin(object):\n def assertWalkEqual(self, actual, expected, msg=None):\n def convert_to_sets(walk_results):\n return [\n (root, set(dirs), set(nondirs))\n for root, dirs, nondirs in walk_results\n ]\n\n self.assertEqual(\n convert_to_sets(actual), convert_to_sets(expected), msg=msg\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInNoSCM_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInNoSCM_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 108, "end_line": 133, "span_ids": ["TestWalkInNoSCM.test_subdir", "TestWalkInNoSCM.test", "TestWalkInNoSCM"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestWalkInNoSCM(AssertWalkEqualMixin, TestDir):\n def test(self):\n tree = WorkingTree(self._root_dir)\n self.assertWalkEqual(\n tree.walk(self._root_dir),\n [\n (\n self._root_dir,\n [\"data_dir\"],\n [\"code.py\", \"bar\", \"\u0442\u0435\u0441\u0442\", \"foo\"],\n ),\n (join(self._root_dir, \"data_dir\"), [\"data_sub_dir\"], [\"data\"]),\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n ),\n ],\n )\n\n def test_subdir(self):\n tree = WorkingTree(self._root_dir)\n self.assertWalkEqual(\n tree.walk(join(\"data_dir\", \"data_sub_dir\")),\n [(join(\"data_dir\", \"data_sub_dir\"), [], [\"data_sub\"])],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_pytest_test_update_import.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_pytest_test_update_import.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "test_update_import"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport os\n\nfrom dvc.dvcfile import Dvcfile\nfrom dvc.compat import fspath, fspath_py35\n\n\n@pytest.mark.parametrize(\"cached\", [True, False])\ndef test_update_import(tmp_dir, dvc, erepo_dir, cached):\n gen = erepo_dir.dvc_gen if cached else erepo_dir.scm_gen\n\n with erepo_dir.branch(\"branch\", new=True), erepo_dir.chdir():\n gen(\"version\", \"branch\", \"add version file\")\n old_rev = erepo_dir.scm.get_rev()\n\n stage = dvc.imp(fspath(erepo_dir), \"version\", \"version\", rev=\"branch\")\n\n assert (tmp_dir / \"version\").read_text() == \"branch\"\n assert stage.deps[0].def_repo[\"rev_lock\"] == old_rev\n\n # Update version file\n with erepo_dir.branch(\"branch\", new=False), erepo_dir.chdir():\n gen(\"version\", \"updated\", \"update version content\")\n new_rev = erepo_dir.scm.get_rev()\n\n assert old_rev != new_rev\n\n dvc.update(stage.path)\n assert (tmp_dir / \"version\").read_text() == \"updated\"\n\n stage = Dvcfile(dvc, stage.path).stage\n assert stage.deps[0].def_repo[\"rev_lock\"] == new_rev", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_import_after_remote_updates_to_dvc_test_update_import_after_remote_updates_to_dvc.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_import_after_remote_updates_to_dvc_test_update_import_after_remote_updates_to_dvc.None_11", "embedding": null, "metadata": {"file_path": "tests/func/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 79, "span_ids": ["test_update_import_after_remote_updates_to_dvc"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_update_import_after_remote_updates_to_dvc(tmp_dir, dvc, erepo_dir):\n old_rev = None\n with erepo_dir.branch(\"branch\", new=True), erepo_dir.chdir():\n erepo_dir.scm_gen(\"version\", \"branch\", commit=\"add version file\")\n old_rev = erepo_dir.scm.get_rev()\n\n stage = dvc.imp(fspath(erepo_dir), \"version\", \"version\", rev=\"branch\")\n\n imported = tmp_dir / \"version\"\n assert imported.is_file()\n assert imported.read_text() == \"branch\"\n assert stage.deps[0].def_repo == {\n \"url\": fspath(erepo_dir),\n \"rev\": \"branch\",\n \"rev_lock\": old_rev,\n }\n\n new_rev = None\n with erepo_dir.branch(\"branch\", new=False), erepo_dir.chdir():\n erepo_dir.scm.repo.index.remove([\"version\"])\n erepo_dir.dvc_gen(\"version\", \"updated\")\n erepo_dir.scm.add([\"version\", \"version.dvc\"])\n erepo_dir.scm.commit(\"upgrade to DVC tracking\")\n new_rev = erepo_dir.scm.get_rev()\n\n assert old_rev != new_rev\n\n (status,) = dvc.status([stage.path])[\"version.dvc\"]\n (changed_dep,) = list(status[\"changed deps\"].items())\n assert changed_dep[0].startswith(\"version \")\n assert changed_dep[1] == \"update available\"\n\n dvc.update(stage.path)\n\n assert dvc.status([stage.path]) == {}\n\n assert imported.is_file()\n assert imported.read_text() == \"updated\"\n\n stage = Dvcfile(dvc, stage.path).stage\n assert stage.deps[0].def_repo == {\n \"url\": fspath(erepo_dir),\n \"rev\": \"branch\",\n \"rev_lock\": new_rev,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_before_and_after_dvc_init_test_update_before_and_after_dvc_init.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_before_and_after_dvc_init_test_update_before_and_after_dvc_init.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 82, "end_line": 111, "span_ids": ["test_update_before_and_after_dvc_init"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_update_before_and_after_dvc_init(tmp_dir, dvc, git_dir):\n with git_dir.chdir():\n git_dir.scm_gen(\"file\", \"first version\", commit=\"first version\")\n old_rev = git_dir.scm.get_rev()\n\n stage = dvc.imp(fspath(git_dir), \"file\", \"file\")\n\n with git_dir.chdir():\n git_dir.init(dvc=True)\n git_dir.scm.repo.index.remove([\"file\"])\n os.remove(\"file\")\n git_dir.dvc_gen(\"file\", \"second version\", commit=\"with dvc\")\n new_rev = git_dir.scm.get_rev()\n\n assert old_rev != new_rev\n\n assert dvc.status([stage.path]) == {\n \"file.dvc\": [\n {\n \"changed deps\": {\n \"file ({})\".format(fspath(git_dir)): \"update available\"\n }\n }\n ]\n }\n\n dvc.update(stage.path)\n\n assert (tmp_dir / \"file\").read_text() == \"second version\"\n assert dvc.status([stage.path]) == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_import_url_test_update_import_url.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_import_url_test_update_import_url.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 114, "end_line": 133, "span_ids": ["test_update_import_url"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_update_import_url(tmp_dir, dvc, tmp_path_factory):\n import_src = tmp_path_factory.mktemp(\"import_url_source\")\n src = import_src / \"file\"\n src.write_text(\"file content\")\n\n dst = tmp_dir / \"imported_file\"\n stage = dvc.imp_url(fspath(src), fspath(dst))\n\n assert dst.is_file()\n assert dst.read_text() == \"file content\"\n\n # update data\n src.write_text(\"updated file content\")\n\n assert dvc.status([stage.path]) == {}\n dvc.update(stage.path)\n assert dvc.status([stage.path]) == {}\n\n assert dst.is_file()\n assert dst.read_text() == \"updated file content\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_rev_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_rev_", "embedding": null, "metadata": {"file_path": "tests/func/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 136, "end_line": 168, "span_ids": ["test_update_rev"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_update_rev(tmp_dir, dvc, scm, git_dir):\n with git_dir.chdir():\n git_dir.scm_gen({\"foo\": \"foo\"}, commit=\"first\")\n\n dvc.imp(fspath(git_dir), \"foo\")\n assert (tmp_dir / \"foo.dvc\").exists()\n\n with git_dir.chdir(), git_dir.branch(\"branch1\", new=True):\n git_dir.scm_gen({\"foo\": \"foobar\"}, commit=\"branch1 commit\")\n branch1_head = git_dir.scm.get_rev()\n\n with git_dir.chdir(), git_dir.branch(\"branch2\", new=True):\n git_dir.scm_gen({\"foo\": \"foobar foo\"}, commit=\"branch2 commit\")\n branch2_head = git_dir.scm.get_rev()\n\n stage = dvc.update(\"foo.dvc\", rev=\"branch1\")\n assert stage.deps[0].def_repo == {\n \"url\": fspath(git_dir),\n \"rev\": \"branch1\",\n \"rev_lock\": branch1_head,\n }\n with open(fspath_py35(tmp_dir / \"foo\")) as f:\n assert \"foobar\" == f.read()\n\n stage = dvc.update(\"foo.dvc\", rev=\"branch2\")\n assert stage.deps[0].def_repo == {\n \"url\": fspath(git_dir),\n \"rev\": \"branch2\",\n \"rev_lock\": branch2_head,\n }\n with open(fspath_py35(tmp_dir / \"foo\")) as f:\n assert \"foobar foo\" == f.read()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_utils.py__encoding_utf_8_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_utils.py__encoding_utf_8_", "embedding": null, "metadata": {"file_path": "tests/func/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["test_dict_md5", "test_boxify", "test_file_md5_crlf", "docstring"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# encoding: utf-8\n\nfrom dvc import utils\n\n\ndef test_file_md5_crlf(tmp_dir):\n tmp_dir.gen(\"cr\", b\"a\\nb\\nc\")\n tmp_dir.gen(\"crlf\", b\"a\\r\\nb\\r\\nc\")\n assert utils.file_md5(\"cr\")[0] == utils.file_md5(\"crlf\")[0]\n\n\ndef test_dict_md5():\n d = {\n \"cmd\": \"python code.py foo file1\",\n \"locked\": \"true\",\n \"outs\": [\n {\n \"path\": \"file1\",\n \"metric\": {\"type\": \"raw\"},\n \"cache\": False,\n \"md5\": \"acbd18db4cc2f85cedef654fccc4a4d8\",\n }\n ],\n \"deps\": [\n {\"path\": \"foo\", \"md5\": \"acbd18db4cc2f85cedef654fccc4a4d8\"},\n {\"path\": \"code.py\", \"md5\": \"d05447644b89960913c7eee5fd776adb\"},\n ],\n }\n\n md5 = \"8b263fa05ede6c3145c164829be694b4\"\n\n assert md5 == utils.dict_md5(d, exclude=[\"metric\", \"locked\"])\n\n\ndef test_boxify():\n expected = (\n \"+-----------------+\\n\"\n \"| |\\n\"\n \"| message |\\n\"\n \"| |\\n\"\n \"+-----------------+\\n\"\n )\n\n assert expected == utils.boxify(\"message\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_os_test_info_in_repo.if_scm_init_.else_.assert_Repo_dvc_no_scm": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_os_test_info_in_repo.if_scm_init_.else_.assert_Repo_dvc_no_scm", "embedding": null, "metadata": {"file_path": "tests/func/test_version.py", "file_name": "test_version.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "test_info_in_repo"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport re\nimport shutil\n\nimport pytest\n\nfrom dvc.command.version import psutil\nfrom dvc.main import main\n\n\n@pytest.mark.parametrize(\"scm_init\", [True, False])\ndef test_info_in_repo(scm_init, tmp_dir, caplog):\n tmp_dir.init(scm=scm_init, dvc=True)\n # Create `.dvc/cache`, that is needed to check supported link types.\n os.mkdir(tmp_dir.dvc.cache.local.cache_dir)\n\n assert main([\"version\"]) == 0\n\n assert re.search(r\"DVC version: \\d+\\.\\d+\\.\\d+\", caplog.text)\n assert re.search(r\"Python version: \\d\\.\\d\\.\\d\", caplog.text)\n assert re.search(r\"Platform: .*\", caplog.text)\n assert re.search(r\"Binary: (True|False)\", caplog.text)\n assert re.search(r\"Package: .*\", caplog.text)\n assert re.search(r\"Supported remotes: .*\", caplog.text)\n assert re.search(\n r\"(Cache: (.*link - (not )?supported(,\\s)?){3})\", caplog.text\n )\n\n if scm_init:\n assert \"Repo: dvc, git\" in caplog.text\n else:\n assert \"Repo: dvc (no_scm)\" in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_in_subdir_test_fs_info_in_repo.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_in_subdir_test_fs_info_in_repo.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_version.py", "file_name": "test_version.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 62, "span_ids": ["test_fs_info_in_repo", "test_info_in_broken_git_repo", "test_info_in_subdir"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_info_in_subdir(tmp_dir, scm, caplog):\n dvc_subdir = tmp_dir / \"subdir\"\n dvc_subdir.mkdir()\n\n with dvc_subdir.chdir():\n dvc_subdir.init(scm=False, dvc=True)\n with dvc_subdir.dvc.config.edit() as conf:\n del conf[\"core\"][\"no_scm\"]\n\n assert main([\"version\"]) == 0\n\n assert \"Repo: dvc (subdir), git\" in caplog.text\n\n\ndef test_info_in_broken_git_repo(tmp_dir, dvc, scm, caplog):\n shutil.rmtree(dvc.scm.dir)\n assert main([\"version\"]) == 0\n\n assert \"Repo: dvc, git (broken)\" in caplog.text\n\n\n@pytest.mark.skipif(psutil is None, reason=\"No psutil.\")\ndef test_fs_info_in_repo(tmp_dir, dvc, caplog):\n os.mkdir(dvc.cache.local.cache_dir)\n assert main([\"version\"]) == 0\n\n assert \"Filesystem type (cache directory): \" in caplog.text\n assert \"Filesystem type (workspace): \" in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_os_Local.get_url.return.Local_get_storagepath_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_os_Local.get_url.return.Local_get_storagepath_", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 50, "span_ids": ["imports", "Local.get_url", "Local.get_storagepath", "Local"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport platform\nimport uuid\nimport getpass\n\nfrom contextlib import contextmanager\nfrom subprocess import CalledProcessError, check_output, Popen\n\nfrom dvc.utils import env2bool\nfrom dvc.remote import RemoteGDrive\nfrom dvc.remote.gs import RemoteGS\nfrom dvc.remote.s3 import RemoteS3\nfrom tests.basic_env import TestDvc\n\nfrom moto.s3 import mock_s3\n\n\nTEST_REMOTE = \"upstream\"\nTEST_CONFIG = {\n \"cache\": {},\n \"core\": {\"remote\": TEST_REMOTE},\n \"remote\": {TEST_REMOTE: {\"url\": \"\"}},\n}\n\nTEST_AWS_REPO_BUCKET = os.environ.get(\"DVC_TEST_AWS_REPO_BUCKET\", \"dvc-temp\")\nTEST_GCP_REPO_BUCKET = os.environ.get(\"DVC_TEST_GCP_REPO_BUCKET\", \"dvc-test\")\nTEST_OSS_REPO_BUCKET = \"dvc-test\"\n\nTEST_GCP_CREDS_FILE = os.path.abspath(\n os.environ.get(\n \"GOOGLE_APPLICATION_CREDENTIALS\",\n os.path.join(\"scripts\", \"ci\", \"gcp-creds.json\"),\n )\n)\n# Ensure that absolute path is used\nos.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"] = TEST_GCP_CREDS_FILE\n\nalways_test = staticmethod(lambda: True)\n\n\nclass Local:\n should_test = always_test\n\n @staticmethod\n def get_storagepath():\n return TestDvc.mkdtemp()\n\n @staticmethod\n def get_url():\n return Local.get_storagepath()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_S3_S3.get_url.return._s3_S3_get_storagep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_S3_S3.get_url.return._s3_S3_get_storagep", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 73, "span_ids": ["S3", "S3.get_storagepath", "S3.should_test", "S3.get_url"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class S3:\n @staticmethod\n def should_test():\n do_test = env2bool(\"DVC_TEST_AWS\", undefined=None)\n if do_test is not None:\n return do_test\n\n if os.getenv(\"AWS_ACCESS_KEY_ID\") and os.getenv(\n \"AWS_SECRET_ACCESS_KEY\"\n ):\n return True\n\n return False\n\n @staticmethod\n def get_storagepath():\n return TEST_AWS_REPO_BUCKET + \"/\" + str(uuid.uuid4())\n\n @staticmethod\n def get_url():\n return \"s3://\" + S3.get_storagepath()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_S3Mocked_S3Mocked.put_objects.for_key_body_in_objects_.s3_put_object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_S3Mocked_S3Mocked.put_objects.for_key_body_in_objects_.s3_put_object_", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 93, "span_ids": ["S3Mocked", "S3Mocked.put_objects", "S3Mocked.remote"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class S3Mocked(S3):\n should_test = always_test\n\n @classmethod\n @contextmanager\n def remote(cls, repo):\n with mock_s3():\n yield RemoteS3(repo, {\"url\": cls.get_url()})\n\n @staticmethod\n def put_objects(remote, objects):\n s3 = remote.s3\n bucket = remote.path_info.bucket\n s3.create_bucket(Bucket=bucket)\n for key, body in objects.items():\n s3.put_object(\n Bucket=bucket, Key=(remote.path_info / key).path, Body=body\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_GCP_GCP.put_objects.for_key_body_in_objects_.bucket_blob_remote_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_GCP_GCP.put_objects.for_key_body_in_objects_.bucket_blob_remote_path_", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 138, "span_ids": ["GCP.get_url", "GCP.should_test", "GCP.remote", "GCP.put_objects", "GCP", "GCP.get_storagepath"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GCP:\n @staticmethod\n def should_test():\n do_test = env2bool(\"DVC_TEST_GCP\", undefined=None)\n if do_test is not None:\n return do_test\n\n if not os.path.exists(TEST_GCP_CREDS_FILE):\n return False\n\n try:\n check_output(\n [\n \"gcloud\",\n \"auth\",\n \"activate-service-account\",\n \"--key-file\",\n TEST_GCP_CREDS_FILE,\n ]\n )\n except (CalledProcessError, OSError):\n return False\n return True\n\n @staticmethod\n def get_storagepath():\n return TEST_GCP_REPO_BUCKET + \"/\" + str(uuid.uuid4())\n\n @staticmethod\n def get_url():\n return \"gs://\" + GCP.get_storagepath()\n\n @classmethod\n @contextmanager\n def remote(cls, repo):\n yield RemoteGS(repo, {\"url\": cls.get_url()})\n\n @staticmethod\n def put_objects(remote, objects):\n client = remote.gs\n bucket = client.get_bucket(remote.path_info.bucket)\n for key, body in objects.items():\n bucket.blob((remote.path_info / key).path).upload_from_string(body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_GDrive_Azure.get_url.return._azure_format_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_GDrive_Azure.get_url.return._azure_format_co", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 167, "span_ids": ["Azure.should_test", "Azure", "Azure.get_url", "GDrive", "GDrive.should_test", "GDrive.get_url"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GDrive:\n @staticmethod\n def should_test():\n return os.getenv(RemoteGDrive.GDRIVE_CREDENTIALS_DATA) is not None\n\n def get_url(self):\n if not getattr(self, \"_remote_url\", None):\n self._remote_url = \"gdrive://root/\" + str(uuid.uuid4())\n return self._remote_url\n\n\nclass Azure:\n @staticmethod\n def should_test():\n do_test = env2bool(\"DVC_TEST_AZURE\", undefined=None)\n if do_test is not None:\n return do_test\n\n return os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\") and os.getenv(\n \"AZURE_STORAGE_CONNECTION_STRING\"\n )\n\n @staticmethod\n def get_url():\n container_name = os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\")\n assert container_name is not None\n return \"azure://{}/{}\".format(container_name, str(uuid.uuid4()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_OSS_OSS.get_url.return._oss_format_OSS_get": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_OSS_OSS.get_url.return._oss_format_OSS_get", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 189, "span_ids": ["OSS", "OSS.get_url", "OSS.get_storagepath", "OSS.should_test"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OSS:\n @staticmethod\n def should_test():\n do_test = env2bool(\"DVC_TEST_OSS\", undefined=None)\n if do_test is not None:\n return do_test\n\n return (\n os.getenv(\"OSS_ENDPOINT\")\n and os.getenv(\"OSS_ACCESS_KEY_ID\")\n and os.getenv(\"OSS_ACCESS_KEY_SECRET\")\n )\n\n @staticmethod\n def get_storagepath():\n return \"{}/{}\".format(TEST_OSS_REPO_BUCKET, (uuid.uuid4()))\n\n @staticmethod\n def get_url():\n return \"oss://{}\".format(OSS.get_storagepath())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_SSH_SSH.get_url.return._ssh_127_0_0_1_22_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_SSH_SSH.get_url.return._ssh_127_0_0_1_22_", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 192, "end_line": 214, "span_ids": ["SSH.get_url", "SSH.should_test", "SSH"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSH:\n @staticmethod\n def should_test():\n do_test = env2bool(\"DVC_TEST_SSH\", undefined=None)\n if do_test is not None:\n return do_test\n\n # FIXME: enable on windows\n if os.name == \"nt\":\n return False\n\n try:\n check_output([\"ssh\", \"-o\", \"BatchMode=yes\", \"127.0.0.1\", \"ls\"])\n except (CalledProcessError, IOError):\n return False\n\n return True\n\n @staticmethod\n def get_url():\n return \"ssh://{}@127.0.0.1:22{}\".format(\n getpass.getuser(), Local.get_storagepath()\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_SSHMocked_SSHMocked.get_url.return.url": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_SSHMocked_SSHMocked.get_url.return.url", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 217, "end_line": 239, "span_ids": ["SSHMocked", "SSHMocked.get_url"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHMocked:\n should_test = always_test\n\n @staticmethod\n def get_url(user, port):\n path = Local.get_storagepath()\n if os.name == \"nt\":\n # NOTE: On Windows Local.get_storagepath() will return an\n # ntpath that looks something like `C:\\some\\path`, which is not\n # compatible with SFTP paths [1], so we need to convert it to\n # a proper posixpath.\n # To do that, we should construct a posixpath that would be\n # relative to the server's root.\n # In our case our ssh server is running with `c:/` as a root,\n # and our URL format requires absolute paths, so the\n # resulting path would look like `/some/path`.\n #\n # [1]https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-6\n drive, path = os.path.splitdrive(path)\n assert drive.lower() == \"c:\"\n path = path.replace(\"\\\\\", \"/\")\n url = \"ssh://{}@127.0.0.1:{}{}\".format(user, port, path)\n return url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_HDFS_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes.py_HDFS_", "embedding": null, "metadata": {"file_path": "tests/remotes.py", "file_name": "remotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 242, "end_line": 281, "span_ids": ["HDFS", "HDFS.get_url", "HTTP.get_url", "HDFS.should_test", "HTTP"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HDFS:\n @staticmethod\n def should_test():\n if platform.system() != \"Linux\":\n return False\n\n try:\n check_output(\n [\"hadoop\", \"version\"],\n shell=True,\n executable=os.getenv(\"SHELL\"),\n )\n except (CalledProcessError, IOError):\n return False\n\n p = Popen(\n \"hadoop fs -ls hdfs://127.0.0.1/\",\n shell=True,\n executable=os.getenv(\"SHELL\"),\n )\n p.communicate()\n if p.returncode != 0:\n return False\n\n return True\n\n @staticmethod\n def get_url():\n return \"hdfs://{}@127.0.0.1{}\".format(\n getpass.getuser(), Local.get_storagepath()\n )\n\n\nclass HTTP:\n should_test = always_test\n\n @staticmethod\n def get_url(port):\n return \"http://127.0.0.1:{}\".format(port)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/ls/test_ls.py_from_dvc_cli_import_parse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/ls/test_ls.py_from_dvc_cli_import_parse_", "embedding": null, "metadata": {"file_path": "tests/unit/command/ls/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 55, "span_ids": ["test_list_git_ssh_rev", "test_list_recursive", "imports", "test_list_outputs_only", "_test_cli", "test_list_targets", "test_list"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.ls import CmdList\n\n\ndef _test_cli(mocker, *args):\n cli_args = parse_args([\"list\", *args])\n assert cli_args.func == CmdList\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.Repo.ls\")\n\n assert cmd.run() == 0\n return m\n\n\ndef test_list(mocker):\n url = \"local_dir\"\n m = _test_cli(mocker, url)\n m.assert_called_once_with(\n url, None, recursive=False, rev=None, outs_only=False\n )\n\n\ndef test_list_recursive(mocker):\n url = \"local_dir\"\n m = _test_cli(mocker, url, \"-R\")\n m.assert_called_once_with(\n url, None, recursive=True, rev=None, outs_only=False\n )\n\n\ndef test_list_git_ssh_rev(mocker):\n url = \"git@github.com:repo\"\n m = _test_cli(mocker, url, \"--rev\", \"123\")\n m.assert_called_once_with(\n url, None, recursive=False, rev=\"123\", outs_only=False\n )\n\n\ndef test_list_targets(mocker):\n url = \"local_dir\"\n target = \"subdir\"\n m = _test_cli(mocker, url, target)\n m.assert_called_once_with(\n url, target, recursive=False, rev=None, outs_only=False\n )\n\n\ndef test_list_outputs_only(mocker):\n url = \"local_dir\"\n m = _test_cli(mocker, url, None, \"--outs-only\")\n m.assert_called_once_with(\n url, None, recursive=False, rev=None, outs_only=True\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/ls/test_ls_colors.py_from_dvc_command_ls_ls_co_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/ls/test_ls_colors.py_from_dvc_command_ls_ls_co_", "embedding": null, "metadata": {"file_path": "tests/unit/command/ls/test_ls_colors.py", "file_name": "test_ls_colors.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 59, "span_ids": ["test_ls_colors_dir", "test_ls_colors_out_file", "test_ls_colors_exec", "imports", "test_ls_colors_file", "colorize", "test_ls_colors_out_exec", "test_ls_colors_out_dir", "test_ls_colors_ext", "test_ls_colors_out_ext"], "tokens": 472}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.command.ls.ls_colors import LsColors\n\n\ndef colorize(ls_colors):\n def _colorize(f, spec=\"\"):\n fs_path = {\n \"path\": f,\n \"isexec\": \"e\" in spec,\n \"isdir\": \"d\" in spec,\n \"isout\": \"o\" in spec,\n }\n return ls_colors.format(fs_path)\n\n return _colorize\n\n\ndef test_ls_colors_out_file():\n ls_colors = LsColors(LsColors.default)\n assert colorize(ls_colors)(\"file\", \"o\") == \"file\"\n\n\ndef test_ls_colors_out_dir():\n ls_colors = LsColors(LsColors.default)\n assert colorize(ls_colors)(\"dir\", \"do\") == \"\\x1b[01;34mdir\\x1b[0m\"\n\n\ndef test_ls_colors_out_exec():\n ls_colors = LsColors(LsColors.default)\n assert (\n colorize(ls_colors)(\"script.sh\", \"eo\") == \"\\x1b[01;32mscript.sh\\x1b[0m\"\n )\n\n\ndef test_ls_colors_out_ext():\n ls_colors = LsColors(LsColors.default + \":*.xml=01;33\")\n assert colorize(ls_colors)(\"file.xml\", \"o\") == \"\\x1b[01;33mfile.xml\\x1b[0m\"\n\n\ndef test_ls_colors_file():\n ls_colors = LsColors(LsColors.default)\n assert colorize(ls_colors)(\"file\") == \"file\"\n\n\ndef test_ls_colors_dir():\n ls_colors = LsColors(LsColors.default)\n assert colorize(ls_colors)(\"dir\", \"d\") == \"\\x1b[01;34mdir\\x1b[0m\"\n\n\ndef test_ls_colors_exec():\n ls_colors = LsColors(LsColors.default)\n assert (\n colorize(ls_colors)(\"script.sh\", \"e\") == \"\\x1b[01;32mscript.sh\\x1b[0m\"\n )\n\n\ndef test_ls_colors_ext():\n ls_colors = LsColors(LsColors.default + \":*.xml=01;33\")\n assert colorize(ls_colors)(\"file.xml\") == \"\\x1b[01;33mfile.xml\\x1b[0m\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_logging_test_checkout.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_logging_test_checkout.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "test_checkout"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.cli import parse_args\nfrom dvc.command.checkout import CmdCheckout, log_summary, log_changes\n\n\ndef test_checkout(tmp_dir, dvc, mocker):\n cli_args = parse_args(\n [\"checkout\", \"foo.dvc\", \"bar.dvc\", \"--relink\", \"--with-deps\"]\n )\n assert cli_args.func == CmdCheckout\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.Repo.checkout\")\n\n assert cmd.run() == 0\n m.assert_called_once_with(\n targets=[\"foo.dvc\", \"bar.dvc\"],\n force=False,\n recursive=False,\n relink=True,\n with_deps=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_test_log_changes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_test_log_changes_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 77, "span_ids": ["test_log_changes"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_log_changes(caplog):\n stats = {\n \"added\": [\"file1\", \"dir1/\"],\n \"deleted\": [\"dir2/\"],\n \"modified\": [\"file2\"],\n }\n\n from itertools import zip_longest\n\n def _assert_output(stats, expected_outs):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n caplog.clear()\n log_changes(stats)\n actual_output = caplog.text.splitlines()\n for out, line in zip_longest(expected_outs, actual_output):\n assert out in line\n\n _assert_output(stats, [\"M\\tfile2\", \"A\\tfile1\", \"A\\tdir1/\", \"D\\tdir2/\"])\n\n del stats[\"deleted\"][0]\n _assert_output(stats, [\"M\\tfile2\", \"A\\tfile1\", \"A\\tdir1/\"])\n\n del stats[\"modified\"]\n _assert_output(stats, [\"A\\tfile1\", \"A\\tdir1/\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_collections_test_default.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_collections_test_default.assert_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "test_default"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import collections\nimport os\n\nfrom dvc.cli import parse_args\n\n\ndef test_default(mocker, caplog):\n args = parse_args([\"diff\"])\n cmd = args.func(args)\n diff = {\n \"added\": [{\"path\": \"file\", \"hash\": \"00000000\"}],\n \"deleted\": [],\n \"modified\": [],\n }\n mocker.patch(\"dvc.repo.Repo.diff\", return_value=diff)\n\n assert 0 == cmd.run()\n assert (\n \"Added:\\n\"\n \" file\\n\"\n \"\\n\"\n \"files summary: 1 added, 0 deleted, 0 modified\"\n ) in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_hash_test_show_hash.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_hash_test_show_hash.assert_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 52, "span_ids": ["test_show_hash"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_show_hash(mocker, caplog):\n args = parse_args([\"diff\", \"--show-hash\"])\n cmd = args.func(args)\n diff = {\n \"added\": [],\n \"deleted\": [\n {\"path\": os.path.join(\"data\", \"\"), \"hash\": \"XXXXXXXX.dir\"},\n {\"path\": os.path.join(\"data\", \"bar\"), \"hash\": \"00000000\"},\n {\"path\": os.path.join(\"data\", \"foo\"), \"hash\": \"11111111\"},\n ],\n \"modified\": [\n {\"path\": \"file\", \"hash\": {\"old\": \"AAAAAAAA\", \"new\": \"BBBBBBBB\"}}\n ],\n }\n mocker.patch(\"dvc.repo.Repo.diff\", return_value=diff)\n assert 0 == cmd.run()\n assert (\n \"Deleted:\\n\"\n \" XXXXXXXX \" + os.path.join(\"data\", \"\") + \"\\n\"\n \" 00000000 \" + os.path.join(\"data\", \"bar\") + \"\\n\"\n \" 11111111 \" + os.path.join(\"data\", \"foo\") + \"\\n\"\n \"\\n\"\n \"Modified:\\n\"\n \" AAAAAAAA..BBBBBBBB file\\n\"\n \"\\n\"\n \"files summary: 0 added, 2 deleted, 1 modified\"\n ) in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_json_test_show_json.assert_modified_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_json_test_show_json.assert_modified_i", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 68, "span_ids": ["test_show_json"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_show_json(mocker, caplog):\n args = parse_args([\"diff\", \"--show-json\"])\n cmd = args.func(args)\n diff = {\n \"added\": [{\"path\": \"file\", \"hash\": \"00000000\"}],\n \"deleted\": [],\n \"modified\": [],\n }\n mocker.patch(\"dvc.repo.Repo.diff\", return_value=diff)\n\n assert 0 == cmd.run()\n assert '\"added\": [{\"path\": \"file\"}]' in caplog.text\n assert '\"deleted\": []' in caplog.text\n assert '\"modified\": []' in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_json_and_hash_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_json_and_hash_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 89, "span_ids": ["test_show_json_and_hash"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_show_json_and_hash(mocker, caplog):\n args = parse_args([\"diff\", \"--show-json\", \"--show-hash\"])\n cmd = args.func(args)\n\n diff = {\n \"added\": [\n # py35: maintain a consistent key order for tests purposes\n collections.OrderedDict([(\"path\", \"file\"), (\"hash\", \"00000000\")])\n ],\n \"deleted\": [],\n \"modified\": [],\n }\n mocker.patch(\"dvc.repo.Repo.diff\", return_value=diff)\n\n assert 0 == cmd.run()\n assert '\"added\": [{\"path\": \"file\", \"hash\": \"00000000\"}]' in caplog.text\n assert '\"deleted\": []' in caplog.text\n assert '\"modified\": []' in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_from_dvc_cli_import_parse_test_get.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_from_dvc_cli_import_parse_test_get.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "test_get"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.get import CmdGet\n\n\ndef test_get(mocker):\n cli_args = parse_args(\n [\"get\", \"repo_url\", \"src\", \"--out\", \"out\", \"--rev\", \"version\"]\n )\n assert cli_args.func == CmdGet\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.Repo.get\")\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\"repo_url\", path=\"src\", out=\"out\", rev=\"version\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_test_get_url_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_test_get_url_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 19, "end_line": 32, "span_ids": ["test_get_url"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_url(mocker, caplog):\n cli_args = parse_args(\n [\"get\", \"repo_url\", \"src\", \"--rev\", \"version\", \"--show-url\"]\n )\n assert cli_args.func == CmdGet\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.api.get_url\", return_value=\"resource_url\")\n\n assert cmd.run() == 0\n assert \"resource_url\" in caplog.text\n\n m.assert_called_once_with(\"src\", repo=\"repo_url\", rev=\"version\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_logging_test_import_url.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_logging_test_import_url.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_imp_url.py", "file_name": "test_imp_url.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_import_url"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.cli import parse_args\nfrom dvc.command.imp_url import CmdImportUrl\nfrom dvc.exceptions import DvcException\n\n\ndef test_import_url(mocker):\n cli_args = parse_args([\"import-url\", \"src\", \"out\", \"--file\", \"file\"])\n assert cli_args.func == CmdImportUrl\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"imp_url\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\"src\", out=\"out\", fname=\"file\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_test_failed_import_url_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_test_failed_import_url_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_imp_url.py", "file_name": "test_imp_url.py", "file_type": "text/x-python", "category": "test", "start_line": 20, "end_line": 34, "span_ids": ["test_failed_import_url"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_failed_import_url(mocker, caplog):\n cli_args = parse_args([\"import-url\", \"http://somesite.com/file_name\"])\n assert cli_args.func == CmdImportUrl\n\n cmd = cli_args.func(cli_args)\n mocker.patch.object(cmd.repo, \"imp_url\", side_effect=DvcException(\"error\"))\n with caplog.at_level(logging.ERROR, logger=\"dvc\"):\n assert cmd.run() == 1\n expected_error = (\n \"failed to import http://somesite.com/file_name. \"\n \"You could also try downloading it manually, and \"\n \"adding it with `dvc add`.\"\n )\n assert expected_error in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_from_dvc_cli_import_parse_test_metrics_diff.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_from_dvc_cli_import_parse_test_metrics_diff.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["imports", "test_metrics_diff"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.metrics import CmdMetricsDiff, _show_diff, CmdMetricsShow\n\n\ndef test_metrics_diff(dvc, mocker):\n cli_args = parse_args(\n [\n \"metrics\",\n \"diff\",\n \"HEAD~10\",\n \"HEAD~1\",\n \"-R\",\n \"--all\",\n \"--show-json\",\n \"--targets\",\n \"target1\",\n \"target2\",\n ]\n )\n assert cli_args.func == CmdMetricsDiff\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.metrics.diff.diff\", return_value={})\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n cmd.repo,\n targets=[\"target1\", \"target2\"],\n a_rev=\"HEAD~10\",\n b_rev=\"HEAD~1\",\n recursive=True,\n all=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_repro.py_from_dvc_cli_import_parse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_repro.py_from_dvc_cli_import_parse_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["test_downstream", "imports", "test_default_arguments"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.repro import CmdRepro\n\ndefault_arguments = {\n \"all_pipelines\": False,\n \"downstream\": False,\n \"dry\": False,\n \"force\": False,\n \"ignore_build_cache\": False,\n \"interactive\": False,\n \"no_commit\": False,\n \"pipeline\": False,\n \"single_item\": False,\n \"recursive\": False,\n}\n\n\ndef test_default_arguments(dvc, mocker):\n cmd = CmdRepro(parse_args([\"repro\"]))\n mocker.patch.object(cmd.repo, \"reproduce\")\n cmd.run()\n cmd.repo.reproduce.assert_called_with(\"Dvcfile\", **default_arguments)\n\n\ndef test_downstream(dvc, mocker):\n cmd = CmdRepro(parse_args([\"repro\", \"--downstream\"]))\n mocker.patch.object(cmd.repo, \"reproduce\")\n cmd.run()\n arguments = default_arguments.copy()\n arguments.update({\"downstream\": True})\n cmd.repo.reproduce.assert_called_with(\"Dvcfile\", **arguments)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_update.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_update.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 20, "span_ids": ["imports", "test_update"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nfrom dvc.cli import parse_args\nfrom dvc.command.update import CmdUpdate\n\n\n@pytest.mark.parametrize(\n \"command,rev\", [([\"update\"], None), ([\"update\", \"--rev\", \"REV\"], \"REV\")]\n)\ndef test_update(dvc, mocker, command, rev):\n targets = [\"target1\", \"target2\", \"target3\"]\n cli_args = parse_args(command + targets)\n assert cli_args.func == CmdUpdate\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.Repo.update\")\n\n assert cmd.run() == 0\n\n calls = [mocker.call(target, rev) for target in targets]\n m.assert_has_calls(calls)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_os_test_str_on_external_absolute_path.assert_str_output_abs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_os_test_str_on_external_absolute_path.assert_str_output_abs", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 66, "span_ids": ["TestOutputLOCAL.test_save_missing", "imports", "test_str_workdir_inside_repo", "TestOutputLOCAL._get_output", "TestOutputLOCAL", "test_str_workdir_outside_repo", "test_str_on_local_absolute_path", "TestOutputLOCAL._get_cls", "test_str_on_external_absolute_path"], "tokens": 448}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom mock import patch\nfrom dvc.output import OutputLOCAL\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.stage import Stage\nfrom dvc.utils import relpath\nfrom tests.basic_env import TestDvc\n\n\nclass TestOutputLOCAL(TestDvc):\n def _get_cls(self):\n return OutputLOCAL\n\n def _get_output(self):\n stage = Stage(self.dvc)\n return self._get_cls()(stage, \"path\", cache=False)\n\n def test_save_missing(self):\n o = self._get_output()\n with patch.object(o.remote, \"exists\", return_value=False):\n with self.assertRaises(o.DoesNotExistError):\n o.save()\n\n\ndef test_str_workdir_outside_repo(erepo_dir):\n stage = Stage(erepo_dir.dvc)\n output = OutputLOCAL(stage, \"path\", cache=False)\n\n assert relpath(\"path\", erepo_dir.dvc.root_dir) == str(output)\n\n\ndef test_str_workdir_inside_repo(dvc):\n stage = Stage(dvc)\n output = OutputLOCAL(stage, \"path\", cache=False)\n\n assert \"path\" == str(output)\n\n stage = Stage(dvc, wdir=\"some_folder\")\n output = OutputLOCAL(stage, \"path\", cache=False)\n\n assert os.path.join(\"some_folder\", \"path\") == str(output)\n\n\ndef test_str_on_local_absolute_path(dvc):\n stage = Stage(dvc)\n\n rel_path = os.path.join(\"path\", \"to\", \"file\")\n abs_path = os.path.abspath(rel_path)\n output = OutputLOCAL(stage, abs_path, cache=False)\n\n assert output.def_path == rel_path\n assert output.path_info.fspath == abs_path\n assert str(output) == rel_path\n\n\ndef test_str_on_external_absolute_path(dvc):\n stage = Stage(dvc)\n\n rel_path = os.path.join(\"..\", \"path\", \"to\", \"file\")\n abs_path = os.path.abspath(rel_path)\n output = OutputLOCAL(stage, abs_path, cache=False)\n\n assert output.def_path == abs_path\n assert output.path_info.fspath == abs_path\n assert str(output) == abs_path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_output.py_logging_test_checksum_schema.assert_Schema_CHECKSUM_SC": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_output.py_logging_test_checksum_schema.assert_Schema_CHECKSUM_SC", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_output.py", "file_name": "test_output.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 40, "span_ids": ["test_checksum_schema", "imports"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nimport pytest\nfrom funcy import first\n\nfrom voluptuous import Schema, MultipleInvalid\n\nfrom dvc.cache import NamedCache\nfrom dvc.output import CHECKSUM_SCHEMA, OutputBase\n\n\n@pytest.mark.parametrize(\n \"value,expected\",\n [\n (\"\", None),\n (None, None),\n (11111, \"11111\"),\n (\"11111\", \"11111\"),\n (\"aAaBa\", \"aaaba\"),\n (\n \"3cc286c534a71504476da009ed174423\",\n \"3cc286c534a71504476da009ed174423\",\n ), # md5\n (\n \"d41d8cd98f00b204e9800998ecf8427e-38\",\n \"d41d8cd98f00b204e9800998ecf8427e-38\",\n ), # etag\n (\n \"000002000000000000000000c16859d1d071c6b1ffc9c8557d4909f1\",\n \"000002000000000000000000c16859d1d071c6b1ffc9c8557d4909f1\",\n ), # hdfs checksum\n # Not much we can do about hex and oct values without writing our own\n # parser. So listing these test cases just to acknowledge this.\n # See https://github.com/iterative/dvc/issues/3331.\n (0x3451, \"13393\"),\n (0o1244, \"676\"),\n ],\n)\ndef test_checksum_schema(value, expected):\n assert Schema(CHECKSUM_SCHEMA)(value) == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_output.py_test_checksum_schema_fail_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_output.py_test_checksum_schema_fail_", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_output.py", "file_name": "test_output.py", "file_type": "text/x-python", "category": "test", "start_line": 43, "end_line": 91, "span_ids": ["test_get_used_cache", "test_checksum_schema_fail"], "tokens": 390}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"value\", [\"1\", \"11\", {}, {\"a\": \"b\"}, [], [1, 2]])\ndef test_checksum_schema_fail(value):\n with pytest.raises(MultipleInvalid):\n Schema(CHECKSUM_SCHEMA)(value)[\"md5\"]\n\n\n@pytest.mark.parametrize(\n \"exists, expected_message\",\n [\n (\n False,\n (\n \"Output 'path'(Stage stage.dvc) is missing version info. \"\n \"Cache for it will not be collected. \"\n \"Use `dvc repro` to get your pipeline up to date.\"\n ),\n ),\n (\n True,\n (\n \"Output 'path'(Stage stage.dvc) is missing version info. \"\n \"Cache for it will not be collected. \"\n \"Use `dvc repro` to get your pipeline up to date.\\n\"\n \"You can also use `dvc commit stage.dvc` to associate \"\n \"existing 'path' with 'stage.dvc'.\"\n ),\n ),\n ],\n)\ndef test_get_used_cache(exists, expected_message, mocker, caplog):\n stage = mocker.MagicMock()\n mocker.patch.object(stage, \"__str__\", return_value=\"Stage stage.dvc\")\n mocker.patch.object(stage, \"relpath\", \"stage.dvc\")\n\n output = OutputBase(stage, \"path\")\n\n mocker.patch.object(output, \"use_cache\", True)\n mocker.patch.object(stage, \"is_repo_import\", False)\n mocker.patch.object(\n OutputBase, \"checksum\", new_callable=mocker.PropertyMock\n ).return_value = None\n mocker.patch.object(\n OutputBase, \"exists\", new_callable=mocker.PropertyMock\n ).return_value = exists\n\n with caplog.at_level(logging.WARNING, logger=\"dvc\"):\n assert isinstance(output.get_used_cache(), NamedCache)\n assert first(caplog.messages) == expected_message", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_filecmp_test_remove_dir.assert_not_dpath_exists_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_filecmp_test_remove_dir.assert_not_dpath_exists_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_connection.py", "file_name": "test_connection.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["test_isfile", "test_isdir", "imports", "test_makedirs", "test_remove_dir", "test_exists"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import filecmp\nimport os\nimport platform\nimport posixpath\nimport tempfile\n\nimport pytest\n\nfrom dvc.command.version import CmdVersion\nfrom dvc.system import System\n\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\n\ndef test_isdir(ssh):\n assert ssh.isdir(here)\n assert not ssh.isdir(__file__)\n\n\ndef test_exists(ssh):\n assert not ssh.exists(\"/path/to/non/existent/file\")\n assert ssh.exists(__file__)\n\n\ndef test_isfile(ssh):\n assert ssh.isfile(__file__)\n assert not ssh.isfile(here)\n\n\ndef test_makedirs(tmp_path, ssh):\n tmp = tmp_path.absolute().as_posix()\n path = posixpath.join(tmp, \"dir\", \"subdir\")\n ssh.makedirs(path)\n assert os.path.isdir(path)\n\n\ndef test_remove_dir(tmp_path, ssh):\n dpath = tmp_path / \"dir\"\n dpath.mkdir()\n (dpath / \"file\").write_text(\"file\")\n (dpath / \"subdir\").mkdir()\n (dpath / \"subdir\" / \"subfile\").write_text(\"subfile\")\n ssh.remove(dpath.absolute().as_posix())\n assert not dpath.exists()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_walk_test_walk.assert_paths_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_walk_test_walk.assert_paths_expected", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_connection.py", "file_name": "test_connection.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 83, "span_ids": ["test_walk"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_walk(tmp_path, ssh):\n root_path = tmp_path\n dir_path = root_path / \"dir\"\n subdir_path = dir_path / \"subdir\"\n\n dir_path.mkdir()\n subdir_path.mkdir()\n\n root_data_path = root_path / \"root_data\"\n dir_data_path = dir_path / \"dir_data\"\n subdir_data_path = subdir_path / \"subdir_data\"\n\n with root_data_path.open(\"w+\") as fobj:\n fobj.write(\"\")\n\n with dir_data_path.open(\"w+\") as fobj:\n fobj.write(\"\")\n\n with subdir_data_path.open(\"w+\") as fobj:\n fobj.write(\"\")\n\n entries = [\n dir_path,\n subdir_path,\n root_data_path,\n dir_data_path,\n subdir_data_path,\n ]\n expected = set([entry.absolute().as_posix() for entry in entries])\n\n paths = set()\n for root, dirs, files in ssh.walk(root_path.absolute().as_posix()):\n for entry in dirs + files:\n paths.add(posixpath.join(root, entry))\n\n assert paths == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_reflink_test_reflink.assert_not_System_is_hard": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_reflink_test_reflink.assert_not_System_is_hard", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_connection.py", "file_name": "test_connection.py", "file_type": "text/x-python", "category": "test", "start_line": 86, "end_line": 96, "span_ids": ["test_reflink"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n CmdVersion.get_fs_type(tempfile.gettempdir())[0]\n not in [\"xfs\", \"apfs\", \"btrfs\"],\n reason=\"Reflinks only work in specified file systems\",\n)\ndef test_reflink(tmp_dir, ssh):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh.reflink(\"foo\", \"link\")\n assert filecmp.cmp(\"foo\", \"link\")\n assert not System.is_symlink(\"link\")\n assert not System.is_hardlink(\"link\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_symlink_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_symlink_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_connection.py", "file_name": "test_connection.py", "file_type": "text/x-python", "category": "test", "start_line": 99, "end_line": 134, "span_ids": ["test_copy", "test_symlink", "test_hardlink", "test_move"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n platform.system() == \"Windows\",\n reason=\"sftp symlink is not supported on Windows\",\n)\ndef test_symlink(tmp_dir, ssh):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh.symlink(\"foo\", \"link\")\n assert System.is_symlink(\"link\")\n\n\n@pytest.mark.skipif(\n platform.system() == \"Windows\",\n reason=\"hardlink is temporarily not supported on Windows\",\n)\ndef test_hardlink(tmp_dir, ssh):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh.hardlink(\"foo\", \"link\")\n assert System.is_hardlink(\"link\")\n\n\n@pytest.mark.skipif(\n platform.system() == \"Windows\",\n reason=\"copy is temporarily not supported on Windows\",\n)\ndef test_copy(tmp_dir, ssh):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh.copy(\"foo\", \"link\")\n assert filecmp.cmp(\"foo\", \"link\")\n\n\ndef test_move(tmp_dir, ssh):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh.move(\"foo\", \"copy\")\n assert os.path.exists(\"copy\")\n assert not os.path.exists(\"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_pool.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_pool.py__", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_pool.py", "file_name": "test_pool.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 15, "span_ids": ["imports", "test_doesnt_swallow_errors"], "tokens": 70}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.remote.pool import get_connection\nfrom dvc.remote.ssh.connection import SSHConnection\n\n\ndef test_doesnt_swallow_errors(ssh_server):\n class MyError(Exception):\n pass\n\n with pytest.raises(MyError), get_connection(\n SSHConnection, **ssh_server.test_creds\n ):\n raise MyError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_keyfile_test_ssh_keyfile.assert_remote_keyfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_keyfile_test_ssh_keyfile.assert_remote_keyfile_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 131, "end_line": 163, "span_ids": ["test_ssh_keyfile"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"config,expected_keyfile\",\n [\n (\n {\"url\": \"ssh://example.com\", \"keyfile\": \"dvc_config.key\"},\n \"dvc_config.key\",\n ),\n (\n {\"url\": \"ssh://example.com\"},\n os.path.expanduser(\"~/.ssh/not_default.key\"),\n ),\n (\n {\n \"url\": \"ssh://not_in_ssh_config.com\",\n \"keyfile\": \"dvc_config.key\",\n },\n \"dvc_config.key\",\n ),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, None),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_keyfile(mock_file, mock_exists, dvc, config, expected_keyfile):\n remote = RemoteSSH(dvc, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.keyfile == expected_keyfile", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_gss_auth_test_ssh_gss_auth.assert_remote_gss_auth_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_gss_auth_test_ssh_gss_auth.assert_remote_gss_auth_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 185, "span_ids": ["test_ssh_gss_auth"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"config,expected_gss_auth\",\n [\n ({\"url\": \"ssh://example.com\", \"gss_auth\": True}, True),\n ({\"url\": \"ssh://example.com\", \"gss_auth\": False}, False),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, False),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_gss_auth(mock_file, mock_exists, dvc, config, expected_gss_auth):\n remote = RemoteSSH(dvc, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.gss_auth == expected_gss_auth", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_hardlink_optimization_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_hardlink_optimization_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 188, "end_line": 213, "span_ids": ["test_hardlink_optimization"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_hardlink_optimization(dvc, tmp_dir, ssh_server):\n port = ssh_server.test_creds[\"port\"]\n user = ssh_server.test_creds[\"username\"]\n\n config = {\n \"url\": SSHMocked.get_url(user, port),\n \"port\": port,\n \"user\": user,\n \"keyfile\": ssh_server.test_creds[\"key_filename\"],\n }\n remote = RemoteSSH(dvc, config)\n\n from_info = remote.path_info / \"empty\"\n to_info = remote.path_info / \"link\"\n\n with remote.open(from_info, \"wb\"):\n pass\n\n if os.name == \"nt\":\n link_path = \"c:\" + to_info.path.replace(\"/\", \"\\\\\")\n else:\n link_path = to_info.path\n\n remote.hardlink(from_info, to_info)\n assert not System.is_hardlink(link_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gdrive.py_TestRemoteGDrive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gdrive.py_TestRemoteGDrive_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_gdrive.py", "file_name": "test_gdrive.py", "file_type": "text/x-python", "category": "test", "start_line": 15, "end_line": 41, "span_ids": ["TestRemoteGDrive", "TestRemoteGDrive.test_init", "TestRemoteGDrive.test_drive"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteGDrive(object):\n CONFIG = {\n \"url\": \"gdrive://root/data\",\n \"gdrive_client_id\": \"client\",\n \"gdrive_client_secret\": \"secret\",\n }\n\n def test_init(self, dvc):\n remote = RemoteGDrive(dvc, self.CONFIG)\n assert str(remote.path_info) == self.CONFIG[\"url\"]\n\n def test_drive(self, dvc):\n remote = RemoteGDrive(dvc, self.CONFIG)\n os.environ[\n RemoteGDrive.GDRIVE_CREDENTIALS_DATA\n ] = USER_CREDS_TOKEN_REFRESH_ERROR\n with pytest.raises(GDriveAccessTokenRefreshError):\n remote._drive\n\n os.environ[RemoteGDrive.GDRIVE_CREDENTIALS_DATA] = \"\"\n remote = RemoteGDrive(dvc, self.CONFIG)\n os.environ[\n RemoteGDrive.GDRIVE_CREDENTIALS_DATA\n ] = USER_CREDS_MISSED_KEY_ERROR\n with pytest.raises(GDriveMissedCredentialKeyError):\n remote._drive", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_pytest_test_public_auth_method.assert_remote_auth_method": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_pytest_test_public_auth_method.assert_remote_auth_method", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_http.py", "file_name": "test_http.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["test_download_fails_on_error_code", "imports", "test_public_auth_method"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.exceptions import HTTPError\nfrom dvc.path_info import URLInfo\nfrom dvc.remote.http import RemoteHTTP\nfrom tests.utils.httpd import StaticFileServer\n\n\ndef test_download_fails_on_error_code(dvc):\n with StaticFileServer() as httpd:\n url = \"http://localhost:{}/\".format(httpd.server_port)\n config = {\"url\": url}\n\n remote = RemoteHTTP(dvc, config)\n\n with pytest.raises(HTTPError):\n remote._download(URLInfo(url) / \"missing.txt\", \"missing.txt\")\n\n\ndef test_public_auth_method(dvc):\n config = {\n \"url\": \"http://example.com/\",\n \"path_info\": \"file.html\",\n \"user\": \"\",\n \"password\": \"\",\n }\n\n remote = RemoteHTTP(dvc, config)\n\n assert remote.auth_method() is None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_test_basic_auth_method_test_basic_auth_method.assert_isinstance_remote_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_test_basic_auth_method_test_basic_auth_method.assert_isinstance_remote_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_http.py", "file_name": "test_http.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 62, "span_ids": ["test_basic_auth_method"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_basic_auth_method(dvc):\n from requests.auth import HTTPBasicAuth\n\n user = \"username\"\n password = \"password\"\n auth = HTTPBasicAuth(user, password)\n config = {\n \"url\": \"http://example.com/\",\n \"path_info\": \"file.html\",\n \"auth\": \"basic\",\n \"user\": user,\n \"password\": password,\n }\n\n remote = RemoteHTTP(dvc, config)\n\n assert remote.auth_method() == auth\n assert isinstance(remote.auth_method(), HTTPBasicAuth)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_test_digest_auth_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_http.py_test_digest_auth_method_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_http.py", "file_name": "test_http.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 101, "span_ids": ["test_digest_auth_method", "test_custom_auth_method"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_digest_auth_method(dvc):\n from requests.auth import HTTPDigestAuth\n\n user = \"username\"\n password = \"password\"\n auth = HTTPDigestAuth(user, password)\n config = {\n \"url\": \"http://example.com/\",\n \"path_info\": \"file.html\",\n \"auth\": \"digest\",\n \"user\": user,\n \"password\": password,\n }\n\n remote = RemoteHTTP(dvc, config)\n\n assert remote.auth_method() == auth\n assert isinstance(remote.auth_method(), HTTPDigestAuth)\n\n\ndef test_custom_auth_method(dvc):\n header = \"Custom-Header\"\n password = \"password\"\n config = {\n \"url\": \"http://example.com/\",\n \"path_info\": \"file.html\",\n \"auth\": \"custom\",\n \"custom_auth_header\": header,\n \"password\": password,\n }\n\n remote = RemoteHTTP(dvc, config)\n\n assert remote.auth_method() is None\n assert header in remote.headers\n assert remote.headers[header] == password", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_os_test_status_download_optimization.assert_other_remote_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_os_test_status_download_optimization.assert_other_remote_cache", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports", "test_status_download_optimization"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport errno\n\nimport pytest\n\nfrom dvc.cache import NamedCache\nfrom dvc.path_info import PathInfo\nfrom dvc.remote.local import RemoteLOCAL\n\n\ndef test_status_download_optimization(mocker, dvc):\n \"\"\"When comparing the status to pull a remote cache,\n And the desired files to fetch are already on the local cache,\n Don't check the existence of the desired files on the remote cache\n \"\"\"\n remote = RemoteLOCAL(dvc, {})\n\n infos = NamedCache()\n infos.add(\"local\", \"acbd18db4cc2f85cedef654fccc4a4d8\", \"foo\")\n infos.add(\"local\", \"37b51d194a7513e45b56f6524f2d51f2\", \"bar\")\n\n local_exists = list(infos[\"local\"])\n mocker.patch.object(remote, \"cache_exists\", return_value=local_exists)\n\n other_remote = mocker.Mock()\n other_remote.url = \"other_remote\"\n other_remote.cache_exists.return_value = []\n\n remote.status(infos, other_remote, download=True)\n\n assert other_remote.cache_exists.call_count == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py__coding_utf_8__remote.with_request_param_remote.yield_remote": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py__coding_utf_8__remote.with_request_param_remote.yield_remote", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_dir.py", "file_name": "test_remote_dir.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 33, "span_ids": ["remote", "docstring"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# -*- coding: utf-8 -*-\nimport pytest\nimport os\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.utils.fs import walk_files\nfrom dvc.path_info import PathInfo\nfrom tests.remotes import GCP, S3Mocked\n\nremotes = [GCP, S3Mocked]\n\nFILE_WITH_CONTENTS = {\n \"data1.txt\": \"\",\n \"empty_dir/\": \"\",\n \"empty_file\": \"\",\n \"foo\": \"foo\",\n \"data/alice\": \"alice\",\n \"data/alpha\": \"alpha\",\n \"data/subdir-file.txt\": \"subdir\",\n \"data/subdir/1\": \"1\",\n \"data/subdir/2\": \"2\",\n \"data/subdir/3\": \"3\",\n \"data/subdir/empty_dir/\": \"\",\n \"data/subdir/empty_file\": \"\",\n}\n\n\n@pytest.fixture\ndef remote(request, dvc):\n if not request.param.should_test():\n raise pytest.skip()\n with request.param.remote(dvc) as remote:\n request.param.put_objects(remote, FILE_WITH_CONTENTS)\n yield remote", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_isdir_test_isdir.for_expected_path_in_tes.assert_remote_isdir_remot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_isdir_test_isdir.for_expected_path_in_tes.assert_remote_isdir_remot", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_dir.py", "file_name": "test_remote_dir.py", "file_type": "text/x-python", "category": "test", "start_line": 36, "end_line": 50, "span_ids": ["test_isdir"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote\", remotes, indirect=True)\ndef test_isdir(remote):\n test_cases = [\n (True, \"data\"),\n (True, \"data/\"),\n (True, \"data/subdir\"),\n (True, \"empty_dir\"),\n (False, \"foo\"),\n (False, \"data/alice\"),\n (False, \"data/al\"),\n (False, \"data/subdir/1\"),\n ]\n\n for expected, path in test_cases:\n assert remote.isdir(remote.path_info / path) == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_exists_test_exists.for_expected_path_in_tes.assert_remote_exists_remo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_exists_test_exists.for_expected_path_in_tes.assert_remote_exists_remo", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_dir.py", "file_name": "test_remote_dir.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 70, "span_ids": ["test_exists"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote\", remotes, indirect=True)\ndef test_exists(remote):\n test_cases = [\n (True, \"data\"),\n (True, \"data/\"),\n (True, \"data/subdir\"),\n (True, \"empty_dir\"),\n (True, \"empty_file\"),\n (True, \"foo\"),\n (True, \"data/alice\"),\n (True, \"data/subdir/1\"),\n (False, \"data/al\"),\n (False, \"foo/\"),\n (True, \"data1.txt\"),\n ]\n\n for expected, path in test_cases:\n assert remote.exists(remote.path_info / path) == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_walk_files_test_walk_files.assert_list_remote_walk_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_walk_files_test_walk_files.assert_list_remote_walk_f", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_dir.py", "file_name": "test_remote_dir.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 85, "span_ids": ["test_walk_files"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote\", remotes, indirect=True)\ndef test_walk_files(remote):\n files = [\n remote.path_info / \"data/alice\",\n remote.path_info / \"data/alpha\",\n remote.path_info / \"data/subdir-file.txt\",\n remote.path_info / \"data/subdir/1\",\n remote.path_info / \"data/subdir/2\",\n remote.path_info / \"data/subdir/3\",\n remote.path_info / \"data/subdir/empty_file\",\n ]\n\n assert list(remote.walk_files(remote.path_info / \"data\")) == files", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_copy_preserve_etag_across_buckets_test_makedirs.assert_remote_isdir_empty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_copy_preserve_etag_across_buckets_test_makedirs.assert_remote_isdir_empty", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_dir.py", "file_name": "test_remote_dir.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 113, "span_ids": ["test_copy_preserve_etag_across_buckets", "test_makedirs"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote\", [S3Mocked], indirect=True)\ndef test_copy_preserve_etag_across_buckets(remote, dvc):\n s3 = remote.s3\n s3.create_bucket(Bucket=\"another\")\n\n another = RemoteS3(dvc, {\"url\": \"s3://another\", \"region\": \"us-east-1\"})\n\n from_info = remote.path_info / \"foo\"\n to_info = another.path_info / \"foo\"\n\n remote.copy(from_info, to_info)\n\n from_etag = RemoteS3.get_etag(s3, from_info.bucket, from_info.path)\n to_etag = RemoteS3.get_etag(s3, \"another\", \"foo\")\n\n assert from_etag == to_etag\n\n\n@pytest.mark.parametrize(\"remote\", remotes, indirect=True)\ndef test_makedirs(remote):\n empty_dir = remote.path_info / \"empty_dir\" / \"\"\n remote.remove(empty_dir)\n assert not remote.exists(empty_dir)\n remote.makedirs(empty_dir)\n assert remote.exists(empty_dir)\n assert remote.isdir(empty_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_isfile_test_isfile.for_expected_path_in_tes.assert_remote_isfile_remo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_isfile_test_isfile.for_expected_path_in_tes.assert_remote_isfile_remo", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_dir.py", "file_name": "test_remote_dir.py", "file_type": "text/x-python", "category": "test", "start_line": 116, "end_line": 135, "span_ids": ["test_isfile"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote\", [GCP, S3Mocked], indirect=True)\ndef test_isfile(remote):\n test_cases = [\n (False, \"empty_dir/\"),\n (True, \"empty_file\"),\n (True, \"foo\"),\n (True, \"data/alice\"),\n (True, \"data/alpha\"),\n (True, \"data/subdir/1\"),\n (True, \"data/subdir/2\"),\n (True, \"data/subdir/3\"),\n (False, \"data/subdir/empty_dir/\"),\n (True, \"data/subdir/empty_file\"),\n (False, \"something-that-does-not-exist\"),\n (False, \"data/subdir/empty-file/\"),\n (False, \"empty_dir\"),\n ]\n\n for expected, path in test_cases:\n assert remote.isfile(remote.path_info / path) == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_download_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_dir.py_test_download_dir_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_dir.py", "file_name": "test_remote_dir.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 157, "span_ids": ["test_download_dir"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote\", remotes, indirect=True)\ndef test_download_dir(remote, tmpdir):\n path = str(tmpdir / \"data\")\n to_info = PathInfo(path)\n remote.download(remote.path_info / \"data\", to_info)\n assert os.path.isdir(path)\n data_dir = tmpdir / \"data\"\n assert len(list(walk_files(path))) == 7\n assert (data_dir / \"alice\").read_text(encoding=\"utf-8\") == \"alice\"\n assert (data_dir / \"alpha\").read_text(encoding=\"utf-8\") == \"alpha\"\n assert (data_dir / \"subdir-file.txt\").read_text(\n encoding=\"utf-8\"\n ) == \"subdir\"\n assert (data_dir / \"subdir\" / \"1\").read_text(encoding=\"utf-8\") == \"1\"\n assert (data_dir / \"subdir\" / \"2\").read_text(encoding=\"utf-8\") == \"2\"\n assert (data_dir / \"subdir\" / \"3\").read_text(encoding=\"utf-8\") == \"3\"\n assert (data_dir / \"subdir\" / \"empty_file\").read_text(\n encoding=\"utf-8\"\n ) == \"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_s3.py_pytest_test_init.assert_remote_path_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_s3.py_pytest_test_init.assert_remote_path_info_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["test_init", "imports", "grants"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.config import ConfigError\nfrom dvc.remote.s3 import RemoteS3\n\n\nbucket_name = \"bucket-name\"\nprefix = \"some/prefix\"\nurl = \"s3://{}/{}\".format(bucket_name, prefix)\n\n\n@pytest.fixture(autouse=True)\ndef grants():\n return {\n \"grant_read\": \"id=read-permission-id,id=other-read-permission-id\",\n \"grant_read_acp\": \"id=read-acp-permission-id\",\n \"grant_write_acp\": \"id=write-acp-permission-id\",\n \"grant_full_control\": \"id=full-control-permission-id\",\n }\n\n\ndef test_init(dvc):\n config = {\"url\": url}\n remote = RemoteS3(dvc, config)\n\n assert remote.path_info == url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_s3.py_test_grants_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_s3.py_test_grants_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 29, "end_line": 57, "span_ids": ["test_grants", "test_grants_mutually_exclusive_acl_error"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_grants(dvc):\n config = {\n \"url\": url,\n \"grant_read\": \"id=read-permission-id,id=other-read-permission-id\",\n \"grant_read_acp\": \"id=read-acp-permission-id\",\n \"grant_write_acp\": \"id=write-acp-permission-id\",\n \"grant_full_control\": \"id=full-control-permission-id\",\n }\n remote = RemoteS3(dvc, config)\n\n assert (\n remote.extra_args[\"GrantRead\"]\n == \"id=read-permission-id,id=other-read-permission-id\"\n )\n assert remote.extra_args[\"GrantReadACP\"] == \"id=read-acp-permission-id\"\n assert remote.extra_args[\"GrantWriteACP\"] == \"id=write-acp-permission-id\"\n assert (\n remote.extra_args[\"GrantFullControl\"]\n == \"id=full-control-permission-id\"\n )\n\n\ndef test_grants_mutually_exclusive_acl_error(dvc, grants):\n for grant_option, grant_value in grants.items():\n config = {\"url\": url, \"acl\": \"public-read\", grant_option: grant_value}\n\n with pytest.raises(ConfigError):\n RemoteS3(dvc, config)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_mock_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_slow_link_detection.py", "file_name": "test_slow_link_detection.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 46, "span_ids": ["timeout_immediately", "test_dont_warn_when_cache_type_is_set", "test_dont_warn_when_warning_is_disabled", "imports", "test_show_warning_once", "make_remote"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\nimport pytest\n\nimport dvc.remote.slow_link_detection\nfrom dvc.remote.slow_link_detection import slow_link_guard\n\n\n@pytest.fixture(autouse=True)\ndef timeout_immediately(monkeypatch):\n monkeypatch.setattr(dvc.remote.slow_link_detection, \"timeout_seconds\", 0.0)\n\n\n@pytest.fixture\ndef make_remote():\n def _make_remote(cache_type=None, should_warn=True):\n remote = mock.Mock()\n remote.repo.config = {\n \"cache\": {\"type\": cache_type, \"slow_link_warning\": should_warn}\n }\n return remote\n\n return _make_remote\n\n\ndef test_show_warning_once(caplog, make_remote):\n remote = make_remote()\n slow_link_guard(lambda x: None)(remote)\n slow_link_guard(lambda x: None)(remote)\n\n assert len(caplog.records) == 1\n assert caplog.records[0].message == dvc.remote.slow_link_detection.message\n\n\ndef test_dont_warn_when_cache_type_is_set(caplog, make_remote):\n remote = make_remote(cache_type=\"copy\")\n slow_link_guard(lambda x: None)(remote)\n\n assert len(caplog.records) == 0\n\n\ndef test_dont_warn_when_warning_is_disabled(caplog, make_remote):\n remote = make_remote(should_warn=False)\n slow_link_guard(lambda x: None)(remote)\n\n assert len(caplog.records) == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_os_test_find_outs_by_path.assert_outs_0_path_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_os_test_find_outs_by_path.assert_outs_0_path_info_", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["imports", "test_find_outs_by_path", "test_is_dvc_internal"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom funcy import raiser\nimport pytest\n\nfrom dvc.repo import locked\n\n\ndef test_is_dvc_internal(dvc):\n assert dvc.is_dvc_internal(os.path.join(\"path\", \"to\", \".dvc\", \"file\"))\n assert not dvc.is_dvc_internal(os.path.join(\"path\", \"to-non-.dvc\", \"file\"))\n\n\n@pytest.mark.parametrize(\n \"path\",\n [\n os.path.join(\"dir\", \"subdir\", \"file\"),\n os.path.join(\"dir\", \"subdir\"),\n \"dir\",\n ],\n)\ndef test_find_outs_by_path(tmp_dir, dvc, path):\n (stage,) = tmp_dir.dvc_gen(\n {\"dir\": {\"subdir\": {\"file\": \"file\"}, \"other\": \"other\"}}\n )\n\n outs = dvc.find_outs_by_path(path, strict=False)\n assert len(outs) == 1\n assert outs[0].path_info == stage.outs[0].path_info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_used_cache_test_used_cache.with_dvc_state_.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_used_cache_test_used_cache.with_dvc_state_.assert_", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 57, "span_ids": ["test_used_cache"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"path\",\n [os.path.join(\"dir\", \"subdir\", \"file\"), os.path.join(\"dir\", \"subdir\")],\n)\ndef test_used_cache(tmp_dir, dvc, path):\n from dvc.cache import NamedCache\n\n tmp_dir.dvc_gen({\"dir\": {\"subdir\": {\"file\": \"file\"}, \"other\": \"other\"}})\n expected = NamedCache.make(\n \"local\", \"70922d6bf66eb073053a82f77d58c536.dir\", \"dir\"\n )\n expected.add_child_cache(\n \"70922d6bf66eb073053a82f77d58c536.dir\",\n NamedCache.make(\n \"local\",\n \"8c7dd922ad47494fc02c388e12c00eac\",\n os.path.join(\"dir\", \"subdir\", \"file\"),\n ),\n )\n\n with dvc.state:\n used_cache = dvc.used_cache([path])\n assert (\n used_cache._items == expected._items\n and used_cache.external == expected.external\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_os_TestGit.test_belongs_to_scm_false.self_assertFalse_self_dvc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_os_TestGit.test_belongs_to_scm_false.self_assertFalse_self_dvc", "embedding": null, "metadata": {"file_path": "tests/unit/scm/test_git.py", "file_name": "test_git.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 19, "span_ids": ["TestGit.test_belongs_to_scm_true_on_gitignore", "TestGit.test_belongs_to_scm_false", "imports", "TestGit", "TestGit.test_belongs_to_scm_true_on_git_internal"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.compat import fspath\n\nfrom tests.basic_env import TestDvcGit\n\n\nclass TestGit(TestDvcGit):\n def test_belongs_to_scm_true_on_gitignore(self):\n path = os.path.join(\"path\", \"to\", \".gitignore\")\n self.assertTrue(self.dvc.scm.belongs_to_scm(path))\n\n def test_belongs_to_scm_true_on_git_internal(self):\n path = os.path.join(\"path\", \"to\", \".git\", \"internal\", \"file\")\n self.assertTrue(self.dvc.scm.belongs_to_scm(path))\n\n def test_belongs_to_scm_false(self):\n path = os.path.join(\"some\", \"non-.git\", \"file\")\n self.assertFalse(self.dvc.scm.belongs_to_scm(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_test_walk_with_submodules_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_test_walk_with_submodules_", "embedding": null, "metadata": {"file_path": "tests/unit/scm/test_git.py", "file_name": "test_git.py", "file_type": "text/x-python", "category": "test", "start_line": 22, "end_line": 40, "span_ids": ["test_walk_with_submodules"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_walk_with_submodules(tmp_dir, scm, git_dir):\n git_dir.scm_gen(\n {\"foo\": \"foo\", \"bar\": \"bar\", \"dir\": {\"data\": \"data\"}},\n commit=\"add dir and files\",\n )\n scm.repo.create_submodule(\"submodule\", \"submodule\", url=fspath(git_dir))\n scm.commit(\"added submodule\")\n\n files = []\n dirs = []\n tree = scm.get_tree(\"HEAD\")\n for _, dnames, fnames in tree.walk(\".\"):\n dirs.extend(dnames)\n files.extend(fnames)\n\n # currently we don't walk through submodules\n assert not dirs\n assert set(files) == {\".gitmodules\", \"submodule\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_scm.py_from_unittest_import_Test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_scm.py_from_unittest_import_Test_", "embedding": null, "metadata": {"file_path": "tests/unit/scm/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 46, "span_ids": ["imports", "TestScmContext.test_should_throw_and_cleanup", "TestScmContext", "test_remind_to_track", "TestScmContext.test_should_successfully_perform_method", "TestScmContext.setUp"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from unittest import TestCase\n\nimport mock\n\nfrom dvc.repo import Repo\nfrom dvc.repo.scm_context import scm_context\nfrom dvc.scm import NoSCM\n\n\nclass TestScmContext(TestCase):\n def setUp(self):\n self.repo_mock = mock.Mock(spec=Repo)\n self.scm_mock = mock.Mock(spec=NoSCM)\n self.repo_mock.scm = self.scm_mock\n\n def test_should_successfully_perform_method(self):\n method = mock.Mock()\n wrapped = scm_context(method)\n\n wrapped(self.repo_mock)\n\n self.assertEqual(1, method.call_count)\n self.assertEqual(1, self.scm_mock.reset_ignores.call_count)\n self.assertEqual(1, self.scm_mock.remind_to_track.call_count)\n\n self.assertEqual(0, self.scm_mock.cleanup_ignores.call_count)\n\n def test_should_throw_and_cleanup(self):\n method = mock.Mock(side_effect=Exception(\"some problem\"))\n wrapped = scm_context(method)\n\n with self.assertRaises(Exception):\n wrapped(self.repo_mock)\n\n self.assertEqual(1, method.call_count)\n self.assertEqual(1, self.scm_mock.cleanup_ignores.call_count)\n\n self.assertEqual(0, self.scm_mock.reset_ignores.call_count)\n self.assertEqual(0, self.scm_mock.remind_to_track.call_count)\n\n\ndef test_remind_to_track(scm, caplog):\n scm.files_to_track = [\"fname with spaces.txt\", \"\u0442\u0435\u0441\u0442\", \"foo\"]\n scm.remind_to_track()\n assert \"git add 'fname with spaces.txt' '\u0442\u0435\u0441\u0442' foo\" in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_pytest_test_collect_and_send_report.assert_mock_daemon_call_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_pytest_test_collect_and_send_report.assert_mock_daemon_call_c", "embedding": null, "metadata": {"file_path": "tests/unit/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["imports", "tmp_global_dir", "test_collect_and_send_report"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport mock\nimport platform\nimport json\n\nfrom voluptuous import Schema, Any\n\nfrom dvc import analytics\nfrom dvc.cli import parse_args\n\n\n@pytest.fixture\ndef tmp_global_dir(tmp_path):\n \"\"\"\n Fixture to prevent modifying the actual global config\n \"\"\"\n with mock.patch(\"dvc.config.Config.get_dir\", return_value=str(tmp_path)):\n yield\n\n\n@mock.patch(\"dvc.daemon._spawn\")\n@mock.patch(\"json.dump\")\ndef test_collect_and_send_report(mock_json, mock_daemon, tmp_global_dir):\n analytics.collect_and_send_report()\n report = mock_json.call_args[0][0]\n\n with pytest.raises(KeyError):\n report[\"cmd_class\"]\n\n with pytest.raises(KeyError):\n report[\"cmd_return_code\"]\n\n args = parse_args([\"add\", \"foo\"])\n return_code = 0\n\n analytics.collect_and_send_report(args, return_code)\n report = mock_json.call_args[0][0]\n\n assert report[\"cmd_class\"] == \"CmdAdd\"\n assert report[\"cmd_return_code\"] == return_code\n\n assert mock_daemon.call_count == 2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_runtime_info_test_send.assert_not_report_file_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_runtime_info_test_send.assert_not_report_file_ex", "embedding": null, "metadata": {"file_path": "tests/unit/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 74, "span_ids": ["test_runtime_info", "test_send"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_runtime_info(tmp_global_dir):\n schema = Schema(\n {\n \"dvc_version\": str,\n \"is_binary\": bool,\n \"scm_class\": Any(\"Git\", None),\n \"user_id\": str,\n \"system_info\": dict,\n },\n required=True,\n )\n\n assert schema(analytics._runtime_info())\n\n\n@mock.patch(\"requests.post\")\ndef test_send(mock_post, tmp_path):\n import requests\n\n url = \"https://analytics.dvc.org\"\n report = {\"name\": \"dummy report\"}\n report_file = tmp_path / \"report\"\n\n report_file.write_text(json.dumps(report))\n mock_post.side_effect = requests.exceptions.RequestException\n\n analytics.send(str(report_file))\n assert mock_post.called\n assert mock_post.call_args.args[0] == url\n assert not report_file.exists()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_is_enabled_test_is_enabled.assert_result_analytic": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_is_enabled_test_is_enabled.assert_result_analytic", "embedding": null, "metadata": {"file_path": "tests/unit/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 97, "span_ids": ["test_is_enabled"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"config, result\",\n [\n ({}, True),\n ({\"analytics\": \"false\"}, False),\n ({\"analytics\": \"true\"}, True),\n ({\"unknown\": \"broken\"}, True),\n ({\"analytics\": \"false\", \"unknown\": \"broken\"}, False),\n ],\n)\ndef test_is_enabled(dvc, config, result, monkeypatch, tmp_global_dir):\n import configobj\n\n conf = configobj.ConfigObj({\"core\": config})\n conf.filename = dvc.config.files[\"repo\"]\n conf.write()\n\n # reset DVC_TEST env var, which affects `is_enabled()`\n monkeypatch.delenv(\"DVC_TEST\")\n\n assert result == analytics.is_enabled()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_system_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_test_system_info_", "embedding": null, "metadata": {"file_path": "tests/unit/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 135, "span_ids": ["test_system_info", "test_find_or_create_user_id"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_system_info():\n schema = Schema({\"os\": Any(\"windows\", \"mac\", \"linux\")}, required=True)\n\n system = platform.system()\n\n if system == \"Windows\":\n schema = schema.extend(\n {\n \"windows_version_build\": int,\n \"windows_version_major\": int,\n \"windows_version_minor\": int,\n \"windows_version_service_pack\": str,\n }\n )\n\n if system == \"Darwin\":\n schema = schema.extend({\"mac_version\": str})\n\n if system == \"Linux\":\n schema = schema.extend(\n {\n \"linux_distro\": str,\n \"linux_distro_like\": str,\n \"linux_distro_version\": str,\n }\n )\n\n assert schema(analytics._system_info())\n\n\ndef test_find_or_create_user_id(tmp_global_dir):\n created = analytics._find_or_create_user_id()\n found = analytics._find_or_create_user_id()\n\n assert created == found", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_daemon.py_inspect_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_daemon.py_inspect_", "embedding": null, "metadata": {"file_path": "tests/unit/test_daemon.py", "file_name": "test_daemon.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 41, "span_ids": ["imports", "TestDaemon.test", "test_no_recursive_spawn", "TestDaemon"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import inspect\nimport os\nfrom unittest import TestCase\n\nimport mock\n\nimport dvc.daemon as daemon\n\n\nclass TestDaemon(TestCase):\n @mock.patch(\"dvc.daemon._spawn_posix\")\n @mock.patch(\"dvc.daemon._spawn_windows\")\n def test(self, mock_windows, mock_posix):\n daemon.daemon([\"updater\"])\n\n if os.name == \"nt\":\n mock_posix.assert_not_called()\n mock_windows.assert_called()\n args, kwargs = mock_windows.call_args\n else:\n mock_windows.assert_not_called()\n mock_posix.assert_called()\n args, kwargs = mock_posix.call_args\n\n env = args[1]\n self.assertTrue(\"PYTHONPATH\" in env.keys())\n\n file_path = os.path.abspath(inspect.stack()[0][1])\n file_dir = os.path.dirname(file_path)\n test_dir = os.path.dirname(file_dir)\n dvc_dir = os.path.dirname(test_dir)\n self.assertEqual(env[\"PYTHONPATH\"], dvc_dir)\n self.assertEqual(env[daemon.DVC_DAEMON], \"1\")\n\n\ndef test_no_recursive_spawn():\n with mock.patch.dict(os.environ, {daemon.DVC_DAEMON: \"1\"}):\n with mock.patch(\"dvc.daemon._spawn\") as mock_spawn:\n daemon.daemon([\"updater\"])\n mock_spawn.assert_not_called()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_dagascii.py_from_dvc_import_dagascii_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_dagascii.py_from_dvc_import_dagascii_", "embedding": null, "metadata": {"file_path": "tests/unit/test_dagascii.py", "file_name": "test_dagascii.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["test_find_pager_returns_plain_pager_when_is_not_atty", "test_find_pager_uses_custom_pager_when_env_var_is_defined", "imports", "test_find_pager_returns_plain_pager_when_default_missing", "test_find_pager_uses_default_pager_when_found"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc import dagascii\nfrom dvc.env import DVC_PAGER\n\n\ndef test_find_pager_uses_default_pager_when_found(mocker):\n mocker.patch(\"sys.stdout.isatty\", return_value=True)\n mocker.patch(\"os.system\", return_value=0)\n m_make_pager = mocker.patch.object(dagascii, \"make_pager\")\n\n dagascii.find_pager()\n\n m_make_pager.assert_called_once_with(dagascii.DEFAULT_PAGER_FORMATTED)\n\n\ndef test_find_pager_returns_plain_pager_when_default_missing(mocker):\n mocker.patch(\"sys.stdout.isatty\", return_value=True)\n mocker.patch(\"os.system\", return_value=1)\n\n pager = dagascii.find_pager()\n\n assert pager.__name__ == \"plainpager\"\n\n\ndef test_find_pager_uses_custom_pager_when_env_var_is_defined(\n mocker, monkeypatch\n):\n mocker.patch(\"sys.stdout.isatty\", return_value=True)\n m_make_pager = mocker.patch.object(dagascii, \"make_pager\")\n monkeypatch.setenv(DVC_PAGER, dagascii.DEFAULT_PAGER)\n\n dagascii.find_pager()\n\n m_make_pager.assert_called_once_with(dagascii.DEFAULT_PAGER)\n\n\ndef test_find_pager_returns_plain_pager_when_is_not_atty(mocker):\n mocker.patch(\"sys.stdout.isatty\", return_value=False)\n\n pager = dagascii.find_pager()\n\n assert pager.__name__ == \"plainpager\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_os_test_ignore_from_file_should_filter_dirs_and_files.assert_file1_file2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_os_test_ignore_from_file_should_filter_dirs_and_files.assert_file1_file2_", "embedding": null, "metadata": {"file_path": "tests/unit/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 35, "span_ids": ["imports", "mock_dvcignore", "test_ignore_from_file_should_filter_dirs_and_files"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport pytest\nfrom mock import MagicMock\nfrom mock import mock_open\nfrom mock import patch\n\nfrom dvc.ignore import DvcIgnoreDirs\nfrom dvc.ignore import DvcIgnorePatterns\n\n\ndef mock_dvcignore(dvcignore_path, patterns):\n tree = MagicMock()\n with patch.object(tree, \"open\", mock_open(read_data=\"\\n\".join(patterns))):\n ignore_patterns = DvcIgnorePatterns(dvcignore_path, tree)\n\n return ignore_patterns\n\n\ndef test_ignore_from_file_should_filter_dirs_and_files():\n dvcignore_path = os.path.join(\n os.path.sep, \"full\", \"path\", \"to\", \"ignore\", \"file\", \".dvcignore\"\n )\n\n patterns = [\"dir_to_ignore\", \"file_to_ignore\"]\n\n root = os.path.dirname(dvcignore_path)\n dirs = [\"dir1\", \"dir2\", \"dir_to_ignore\"]\n files = [\"file1\", \"file2\", \"file_to_ignore\"]\n\n ignore = mock_dvcignore(dvcignore_path, patterns)\n new_dirs, new_files = ignore(root, dirs, files)\n\n assert {\"dir1\", \"dir2\"} == set(new_dirs)\n assert {\"file1\", \"file2\"} == set(new_files)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_imports.py_subprocess_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_imports.py_subprocess_", "embedding": null, "metadata": {"file_path": "tests/unit/test_imports.py", "file_name": "test_imports.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 20, "span_ids": ["test_no_remote_imports", "imports"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import subprocess\n\n\ndef test_no_remote_imports():\n remote_modules = {\n \"boto3\",\n \"botocore\",\n \"google.cloud.storage\",\n \"azure.storage.blob\",\n \"oss2\",\n \"pydrive2\",\n \"paramiko\",\n \"pyarrow\",\n }\n\n code = \"import dvc.main, sys; print(' '.join(sys.modules))\"\n res = subprocess.run([\"python\", \"-c\", code], stdout=subprocess.PIPE)\n modules = res.stdout.decode().split()\n assert not set(modules) & remote_modules", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_logging_dt.yield_2020_02_02_00_00_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_logging_dt.yield_2020_02_02_00_00_0", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports", "dt"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport traceback\n\nimport colorama\n\nimport dvc.logger\nimport time\nfrom datetime import datetime\nimport pytest\n\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(\"dvc\")\nformatter = dvc.logger.ColorFormatter()\ncolors = {\n \"blue\": colorama.Fore.BLUE,\n \"green\": colorama.Fore.GREEN,\n \"red\": colorama.Fore.RED,\n \"yellow\": colorama.Fore.YELLOW,\n \"nc\": colorama.Fore.RESET,\n}\n\n\n@pytest.fixture()\ndef dt(mocker):\n mocker.patch(\n \"time.time\", return_value=time.mktime(datetime(2020, 2, 2).timetuple())\n )\n yield \"2020-02-02 00:00:00,000\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter_TestColorFormatter.test_exception_with_description_and_message.with_caplog_at_level_logg.assert_expected_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter_TestColorFormatter.test_exception_with_description_and_message.with_caplog_at_level_logg.assert_expected_format", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 97, "span_ids": ["TestColorFormatter.test_exception_with_description_and_message", "TestColorFormatter.test_exception", "TestColorFormatter.test_exception_with_description_and_without_message", "TestColorFormatter.test_info", "TestColorFormatter.test_error", "TestColorFormatter.test_warning", "TestColorFormatter", "TestColorFormatter.test_debug"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestColorFormatter:\n def test_debug(self, caplog, dt):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n logger.debug(\"message\")\n\n expected = \"{green}{datetime}{nc} {blue}DEBUG{nc}: message\".format(\n **colors, datetime=dt\n )\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_info(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n logger.info(\"message\")\n\n assert \"message\" == formatter.format(caplog.records[0])\n\n def test_warning(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n logger.warning(\"message\")\n\n expected = \"{yellow}WARNING{nc}: message\".format(**colors)\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_error(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n logger.error(\"message\")\n\n expected = \"{red}ERROR{nc}: message\".format(**colors)\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_exception(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n try:\n raise ValueError\n except Exception:\n logger.exception(\"message\")\n\n expected = \"{red}ERROR{nc}: message\".format(**colors)\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_exception_with_description_and_without_message(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n try:\n raise Exception(\"description\")\n except Exception:\n logger.exception(\"\")\n\n expected = \"{red}ERROR{nc}: description\".format(**colors)\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_exception_with_description_and_message(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n try:\n raise Exception(\"description\")\n except Exception:\n logger.exception(\"message\")\n\n expected = \"{red}ERROR{nc}: message - description\".format(**colors)\n\n assert expected == formatter.format(caplog.records[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exc_info_on_other_record_types_TestColorFormatter.test_exc_info_on_other_record_types.with_caplog_at_level_logg.assert_expected_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exc_info_on_other_record_types_TestColorFormatter.test_exc_info_on_other_record_types.with_caplog_at_level_logg.assert_expected_format", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 122, "end_line": 143, "span_ids": ["TestColorFormatter.test_exc_info_on_other_record_types"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestColorFormatter:\n\n def test_exc_info_on_other_record_types(self, caplog, dt):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n try:\n raise Exception(\"description\")\n except Exception:\n stack_trace = traceback.format_exc()\n logger.debug(\"\", exc_info=True)\n\n expected = (\n \"{green}{datetime}{nc} \"\n \"{blue}DEBUG{nc}: description\\n\"\n \"{red}{line}{nc}\\n\"\n \"{stack_trace}\"\n \"{red}{line}{nc}\".format(\n line=\"-\" * 60,\n stack_trace=stack_trace,\n datetime=dt,\n **colors,\n )\n )\n\n assert expected == formatter.format(caplog.records[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_tb_only_TestColorFormatter.test_tb_only.with_caplog_at_level_logg.assert_expected_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_tb_only_TestColorFormatter.test_tb_only.with_caplog_at_level_logg.assert_expected_format", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 145, "end_line": 166, "span_ids": ["TestColorFormatter.test_tb_only"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestColorFormatter:\n\n def test_tb_only(self, caplog, dt):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n try:\n raise Exception(\"description\")\n except Exception:\n stack_trace = traceback.format_exc()\n logger.exception(\"something\", extra={\"tb_only\": True})\n\n expected = (\n \"{green}{datetime}{nc} \"\n \"{red}ERROR{nc}: something\\n\"\n \"{red}{line}{nc}\\n\"\n \"{stack_trace}\"\n \"{red}{line}{nc}\".format(\n line=\"-\" * 60,\n stack_trace=stack_trace,\n **colors,\n datetime=dt,\n )\n )\n\n assert expected == formatter.format(caplog.records[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_nested_exceptions_TestColorFormatter.test_nested_exceptions.with_caplog_at_level_logg.assert_dvc_exceptions_Dv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_nested_exceptions_TestColorFormatter.test_nested_exceptions.with_caplog_at_level_logg.assert_dvc_exceptions_Dv", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 168, "end_line": 193, "span_ids": ["TestColorFormatter.test_nested_exceptions"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestColorFormatter:\n\n def test_nested_exceptions(self, caplog, dt):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n try:\n raise Exception(\"first\")\n except Exception as exc:\n try:\n raise DvcException(\"second\") from exc\n except DvcException:\n stack_trace = traceback.format_exc()\n logger.exception(\"message\")\n\n expected = (\n \"{green}{datetime}{nc} \"\n \"{red}ERROR{nc}: message - second: first\\n\"\n \"{red}{line}{nc}\\n\"\n \"{stack_trace}\"\n \"{red}{line}{nc}\".format(\n line=\"-\" * 60,\n stack_trace=stack_trace,\n **colors,\n datetime=dt,\n )\n )\n assert expected == formatter.format(caplog.records[0])\n assert \"Exception: first\" in stack_trace\n assert \"dvc.exceptions.DvcException: second\" in stack_trace", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_progress_awareness_TestColorFormatter.test_progress_awareness.with_Tqdm_total_100_desc.None_1.assert_captured_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_progress_awareness_TestColorFormatter.test_progress_awareness.with_Tqdm_total_100_desc.None_1.assert_captured_out_", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 223, "span_ids": ["TestColorFormatter.test_progress_awareness"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestColorFormatter:\n\n def test_progress_awareness(self, mocker, capsys, caplog):\n from dvc.progress import Tqdm\n\n mocker.patch(\"sys.stdout.isatty\", return_value=True)\n with Tqdm(total=100, desc=\"progress\") as pbar:\n pbar.update()\n\n # logging an invisible message should not break\n # the progress bar output\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n debug_record = logging.LogRecord(\n name=\"dvc\",\n level=logging.DEBUG,\n pathname=__name__,\n lineno=1,\n msg=\"debug\",\n args=(),\n exc_info=None,\n )\n\n formatter.format(debug_record)\n captured = capsys.readouterr()\n assert captured.out == \"\"\n\n # when the message is actually visible\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n logger.info(\"some info\")\n captured = capsys.readouterr()\n assert captured.out == \"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_test_handlers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_test_handlers_", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 250, "span_ids": ["test_logging_debug_with_datetime", "test_handlers", "test_info_with_debug_loglevel_shows_no_datetime"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_handlers():\n out, deb, err = logger.handlers\n\n assert out.level == logging.INFO\n assert deb.level == logging.DEBUG\n assert err.level == logging.WARNING\n\n\ndef test_logging_debug_with_datetime(caplog, dt):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n logger.warning(\"WARNING\")\n logger.debug(\"DEBUG\")\n logger.error(\"ERROR\")\n\n for record in caplog.records:\n assert dt in formatter.format(record)\n assert record.levelname == record.message\n\n\ndef test_info_with_debug_loglevel_shows_no_datetime(caplog, dt):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n logger.info(\"message\")\n\n assert \"message\" == formatter.format(caplog.records[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_copy_test_https_url_info_str.assert_u_fragment_fra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_copy_test_https_url_info_str.assert_u_fragment_fra", "embedding": null, "metadata": {"file_path": "tests/unit/test_path_info.py", "file_name": "test_path_info.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 62, "span_ids": ["test_url_info_parent", "imports", "test_url_info_str", "test_url_info_eq", "test_https_url_info_str", "test_url_info_parents", "test_url_info_deepcopy"], "tokens": 486}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import copy\nimport pathlib\n\nimport pytest\n\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.path_info import HTTPURLInfo\nfrom dvc.path_info import PathInfo\nfrom dvc.path_info import URLInfo\n\n\nTEST_DEPTH = len(pathlib.Path(__file__).parents) + 1\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo])\ndef test_url_info_str(cls):\n u = cls(\"ssh://user@test.com:/test1/\")\n assert u.url == \"ssh://user@test.com/test1/\"\n assert str(u) == u.url\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo])\ndef test_url_info_eq(cls):\n u1 = cls(\"ssh://user@test.com:/test1/\")\n u2 = cls(\"ssh://user@test.com/test1\")\n assert u1 == u2\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo])\ndef test_url_info_parent(cls):\n u1 = cls(\"ssh://user@test.com:/test1/test2\")\n p = u1.parent\n u3 = cls(\"ssh://user@test.com/test1\")\n assert u3 == p\n assert str(p) == \"ssh://user@test.com/test1\"\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo])\ndef test_url_info_parents(cls):\n u1 = cls(\"ssh://user@test.com:/test1/test2/test3\")\n assert list(u1.parents) == [\n cls(\"ssh://user@test.com/test1/test2\"),\n cls(\"ssh://user@test.com/test1\"),\n cls(\"ssh://user@test.com/\"),\n ]\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo, HTTPURLInfo])\ndef test_url_info_deepcopy(cls):\n u1 = cls(\"ssh://user@test.com:/test1/test2/test3\")\n u2 = copy.deepcopy(u1)\n assert u1 == u2\n\n\ndef test_https_url_info_str():\n url = \"https://user@test.com/test1;p=par?q=quer#frag\"\n u = HTTPURLInfo(url)\n assert u.url == url\n assert str(u) == u.url\n assert u.params == \"p=par\"\n assert u.query == \"q=quer\"\n assert u.fragment == \"frag\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_test_path_info_as_posix_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_test_path_info_as_posix_", "embedding": null, "metadata": {"file_path": "tests/unit/test_path_info.py", "file_name": "test_path_info.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 92, "span_ids": ["test_path_info_as_posix"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"path, as_posix, osname\",\n [\n (\"/some/abs/path\", \"/some/abs/path\", \"posix\"),\n (\"some/rel/path\", \"some/rel/path\", \"posix\"),\n (\"../some/rel/path\", \"../some/rel/path\", \"posix\"),\n (\"windows\\\\relpath\", \"windows/relpath\", \"nt\"),\n (\"..\\\\windows\\\\rel\\\\path\", \"../windows/rel/path\", \"nt\"),\n # These ones are to test that no matter how layered this relpath is,\n # we don't accidentally round it over. E.g. how\n #\n # import os\n # os.chdir(\"/\")\n # os.path.relpath(\"../../path\")\n #\n # results in \"path\".\n (\"\\\\\".join([\"..\"] * TEST_DEPTH), \"/\".join([\"..\"] * TEST_DEPTH), \"nt\"),\n (\n \"/\".join([\"..\"] * TEST_DEPTH),\n \"/\".join([\"..\"] * TEST_DEPTH),\n \"posix\",\n ),\n ],\n)\ndef test_path_info_as_posix(mocker, path, as_posix, osname):\n mocker.patch(\"os.name\", osname)\n assert PathInfo(path).as_posix() == as_posix", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_os_test_rwlock.None_2.with_pytest_raises_LockEr.with_rwlock_path_cmd2_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_os_test_rwlock.None_2.with_pytest_raises_LockEr.with_rwlock_path_cmd2_.pass", "embedding": null, "metadata": {"file_path": "tests/unit/test_rwlock.py", "file_name": "test_rwlock.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 33, "span_ids": ["imports", "test_rwlock"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport pytest\n\nfrom dvc.rwlock import (\n rwlock,\n _edit_rwlock,\n RWLockFileFormatError,\n RWLockFileCorruptedError,\n)\nfrom dvc.lock import LockError\nfrom dvc.compat import fspath\nfrom dvc.path_info import PathInfo\n\n\ndef test_rwlock(tmp_path):\n path = fspath(tmp_path)\n foo = PathInfo(\"foo\")\n\n with rwlock(path, \"cmd1\", [foo], []):\n with pytest.raises(LockError):\n with rwlock(path, \"cmd2\", [], [foo]):\n pass\n\n with rwlock(path, \"cmd1\", [], [foo]):\n with pytest.raises(LockError):\n with rwlock(path, \"cmd2\", [foo], []):\n pass\n\n with rwlock(path, \"cmd1\", [], [foo]):\n with pytest.raises(LockError):\n with rwlock(path, \"cmd2\", [], [foo]):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_test_rwlock_reentrant_test_rwlock_reentrant.with_rwlock_path_cmd_.with__edit_rwlock_path_a.assert_lock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_test_rwlock_reentrant_test_rwlock_reentrant.with_rwlock_path_cmd_.with__edit_rwlock_path_a.assert_lock_", "embedding": null, "metadata": {"file_path": "tests/unit/test_rwlock.py", "file_name": "test_rwlock.py", "file_type": "text/x-python", "category": "test", "start_line": 36, "end_line": 56, "span_ids": ["test_rwlock_reentrant"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rwlock_reentrant(tmp_path):\n path = fspath(tmp_path)\n foo = PathInfo(\"foo\")\n\n with rwlock(path, \"cmd1\", [], [foo]):\n with rwlock(path, \"cmd1\", [], [foo]):\n pass\n with _edit_rwlock(path) as lock:\n assert lock == {\n \"read\": {},\n \"write\": {\"foo\": {\"cmd\": \"cmd1\", \"pid\": os.getpid()}},\n }\n\n with rwlock(path, \"cmd\", [foo], []):\n with rwlock(path, \"cmd\", [foo], []):\n pass\n with _edit_rwlock(path) as lock:\n assert lock == {\n \"read\": {\"foo\": [{\"cmd\": \"cmd\", \"pid\": os.getpid()}]},\n \"write\": {},\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_test_rwlock_subdirs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_rwlock.py_test_rwlock_subdirs_", "embedding": null, "metadata": {"file_path": "tests/unit/test_rwlock.py", "file_name": "test_rwlock.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 97, "span_ids": ["test_rwlock_subdirs", "test_broken_rwlock"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rwlock_subdirs(tmp_path):\n path = fspath(tmp_path)\n foo = PathInfo(\"foo\")\n subfoo = PathInfo(\"foo/subfoo\")\n\n with rwlock(path, \"cmd1\", [foo], []):\n with pytest.raises(LockError, match=r\"subfoo(.|\\n)*cmd1\"):\n with rwlock(path, \"cmd2\", [], [subfoo]):\n pass\n\n with rwlock(path, \"cmd1\", [], [subfoo]):\n with pytest.raises(LockError, match=r\"'foo'(.|\\n)*cmd1\"):\n with rwlock(path, \"cmd2\", [foo], []):\n pass\n\n with rwlock(path, \"cmd1\", [], [subfoo]):\n with pytest.raises(LockError):\n with rwlock(path, \"cmd2\", [], [foo]):\n pass\n\n with rwlock(path, \"cmd1\", [subfoo], []):\n with rwlock(path, \"cmd2\", [foo], []):\n pass\n\n\ndef test_broken_rwlock(tmp_path):\n dir_path = fspath(tmp_path)\n path = tmp_path / \"rwlock\"\n\n path.write_text('{\"broken\": \"format\"}', encoding=\"utf-8\")\n with pytest.raises(RWLockFileFormatError):\n with _edit_rwlock(dir_path):\n pass\n\n path.write_text(\"{broken json\", encoding=\"utf-8\")\n with pytest.raises(RWLockFileCorruptedError):\n with _edit_rwlock(dir_path):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_test_stage_update_test_stage_update.with_pytest_raises_StageU.stage_update_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_test_stage_update_test_stage_update.with_pytest_raises_StageU.stage_update_", "embedding": null, "metadata": {"file_path": "tests/unit/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 89, "span_ids": ["test_stage_update"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stage_update(mocker):\n dep = DependencyREPO({\"url\": \"example.com\"}, None, \"dep_path\")\n mocker.patch.object(dep, \"update\", return_value=None)\n\n stage = Stage(None, \"path\", deps=[dep])\n reproduce = mocker.patch.object(stage, \"reproduce\")\n is_repo_import = mocker.patch(\n __name__ + \".Stage.is_repo_import\", new_callable=mocker.PropertyMock\n )\n\n is_repo_import.return_value = True\n stage.update()\n assert reproduce.called_once_with()\n\n is_repo_import.return_value = False\n with pytest.raises(StageUpdateError):\n stage.update()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_test_stage_run_ignore_sigint_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_test_stage_run_ignore_sigint_", "embedding": null, "metadata": {"file_path": "tests/unit/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 92, "end_line": 117, "span_ids": ["test_stage_run_ignore_sigint", "test_always_changed"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n not isinstance(threading.current_thread(), threading._MainThread),\n reason=\"Not running in the main thread.\",\n)\ndef test_stage_run_ignore_sigint(dvc, mocker):\n proc = mocker.Mock()\n communicate = mocker.Mock()\n proc.configure_mock(returncode=0, communicate=communicate)\n popen = mocker.patch.object(subprocess, \"Popen\", return_value=proc)\n signal_mock = mocker.patch(\"signal.signal\")\n\n dvc.run(cmd=\"path\")\n\n assert popen.called_once()\n assert communicate.called_once_with()\n signal_mock.assert_any_call(signal.SIGINT, signal.SIG_IGN)\n assert signal.getsignal(signal.SIGINT) == signal.default_int_handler\n\n\ndef test_always_changed(dvc):\n stage = Stage(dvc, \"path\", always_changed=True)\n stage.save()\n with dvc.lock:\n assert stage.changed()\n assert stage.status()[\"path\"] == [\"always changed\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_state.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_state.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/unit/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "test_build_uri"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nfrom dvc.state import _build_sqlite_uri\n\n\n@pytest.mark.parametrize(\n \"path, osname, result\",\n [\n (\"/abs/path\", \"posix\", \"file:///abs/path\"),\n (\"C:\\\\abs\\\\path\", \"nt\", \"file:///C:/abs/path\"),\n (\"/abs/p?ath\", \"posix\", \"file:///abs/p%3fath\"),\n (\"C:\\\\abs\\\\p?ath\", \"nt\", \"file:///C:/abs/p%3fath\"),\n (\"/abs/p#ath\", \"posix\", \"file:///abs/p%23ath\"),\n (\"C:\\\\abs\\\\p#ath\", \"nt\", \"file:///C:/abs/p%23ath\"),\n (\"/abs/path space\", \"posix\", \"file:///abs/path space\"),\n (\"C:\\\\abs\\\\path space\", \"nt\", \"file:///C:/abs/path space\"),\n (\"/abs/path%20encoded\", \"posix\", \"file:///abs/path%2520encoded\"),\n (\"C:\\\\abs\\\\path%20encoded\", \"nt\", \"file:///C:/abs/path%2520encoded\"),\n ],\n)\ndef test_build_uri(path, osname, result, mocker):\n mocker.patch(\"os.name\", osname)\n assert _build_sqlite_uri(path, {}) == result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_json_test_fetch.assert_info_version_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_json_test_fetch.assert_info_version_", "embedding": null, "metadata": {"file_path": "tests/unit/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports", "test_fetch", "updater"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import json\nimport os\nimport mock\nimport pytest\n\nfrom dvc import __version__\nfrom dvc.updater import Updater\n\n\n@pytest.fixture\ndef updater(dvc):\n return Updater(dvc.dvc_dir)\n\n\n@mock.patch(\"requests.get\")\ndef test_fetch(mock_get, updater):\n mock_get.return_value.status_code = 200\n mock_get.return_value.json.return_value = {\"version\": __version__}\n\n assert not os.path.exists(updater.updater_file)\n\n updater.fetch(detach=False)\n\n mock_get.assert_called_once_with(Updater.URL, timeout=Updater.TIMEOUT_GET)\n assert os.path.isfile(updater.updater_file)\n\n with open(updater.updater_file, \"r\") as fobj:\n info = json.load(fobj)\n\n assert info[\"version\"] == __version__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_is_outdated_test_is_outdated.assert_updater__is_outdat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_is_outdated_test_is_outdated.assert_updater__is_outdat", "embedding": null, "metadata": {"file_path": "tests/unit/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 45, "span_ids": ["test_is_outdated"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"latest, current, result\",\n [\n (\"0.20.8\", \"0.21.0\", False),\n (\"0.20.8\", \"0.20.8\", False),\n (\"0.20.8\", \"0.19.0\", True),\n ],\n)\ndef test_is_outdated(latest, current, result, updater):\n updater.latest = latest\n updater.current = current\n\n assert updater._is_outdated() == result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_", "embedding": null, "metadata": {"file_path": "tests/unit/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 62, "span_ids": ["test_check"], "tokens": 103}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n os.getenv(\"TRAVIS_EVENT_TYPE\") != \"cron\",\n reason=\"Only run on travis CRON to avoid generating too much logs\",\n)\n@mock.patch(\"dvc.updater.Updater._check\")\ndef test_check(mock_check, updater, monkeypatch):\n monkeypatch.delenv(\"CI\", None)\n monkeypatch.setenv(\"DVC_TEST\", False)\n\n updater.check()\n updater.check()\n updater.check()\n\n assert mock_check.call_count == 3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_version.py_subprocess_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_version.py_subprocess_", "embedding": null, "metadata": {"file_path": "tests/unit/test_version.py", "file_name": "test_version.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports", "test_is_release"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import subprocess\n\nimport mock\n\nimport dvc.version\n\n\ndef test_is_release():\n with mock.patch.object(dvc.version.subprocess, \"check_output\") as m:\n m.side_effect = subprocess.CalledProcessError(1, \"cmd\")\n ret = dvc.version._is_release(None, dvc.version._BASE_VERSION)\n assert ret is False\n\n m.side_effect = None\n m.return_value = dvc.version._BASE_VERSION.encode(\"ascii\")\n ret = dvc.version._is_release(None, dvc.version._BASE_VERSION)\n assert ret\n\n m.return_value = b\"630d1741c2d5dd89a3176bd15b63121b905d35c9\"\n ret = dvc.version._is_release(None, dvc.version._BASE_VERSION)\n assert ret is False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_filecmp_from_tests_basic_env_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_filecmp_from_tests_basic_env_impo", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["imports"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import filecmp\nimport os\nfrom unittest import TestCase\n\nimport pytest\nfrom mock import patch\n\nimport dvc\nfrom dvc.compat import fspath\nfrom dvc.ignore import CleanTree\nfrom dvc.path_info import PathInfo\nfrom dvc.scm.tree import WorkingTree\nfrom dvc.system import System\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import BasePathNotInCheckedPathException\nfrom dvc.utils.fs import copyfile\nfrom dvc.utils.fs import contains_symlink_up_to\nfrom dvc.utils.fs import get_inode\nfrom dvc.utils.fs import get_mtime_and_size\nfrom dvc.utils.fs import move\nfrom dvc.utils.fs import path_isin, remove\nfrom dvc.utils.fs import makedirs\nfrom dvc.utils.fs import walk_files\nfrom tests.basic_env import TestDir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestMtimeAndSize_TestMtimeAndSize.test.self_assertEqual_dir_size": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestMtimeAndSize_TestMtimeAndSize.test.self_assertEqual_dir_size", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 27, "end_line": 43, "span_ids": ["TestMtimeAndSize.test", "TestMtimeAndSize"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMtimeAndSize(TestDir):\n def test(self):\n tree = CleanTree(WorkingTree(self.root_dir))\n file_time, file_size = get_mtime_and_size(self.DATA, tree)\n dir_time, dir_size = get_mtime_and_size(self.DATA_DIR, tree)\n\n actual_file_size = os.path.getsize(self.DATA)\n actual_dir_size = os.path.getsize(self.DATA) + os.path.getsize(\n self.DATA_SUB\n )\n\n self.assertIs(type(file_time), str)\n self.assertIs(type(file_size), str)\n self.assertEqual(file_size, str(actual_file_size))\n self.assertIs(type(dir_time), str)\n self.assertIs(type(dir_size), str)\n self.assertEqual(dir_size, str(actual_dir_size))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink.test_should_return_false_when_base_path_is_symlink_TestContainsLink.test_path_object_and_str_are_valid_arg_types.self_assertFalse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink.test_should_return_false_when_base_path_is_symlink_TestContainsLink.test_path_object_and_str_are_valid_arg_types.self_assertFalse_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 72, "end_line": 93, "span_ids": ["TestContainsLink.test_should_return_false_when_base_path_is_symlink", "TestContainsLink.test_path_object_and_str_are_valid_arg_types"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestContainsLink(TestCase):\n\n @patch.object(System, \"is_symlink\", return_value=True)\n def test_should_return_false_when_base_path_is_symlink(self, _):\n base_path = \"foo\"\n target_path = os.path.join(base_path, \"bar\")\n\n def base_path_is_symlink(path):\n if path == base_path:\n return True\n return False\n\n with patch.object(\n System, \"is_symlink\", side_effect=base_path_is_symlink\n ):\n self.assertFalse(contains_symlink_up_to(target_path, base_path))\n\n def test_path_object_and_str_are_valid_arg_types(self):\n base_path = \"foo\"\n target_path = os.path.join(base_path, \"bar\")\n self.assertFalse(contains_symlink_up_to(target_path, base_path))\n self.assertFalse(\n contains_symlink_up_to(PathInfo(target_path), PathInfo(base_path))\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_should_call_recursive_on_no_condition_matched_test_should_call_recursive_on_no_condition_matched.assert_contains_symlink_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_should_call_recursive_on_no_condition_matched_test_should_call_recursive_on_no_condition_matched.assert_contains_symlink_s", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 96, "end_line": 105, "span_ids": ["test_should_call_recursive_on_no_condition_matched"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_should_call_recursive_on_no_condition_matched(mocker):\n mocker.patch.object(System, \"is_symlink\", return_value=False)\n\n contains_symlink_spy = mocker.spy(dvc.utils.fs, \"contains_symlink_up_to\")\n\n # call from full path to match contains_symlink_spy patch path\n assert not dvc.utils.fs.contains_symlink_up_to(\n os.path.join(\"foo\", \"path\"), \"foo\"\n )\n assert contains_symlink_spy.mock.call_count == 2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_relpath_windows_different_drives_test_get_inode.assert_get_inode_foo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_relpath_windows_different_drives_test_get_inode.assert_get_inode_foo_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 108, "end_line": 123, "span_ids": ["test_relpath_windows_different_drives", "test_get_inode"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(os.name != \"nt\", reason=\"Windows specific\")\ndef test_relpath_windows_different_drives():\n path1 = os.path.join(\"A:\", os.sep, \"some\", \"path\")\n path2 = os.path.join(\"B:\", os.sep, \"other\", \"path\")\n assert relpath(path1, path2) == path1\n\n info1, info2 = PathInfo(path1), PathInfo(path2)\n rel_info = relpath(info1, info2)\n assert isinstance(rel_info, str)\n assert rel_info == path1\n\n\ndef test_get_inode(tmp_dir):\n tmp_dir.gen(\"foo\", \"foo content\")\n\n assert get_inode(\"foo\") == get_inode(PathInfo(\"foo\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_path_object_and_str_are_valid_types_get_mtime_and_size_test_path_object_and_str_are_valid_types_get_mtime_and_size.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_path_object_and_str_are_valid_types_get_mtime_and_size_test_path_object_and_str_are_valid_types_get_mtime_and_size.None_7", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 140, "span_ids": ["test_path_object_and_str_are_valid_types_get_mtime_and_size"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_path_object_and_str_are_valid_types_get_mtime_and_size(tmp_dir):\n tmp_dir.gen(\n {\"dir\": {\"dir_file\": \"dir file content\"}, \"file\": \"file_content\"}\n )\n tree = CleanTree(WorkingTree(tmp_dir))\n\n time, size = get_mtime_and_size(\"dir\", tree)\n object_time, object_size = get_mtime_and_size(PathInfo(\"dir\"), tree)\n assert time == object_time\n assert size == object_size\n\n time, size = get_mtime_and_size(\"file\", tree)\n object_time, object_size = get_mtime_and_size(PathInfo(\"file\"), tree)\n assert time == object_time\n assert size == object_size", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_move_test_move.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_move_test_move.None_5", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 143, "end_line": 160, "span_ids": ["test_move"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_move(tmp_dir):\n tmp_dir.gen({\"foo\": \"foo content\", \"bar\": \"bar content\"})\n src = \"foo\"\n src_info = PathInfo(\"bar\")\n dest = os.path.join(\"some\", \"directory\")\n dest_info = PathInfo(os.path.join(\"some\", \"path-like\", \"directory\"))\n\n os.makedirs(dest)\n assert len(os.listdir(dest)) == 0\n move(src, dest)\n assert not os.path.isfile(src)\n assert len(os.listdir(dest)) == 1\n\n os.makedirs(dest_info.fspath)\n assert len(os.listdir(dest_info.fspath)) == 0\n move(src_info, dest_info)\n assert not os.path.isfile(src_info.fspath)\n assert len(os.listdir(dest_info.fspath)) == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_remove_test_makedirs.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_remove_test_makedirs.None_1", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 224, "span_ids": ["test_path_isin_accepts_pathinfo", "test_path_isin_positive", "test_path_isin_on_common_substring_path", "test_makedirs", "test_path_isin_on_same_path", "test_path_isin_with_absolute_path", "test_remove"], "tokens": 453}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_remove(tmp_dir):\n tmp_dir.gen({\"foo\": \"foo content\", \"bar\": \"bar content\"})\n path = \"foo\"\n path_info = PathInfo(\"bar\")\n\n remove(path)\n assert not os.path.isfile(path)\n\n remove(path_info)\n assert not os.path.isfile(path_info.fspath)\n\n\ndef test_path_isin_positive():\n child = os.path.join(\"path\", \"to\", \"folder\")\n\n assert path_isin(child, os.path.join(\"path\", \"to\", \"\"))\n assert path_isin(child, os.path.join(\"path\", \"to\"))\n assert path_isin(child, os.path.join(\"path\", \"\"))\n assert path_isin(child, os.path.join(\"path\"))\n\n\ndef test_path_isin_on_same_path():\n path = os.path.join(\"path\", \"to\", \"folder\")\n path_with_sep = os.path.join(path, \"\")\n\n assert not path_isin(path, path)\n assert not path_isin(path, path_with_sep)\n assert not path_isin(path_with_sep, path)\n assert not path_isin(path_with_sep, path_with_sep)\n\n\ndef test_path_isin_on_common_substring_path():\n path1 = os.path.join(\"path\", \"to\", \"folder1\")\n path2 = os.path.join(\"path\", \"to\", \"folder\")\n\n assert not path_isin(path1, path2)\n\n\ndef test_path_isin_accepts_pathinfo():\n child = os.path.join(\"path\", \"to\", \"folder\")\n parent = PathInfo(child) / \"..\"\n\n assert path_isin(child, parent)\n assert not path_isin(parent, child)\n\n\ndef test_path_isin_with_absolute_path():\n parent = os.path.abspath(\"path\")\n child = os.path.join(parent, \"to\", \"folder\")\n\n assert path_isin(child, parent)\n\n\ndef test_makedirs(tmp_dir):\n path = os.path.join(fspath(tmp_dir), \"directory\")\n path_info = PathInfo(os.path.join(fspath(tmp_dir), \"another\", \"directory\"))\n\n makedirs(path)\n assert os.path.isdir(path)\n\n makedirs(path_info)\n assert os.path.isdir(path_info.fspath)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_copyfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_copyfile_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_fs.py", "file_name": "test_fs.py", "file_type": "text/x-python", "category": "test", "start_line": 227, "end_line": 263, "span_ids": ["test_copyfile", "test_walk_files"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"path\", [\"file\", \"dir\"])\ndef test_copyfile(path, tmp_dir):\n tmp_dir.gen(\n {\n \"foo\": \"foo content\",\n \"bar\": \"bar content\",\n \"file\": \"file content\",\n \"dir\": {},\n }\n )\n src = \"foo\"\n dest = path\n src_info = PathInfo(\"bar\")\n dest_info = PathInfo(path)\n\n copyfile(src, dest)\n if os.path.isdir(dest):\n assert filecmp.cmp(\n src, os.path.join(dest, os.path.basename(src)), shallow=False\n )\n else:\n assert filecmp.cmp(src, dest, shallow=False)\n\n copyfile(src_info, dest_info)\n if os.path.isdir(dest_info.fspath):\n assert filecmp.cmp(\n src_info.fspath,\n os.path.join(dest_info.fspath, os.path.basename(src_info.fspath)),\n shallow=False,\n )\n else:\n assert filecmp.cmp(src_info.fspath, dest_info.fspath, shallow=False)\n\n\ndef test_walk_files(tmp_dir):\n assert list(walk_files(\".\")) == list(walk_files(tmp_dir))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_http.py_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_http.py_io_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_http.py", "file_name": "test_http.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["imports", "test_open_url"], "tokens": 284}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import io\n\nimport requests\n\nfrom dvc.utils.http import open_url\nfrom tests.utils.httpd import StaticFileServer\n\n\ndef test_open_url(tmp_path, monkeypatch):\n monkeypatch.chdir(tmp_path)\n\n # Simulate bad connection\n original_iter_content = requests.Response.iter_content\n\n def bad_iter_content(self, *args, **kwargs):\n it = original_iter_content(self, *args, **kwargs)\n for i, chunk in enumerate(it):\n # Drop connection error on second chunk if there is one\n if i > 0:\n raise requests.ConnectionError(\"Simulated connection drop\")\n yield chunk\n\n monkeypatch.setattr(requests.Response, \"iter_content\", bad_iter_content)\n\n # Text should be longer than default chunk to test resume,\n # using twice of that plus something tests second resume,\n # this is important because second response is different\n text = \"0123456789\" * (io.DEFAULT_BUFFER_SIZE // 10 + 1)\n (tmp_path / \"sample.txt\").write_text(text * 2)\n\n with StaticFileServer() as httpd:\n url = \"http://localhost:{}/sample.txt\".format(httpd.server_port)\n with open_url(url) as fd:\n # Test various .read() variants\n assert fd.read(len(text)) == text\n assert fd.read() == text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_re_test_to_chunks_chunk_size.assert_result_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_re_test_to_chunks_chunk_size.assert_result_expected", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 21, "span_ids": ["imports", "test_to_chunks_chunk_size"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\nimport os\n\nimport pytest\n\nfrom dvc.path_info import PathInfo\nfrom dvc.utils import file_md5, resolve_output\nfrom dvc.utils import fix_env\nfrom dvc.utils import relpath\nfrom dvc.utils import to_chunks\nfrom dvc.utils import tmp_fname\n\n\n@pytest.mark.parametrize(\n \"chunk_size, expected_chunks\",\n [(1, [[1], [2], [3], [4]]), (2, [[1, 2], [3, 4]]), (3, [[1, 2, 3], [4]])],\n)\ndef test_to_chunks_chunk_size(chunk_size, expected_chunks):\n list_to_chunk = [1, 2, 3, 4]\n result = list(to_chunks(list_to_chunk, chunk_size=chunk_size))\n assert result == expected_chunks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_to_chunks_should_raise_test_to_chunks_num_chunks.assert_result_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_to_chunks_should_raise_test_to_chunks_num_chunks.assert_result_expected", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 24, "end_line": 38, "span_ids": ["test_to_chunks_num_chunks", "test_to_chunks_should_raise"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"num_chunks, chunk_size\", [(1, 2), (None, None)])\ndef test_to_chunks_should_raise(num_chunks, chunk_size):\n list_to_chunk = [1, 2, 3]\n with pytest.raises(ValueError):\n to_chunks(list_to_chunk, num_chunks, chunk_size)\n\n\n@pytest.mark.parametrize(\n \"num_chunks, expected_chunks\",\n [(4, [[1], [2], [3], [4]]), (3, [[1, 2], [3, 4]]), (2, [[1, 2], [3, 4]])],\n)\ndef test_to_chunks_num_chunks(num_chunks, expected_chunks):\n list_to_chunk = [1, 2, 3, 4]\n result = to_chunks(list_to_chunk, num_chunks=num_chunks)\n assert result == expected_chunks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_fix_env_pyenv_test_fix_env_pyenv.assert_fix_env_env_PATH": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_fix_env_pyenv_test_fix_env_pyenv.assert_fix_env_env_PATH", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 78, "span_ids": ["test_fix_env_pyenv"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(os.name == \"nt\", reason=\"pyenv-win is not supported\")\n@pytest.mark.parametrize(\n \"path, orig\",\n [\n (\n (\n \"/pyenv/bin:/pyenv/libexec:/pyenv/plugins/plugin:\"\n \"/orig/path1:/orig/path2\"\n ),\n \"/orig/path1:/orig/path2\",\n ),\n (\n \"/pyenv/bin:/pyenv/libexec:/orig/path1:/orig/path2\",\n \"/orig/path1:/orig/path2\",\n ),\n (\n (\n \"/pyenv/bin:/some/libexec:/pyenv/plugins/plugin:\"\n \"/orig/path1:/orig/path2\"\n ),\n \"/orig/path1:/orig/path2\",\n ),\n (\"/orig/path1:/orig/path2\", \"/orig/path1:/orig/path2\"),\n (\n \"/orig/path1:/orig/path2:/pyenv/bin:/pyenv/libexec\",\n \"/orig/path1:/orig/path2:/pyenv/bin:/pyenv/libexec\",\n ),\n ],\n)\ndef test_fix_env_pyenv(path, orig):\n env = {\n \"PATH\": path,\n \"PYENV_ROOT\": \"/pyenv\",\n \"PYENV_VERSION\": \"3.7.2\",\n \"PYENV_DIR\": \"/some/dir\",\n \"PYENV_HOOK_PATH\": \"/some/hook/path\",\n }\n assert fix_env(env)[\"PATH\"] == orig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_file_md5_test_relpath.assert_relpath_path_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_file_md5_test_relpath.assert_relpath_path_r", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 106, "span_ids": ["test_file_md5", "test_relpath", "test_tmp_fname"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_file_md5(tmp_dir):\n tmp_dir.gen(\"foo\", \"foo content\")\n\n assert file_md5(\"foo\") == file_md5(PathInfo(\"foo\"))\n\n\ndef test_tmp_fname():\n file_path = os.path.join(\"path\", \"to\", \"file\")\n file_path_info = PathInfo(file_path)\n\n def pattern(path):\n return r\"^\" + re.escape(path) + r\"\\.[a-z0-9]{22}\\.tmp$\"\n\n assert re.search(pattern(file_path), tmp_fname(file_path), re.IGNORECASE)\n assert re.search(\n pattern(file_path_info.fspath),\n tmp_fname(file_path_info),\n re.IGNORECASE,\n )\n\n\ndef test_relpath():\n path = \"path\"\n path_info = PathInfo(path)\n\n assert relpath(path) == relpath(path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_resolve_output_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_resolve_output_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 109, "end_line": 131, "span_ids": ["test_resolve_output"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"inp,out,is_dir,expected\",\n [\n [\"target\", None, False, \"target\"],\n [\"target\", \"dir\", True, os.path.join(\"dir\", \"target\")],\n [\"target\", \"file_target\", False, \"file_target\"],\n [\n \"target\",\n os.path.join(\"dir\", \"subdir\"),\n True,\n os.path.join(\"dir\", \"subdir\", \"target\"),\n ],\n [\"dir/\", None, False, \"dir\"],\n [\"dir\", None, False, \"dir\"],\n [\"dir\", \"other_dir\", False, \"other_dir\"],\n [\"dir\", \"other_dir\", True, os.path.join(\"other_dir\", \"dir\")],\n ],\n)\ndef test_resolve_output(inp, out, is_dir, expected, mocker):\n mocker.patch(\"os.path.isdir\", return_value=is_dir)\n result = resolve_output(inp, out)\n assert result == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_hashlib_ContentMD5Handler.checksum_header._Content_MD5_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_hashlib_ContentMD5Handler.checksum_header._Content_MD5_", "embedding": null, "metadata": {"file_path": "tests/utils/httpd.py", "file_name": "httpd.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["imports", "ETagHandler", "ContentMD5Handler", "TestRequestHandler", "TestRequestHandler.end_headers"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import hashlib\nimport os\nimport threading\nfrom http import HTTPStatus\nfrom http.server import HTTPServer, SimpleHTTPRequestHandler\nfrom RangeHTTPServer import RangeRequestHandler\n\n\nclass TestRequestHandler(RangeRequestHandler):\n checksum_header = None\n\n def end_headers(self):\n # RangeRequestHandler only sends Accept-Ranges header if Range header\n # is present, see https://github.com/danvk/RangeHTTPServer/issues/23\n if not self.headers.get(\"Range\"):\n self.send_header(\"Accept-Ranges\", \"bytes\")\n\n # Add a checksum header\n if self.checksum_header:\n file = self.translate_path(self.path)\n\n if not os.path.isdir(file) and os.path.exists(file):\n with open(file, \"r\") as fd:\n encoded_text = fd.read().encode(\"utf8\")\n checksum = hashlib.md5(encoded_text).hexdigest()\n self.send_header(self.checksum_header, checksum)\n\n RangeRequestHandler.end_headers(self)\n\n\nclass ETagHandler(TestRequestHandler):\n checksum_header = \"ETag\"\n\n\nclass ContentMD5Handler(TestRequestHandler):\n checksum_header = \"Content-MD5\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_PushRequestHandler_PushRequestHandler.do_POST.self_end_headers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_PushRequestHandler_PushRequestHandler.do_POST.self_end_headers_", "embedding": null, "metadata": {"file_path": "tests/utils/httpd.py", "file_name": "httpd.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 65, "span_ids": ["PushRequestHandler.do_POST", "PushRequestHandler", "PushRequestHandler._chunks"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PushRequestHandler(SimpleHTTPRequestHandler):\n def _chunks(self):\n while True:\n data = self.rfile.readline(65537)\n chunk_size = int(data[:-2], 16)\n if chunk_size == 0:\n return\n data = self.rfile.read(chunk_size)\n yield data\n self.rfile.read(2)\n\n def do_POST(self):\n chunked = self.headers.get(\"Transfer-Encoding\", \"\") == \"chunked\"\n path = self.translate_path(self.path)\n try:\n os.makedirs(os.path.dirname(path), exist_ok=True)\n with open(path, \"wb\") as fd:\n if chunked:\n for chunk in self._chunks():\n fd.write(chunk)\n else:\n size = int(self.headers.get(\"Content-Length\", 0))\n fd.write(self.rfile.read(size))\n except OSError as e:\n self.send_error(HTTPStatus.INTERNAL_SERVER_ERROR, str(e))\n self.send_response(HTTPStatus.OK)\n self.end_headers()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_from_urllib_parse_import__SCHEMA_update_DependencyP": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_from_urllib_parse_import__SCHEMA_update_DependencyP", "embedding": null, "metadata": {"file_path": "dvc/dependency/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 48, "span_ids": ["imports"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from urllib.parse import urlparse\nfrom collections import defaultdict\n\nimport dvc.output as output\nfrom dvc.dependency.gs import DependencyGS\nfrom dvc.dependency.hdfs import DependencyHDFS\nfrom dvc.dependency.http import DependencyHTTP\nfrom dvc.dependency.https import DependencyHTTPS\nfrom dvc.dependency.local import DependencyLOCAL\nfrom dvc.dependency.s3 import DependencyS3\nfrom dvc.dependency.ssh import DependencySSH\nfrom dvc.dependency.param import DependencyPARAMS\nfrom dvc.output.base import OutputBase\nfrom dvc.remote import Remote\nfrom dvc.scheme import Schemes\nfrom .repo import DependencyREPO\n\n\nDEPS = [\n DependencyGS,\n DependencyHDFS,\n DependencyHTTP,\n DependencyHTTPS,\n DependencyS3,\n DependencySSH,\n # NOTE: DependencyLOCAL is the default choice\n]\n\nDEP_MAP = {\n Schemes.LOCAL: DependencyLOCAL,\n Schemes.SSH: DependencySSH,\n Schemes.S3: DependencyS3,\n Schemes.GS: DependencyGS,\n Schemes.HDFS: DependencyHDFS,\n Schemes.HTTP: DependencyHTTP,\n Schemes.HTTPS: DependencyHTTPS,\n}\n\n\n# NOTE: schema for dependencies is basically the same as for outputs, but\n# without output-specific entries like 'cache' (whether or not output is\n# cached, see -o and -O flags for `dvc run`) and 'metric' (whether or not\n# output is a metric file and how to parse it, see `-M` flag for `dvc run`).\nSCHEMA = output.SCHEMA.copy()\ndel SCHEMA[OutputBase.PARAM_CACHE]\ndel SCHEMA[OutputBase.PARAM_METRIC]\nSCHEMA.update(DependencyREPO.REPO_SCHEMA)\nSCHEMA.update(DependencyPARAMS.PARAM_SCHEMA)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__get__get.return.DependencyLOCAL_stage_p_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__get__get.return.DependencyLOCAL_stage_p_", "embedding": null, "metadata": {"file_path": "dvc/dependency/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 68, "span_ids": ["_get"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get(stage, p, info):\n parsed = urlparse(p) if p else None\n if parsed and parsed.scheme == \"remote\":\n remote = Remote(stage.repo, name=parsed.netloc)\n return DEP_MAP[remote.scheme](stage, p, info, remote=remote)\n\n if info and info.get(DependencyREPO.PARAM_REPO):\n repo = info.pop(DependencyREPO.PARAM_REPO)\n return DependencyREPO(repo, stage, p, info)\n\n if info and info.get(DependencyPARAMS.PARAM_PARAMS):\n params = info.pop(DependencyPARAMS.PARAM_PARAMS)\n return DependencyPARAMS(stage, p, params)\n\n for d in DEPS:\n if d.supported(p):\n return d(stage, p, info)\n return DependencyLOCAL(stage, p, info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_loadd_from__parse_params.return.path_params": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_loadd_from__parse_params.return.path_params", "embedding": null, "metadata": {"file_path": "dvc/dependency/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 90, "span_ids": ["loadd_from", "loads_from", "_parse_params"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def loadd_from(stage, d_list):\n ret = []\n for d in d_list:\n p = d.pop(OutputBase.PARAM_PATH, None)\n ret.append(_get(stage, p, d))\n return ret\n\n\ndef loads_from(stage, s_list, erepo=None):\n ret = []\n for s in s_list:\n info = {DependencyREPO.PARAM_REPO: erepo} if erepo else {}\n ret.append(_get(stage, s, info))\n return ret\n\n\ndef _parse_params(path_params):\n path, _, params_str = path_params.rpartition(\":\")\n params = params_str.split(\",\")\n return path, params", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_loads_params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_loads_params_", "embedding": null, "metadata": {"file_path": "dvc/dependency/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 110, "span_ids": ["loads_params"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def loads_params(stage, s_list):\n # Creates an object for each unique file that is referenced in the list\n params_by_path = defaultdict(list)\n for s in s_list:\n path, params = _parse_params(s)\n params_by_path[path].extend(params)\n\n d_list = []\n for path, params in params_by_path.items():\n d_list.append(\n {\n OutputBase.PARAM_PATH: path,\n DependencyPARAMS.PARAM_PARAMS: params,\n }\n )\n\n return loadd_from(stage, d_list)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.save_OutputBase.save.self.info.self_save_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.save_OutputBase.save.self.info.self_save_info_", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 240, "span_ids": ["OutputBase.save"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def save(self):\n if not self.exists:\n raise self.DoesNotExistError(self)\n\n if not self.isfile and not self.isdir:\n raise self.IsNotFileOrDirError(self)\n\n if self.is_empty:\n logger.warning(\"'{}' is empty.\".format(self))\n\n if self.use_scm_ignore:\n if self.repo.scm.is_tracked(self.fspath):\n raise OutputAlreadyTrackedError(self)\n\n self.repo.scm.ignore(self.fspath)\n\n if not self.use_cache:\n self.info = self.save_info()\n if self.metric:\n self.verify_metric()\n if not self.IS_DEPENDENCY:\n logger.info(\n \"Output '{}' doesn't use cache. Skipping saving.\".format(\n self\n )\n )\n return\n\n assert not self.IS_DEPENDENCY\n\n if not self.changed():\n logger.info(\n \"Output '{}' didn't change. Skipping saving.\".format(self)\n )\n return\n\n self.info = self.save_info()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_object_exists_RemoteBASE._cache_object_exists.with_Tqdm_.with_ThreadPoolExecutor_m.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_object_exists_RemoteBASE._cache_object_exists.with_Tqdm_.with_ThreadPoolExecutor_m.return.ret", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 937, "end_line": 957, "span_ids": ["RemoteBASE._cache_object_exists"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _cache_object_exists(self, checksums, jobs=None, name=None):\n logger.debug(\n \"Querying {} checksums via object_exists\".format(len(checksums))\n )\n with Tqdm(\n desc=\"Querying \"\n + (\"cache in \" + name if name else \"remote cache\"),\n total=len(checksums),\n unit=\"file\",\n ) as pbar:\n\n def exists_with_progress(path_info):\n ret = self.exists(path_info)\n pbar.update_desc(str(path_info))\n return ret\n\n with ThreadPoolExecutor(max_workers=jobs or self.JOBS) as executor:\n path_infos = map(self.checksum_to_path_info, checksums)\n in_remote = executor.map(exists_with_progress, path_infos)\n ret = list(itertools.compress(checksums, in_remote))\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive_RemoteGDrive.__init__.self._gdrive_user_credentials_path._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive_RemoteGDrive.__init__.self._gdrive_user_credentials_path._", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 142, "span_ids": ["RemoteGDrive", "RemoteGDrive.__init__"], "tokens": 496}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n scheme = Schemes.GDRIVE\n path_cls = GDriveURLInfo\n REQUIRES = {\"pydrive2\": \"pydrive2\"}\n DEFAULT_VERIFY = True\n # Always prefer traverse for GDrive since API usage quotas are a concern.\n TRAVERSE_WEIGHT_MULTIPLIER = 1\n TRAVERSE_PREFIX_LEN = 2\n\n GDRIVE_CREDENTIALS_DATA = \"GDRIVE_CREDENTIALS_DATA\"\n DEFAULT_USER_CREDENTIALS_FILE = \"gdrive-user-credentials.json\"\n\n DEFAULT_GDRIVE_CLIENT_ID = \"710796635688-iivsgbgsb6uv1fap6635dhvuei09o66c.apps.googleusercontent.com\" # noqa: E501\n DEFAULT_GDRIVE_CLIENT_SECRET = \"a1Fz59uTpVNeG_VGuSKDLJXv\"\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n self.path_info = self.path_cls(config[\"url\"])\n\n if not self.path_info.bucket:\n raise DvcException(\n \"Empty Google Drive URL '{}'. Learn more at \"\n \"{}.\".format(\n config[\"url\"],\n format_link(\"https://man.dvc.org/remote/add\"),\n )\n )\n\n self._bucket = self.path_info.bucket\n self._trash_only = config.get(\"gdrive_trash_only\")\n self._use_service_account = config.get(\"gdrive_use_service_account\")\n self._service_account_email = config.get(\n \"gdrive_service_account_email\"\n )\n self._service_account_user_email = config.get(\n \"gdrive_service_account_user_email\"\n )\n self._service_account_p12_file_path = config.get(\n \"gdrive_service_account_p12_file_path\"\n )\n self._client_id = config.get(\"gdrive_client_id\")\n self._client_secret = config.get(\"gdrive_client_secret\")\n self._validate_config()\n self._gdrive_user_credentials_path = (\n tmp_fname(os.path.join(self.repo.tmp_dir, \"\"))\n if os.getenv(RemoteGDrive.GDRIVE_CREDENTIALS_DATA)\n else config.get(\n \"gdrive_user_credentials_file\",\n os.path.join(\n self.repo.tmp_dir, self.DEFAULT_USER_CREDENTIALS_FILE\n ),\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive.list_cache_paths_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive.list_cache_paths_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 462, "end_line": 488, "span_ids": ["RemoteGDrive.remove", "RemoteGDrive.list_cache_paths"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n if not self._ids_cache[\"ids\"]:\n return\n\n if prefix:\n dir_ids = self._ids_cache[\"dirs\"].get(prefix[:2])\n if not dir_ids:\n return\n else:\n dir_ids = self._ids_cache[\"ids\"]\n parents_query = \" or \".join(\n \"'{}' in parents\".format(dir_id) for dir_id in dir_ids\n )\n query = \"({}) and trashed=false\".format(parents_query)\n\n for item in self._gdrive_list(query):\n if progress_callback:\n progress_callback()\n parent_id = item[\"parents\"][0][\"id\"]\n yield posixpath.join(\n self._ids_cache[\"ids\"][parent_id], item[\"title\"]\n )\n\n def remove(self, path_info):\n item_id = self._get_item_id(path_info)\n self._gdrive_delete_file(item_id)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.open_RemoteHDFS.open.try_.except_IOError_as_e_.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.open_RemoteHDFS.open.try_.except_IOError_as_e_.raise", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 154, "span_ids": ["RemoteHDFS.open"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHDFS(RemoteBASE):\n\n @contextmanager\n def open(self, path_info, mode=\"r\", encoding=None):\n assert mode in {\"r\", \"rt\", \"rb\"}\n\n try:\n with self.hdfs(path_info) as hdfs, closing(\n hdfs.open(path_info.path, mode=\"rb\")\n ) as fd:\n if mode == \"rb\":\n yield fd\n else:\n yield io.TextIOWrapper(fd, encoding=encoding)\n except IOError as e:\n # Empty .errno and not specific enough error class in pyarrow,\n # see https://issues.apache.org/jira/browse/ARROW-6248\n if \"file does not exist\" in str(e):\n raise FileNotFoundError(*e.args)\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.list_cache_paths_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.list_cache_paths_", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 182, "span_ids": ["RemoteHDFS.list_cache_paths"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHDFS(RemoteBASE):\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n if not self.exists(self.path_info):\n return\n\n if prefix:\n root = posixpath.join(self.path_info.path, prefix[:2])\n else:\n root = self.path_info.path\n dirs = deque([root])\n\n with self.hdfs(self.path_info) as hdfs:\n while dirs:\n try:\n entries = hdfs.ls(dirs.pop(), detail=True)\n for entry in entries:\n if entry[\"kind\"] == \"directory\":\n dirs.append(urlparse(entry[\"name\"]).path)\n elif entry[\"kind\"] == \"file\":\n if progress_callback:\n progress_callback()\n yield urlparse(entry[\"name\"]).path\n except IOError as e:\n # When searching for a specific prefix pyarrow raises an\n # exception if the specified cache dir does not exist\n if not prefix:\n raise e", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL_RemoteLOCAL.move.move_from_info_to_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL_RemoteLOCAL.move.move_from_info_to_info_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 169, "span_ids": ["RemoteLOCAL.get", "RemoteLOCAL.iscopy", "RemoteLOCAL.isfile", "RemoteLOCAL.get_file_checksum", "RemoteLOCAL._verify_link", "RemoteLOCAL.exists", "RemoteLOCAL.remove", "RemoteLOCAL.move", "RemoteLOCAL.state", "RemoteLOCAL.isdir", "RemoteLOCAL", "RemoteLOCAL.list_cache_paths", "RemoteLOCAL.already_cached", "RemoteLOCAL.cache_dir_2", "RemoteLOCAL.makedirs", "RemoteLOCAL.cache_dir", "RemoteLOCAL.__init__", "RemoteLOCAL.getsize", "RemoteLOCAL.supported", "RemoteLOCAL.walk_files", "RemoteLOCAL.is_empty"], "tokens": 861}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n scheme = Schemes.LOCAL\n path_cls = PathInfo\n PARAM_CHECKSUM = \"md5\"\n PARAM_PATH = \"path\"\n TRAVERSE_PREFIX_LEN = 2\n INDEX_CLS = RemoteIndexNoop\n\n UNPACKED_DIR_SUFFIX = \".unpacked\"\n\n DEFAULT_CACHE_TYPES = [\"reflink\", \"copy\"]\n\n CACHE_MODE = 0o444\n SHARED_MODE_MAP = {None: (0o644, 0o755), \"group\": (0o664, 0o775)}\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n self.cache_dir = config.get(\"url\")\n self._dir_info = {}\n\n @property\n def state(self):\n return self.repo.state\n\n @property\n def cache_dir(self):\n return self.path_info.fspath if self.path_info else None\n\n @cache_dir.setter\n def cache_dir(self, value):\n self.path_info = PathInfo(value) if value else None\n\n @classmethod\n def supported(cls, config):\n return True\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n assert self.path_info is not None\n if prefix:\n path_info = self.path_info / prefix[:2]\n else:\n path_info = self.path_info\n if progress_callback:\n for path in walk_files(path_info):\n progress_callback()\n yield path\n else:\n yield from walk_files(path_info)\n\n def get(self, md5):\n if not md5:\n return None\n\n return self.checksum_to_path_info(md5).url\n\n def exists(self, path_info):\n assert is_working_tree(self.repo.tree)\n assert path_info.scheme == \"local\"\n return self.repo.tree.exists(fspath_py35(path_info))\n\n def makedirs(self, path_info):\n makedirs(path_info, exist_ok=True, mode=self._dir_mode)\n\n def already_cached(self, path_info):\n assert path_info.scheme in [\"\", \"local\"]\n\n current_md5 = self.get_checksum(path_info)\n\n if not current_md5:\n return False\n\n return not self.changed_cache(current_md5)\n\n def _verify_link(self, path_info, link_type):\n if link_type == \"hardlink\" and self.getsize(path_info) == 0:\n return\n\n super()._verify_link(path_info, link_type)\n\n def is_empty(self, path_info):\n path = path_info.fspath\n\n if self.isfile(path_info) and os.path.getsize(path) == 0:\n return True\n\n if self.isdir(path_info) and len(os.listdir(path)) == 0:\n return True\n\n return False\n\n @staticmethod\n def isfile(path_info):\n return os.path.isfile(fspath_py35(path_info))\n\n @staticmethod\n def isdir(path_info):\n return os.path.isdir(fspath_py35(path_info))\n\n def iscopy(self, path_info):\n return not (\n System.is_symlink(path_info) or System.is_hardlink(path_info)\n )\n\n @staticmethod\n def getsize(path_info):\n return os.path.getsize(fspath_py35(path_info))\n\n def walk_files(self, path_info):\n assert is_working_tree(self.repo.tree)\n\n for fname in self.repo.tree.walk_files(path_info):\n yield PathInfo(fname)\n\n def get_file_checksum(self, path_info):\n return file_md5(path_info)[0]\n\n def remove(self, path_info):\n if path_info.scheme != \"local\":\n raise NotImplementedError\n\n if self.exists(path_info):\n remove(path_info.fspath)\n\n def move(self, from_info, to_info, mode=None):\n if from_info.scheme != \"local\" or to_info.scheme != \"local\":\n raise NotImplementedError\n\n self.makedirs(to_info.parent)\n\n if mode is None:\n if self.isfile(from_info):\n mode = self._file_mode\n else:\n mode = self._dir_mode\n\n move(from_info, to_info, mode=mode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.copy_RemoteLOCAL.is_symlink.return.System_is_symlink_path_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.copy_RemoteLOCAL.is_symlink.return.System_is_symlink_path_in", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 168, "span_ids": ["RemoteLOCAL.is_symlink", "RemoteLOCAL.symlink", "RemoteLOCAL.copy"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def copy(self, from_info, to_info):\n tmp_info = to_info.parent / tmp_fname(to_info.name)\n try:\n System.copy(from_info, tmp_info)\n os.chmod(fspath_py35(tmp_info), self._file_mode)\n os.rename(fspath_py35(tmp_info), fspath_py35(to_info))\n except Exception:\n self.remove(tmp_info)\n raise\n\n @staticmethod\n def symlink(from_info, to_info):\n System.symlink(from_info, to_info)\n\n @staticmethod\n def is_symlink(path_info):\n return System.is_symlink(path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.hardlink_RemoteLOCAL.hardlink.System_hardlink_from_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.hardlink_RemoteLOCAL.hardlink.System_hardlink_from_info", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 194, "span_ids": ["RemoteLOCAL.hardlink"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def hardlink(self, from_info, to_info):\n # If there are a lot of empty files (which happens a lot in datasets),\n # and the cache type is `hardlink`, we might reach link limits and\n # will get something like: `too many links error`\n #\n # This is because all those empty files will have the same checksum\n # (i.e. 68b329da9893e34099c7d8ad5cb9c940), therefore, they will be\n # linked to the same file in the cache.\n #\n # From https://en.wikipedia.org/wiki/Hard_link\n # * ext4 limits the number of hard links on a file to 65,000\n # * Windows with NTFS has a limit of 1024 hard links on a file\n #\n # That's why we simply create an empty file rather than a link.\n if self.getsize(from_info) == 0:\n self.open(to_info, \"w\").close()\n\n logger.debug(\n \"Created empty file: {src} -> {dest}\".format(\n src=str(from_info), dest=str(to_info)\n )\n )\n return\n\n System.hardlink(from_info, to_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._list_paths_RemoteS3.makedirs.self_s3_put_object_Bucket": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._list_paths_RemoteS3.makedirs.self_s3_put_object_Bucket", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 215, "end_line": 263, "span_ids": ["RemoteS3.isfile", "RemoteS3._list_paths", "RemoteS3.makedirs", "RemoteS3.list_cache_paths", "RemoteS3.exists"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n def _list_paths(\n self, path_info, max_items=None, prefix=None, progress_callback=None\n ):\n return (\n item[\"Key\"]\n for item in self._list_objects(\n path_info, max_items, prefix, progress_callback\n )\n )\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n return self._list_paths(\n self.path_info, prefix=prefix, progress_callback=progress_callback\n )\n\n def isfile(self, path_info):\n from botocore.exceptions import ClientError\n\n if path_info.path.endswith(\"/\"):\n return False\n\n try:\n self.s3.head_object(Bucket=path_info.bucket, Key=path_info.path)\n except ClientError as exc:\n if exc.response[\"Error\"][\"Code\"] != \"404\":\n raise\n return False\n\n return True\n\n def exists(self, path_info):\n \"\"\"Check if the blob exists. If it does not exist,\n it could be a part of a directory path.\n\n eg: if `data/file.txt` exists, check for `data` should return True\n \"\"\"\n return self.isfile(path_info) or self.isdir(path_info)\n\n def makedirs(self, path_info):\n # We need to support creating empty directories, which means\n # creating an object with an empty body and a trailing slash `/`.\n #\n # We are not creating directory objects for every parent prefix,\n # as it is not required.\n if not path_info.path:\n return\n\n dir_path = path_info / \"\"\n self.s3.put_object(Bucket=path_info.bucket, Key=dir_path.path, Body=\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_dvc_dir_Repo._ignore.self_scm_ignore_list_flis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_dvc_dir_Repo._ignore.self_scm_ignore_list_flis", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 173, "span_ids": ["Repo.find_dvc_dir", "Repo._ignore", "Repo.init", "Repo.unprotect"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n @classmethod\n def find_dvc_dir(cls, root=None):\n root_dir = cls.find_root(root)\n return os.path.join(root_dir, cls.DVC_DIR)\n\n @staticmethod\n def init(root_dir=os.curdir, no_scm=False, force=False, subdir=False):\n from dvc.repo.init import init\n\n init(root_dir=root_dir, no_scm=no_scm, force=force, subdir=subdir)\n return Repo(root_dir)\n\n def unprotect(self, target):\n return self.cache.local.unprotect(PathInfo(target))\n\n def _ignore(self):\n from dvc.updater import Updater\n\n updater = Updater(self.dvc_dir)\n\n flist = (\n [self.config.files[\"local\"], updater.updater_file]\n + [self.lock.lockfile, updater.lock.lockfile, self.tmp_dir]\n + self.state.files\n )\n\n if path_isin(self.cache.local.cache_dir, self.root_dir):\n flist += [self.cache.local.cache_dir]\n\n self.scm.ignore_list(flist)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py__fetch_external__fetch_external.return.downloaded_failed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py__fetch_external__fetch_external.return.downloaded_failed", "embedding": null, "metadata": {"file_path": "dvc/repo/fetch.py", "file_name": "fetch.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 107, "span_ids": ["_fetch_external"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _fetch_external(self, repo_url, repo_rev, files, jobs):\n from dvc.external_repo import external_repo, ExternalRepo\n\n failed, downloaded = 0, 0\n try:\n with external_repo(repo_url, repo_rev) as repo:\n is_dvc_repo = isinstance(repo, ExternalRepo)\n # gather git-only tracked files if dvc repo\n git_files = [] if is_dvc_repo else files\n if is_dvc_repo:\n repo.cache.local.cache_dir = self.cache.local.cache_dir\n with repo.state:\n cache = NamedCache()\n for name in files:\n try:\n out = repo.find_out_by_relpath(name)\n except OutputNotFoundError:\n # try to add to cache if they are git-tracked files\n git_files.append(name)\n else:\n cache.update(out.get_used_cache())\n\n try:\n downloaded += repo.cloud.pull(cache, jobs=jobs)\n except DownloadError as exc:\n failed += exc.amount\n\n d, f = _git_to_cache(self.cache.local, repo.root_dir, git_files)\n downloaded += d\n failed += f\n except CloneError:\n failed += 1\n logger.exception(\n \"failed to fetch data for '{}'\".format(\", \".join(files))\n )\n\n return downloaded, failed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py__git_to_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py__git_to_cache_", "embedding": null, "metadata": {"file_path": "dvc/repo/fetch.py", "file_name": "fetch.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 132, "span_ids": ["_git_to_cache"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _git_to_cache(cache, repo_root, files):\n \"\"\"Save files from a git repo directly to the cache.\"\"\"\n failed = set()\n num_downloads = 0\n repo_root = PathInfo(repo_root)\n for file in files:\n info = cache.save_info(repo_root / file)\n if info.get(cache.PARAM_CHECKSUM) is None:\n failed.add(file)\n continue\n\n if cache.changed_cache(info[cache.PARAM_CHECKSUM]):\n logger.debug(\"fetched '%s' from '%s' repo\", file, repo_root)\n num_downloads += 1\n cache.save(repo_root / file, info, save_link=False)\n\n if failed:\n logger.exception(\n \"failed to fetch data for {}\".format(\", \".join(failed))\n )\n\n return num_downloads, len(failed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_verify_checksums_test_verify_checksums.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_verify_checksums_test_verify_checksums.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 687, "end_line": 713, "span_ids": ["test_verify_checksums"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_verify_checksums(tmp_dir, scm, dvc, mocker, tmp_path_factory):\n tmp_dir.dvc_gen({\"file\": \"file1 content\"}, commit=\"add file\")\n tmp_dir.dvc_gen({\"dir\": {\"subfile\": \"file2 content\"}}, commit=\"add dir\")\n\n dvc.config[\"remote\"][\"local_remote\"] = {\n \"url\": fspath(tmp_path_factory.mktemp(\"local_remote\"))\n }\n dvc.config[\"core\"][\"remote\"] = \"local_remote\"\n dvc.push()\n\n # remove artifacts and cache to trigger fetching\n remove(\"file\")\n remove(\"dir\")\n remove(dvc.cache.local.cache_dir)\n\n checksum_spy = mocker.spy(dvc.cache.local, \"get_file_checksum\")\n\n dvc.pull()\n assert checksum_spy.call_count == 0\n\n # Removing cache will invalidate existing state entries\n remove(dvc.cache.local.cache_dir)\n\n dvc.config[\"remote\"][\"local_remote\"][\"verify\"] = True\n\n dvc.pull()\n assert checksum_spy.call_count == 3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pull_git_imports_test_pull_git_imports.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pull_git_imports_test_pull_git_imports.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 716, "end_line": 739, "span_ids": ["test_pull_git_imports"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"erepo\", [\"git_dir\", \"erepo_dir\"])\ndef test_pull_git_imports(request, tmp_dir, dvc, scm, erepo):\n erepo = request.getfixturevalue(erepo)\n with erepo.chdir():\n erepo.scm_gen({\"dir\": {\"bar\": \"bar\"}}, commit=\"second\")\n erepo.scm_gen(\"foo\", \"foo\", commit=\"first\")\n\n dvc.imp(fspath(erepo), \"foo\")\n dvc.imp(fspath(erepo), \"dir\", out=\"new_dir\", rev=\"HEAD~\")\n\n assert dvc.pull()[\"downloaded\"] == 0\n\n for item in [\"foo\", \"new_dir\", dvc.cache.local.cache_dir]:\n remove(item)\n os.makedirs(dvc.cache.local.cache_dir, exist_ok=True)\n clean_repos()\n\n assert dvc.pull(force=True)[\"downloaded\"] == 2\n\n assert (tmp_dir / \"foo\").exists()\n assert (tmp_dir / \"foo\").read_text() == \"foo\"\n\n assert (tmp_dir / \"new_dir\").exists()\n assert (tmp_dir / \"new_dir\" / \"bar\").read_text() == \"bar\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pull_external_dvc_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pull_external_dvc_imports_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 742, "end_line": 767, "span_ids": ["test_pull_external_dvc_imports"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pull_external_dvc_imports(tmp_dir, dvc, scm, erepo_dir):\n with erepo_dir.chdir():\n erepo_dir.dvc_gen({\"dir\": {\"bar\": \"bar\"}}, commit=\"second\")\n erepo_dir.dvc_gen(\"foo\", \"foo\", commit=\"first\")\n\n os.remove(\"foo\")\n shutil.rmtree(\"dir\")\n\n dvc.imp(fspath(erepo_dir), \"foo\")\n dvc.imp(fspath(erepo_dir), \"dir\", out=\"new_dir\", rev=\"HEAD~\")\n\n assert dvc.pull()[\"downloaded\"] == 0\n\n for item in [\"foo\", \"new_dir\", dvc.cache.local.cache_dir]:\n remove(item)\n os.makedirs(dvc.cache.local.cache_dir, exist_ok=True)\n clean_repos()\n\n assert dvc.pull(force=True)[\"downloaded\"] == 2\n\n assert (tmp_dir / \"foo\").exists()\n assert (tmp_dir / \"foo\").read_text() == \"foo\"\n\n assert (tmp_dir / \"new_dir\").exists()\n assert (tmp_dir / \"new_dir\" / \"bar\").read_text() == \"bar\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_test_log_summary_test_log_summary._assert_output_No_ch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_checkout.py_test_log_summary_test_log_summary._assert_output_No_ch", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 50, "span_ids": ["test_log_summary"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_log_summary(caplog):\n stats = {\n \"added\": [\"file1\", \"file2\", \"file3\"],\n \"deleted\": [\"file4\", \"file5\"],\n \"modified\": [\"file6\", \"file7\"],\n }\n\n def _assert_output(stats, expected_text):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n caplog.clear()\n log_summary(stats)\n assert expected_text in caplog.text\n\n _assert_output(stats, \"3 added, 2 deleted and 2 modified\")\n\n del stats[\"deleted\"][1]\n _assert_output(stats, \"3 added, 1 deleted and 2 modified\")\n\n del stats[\"deleted\"][0]\n _assert_output(stats, \"3 added and 2 modified\")\n\n del stats[\"modified\"]\n _assert_output(stats, \"3 added\")\n\n _assert_output({}, \"No changes.\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_yaml_test_loads_params.assert_deps_1_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_yaml_test_loads_params.assert_deps_1_info_", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_params.py", "file_name": "test_params.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports", "test_loads_params"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import yaml\n\nimport pytest\n\nfrom dvc.dependency import DependencyPARAMS, loads_params, loadd_from\nfrom dvc.dependency.param import BadParamFileError, MissingParamsError\nfrom dvc.stage import Stage\n\n\nPARAMS = {\n \"foo\": 1,\n \"bar\": 53.135,\n \"baz\": \"str\",\n \"qux\": None,\n}\n\n\ndef test_loads_params(dvc):\n stage = Stage(dvc)\n deps = loads_params(stage, [\"foo\", \"bar,baz\", \"a_file:qux\"])\n assert len(deps) == 2\n\n assert isinstance(deps[0], DependencyPARAMS)\n assert deps[0].def_path == DependencyPARAMS.DEFAULT_PARAMS_FILE\n assert deps[0].params == [\"foo\", \"bar\", \"baz\"]\n assert deps[0].info == {}\n\n assert isinstance(deps[1], DependencyPARAMS)\n assert deps[1].def_path == \"a_file\"\n assert deps[1].params == [\"qux\"]\n assert deps[1].info == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_test_loadd_from_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_test_loadd_from_", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_params.py", "file_name": "test_params.py", "file_type": "text/x-python", "category": "test", "start_line": 34, "end_line": 91, "span_ids": ["test_save_info_missing_param", "test_read_params_nonexistent_file", "test_dumpd_with_info", "test_dumpd_without_info", "test_read_params_nested", "test_read_params_unsupported_format", "test_save_info_missing_config", "test_loadd_from"], "tokens": 477}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_loadd_from(dvc):\n stage = Stage(dvc)\n deps = loadd_from(stage, [{\"params\": PARAMS}])\n assert len(deps) == 1\n assert isinstance(deps[0], DependencyPARAMS)\n assert deps[0].def_path == DependencyPARAMS.DEFAULT_PARAMS_FILE\n assert deps[0].params == list(PARAMS.keys())\n assert deps[0].info == PARAMS\n\n\ndef test_dumpd_with_info(dvc):\n dep = DependencyPARAMS(Stage(dvc), None, PARAMS)\n assert dep.dumpd() == {\n \"path\": \"params.yaml\",\n \"params\": PARAMS,\n }\n\n\ndef test_dumpd_without_info(dvc):\n dep = DependencyPARAMS(Stage(dvc), None, list(PARAMS.keys()))\n assert dep.dumpd() == {\n \"path\": \"params.yaml\",\n \"params\": list(PARAMS.keys()),\n }\n\n\ndef test_read_params_nonexistent_file(dvc):\n dep = DependencyPARAMS(Stage(dvc), None, [\"foo\"])\n assert dep.read_params() == {}\n\n\ndef test_read_params_unsupported_format(tmp_dir, dvc):\n tmp_dir.gen(\"params.yaml\", b\"\\0\\1\\2\\3\\4\\5\\6\\7\")\n dep = DependencyPARAMS(Stage(dvc), None, [\"foo\"])\n with pytest.raises(BadParamFileError):\n dep.read_params()\n\n\ndef test_read_params_nested(tmp_dir, dvc):\n tmp_dir.gen(\n \"params.yaml\", yaml.dump({\"some\": {\"path\": {\"foo\": [\"val1\", \"val2\"]}}})\n )\n dep = DependencyPARAMS(Stage(dvc), None, [\"some.path.foo\"])\n assert dep.read_params() == {\"some.path.foo\": [\"val1\", \"val2\"]}\n\n\ndef test_save_info_missing_config(dvc):\n dep = DependencyPARAMS(Stage(dvc), None, [\"foo\"])\n with pytest.raises(MissingParamsError):\n dep.save_info()\n\n\ndef test_save_info_missing_param(tmp_dir, dvc):\n tmp_dir.gen(\"params.yaml\", \"bar: baz\")\n dep = DependencyPARAMS(Stage(dvc), None, [\"foo\"])\n with pytest.raises(MissingParamsError):\n dep.save_info()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_locked_test_collect_optimization.dvc_collect_granular_stag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_locked_test_collect_optimization.dvc_collect_granular_stag", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 84, "span_ids": ["test_locked", "test_collect_optimization"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_locked(mocker):\n repo = mocker.MagicMock()\n repo.method = locked(repo.method)\n\n args = {}\n kwargs = {}\n repo.method(repo, args, kwargs)\n\n assert repo.method_calls == [\n mocker.call._reset(),\n mocker.call.method(repo, args, kwargs),\n mocker.call._reset(),\n ]\n\n\ndef test_collect_optimization(tmp_dir, dvc, mocker):\n (stage,) = tmp_dir.dvc_gen(\"foo\", \"foo text\")\n\n # Forget cached stages and graph and error out on collection\n dvc._reset()\n mocker.patch(\n \"dvc.repo.Repo.stages\",\n property(raiser(Exception(\"Should not collect\"))),\n )\n\n # Should read stage directly instead of collecting the whole graph\n dvc.collect(stage.path)\n dvc.collect_granular(stage.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_skip_graph_checks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_skip_graph_checks_", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 87, "end_line": 112, "span_ids": ["test_skip_graph_checks"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_skip_graph_checks(tmp_dir, dvc, mocker, run_copy):\n # See https://github.com/iterative/dvc/issues/2671 for more info\n mock_collect_graph = mocker.patch(\"dvc.repo.Repo._collect_graph\")\n\n # sanity check\n tmp_dir.gen(\"foo\", \"foo text\")\n dvc.add(\"foo\")\n run_copy(\"foo\", \"bar\")\n assert mock_collect_graph.called\n\n # check that our hack can be enabled\n mock_collect_graph.reset_mock()\n dvc._skip_graph_checks = True\n tmp_dir.gen(\"baz\", \"baz text\")\n dvc.add(\"baz\")\n run_copy(\"baz\", \"qux\")\n assert not mock_collect_graph.called\n\n # check that our hack can be disabled\n mock_collect_graph.reset_mock()\n dvc._skip_graph_checks = False\n tmp_dir.gen(\"quux\", \"quux text\")\n dvc.add(\"quux\")\n run_copy(\"quux\", \"quuz\")\n assert mock_collect_graph.called", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo._fill_parts_URLInfo._fill_parts.if_isinstance_path__URLP.else_.self._spath.path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo._fill_parts_URLInfo._fill_parts.if_isinstance_path__URLP.else_.self._spath.path", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 133, "end_line": 146, "span_ids": ["URLInfo._fill_parts"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class URLInfo(_BasePath):\n\n def _fill_parts(self, scheme, host, user, port, path):\n assert scheme != \"remote\"\n assert isinstance(path, (str, bytes, _URLPathInfo))\n\n self.scheme, self.host, self.user = scheme, host, user\n self.port = int(port) if port else self.DEFAULT_PORTS.get(self.scheme)\n\n if isinstance(path, _URLPathInfo):\n self._spath = str(path)\n self._path = path\n else:\n if path and path[0] != \"/\":\n path = \"/\" + path\n self._spath = path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Tqdm.wrap_fn_Tqdm.close.super_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Tqdm.wrap_fn_Tqdm.close.super_close_", "embedding": null, "metadata": {"file_path": "dvc/progress.py", "file_name": "progress.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 139, "span_ids": ["Tqdm.wrap_fn", "Tqdm.close"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Tqdm(tqdm):\n\n def wrap_fn(self, fn, callback=None):\n \"\"\"\n Returns a wrapped `fn` which calls `callback()` on each call.\n `callback` is `self.update` by default.\n \"\"\"\n if callback is None:\n callback = self.update\n\n def wrapped(*args, **kwargs):\n res = fn(*args, **kwargs)\n callback()\n return res\n\n return wrapped\n\n def close(self):\n if self.desc_persist is not None:\n self.set_description_str(self.desc_persist, refresh=False)\n # unknown/zero ETA\n self.bar_format = self.bar_format.replace(\"<{remaining}\", \"\")\n # remove completed bar\n self.bar_format = self.bar_format.replace(\"|{bar:10}|\", \" \")\n super().close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Tqdm.format_dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Tqdm.format_dict_", "embedding": null, "metadata": {"file_path": "dvc/progress.py", "file_name": "progress.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 155, "span_ids": ["Tqdm.format_dict"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Tqdm(tqdm):\n\n @property\n def format_dict(self):\n \"\"\"inject `ncols_desc` to fill the display width (`ncols`)\"\"\"\n d = super().format_dict\n ncols = d[\"ncols\"] or 80\n ncols_desc = ncols - len(self.format_meter(ncols_desc=1, **d)) + 1\n ncols_desc = max(ncols_desc, 0)\n if ncols_desc:\n d[\"ncols_desc\"] = ncols_desc\n else:\n # work-around for zero-width description\n d[\"ncols_desc\"] = 1\n d[\"prefix\"] = \"\"\n return d", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.__repr___RemoteBASE.get_file_checksum.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.__repr___RemoteBASE.get_file_checksum.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 175, "span_ids": ["RemoteBASE.__repr__", "RemoteBASE.cache", "RemoteBASE.get_file_checksum", "RemoteBASE.supported"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def __repr__(self):\n return \"{class_name}: '{path_info}'\".format(\n class_name=type(self).__name__,\n path_info=self.path_info or \"No path\",\n )\n\n @classmethod\n def supported(cls, config):\n if isinstance(config, (str, bytes)):\n url = config\n else:\n url = config[\"url\"]\n\n # NOTE: silently skipping remote, calling code should handle that\n parsed = urlparse(url)\n return parsed.scheme == cls.scheme\n\n @property\n def cache(self):\n return getattr(self.repo.cache, self.scheme)\n\n def get_file_checksum(self, path_info):\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._calculate_checksums_RemoteBASE._calculate_checksums.return.checksums": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._calculate_checksums_RemoteBASE._calculate_checksums.return.checksums", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 190, "span_ids": ["RemoteBASE._calculate_checksums"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _calculate_checksums(self, file_infos):\n file_infos = list(file_infos)\n with Tqdm(\n total=len(file_infos),\n unit=\"md5\",\n desc=\"Computing file/dir hashes (only done once)\",\n ) as pbar:\n worker = pbar.wrap_fn(self.get_file_checksum)\n with ThreadPoolExecutor(\n max_workers=self.checksum_jobs\n ) as executor:\n tasks = executor.map(worker, file_infos)\n checksums = dict(zip(file_infos, tasks))\n return checksums", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._download_dir_RemoteBASE._download_dir.with_Tqdm_.with_ThreadPoolExecutor_m.return.sum_futures_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._download_dir_RemoteBASE._download_dir.with_Tqdm_.with_ThreadPoolExecutor_m.return.sum_futures_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 606, "end_line": 631, "span_ids": ["RemoteBASE._download_dir"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _download_dir(\n self, from_info, to_info, name, no_progress_bar, file_mode, dir_mode\n ):\n from_infos = list(self.walk_files(from_info))\n to_infos = (\n to_info / info.relative_to(from_info) for info in from_infos\n )\n\n with Tqdm(\n total=len(from_infos),\n desc=\"Downloading directory\",\n unit=\"Files\",\n disable=no_progress_bar,\n ) as pbar:\n download_files = pbar.wrap_fn(\n partial(\n self._download_file,\n name=name,\n no_progress_bar=True,\n file_mode=file_mode,\n dir_mode=dir_mode,\n )\n )\n with ThreadPoolExecutor(max_workers=self.JOBS) as executor:\n futures = executor.map(download_files, from_infos, to_infos)\n return sum(futures)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.open_RemoteBASE.cache_checksums.for_path_in_self_list_cac.try_.except_ValueError_.logger_debug_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.open_RemoteBASE.cache_checksums.for_path_in_self_list_cac.try_.except_ValueError_.logger_debug_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 656, "end_line": 712, "span_ids": ["RemoteBASE.copy", "RemoteBASE.open", "RemoteBASE.list_cache_paths", "RemoteBASE.remove", "RemoteBASE.symlink", "RemoteBASE.checksum_to_path_info", "RemoteBASE.move", "RemoteBASE.path_to_checksum", "RemoteBASE.exists", "RemoteBASE.hardlink", "RemoteBASE.reflink", "RemoteBASE.cache_checksums"], "tokens": 444}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def open(self, path_info, mode=\"r\", encoding=None):\n if hasattr(self, \"_generate_download_url\"):\n get_url = partial(self._generate_download_url, path_info)\n return open_url(get_url, mode=mode, encoding=encoding)\n\n raise RemoteActionNotImplemented(\"open\", self.scheme)\n\n def remove(self, path_info):\n raise RemoteActionNotImplemented(\"remove\", self.scheme)\n\n def move(self, from_info, to_info, mode=None):\n assert mode is None\n self.copy(from_info, to_info)\n self.remove(from_info)\n\n def copy(self, from_info, to_info):\n raise RemoteActionNotImplemented(\"copy\", self.scheme)\n\n def symlink(self, from_info, to_info):\n raise RemoteActionNotImplemented(\"symlink\", self.scheme)\n\n def hardlink(self, from_info, to_info):\n raise RemoteActionNotImplemented(\"hardlink\", self.scheme)\n\n def reflink(self, from_info, to_info):\n raise RemoteActionNotImplemented(\"reflink\", self.scheme)\n\n def exists(self, path_info):\n raise NotImplementedError\n\n def path_to_checksum(self, path):\n parts = self.path_cls(path).parts[-2:]\n\n if not (len(parts) == 2 and parts[0] and len(parts[0]) == 2):\n raise ValueError(\"Bad cache file path '{}'\".format(path))\n\n return \"\".join(parts)\n\n def checksum_to_path_info(self, checksum):\n return self.path_info / checksum[0:2] / checksum[2:]\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n raise NotImplementedError\n\n def cache_checksums(self, prefix=None, progress_callback=None):\n \"\"\"Iterate over remote cache checksums.\n\n If `prefix` is specified, only checksums which begin with `prefix`\n will be returned.\n \"\"\"\n for path in self.list_cache_paths(prefix, progress_callback):\n try:\n yield self.path_to_checksum(path)\n except ValueError:\n logger.debug(\n \"'%s' doesn't look like a cache file, skipping\", path\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.all_RemoteBASE.all.return.self__cache_checksums_tra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.all_RemoteBASE.all.return.self__cache_checksums_tra", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 714, "end_line": 732, "span_ids": ["RemoteBASE.all"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def all(self, jobs=None, name=None):\n \"\"\"Iterate over all checksums in the remote cache.\n\n Checksums will be fetched in parallel threads according to prefix\n (except for small remotes) and a progress bar will be displayed.\n \"\"\"\n logger.debug(\n \"Fetching all checksums from '{}'\".format(\n name if name else \"remote cache\"\n )\n )\n\n if not self.CAN_TRAVERSE:\n return self.cache_checksums()\n\n remote_size, remote_checksums = self._estimate_cache_size(name=name)\n return self._cache_checksums_traverse(\n remote_size, remote_checksums, jobs, name\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.gc_RemoteBASE.is_protected.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.gc_RemoteBASE.is_protected.return.False", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 759, "end_line": 785, "span_ids": ["RemoteBASE.is_protected", "RemoteBASE.gc"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n @index_locked\n def gc(self, named_cache, jobs=None):\n used = self.extract_used_local_checksums(named_cache)\n\n if self.scheme != \"\":\n used.update(named_cache.scheme_keys(self.scheme))\n\n removed = False\n # checksums must be sorted to ensure we always remove .dir files first\n for checksum in sorted(\n self.all(jobs, str(self.path_info)),\n key=self.is_dir_checksum,\n reverse=True,\n ):\n if checksum in used:\n continue\n path_info = self.checksum_to_path_info(checksum)\n if self.is_dir_checksum(checksum):\n self._remove_unpacked_dir(checksum)\n self.remove(path_info)\n removed = True\n if removed:\n self.index.clear()\n return removed\n\n def is_protected(self, path_info):\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checksums_with_limit_RemoteBASE._max_estimation_size.return.max_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checksums_with_limit_RemoteBASE._max_estimation_size.return.max_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 908, "end_line": 929, "span_ids": ["RemoteBASE._checksums_with_limit", "RemoteBASE._max_estimation_size"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _checksums_with_limit(\n self, limit, prefix=None, progress_callback=None\n ):\n count = 0\n for checksum in self.cache_checksums(prefix, progress_callback):\n yield checksum\n count += 1\n if count > limit:\n logger.debug(\n \"`cache_checksums()` returned max '{}' checksums, \"\n \"skipping remaining results\".format(limit)\n )\n return\n\n def _max_estimation_size(self, checksums):\n # Max remote size allowed for us to use traverse method\n return max(\n self.TRAVERSE_THRESHOLD_SIZE,\n len(checksums)\n / self.TRAVERSE_WEIGHT_MULTIPLIER\n * self.LIST_OBJECT_PAGE_SIZE,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._estimate_cache_size_RemoteBASE._estimate_cache_size.return.remote_size_remote_check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._estimate_cache_size_RemoteBASE._estimate_cache_size.return.remote_size_remote_check", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 931, "end_line": 964, "span_ids": ["RemoteBASE._estimate_cache_size"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _estimate_cache_size(self, checksums=None, name=None):\n \"\"\"Estimate remote cache size based on number of entries beginning with\n \"00...\" prefix.\n \"\"\"\n prefix = \"0\" * self.TRAVERSE_PREFIX_LEN\n total_prefixes = pow(16, self.TRAVERSE_PREFIX_LEN)\n if checksums:\n max_checksums = self._max_estimation_size(checksums)\n else:\n max_checksums = None\n\n with Tqdm(\n desc=\"Estimating size of \"\n + (\"cache in '{}'\".format(name) if name else \"remote cache\"),\n unit=\"file\",\n ) as pbar:\n\n def update(n=1):\n pbar.update(n * total_prefixes)\n\n if max_checksums:\n checksums = self._checksums_with_limit(\n max_checksums / total_prefixes, prefix, update\n )\n else:\n checksums = self.cache_checksums(prefix, update)\n\n remote_checksums = set(checksums)\n if remote_checksums:\n remote_size = total_prefixes * len(remote_checksums)\n else:\n remote_size = total_prefixes\n logger.debug(\"Estimated remote size: {} files\".format(remote_size))\n return remote_size, remote_checksums", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_checksums_traverse_RemoteBASE._cache_checksums_traverse.with_Tqdm_.with_ThreadPoolExecutor_m.yield_from_itertools_chai": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._cache_checksums_traverse_RemoteBASE._cache_checksums_traverse.with_Tqdm_.with_ThreadPoolExecutor_m.yield_from_itertools_chai", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 966, "end_line": 1019, "span_ids": ["RemoteBASE._cache_checksums_traverse"], "tokens": 520}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _cache_checksums_traverse(\n self, remote_size, remote_checksums, jobs=None, name=None\n ):\n \"\"\"Iterate over all checksums in the remote cache.\n Checksums are fetched in parallel according to prefix, except in\n cases where the remote size is very small.\n\n All checksums from the remote (including any from the size\n estimation step passed via the `remote_checksums` argument) will be\n returned.\n\n NOTE: For large remotes the list of checksums will be very\n big(e.g. 100M entries, md5 for each is 32 bytes, so ~3200Mb list)\n and we don't really need all of it at the same time, so it makes\n sense to use a generator to gradually iterate over it, without\n keeping all of it in memory.\n \"\"\"\n num_pages = remote_size / self.LIST_OBJECT_PAGE_SIZE\n if num_pages < 256 / self.JOBS:\n # Fetching prefixes in parallel requires at least 255 more\n # requests, for small enough remotes it will be faster to fetch\n # entire cache without splitting it into prefixes.\n #\n # NOTE: this ends up re-fetching checksums that were already\n # fetched during remote size estimation\n traverse_prefixes = [None]\n initial = 0\n else:\n yield from remote_checksums\n initial = len(remote_checksums)\n traverse_prefixes = [\"{:02x}\".format(i) for i in range(1, 256)]\n if self.TRAVERSE_PREFIX_LEN > 2:\n traverse_prefixes += [\n \"{0:0{1}x}\".format(i, self.TRAVERSE_PREFIX_LEN)\n for i in range(1, pow(16, self.TRAVERSE_PREFIX_LEN - 2))\n ]\n with Tqdm(\n desc=\"Querying \"\n + (\"cache in '{}'\".format(name) if name else \"remote cache\"),\n total=remote_size,\n initial=initial,\n unit=\"file\",\n ) as pbar:\n\n def list_with_update(prefix):\n return list(\n self.cache_checksums(\n prefix=prefix, progress_callback=pbar.update\n )\n )\n\n with ThreadPoolExecutor(max_workers=jobs or self.JOBS) as executor:\n in_remote = executor.map(list_with_update, traverse_prefixes,)\n yield from itertools.chain.from_iterable(in_remote)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py__gdrive_retry__gdrive_retry.return.retry_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py__gdrive_retry__gdrive_retry.return.retry_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 79, "span_ids": ["_gdrive_retry"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _gdrive_retry(func):\n def should_retry(exc):\n from pydrive2.files import ApiRequestError\n\n if not isinstance(exc, ApiRequestError):\n return False\n\n error_code = exc.error.get(\"code\", 0)\n result = False\n if 500 <= error_code < 600:\n result = True\n\n if error_code == 403:\n result = _extract(exc, \"reason\") in [\n \"userRateLimitExceeded\",\n \"rateLimitExceeded\",\n ]\n if result:\n logger.debug(\"Retrying GDrive API call, error: {}.\".format(exc))\n\n return result\n\n # 16 tries, start at 0.5s, multiply by golden ratio, cap at 20s\n return retry(\n 16,\n timeout=lambda a: min(0.5 * 1.618 ** a, 20),\n filter_errors=should_retry,\n )(func)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._validate_config_RemoteGDrive._validate_config.if_not_self__use_service_.if_bool_self__client_id_.raise_DvcException_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._validate_config_RemoteGDrive._validate_config.if_not_self__use_service_.if_bool_self__client_id_.raise_DvcException_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 170, "span_ids": ["RemoteGDrive._validate_config"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n def _validate_config(self):\n # Validate Service Account configuration\n if self._use_service_account and (\n not self._service_account_email\n or not self._service_account_p12_file_path\n ):\n raise DvcException(\n \"To use service account please specify {}, {} and \"\n \"{} in DVC config. Learn more at \"\n \"{}.\".format(\n \"gdrive_service_account_email\",\n \"gdrive_service_account_p12_file_path\",\n \"gdrive_service_account_user_email (optional)\",\n format_link(\"https://man.dvc.org/remote/modify\"),\n )\n )\n\n # Validate OAuth 2.0 Client ID configuration\n if not self._use_service_account:\n if bool(self._client_id) != bool(self._client_secret):\n raise DvcException(\n \"Please specify Google Drive's client id and secret in \"\n \"DVC config or omit both to use defaults. Learn more at \"\n \"{}.\".format(\n format_link(\"https://man.dvc.org/remote/modify\")\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._drive_RemoteGDrive._drive.return.GoogleDrive_gauth_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._drive_RemoteGDrive._drive.return.GoogleDrive_gauth_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 236, "span_ids": ["RemoteGDrive._drive"], "tokens": 574}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n @wrap_prop(threading.RLock())\n @cached_property\n def _drive(self):\n from pydrive2.auth import RefreshError\n from pydrive2.auth import GoogleAuth\n from pydrive2.drive import GoogleDrive\n\n if os.getenv(RemoteGDrive.GDRIVE_CREDENTIALS_DATA):\n with open(\n self._gdrive_user_credentials_path, \"w\"\n ) as credentials_file:\n credentials_file.write(\n os.getenv(RemoteGDrive.GDRIVE_CREDENTIALS_DATA)\n )\n\n GoogleAuth.DEFAULT_SETTINGS[\"client_config_backend\"] = \"settings\"\n if self._use_service_account:\n GoogleAuth.DEFAULT_SETTINGS[\"service_config\"] = {\n \"client_service_email\": self._service_account_email,\n \"client_user_email\": self._service_account_user_email,\n \"client_pkcs12_file_path\": self._service_account_p12_file_path,\n }\n else:\n GoogleAuth.DEFAULT_SETTINGS[\"client_config\"] = {\n \"client_id\": self._client_id or self.DEFAULT_GDRIVE_CLIENT_ID,\n \"client_secret\": self._client_secret\n or self.DEFAULT_GDRIVE_CLIENT_SECRET,\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://oauth2.googleapis.com/token\",\n \"revoke_uri\": \"https://oauth2.googleapis.com/revoke\",\n \"redirect_uri\": \"\",\n }\n GoogleAuth.DEFAULT_SETTINGS[\"save_credentials\"] = True\n GoogleAuth.DEFAULT_SETTINGS[\"save_credentials_backend\"] = \"file\"\n GoogleAuth.DEFAULT_SETTINGS[\n \"save_credentials_file\"\n ] = self._gdrive_user_credentials_path\n GoogleAuth.DEFAULT_SETTINGS[\"get_refresh_token\"] = True\n GoogleAuth.DEFAULT_SETTINGS[\"oauth_scope\"] = [\n \"https://www.googleapis.com/auth/drive\",\n \"https://www.googleapis.com/auth/drive.appdata\",\n ]\n\n # Pass non existent settings path to force DEFAULT_SETTINGS loading\n gauth = GoogleAuth(settings_file=\"\")\n\n try:\n if self._use_service_account:\n gauth.ServiceAuth()\n else:\n gauth.CommandLineAuth()\n except RefreshError as exc:\n raise GDriveAccessTokenRefreshError from exc\n except KeyError as exc:\n raise GDriveMissedCredentialKeyError(\n self._gdrive_user_credentials_path\n ) from exc\n # Handle pydrive2.auth.AuthenticationError and other auth failures\n except Exception as exc:\n raise DvcException(\"Google Drive authentication failed\") from exc\n finally:\n if os.getenv(RemoteGDrive.GDRIVE_CREDENTIALS_DATA):\n os.remove(self._gdrive_user_credentials_path)\n\n return GoogleDrive(gauth)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._ids_cache_RemoteGDrive._ids_cache.return.cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._ids_cache_RemoteGDrive._ids_cache.return.cache", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 238, "end_line": 255, "span_ids": ["RemoteGDrive._ids_cache"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n @wrap_prop(threading.RLock())\n @cached_property\n def _ids_cache(self):\n cache = {\n \"dirs\": defaultdict(list),\n \"ids\": {},\n \"root_id\": self._get_item_id(self.path_info, use_cache=False),\n }\n\n self._cache_path_id(self.path_info.path, cache[\"root_id\"], cache)\n\n for item in self._gdrive_list(\n \"'{}' in parents and trashed=false\".format(cache[\"root_id\"])\n ):\n item_path = (self.path_info / item[\"title\"]).path\n self._cache_path_id(item_path, item[\"id\"], cache)\n\n return cache", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._cache_path_id_RemoteGDrive._gdrive_shared_drive_id.return.item_get_driveId_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._cache_path_id_RemoteGDrive._gdrive_shared_drive_id.return.item_get_driveId_None_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 257, "end_line": 280, "span_ids": ["RemoteGDrive._gdrive_shared_drive_id", "RemoteGDrive._list_params", "RemoteGDrive._cache_path_id"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n def _cache_path_id(self, path, item_id, cache=None):\n cache = cache or self._ids_cache\n cache[\"dirs\"][path].append(item_id)\n cache[\"ids\"][item_id] = path\n\n @cached_property\n def _list_params(self):\n params = {\"corpora\": \"default\"}\n if self._bucket != \"root\" and self._bucket != \"appDataFolder\":\n drive_id = self._gdrive_shared_drive_id(self._bucket)\n if drive_id:\n params[\"driveId\"] = drive_id\n params[\"corpora\"] = \"drive\"\n return params\n\n @_gdrive_retry\n def _gdrive_shared_drive_id(self, item_id):\n param = {\"id\": item_id}\n # it does not create a file on the remote\n item = self._drive.CreateFile(param)\n # ID of the shared drive the item resides in.\n # Only populated for items in shared drives.\n item.FetchMetadata(\"driveId\")\n return item.get(\"driveId\", None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_upload_file_RemoteGDrive._gdrive_upload_file.return.item": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_upload_file_RemoteGDrive._gdrive_upload_file.return.item", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 282, "end_line": 309, "span_ids": ["RemoteGDrive._gdrive_upload_file"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n @_gdrive_retry\n def _gdrive_upload_file(\n self,\n parent_id,\n title,\n no_progress_bar=False,\n from_file=\"\",\n progress_name=\"\",\n ):\n item = self._drive.CreateFile(\n {\"title\": title, \"parents\": [{\"id\": parent_id}]}\n )\n\n with open(from_file, \"rb\") as fobj:\n total = os.path.getsize(from_file)\n with Tqdm.wrapattr(\n fobj,\n \"read\",\n desc=progress_name,\n total=total,\n disable=no_progress_bar,\n ) as wrapped:\n # PyDrive doesn't like content property setting for empty files\n # https://github.com/gsuitedevs/PyDrive/issues/121\n if total:\n item.content = wrapped\n item.Upload()\n return item", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_download_file_RemoteGDrive._gdrive_download_file.with_Tqdm_.gdrive_file_GetContentFil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_download_file_RemoteGDrive._gdrive_download_file.with_Tqdm_.gdrive_file_GetContentFil", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 325, "span_ids": ["RemoteGDrive._gdrive_download_file"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n @_gdrive_retry\n def _gdrive_download_file(\n self, item_id, to_file, progress_desc, no_progress_bar\n ):\n param = {\"id\": item_id}\n # it does not create a file on the remote\n gdrive_file = self._drive.CreateFile(param)\n bar_format = (\n \"Downloading {desc:{ncols_desc}.{ncols_desc}}... \"\n + Tqdm.format_sizeof(int(gdrive_file[\"fileSize\"]), \"B\", 1024)\n )\n with Tqdm(\n bar_format=bar_format, desc=progress_desc, disable=no_progress_bar\n ):\n gdrive_file.GetContentFile(to_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_delete_file_RemoteGDrive._gdrive_delete_file.try_.except_ApiRequestError_as.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_delete_file_RemoteGDrive._gdrive_delete_file.try_.except_ApiRequestError_as.raise", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 364, "span_ids": ["RemoteGDrive._gdrive_delete_file"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n @_gdrive_retry\n def _gdrive_delete_file(self, item_id):\n from pydrive2.files import ApiRequestError\n\n param = {\"id\": item_id}\n # it does not create a file on the remote\n item = self._drive.CreateFile(param)\n\n try:\n item.Trash() if self._trash_only else item.Delete()\n except ApiRequestError as exc:\n http_error_code = exc.error.get(\"code\", 0)\n if (\n http_error_code == 403\n and self._list_params[\"corpora\"] == \"drive\"\n and _extract(exc, \"location\") == \"file.permissions\"\n ):\n raise DvcException(\n \"Insufficient permissions to {}. You should have {} \"\n \"access level for the used shared drive. More details \"\n \"at {}.\".format(\n \"move the file into Trash\"\n if self._trash_only\n else \"permanently delete the file\",\n \"Manager or Content Manager\"\n if self._trash_only\n else \"Manager\",\n \"https://support.google.com/a/answer/7337554\",\n )\n ) from exc\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_list_RemoteGDrive._create_dir.return.item_id_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._gdrive_list_RemoteGDrive._create_dir.return.item_id_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 390, "span_ids": ["RemoteGDrive._gdrive_create_dir", "RemoteGDrive._create_dir", "RemoteGDrive._gdrive_list"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n def _gdrive_list(self, query):\n param = {\"q\": query, \"maxResults\": 1000}\n param.update(self._list_params)\n file_list = self._drive.ListFile(param)\n\n # Isolate and decorate fetching of remote drive items in pages.\n get_list = _gdrive_retry(lambda: next(file_list, None))\n\n # Fetch pages until None is received, lazily flatten the thing.\n return cat(iter(get_list, None))\n\n @_gdrive_retry\n def _gdrive_create_dir(self, parent_id, title):\n parent = {\"id\": parent_id}\n item = self._drive.CreateFile(\n {\"title\": title, \"parents\": [parent], \"mimeType\": FOLDER_MIME_TYPE}\n )\n item.Upload()\n return item\n\n @wrap_with(threading.RLock())\n def _create_dir(self, parent_id, title, remote_path):\n cached = self._ids_cache[\"dirs\"].get(remote_path)\n if cached:\n return cached[0]\n\n item = self._gdrive_create_dir(parent_id, title)\n\n if parent_id == self._ids_cache[\"root_id\"]:\n self._cache_path_id(remote_path, item[\"id\"])\n\n return item[\"id\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_remote_item_ids_RemoteGDrive._get_remote_item_ids.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_remote_item_ids_RemoteGDrive._get_remote_item_ids.return._", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 392, "end_line": 408, "span_ids": ["RemoteGDrive._get_remote_item_ids"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n def _get_remote_item_ids(self, parent_ids, title):\n if not parent_ids:\n return None\n query = \"trashed=false and ({})\".format(\n \" or \".join(\n \"'{}' in parents\".format(parent_id) for parent_id in parent_ids\n )\n )\n query += \" and title='{}'\".format(title.replace(\"'\", \"\\\\'\"))\n\n # GDrive list API is case insensitive, we need to compare\n # all results and pick the ones with the right title\n return [\n item[\"id\"]\n for item in self._gdrive_list(query)\n if item[\"title\"] == title\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_cached_item_ids_RemoteGDrive._path_to_item_ids.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_cached_item_ids_RemoteGDrive._path_to_item_ids.return._", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 410, "end_line": 430, "span_ids": ["RemoteGDrive._get_cached_item_ids", "RemoteGDrive._path_to_item_ids"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n def _get_cached_item_ids(self, path, use_cache):\n if not path:\n return [self._bucket]\n if use_cache:\n return self._ids_cache[\"dirs\"].get(path, [])\n return []\n\n def _path_to_item_ids(self, path, create, use_cache):\n item_ids = self._get_cached_item_ids(path, use_cache)\n if item_ids:\n return item_ids\n\n parent_path, title = posixpath.split(path)\n parent_ids = self._path_to_item_ids(parent_path, create, use_cache)\n item_ids = self._get_remote_item_ids(parent_ids, title)\n if item_ids:\n return item_ids\n\n return (\n [self._create_dir(min(parent_ids), title, path)] if create else []\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_item_id_RemoteGDrive._download.self__gdrive_download_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_RemoteGDrive._get_item_id_RemoteGDrive._download.self__gdrive_download_fil", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 432, "end_line": 460, "span_ids": ["RemoteGDrive._upload", "RemoteGDrive.exists", "RemoteGDrive._get_item_id", "RemoteGDrive._download"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGDrive(RemoteBASE):\n\n def _get_item_id(self, path_info, create=False, use_cache=True):\n assert path_info.bucket == self._bucket\n\n item_ids = self._path_to_item_ids(path_info.path, create, use_cache)\n if item_ids:\n return min(item_ids)\n\n raise GDrivePathNotFound(path_info)\n\n def exists(self, path_info):\n try:\n self._get_item_id(path_info)\n except GDrivePathNotFound:\n return False\n else:\n return True\n\n def _upload(self, from_file, to_info, name=None, no_progress_bar=False):\n dirname = to_info.parent\n assert dirname\n parent_id = self._get_item_id(dirname, True)\n\n self._gdrive_upload_file(\n parent_id, to_info.name, no_progress_bar, from_file, name\n )\n\n def _download(self, from_info, to_file, name=None, no_progress_bar=False):\n item_id = self._get_item_id(from_info)\n self._gdrive_download_file(item_id, to_file, name, no_progress_bar)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS_RemoteGS.exists.return.self_isfile_path_info_or": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS_RemoteGS.exists.return.self_isfile_path_info_or", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 181, "span_ids": ["RemoteGS.list_cache_paths", "RemoteGS._list_paths", "RemoteGS.makedirs", "RemoteGS.walk_files", "RemoteGS.copy", "RemoteGS.isdir", "RemoteGS.remove", "RemoteGS.isfile", "RemoteGS.__init__", "RemoteGS.gs", "RemoteGS.get_file_checksum", "RemoteGS", "RemoteGS.exists"], "tokens": 788}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGS(RemoteBASE):\n scheme = Schemes.GS\n path_cls = CloudURLInfo\n REQUIRES = {\"google-cloud-storage\": \"google.cloud.storage\"}\n PARAM_CHECKSUM = \"md5\"\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n\n url = config.get(\"url\", \"gs:///\")\n self.path_info = self.path_cls(url)\n\n self.projectname = config.get(\"projectname\", None)\n self.credentialpath = config.get(\"credentialpath\")\n\n @wrap_prop(threading.Lock())\n @cached_property\n def gs(self):\n from google.cloud.storage import Client\n\n return (\n Client.from_service_account_json(self.credentialpath)\n if self.credentialpath\n else Client(self.projectname)\n )\n\n def get_file_checksum(self, path_info):\n import base64\n import codecs\n\n bucket = path_info.bucket\n path = path_info.path\n blob = self.gs.bucket(bucket).get_blob(path)\n if not blob:\n return None\n\n b64_md5 = blob.md5_hash\n md5 = base64.b64decode(b64_md5)\n return codecs.getencoder(\"hex\")(md5)[0].decode(\"utf-8\")\n\n def copy(self, from_info, to_info):\n from_bucket = self.gs.bucket(from_info.bucket)\n blob = from_bucket.get_blob(from_info.path)\n if not blob:\n msg = \"'{}' doesn't exist in the cloud\".format(from_info.path)\n raise DvcException(msg)\n\n to_bucket = self.gs.bucket(to_info.bucket)\n from_bucket.copy_blob(blob, to_bucket, new_name=to_info.path)\n\n def remove(self, path_info):\n if path_info.scheme != \"gs\":\n raise NotImplementedError\n\n logger.debug(\"Removing gs://{}\".format(path_info))\n blob = self.gs.bucket(path_info.bucket).get_blob(path_info.path)\n if not blob:\n return\n\n blob.delete()\n\n def _list_paths(\n self, path_info, max_items=None, prefix=None, progress_callback=None\n ):\n if prefix:\n prefix = posixpath.join(path_info.path, prefix[:2], prefix[2:])\n else:\n prefix = path_info.path\n for blob in self.gs.bucket(path_info.bucket).list_blobs(\n prefix=path_info.path, max_results=max_items\n ):\n if progress_callback:\n progress_callback()\n yield blob.name\n\n def list_cache_paths(self, prefix=None, progress_callback=None):\n return self._list_paths(\n self.path_info, prefix=prefix, progress_callback=progress_callback\n )\n\n def walk_files(self, path_info):\n for fname in self._list_paths(path_info / \"\"):\n # skip nested empty directories\n if fname.endswith(\"/\"):\n continue\n yield path_info.replace(fname)\n\n def makedirs(self, path_info):\n if not path_info.path:\n return\n\n self.gs.bucket(path_info.bucket).blob(\n (path_info / \"\").path\n ).upload_from_string(\"\")\n\n def isdir(self, path_info):\n dir_path = path_info / \"\"\n return bool(list(self._list_paths(dir_path, max_items=1)))\n\n def isfile(self, path_info):\n if path_info.path.endswith(\"/\"):\n return False\n\n blob = self.gs.bucket(path_info.bucket).blob(path_info.path)\n return blob.exists()\n\n def exists(self, path_info):\n \"\"\"Check if the blob exists. If it does not exist,\n it could be a part of a directory path.\n\n eg: if `data/file.txt` exists, check for `data` should return True\n \"\"\"\n return self.isfile(path_info) or self.isdir(path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS._upload_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS._upload_", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 214, "span_ids": ["RemoteGS._download", "RemoteGS._upload", "RemoteGS._generate_download_url"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteGS(RemoteBASE):\n\n def _upload(self, from_file, to_info, name=None, no_progress_bar=False):\n bucket = self.gs.bucket(to_info.bucket)\n _upload_to_bucket(\n bucket,\n from_file,\n to_info,\n name=name,\n no_progress_bar=no_progress_bar,\n )\n\n def _download(self, from_info, to_file, name=None, no_progress_bar=False):\n bucket = self.gs.bucket(from_info.bucket)\n blob = bucket.get_blob(from_info.path)\n with io.open(to_file, mode=\"wb\") as fobj:\n with Tqdm.wrapattr(\n fobj,\n \"write\",\n desc=name or from_info.path,\n total=blob.size,\n disable=no_progress_bar,\n ) as wrapped:\n blob.download_to_file(wrapped)\n\n def _generate_download_url(self, path_info, expires=3600):\n expiration = timedelta(seconds=int(expires))\n\n bucket = self.gs.bucket(path_info.bucket)\n blob = bucket.get_blob(path_info.path)\n if blob is None:\n raise FileNotFoundError\n return blob.generate_signed_url(expiration=expiration)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._download_RemoteHTTP._download.with_open_to_file_wb_.with_Tqdm_wrapattr_.for_chunk_in_response_ite.fd_wrapped_write_chunk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._download_RemoteHTTP._download.with_open_to_file_wb_.with_Tqdm_wrapattr_.for_chunk_in_response_ite.fd_wrapped_write_chunk_", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 70, "span_ids": ["RemoteHTTP._download"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHTTP(RemoteBASE):\n\n def _download(self, from_info, to_file, name=None, no_progress_bar=False):\n response = self._request(\"GET\", from_info.url, stream=True)\n if response.status_code != 200:\n raise HTTPError(response.status_code, response.reason)\n with open(to_file, \"wb\") as fd:\n with Tqdm.wrapattr(\n fd,\n \"write\",\n total=None\n if no_progress_bar\n else self._content_length(response),\n leave=False,\n desc=from_info.url if name is None else name,\n disable=no_progress_bar,\n ) as fd_wrapped:\n for chunk in response.iter_content(chunk_size=self.CHUNK_SIZE):\n fd_wrapped.write(chunk)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._upload_RemoteHTTP._upload.if_response_status_code_n.raise_HTTPError_response_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._upload_RemoteHTTP._upload.if_response_status_code_n.raise_HTTPError_response_", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 93, "span_ids": ["RemoteHTTP._upload"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHTTP(RemoteBASE):\n\n def _upload(self, from_file, to_info, name=None, no_progress_bar=False):\n def chunks():\n with open(from_file, \"rb\") as fd:\n with Tqdm.wrapattr(\n fd,\n \"read\",\n total=None\n if no_progress_bar\n else os.path.getsize(from_file),\n leave=False,\n desc=to_info.url if name is None else name,\n disable=no_progress_bar,\n ) as fd_wrapped:\n while True:\n chunk = fd_wrapped.read(self.CHUNK_SIZE)\n if not chunk:\n break\n yield chunk\n\n response = self._request(\"POST\", to_info.url, data=chunks())\n if response.status_code not in (200, 201):\n raise HTTPError(response.status_code, response.reason)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_dir_RemoteLOCAL.protect.try_.except_OSError_as_exc_.if_actual_mode_.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_dir_RemoteLOCAL.protect.try_.except_OSError_as_exc_.if_actual_mode_.raise", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 435, "end_line": 471, "span_ids": ["RemoteLOCAL.unprotect", "RemoteLOCAL.protect", "RemoteLOCAL._unprotect_dir"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _unprotect_dir(self, path):\n assert is_working_tree(self.repo.tree)\n\n for fname in self.repo.tree.walk_files(path):\n self._unprotect_file(fname)\n\n def unprotect(self, path_info):\n path = path_info.fspath\n if not os.path.exists(path):\n raise DvcException(\n \"can't unprotect non-existing data '{}'\".format(path)\n )\n\n if os.path.isdir(path):\n self._unprotect_dir(path)\n else:\n self._unprotect_file(path)\n\n def protect(self, path_info):\n path = fspath_py35(path_info)\n mode = self.CACHE_MODE\n\n try:\n os.chmod(path, mode)\n except OSError as exc:\n # There is nothing we need to do in case of a read-only file system\n if exc.errno == errno.EROFS:\n return\n\n # In shared cache scenario, we might not own the cache file, so we\n # need to check if cache file is already protected.\n if exc.errno not in [errno.EPERM, errno.EACCES]:\n raise\n\n actual = stat.S_IMODE(os.stat(path).st_mode)\n if actual != mode:\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._get_unpacked_dir_path_info_RemoteLOCAL._update_unpacked_dir.try_.except_DvcException_.self_remove_unpacked_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._get_unpacked_dir_path_info_RemoteLOCAL._update_unpacked_dir.try_.except_DvcException_.self_remove_unpacked_dir_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 473, "end_line": 500, "span_ids": ["RemoteLOCAL._remove_unpacked_dir", "RemoteLOCAL._path_info_changed", "RemoteLOCAL._get_unpacked_dir_path_info", "RemoteLOCAL._update_unpacked_dir"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _get_unpacked_dir_path_info(self, checksum):\n info = self.checksum_to_path_info(checksum)\n return info.with_name(info.name + self.UNPACKED_DIR_SUFFIX)\n\n def _remove_unpacked_dir(self, checksum):\n path_info = self._get_unpacked_dir_path_info(checksum)\n self.remove(path_info)\n\n def _path_info_changed(self, path_info):\n if self.exists(path_info) and self.state.get(path_info):\n return False\n return True\n\n def _update_unpacked_dir(self, checksum):\n unpacked_dir_info = self._get_unpacked_dir_path_info(checksum)\n\n if not self._path_info_changed(unpacked_dir_info):\n return\n\n self.remove(unpacked_dir_info)\n\n try:\n dir_info = self.get_dir_cache(checksum)\n self._create_unpacked_dir(checksum, dir_info, unpacked_dir_info)\n except DvcException:\n logger.warning(\"Could not create '{}'\".format(unpacked_dir_info))\n\n self.remove(unpacked_dir_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.copy_RemoteS3._list_objects.for_page_in_paginator_pag.if_progress_callback_.else_.yield_from_contents": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.copy_RemoteS3._list_objects.for_page_in_paginator_pag.if_progress_callback_.else_.yield_from_contents", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 184, "end_line": 213, "span_ids": ["RemoteS3.remove", "RemoteS3.copy", "RemoteS3._list_objects"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n def copy(self, from_info, to_info):\n self._copy(self.s3, from_info, to_info, self.extra_args)\n\n def remove(self, path_info):\n if path_info.scheme != \"s3\":\n raise NotImplementedError\n\n logger.debug(\"Removing {}\".format(path_info))\n self.s3.delete_object(Bucket=path_info.bucket, Key=path_info.path)\n\n def _list_objects(\n self, path_info, max_items=None, prefix=None, progress_callback=None\n ):\n \"\"\" Read config for list object api, paginate through list objects.\"\"\"\n kwargs = {\n \"Bucket\": path_info.bucket,\n \"Prefix\": path_info.path,\n \"PaginationConfig\": {\"MaxItems\": max_items},\n }\n if prefix:\n kwargs[\"Prefix\"] = posixpath.join(path_info.path, prefix[:2])\n paginator = self.s3.get_paginator(self.list_objects_api)\n for page in paginator.paginate(**kwargs):\n contents = page.get(\"Contents\", ())\n if progress_callback:\n for item in contents:\n progress_callback()\n yield item\n else:\n yield from contents", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH_RemoteSSH.exists.with_self_ssh_path_info_.return.ssh_exists_path_info_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH_RemoteSSH.exists.with_self_ssh_path_info_.return.ssh_exists_path_info_path", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 153, "span_ids": ["RemoteSSH._try_get_ssh_config_port", "RemoteSSH.__init__", "RemoteSSH.ssh", "RemoteSSH._try_get_ssh_config_keyfile", "RemoteSSH", "RemoteSSH.ssh_config_filename", "RemoteSSH._load_user_ssh_config", "RemoteSSH.ensure_credentials", "RemoteSSH.exists"], "tokens": 835}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteSSH(RemoteBASE):\n scheme = Schemes.SSH\n REQUIRES = {\"paramiko\": \"paramiko\"}\n\n JOBS = 4\n PARAM_CHECKSUM = \"md5\"\n DEFAULT_PORT = 22\n TIMEOUT = 1800\n # At any given time some of the connections will go over network and\n # paramiko stuff, so we would ideally have it double of server processors.\n # We use conservative setting of 4 instead to not exhaust max sessions.\n CHECKSUM_JOBS = 4\n TRAVERSE_PREFIX_LEN = 2\n\n DEFAULT_CACHE_TYPES = [\"copy\"]\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n url = config.get(\"url\")\n if url:\n parsed = urlparse(url)\n user_ssh_config = self._load_user_ssh_config(parsed.hostname)\n\n host = user_ssh_config.get(\"hostname\", parsed.hostname)\n user = (\n config.get(\"user\")\n or parsed.username\n or user_ssh_config.get(\"user\")\n or getpass.getuser()\n )\n port = (\n config.get(\"port\")\n or parsed.port\n or self._try_get_ssh_config_port(user_ssh_config)\n or self.DEFAULT_PORT\n )\n self.path_info = self.path_cls.from_parts(\n scheme=self.scheme,\n host=host,\n user=user,\n port=port,\n path=parsed.path,\n )\n else:\n self.path_info = None\n user_ssh_config = {}\n\n self.keyfile = config.get(\n \"keyfile\"\n ) or self._try_get_ssh_config_keyfile(user_ssh_config)\n self.timeout = config.get(\"timeout\", self.TIMEOUT)\n self.password = config.get(\"password\", None)\n self.ask_password = config.get(\"ask_password\", False)\n self.gss_auth = config.get(\"gss_auth\", False)\n proxy_command = user_ssh_config.get(\"proxycommand\", False)\n if proxy_command:\n import paramiko\n\n self.sock = paramiko.ProxyCommand(proxy_command)\n else:\n self.sock = None\n\n @staticmethod\n def ssh_config_filename():\n return os.path.expanduser(os.path.join(\"~\", \".ssh\", \"config\"))\n\n @staticmethod\n def _load_user_ssh_config(hostname):\n import paramiko\n\n user_config_file = RemoteSSH.ssh_config_filename()\n user_ssh_config = {}\n if hostname and os.path.exists(user_config_file):\n ssh_config = paramiko.SSHConfig()\n with open(user_config_file) as f:\n # For whatever reason parsing directly from f is unreliable\n f_copy = io.StringIO(f.read())\n ssh_config.parse(f_copy)\n user_ssh_config = ssh_config.lookup(hostname)\n return user_ssh_config\n\n @staticmethod\n def _try_get_ssh_config_port(user_ssh_config):\n return silent(int)(user_ssh_config.get(\"port\"))\n\n @staticmethod\n def _try_get_ssh_config_keyfile(user_ssh_config):\n return first(user_ssh_config.get(\"identityfile\") or ())\n\n def ensure_credentials(self, path_info=None):\n if path_info is None:\n path_info = self.path_info\n\n # NOTE: we use the same password regardless of the server :(\n if self.ask_password and self.password is None:\n host, user, port = path_info.host, path_info.user, path_info.port\n self.password = ask_password(host, user, port)\n\n def ssh(self, path_info):\n self.ensure_credentials(path_info)\n\n from .connection import SSHConnection\n\n return get_connection(\n SSHConnection,\n path_info.host,\n username=path_info.user,\n port=path_info.port,\n key_filename=self.keyfile,\n timeout=self.timeout,\n password=self.password,\n gss_auth=self.gss_auth,\n sock=self.sock,\n )\n\n def exists(self, path_info):\n with self.ssh(path_info) as ssh:\n return ssh.exists(path_info.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.get_file_checksum_RemoteSSH.symlink.with_self_ssh_from_info_.ssh_symlink_from_info_pat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.get_file_checksum_RemoteSSH.symlink.with_self_ssh_from_info_.ssh_symlink_from_info_pat", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 186, "span_ids": ["RemoteSSH.get_file_checksum", "RemoteSSH.copy", "RemoteSSH.getsize", "RemoteSSH.isfile", "RemoteSSH.isdir", "RemoteSSH.symlink"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteSSH(RemoteBASE):\n\n def get_file_checksum(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n with self.ssh(path_info) as ssh:\n return ssh.md5(path_info.path)\n\n def isdir(self, path_info):\n with self.ssh(path_info) as ssh:\n return ssh.isdir(path_info.path)\n\n def isfile(self, path_info):\n with self.ssh(path_info) as ssh:\n return ssh.isfile(path_info.path)\n\n def getsize(self, path_info):\n with self.ssh(path_info) as ssh:\n return ssh.getsize(path_info.path)\n\n def copy(self, from_info, to_info):\n if not from_info.scheme == to_info.scheme == self.scheme:\n raise NotImplementedError\n\n with self.ssh(from_info) as ssh:\n ssh.atomic_copy(from_info.path, to_info.path)\n\n def symlink(self, from_info, to_info):\n if not from_info.scheme == to_info.scheme == self.scheme:\n raise NotImplementedError\n\n with self.ssh(from_info) as ssh:\n ssh.symlink(from_info.path, to_info.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteS3_setup_gdrive_cloud.remote__gdrive_create_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteS3_setup_gdrive_cloud.remote__gdrive_create_dir", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 203, "span_ids": ["TestRemoteS3", "setup_gdrive_cloud", "TestRemoteS3._get_cloud_class"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteS3(S3, TestDataCloudBase):\n def _get_cloud_class(self):\n return RemoteS3\n\n\ndef setup_gdrive_cloud(remote_url, dvc):\n config = copy.deepcopy(TEST_CONFIG)\n config[\"remote\"][TEST_REMOTE] = {\n \"url\": remote_url,\n \"gdrive_service_account_email\": \"test\",\n \"gdrive_service_account_p12_file_path\": \"test.p12\",\n \"gdrive_use_service_account\": True,\n }\n\n dvc.config = config\n remote = DataCloud(dvc).get_remote()\n remote._gdrive_create_dir(\"root\", remote.path_info.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_diff_no_cache_test_diff_no_cache.assert_first_diff_modifi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_diff_no_cache_test_diff_no_cache.assert_first_diff_modifi", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 161, "end_line": 178, "span_ids": ["test_diff_no_cache"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_diff_no_cache(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen({\"dir\": {\"file\": \"file content\"}}, commit=\"first\")\n scm.tag(\"v1\")\n\n tmp_dir.dvc_gen(\n {\"dir\": {\"file\": \"modified file content\"}}, commit=\"second\"\n )\n scm.tag(\"v2\")\n\n remove(dvc.cache.local.cache_dir)\n\n # invalidate_dir_info to force cache loading\n dvc.cache.local._dir_info = {}\n\n diff = dvc.diff(\"v1\", \"v2\")\n assert diff[\"added\"] == []\n assert diff[\"deleted\"] == []\n assert first(diff[\"modified\"])[\"path\"] == os.path.join(\"dir\", \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_diff_dirty_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_test_diff_dirty_", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 181, "end_line": 210, "span_ids": ["test_diff_dirty"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_diff_dirty(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen(\n {\"file\": \"file_content\", \"dir\": {\"dir_file1\": \"dir file content\"}},\n commit=\"initial\",\n )\n\n (tmp_dir / \"file\").unlink()\n tmp_dir.gen({\"dir\": {\"dir_file2\": \"dir file 2 content\"}})\n tmp_dir.dvc_gen(\"new_file\", \"new_file_content\")\n\n result = dvc.diff()\n\n assert result == {\n \"added\": [\n {\"hash\": \"86d049de17c76ac44cdcac146042ec9b\", \"path\": \"new_file\"}\n ],\n \"deleted\": [\n {\"hash\": \"7f0b6bb0b7e951b7fd2b2a4a326297e1\", \"path\": \"file\"}\n ],\n \"modified\": [\n {\n \"hash\": {\n \"new\": \"38175ad60f0e58ac94e0e2b7688afd81.dir\",\n \"old\": \"92daf39af116ca2fb245acaeb2ae65f7.dir\",\n },\n \"path\": os.path.join(\"dir\", \"\"),\n }\n ],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py_test_link_created_on_non_nested_path_test_makedirs_doesnot_try_on_top_level_paths.remote_makedirs_base_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py_test_link_created_on_non_nested_path_test_makedirs_doesnot_try_on_top_level_paths.remote_makedirs_base_info", "embedding": null, "metadata": {"file_path": "tests/func/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 49, "end_line": 70, "span_ids": ["test_link_created_on_non_nested_path", "test_makedirs_doesnot_try_on_top_level_paths"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mock_s3\n@pytest.mark.parametrize(\n \"base_info\",\n [RemoteS3.path_cls(\"s3://bucket/\"), RemoteS3.path_cls(\"s3://bucket/ns/\")],\n)\ndef test_link_created_on_non_nested_path(base_info, tmp_dir, dvc, scm):\n remote = RemoteS3(dvc, {\"url\": str(base_info.parent)})\n remote.s3.create_bucket(Bucket=base_info.bucket)\n remote.s3.put_object(\n Bucket=base_info.bucket, Key=(base_info / \"from\").path, Body=\"data\"\n )\n remote.link(base_info / \"from\", base_info / \"to\")\n\n assert remote.exists(base_info / \"from\")\n assert remote.exists(base_info / \"to\")\n\n\n@mock_s3\ndef test_makedirs_doesnot_try_on_top_level_paths(tmp_dir, dvc, scm):\n base_info = RemoteS3.path_cls(\"s3://bucket/\")\n remote = RemoteS3(dvc, {\"url\": str(base_info)})\n remote.makedirs(base_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_cache_exists_test_cache_exists.None_2.traverse_assert_called_wi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_cache_exists_test_cache_exists.None_2.traverse_assert_called_wi", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_base.py", "file_name": "test_base.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 97, "span_ids": ["test_cache_exists"], "tokens": 408}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mock.patch.object(RemoteBASE, \"_cache_checksums_traverse\")\n@mock.patch.object(RemoteBASE, \"_cache_object_exists\")\ndef test_cache_exists(object_exists, traverse, dvc):\n remote = RemoteBASE(dvc, {})\n\n # remote does not support traverse\n remote.CAN_TRAVERSE = False\n with mock.patch.object(\n remote, \"cache_checksums\", return_value=list(range(256))\n ):\n checksums = set(range(1000))\n remote.cache_exists(checksums)\n object_exists.assert_called_with(checksums, None, None)\n traverse.assert_not_called()\n\n remote.CAN_TRAVERSE = True\n\n # large remote, small local\n object_exists.reset_mock()\n traverse.reset_mock()\n with mock.patch.object(\n remote, \"cache_checksums\", return_value=list(range(256))\n ):\n checksums = list(range(1000))\n remote.cache_exists(checksums)\n # verify that _cache_paths_with_max() short circuits\n # before returning all 256 remote checksums\n max_checksums = math.ceil(\n remote._max_estimation_size(checksums)\n / pow(16, remote.TRAVERSE_PREFIX_LEN)\n )\n assert max_checksums < 256\n object_exists.assert_called_with(\n frozenset(range(max_checksums, 1000)), None, None\n )\n traverse.assert_not_called()\n\n # large remote, large local\n object_exists.reset_mock()\n traverse.reset_mock()\n remote.JOBS = 16\n with mock.patch.object(\n remote, \"cache_checksums\", return_value=list(range(256))\n ):\n checksums = list(range(1000000))\n remote.cache_exists(checksums)\n object_exists.assert_not_called()\n traverse.assert_called_with(\n 256 * pow(16, remote.TRAVERSE_PREFIX_LEN),\n set(range(256)),\n None,\n None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_cache_checksums_traverse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_cache_checksums_traverse_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_base.py", "file_name": "test_base.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 140, "span_ids": ["test_cache_checksums_traverse", "test_cache_checksums"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mock.patch.object(\n RemoteBASE, \"cache_checksums\", return_value=[],\n)\n@mock.patch.object(\n RemoteBASE, \"path_to_checksum\", side_effect=lambda x: x,\n)\ndef test_cache_checksums_traverse(path_to_checksum, cache_checksums, dvc):\n remote = RemoteBASE(dvc, {})\n remote.path_info = PathInfo(\"foo\")\n\n # parallel traverse\n size = 256 / remote.JOBS * remote.LIST_OBJECT_PAGE_SIZE\n list(remote._cache_checksums_traverse(size, {0}))\n for i in range(1, 16):\n cache_checksums.assert_any_call(\n prefix=\"{:03x}\".format(i), progress_callback=CallableOrNone\n )\n for i in range(1, 256):\n cache_checksums.assert_any_call(\n prefix=\"{:02x}\".format(i), progress_callback=CallableOrNone\n )\n\n # default traverse (small remote)\n size -= 1\n cache_checksums.reset_mock()\n list(remote._cache_checksums_traverse(size - 1, {0}))\n cache_checksums.assert_called_with(\n prefix=None, progress_callback=CallableOrNone\n )\n\n\ndef test_cache_checksums(dvc):\n remote = RemoteBASE(dvc, {})\n remote.path_info = PathInfo(\"foo\")\n\n with mock.patch.object(\n remote, \"list_cache_paths\", return_value=[\"12/3456\", \"bar\"]\n ):\n checksums = list(remote.cache_checksums())\n assert checksums == [\"123456\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_test_protect_ignore_errors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_test_protect_ignore_errors_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 89, "span_ids": ["test_protect_ignore_erofs", "test_protect_ignore_errors"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"err\", [errno.EPERM, errno.EACCES])\ndef test_protect_ignore_errors(tmp_dir, mocker, err):\n tmp_dir.gen(\"foo\", \"foo\")\n foo = PathInfo(\"foo\")\n remote = RemoteLOCAL(None, {})\n\n remote.protect(foo)\n\n mock_chmod = mocker.patch(\n \"os.chmod\", side_effect=OSError(err, \"something\")\n )\n remote.protect(foo)\n assert mock_chmod.called\n\n\ndef test_protect_ignore_erofs(tmp_dir, mocker):\n tmp_dir.gen(\"foo\", \"foo\")\n foo = PathInfo(\"foo\")\n remote = RemoteLOCAL(None, {})\n\n mock_chmod = mocker.patch(\n \"os.chmod\", side_effect=OSError(errno.EROFS, \"read-only fs\")\n )\n remote.protect(foo)\n assert mock_chmod.called", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote.py_pytest_test_remote_without_checksum_jobs_default.assert_remote_checksum_jo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote.py_pytest_test_remote_without_checksum_jobs_default.assert_remote_checksum_jo", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["imports", "test_remote_with_checksum_jobs", "test_remote_without_checksum_jobs", "test_remote_without_checksum_jobs_default"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.remote import Remote, RemoteS3, RemoteGS\n\n\ndef test_remote_with_checksum_jobs(dvc):\n dvc.config[\"remote\"][\"with_checksum_jobs\"] = {\n \"url\": \"s3://bucket/name\",\n \"checksum_jobs\": 100,\n }\n dvc.config[\"core\"][\"checksum_jobs\"] = 200\n\n remote = Remote(dvc, name=\"with_checksum_jobs\")\n assert remote.checksum_jobs == 100\n\n\ndef test_remote_without_checksum_jobs(dvc):\n dvc.config[\"remote\"][\"without_checksum_jobs\"] = {\"url\": \"s3://bucket/name\"}\n dvc.config[\"core\"][\"checksum_jobs\"] = 200\n\n remote = Remote(dvc, name=\"without_checksum_jobs\")\n assert remote.checksum_jobs == 200\n\n\ndef test_remote_without_checksum_jobs_default(dvc):\n dvc.config[\"remote\"][\"without_checksum_jobs\"] = {\"url\": \"s3://bucket/name\"}\n\n remote = Remote(dvc, name=\"without_checksum_jobs\")\n assert remote.checksum_jobs == remote.CHECKSUM_JOBS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote.py_test_makedirs_not_create_for_top_level_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote.py_test_makedirs_not_create_for_top_level_path_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 42, "span_ids": ["test_makedirs_not_create_for_top_level_path"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"remote_cls\", [RemoteGS, RemoteS3])\ndef test_makedirs_not_create_for_top_level_path(remote_cls, dvc, mocker):\n url = \"{.scheme}://bucket/\".format(remote_cls)\n remote = remote_cls(dvc, {\"url\": url})\n mocked_client = mocker.PropertyMock()\n # we use remote clients with same name as scheme to interact with remote\n mocker.patch.object(remote_cls, remote.scheme, mocked_client)\n\n remote.makedirs(remote.path_info)\n assert not mocked_client.called", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py__", "embedding": null, "metadata": {"file_path": "dvc/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 11, "span_ids": ["docstring"], "tokens": 42}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nDVC\n----\nMake your data science projects reproducible and shareable.\n\"\"\"\nimport dvc.logger\nfrom dvc.version import __version__ # noqa: F401\n\n\ndvc.logger.setup()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_is_enabled_send.os_remove_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_is_enabled_send.os_remove_path_", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 86, "span_ids": ["send", "is_enabled"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_enabled():\n if env2bool(\"DVC_TEST\"):\n return False\n\n enabled = to_bool(\n Config(validate=False).get(\"core\", {}).get(\"analytics\", \"true\")\n )\n logger.debug(\"Analytics is {}abled.\".format(\"en\" if enabled else \"dis\"))\n\n return enabled\n\n\ndef send(path):\n \"\"\"\n Side effect: Removes the report after sending it.\n\n The report is generated and stored in a temporary file, see:\n `collect_and_send_report`. Sending happens on another process,\n thus, the need of removing such file afterwards.\n \"\"\"\n url = \"https://analytics.dvc.org\"\n headers = {\"content-type\": \"application/json\"}\n\n with open(path, \"r\") as fobj:\n report = json.load(fobj)\n\n report.update(_runtime_info())\n\n try:\n requests.post(url, json=report, headers=headers, timeout=5)\n except requests.exceptions.RequestException:\n logger.debug(\"failed to send analytics report\", exc_info=True)\n\n os.remove(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsShow_CmdMetricsShow.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsShow_CmdMetricsShow.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 67, "span_ids": ["CmdMetricsShow", "CmdMetricsShow.run"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdMetricsShow(CmdBase):\n def run(self):\n try:\n metrics = self.repo.metrics.show(\n self.args.targets,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n all_commits=self.args.all_commits,\n recursive=self.args.recursive,\n )\n\n if self.args.show_json:\n import json\n\n logger.info(json.dumps(metrics))\n else:\n show_metrics(\n metrics,\n self.args.all_branches,\n self.args.all_tags,\n self.args.all_commits,\n )\n except DvcException:\n logger.exception(\"failed to show metrics\")\n return 1\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_argparse_CmdParamsDiff.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_argparse_CmdParamsDiff.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/params.py", "file_name": "params.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["imports", "CmdParamsDiff.run", "CmdParamsDiff", "_show_diff"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom collections import OrderedDict\n\nfrom dvc.command.base import append_doc_link\nfrom dvc.command.base import CmdBase\nfrom dvc.command.base import fix_subparsers\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _show_diff(diff):\n from dvc.utils.diff import table\n\n rows = []\n for fname, pdiff in diff.items():\n sorted_pdiff = OrderedDict(sorted(pdiff.items()))\n for param, change in sorted_pdiff.items():\n rows.append([fname, param, change[\"old\"], change[\"new\"]])\n\n return table([\"Path\", \"Param\", \"Old\", \"New\"], rows)\n\n\nclass CmdParamsDiff(CmdBase):\n def run(self):\n try:\n diff = self.repo.params.diff(\n a_rev=self.args.a_rev,\n b_rev=self.args.b_rev,\n all=self.args.all,\n )\n\n if self.args.show_json:\n import json\n\n logger.info(json.dumps(diff))\n else:\n table = _show_diff(diff)\n if table:\n logger.info(table)\n\n except DvcException:\n logger.exception(\"failed to show params diff\")\n return 1\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/params.py", "file_name": "params.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 102, "span_ids": ["add_parser"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n PARAMS_HELP = \"Commands to display params.\"\n\n params_parser = subparsers.add_parser(\n \"params\",\n parents=[parent_parser],\n description=append_doc_link(PARAMS_HELP, \"params\"),\n help=PARAMS_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n\n params_subparsers = params_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use `dvc params CMD --help` to display command-specific help.\",\n )\n\n fix_subparsers(params_subparsers)\n\n PARAMS_DIFF_HELP = (\n \"Show changes in params between commits in the DVC repository, or \"\n \"between a commit and the workspace.\"\n )\n params_diff_parser = params_subparsers.add_parser(\n \"diff\",\n parents=[parent_parser],\n description=append_doc_link(PARAMS_DIFF_HELP, \"params/diff\"),\n help=PARAMS_DIFF_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n params_diff_parser.add_argument(\n \"a_rev\", nargs=\"?\", help=\"Old Git commit to compare (defaults to HEAD)\"\n )\n params_diff_parser.add_argument(\n \"b_rev\",\n nargs=\"?\",\n help=(\"New Git commit to compare (defaults to the current workspace)\"),\n )\n params_diff_parser.add_argument(\n \"--all\",\n action=\"store_true\",\n default=False,\n help=\"Show unchanged params as well.\",\n )\n params_diff_parser.add_argument(\n \"--show-json\",\n action=\"store_true\",\n default=False,\n help=\"Show output in JSON format.\",\n )\n params_diff_parser.set_defaults(func=CmdParamsDiff)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/param.py_os_DependencyPARAMS.dumpd.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/param.py_os_DependencyPARAMS.dumpd.return._", "embedding": null, "metadata": {"file_path": "dvc/dependency/param.py", "file_name": "param.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 75, "span_ids": ["DependencyPARAMS", "DependencyPARAMS.dumpd", "BadParamFileError", "DependencyPARAMS.save", "imports", "MissingParamsError", "DependencyPARAMS.status", "DependencyPARAMS.__init__"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport yaml\nfrom collections import defaultdict\n\nimport dpath.util\nfrom voluptuous import Any\n\nfrom dvc.compat import fspath_py35\nfrom dvc.dependency.local import DependencyLOCAL\nfrom dvc.exceptions import DvcException\n\n\nclass MissingParamsError(DvcException):\n pass\n\n\nclass BadParamFileError(DvcException):\n pass\n\n\nclass DependencyPARAMS(DependencyLOCAL):\n PARAM_PARAMS = \"params\"\n PARAM_SCHEMA = {PARAM_PARAMS: Any(dict, list, None)}\n DEFAULT_PARAMS_FILE = \"params.yaml\"\n\n def __init__(self, stage, path, params):\n info = {}\n self.params = []\n if params:\n if isinstance(params, list):\n self.params = params\n else:\n assert isinstance(params, dict)\n self.params = list(params.keys())\n info = params\n\n super().__init__(\n stage,\n path\n or os.path.join(stage.repo.root_dir, self.DEFAULT_PARAMS_FILE),\n info=info,\n )\n\n def save(self):\n super().save()\n self.info = self.save_info()\n\n def status(self):\n status = super().status()\n\n if status[str(self)] == \"deleted\":\n return status\n\n status = defaultdict(dict)\n info = self.read_params()\n for param in self.params:\n if param not in info.keys():\n st = \"deleted\"\n elif param not in self.info:\n st = \"new\"\n elif info[param] != self.info[param]:\n st = \"modified\"\n else:\n assert info[param] == self.info[param]\n continue\n\n status[str(self)][param] = st\n\n return status\n\n def dumpd(self):\n return {\n self.PARAM_PATH: self.def_path,\n self.PARAM_PARAMS: self.info or self.params,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/param.py_DependencyPARAMS.read_params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/param.py_DependencyPARAMS.read_params_", "embedding": null, "metadata": {"file_path": "dvc/dependency/param.py", "file_name": "param.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 109, "span_ids": ["DependencyPARAMS.save_info", "DependencyPARAMS.read_params"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyPARAMS(DependencyLOCAL):\n\n def read_params(self):\n if not self.exists:\n return {}\n\n with self.repo.tree.open(fspath_py35(self.path_info), \"r\") as fobj:\n try:\n config = yaml.safe_load(fobj)\n except yaml.YAMLError as exc:\n raise BadParamFileError(\n \"Unable to read parameters from '{}'\".format(self)\n ) from exc\n\n ret = {}\n for param in self.params:\n try:\n ret[param] = dpath.util.get(config, param, separator=\".\")\n except KeyError:\n pass\n return ret\n\n def save_info(self):\n info = self.read_params()\n\n missing_params = set(self.params) - set(info.keys())\n if missing_params:\n raise MissingParamsError(\n \"Parameters '{}' are missing from '{}'.\".format(\n \", \".join(missing_params), self,\n )\n )\n\n return info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_from_collections_import_d__extract.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_from_collections_import_d__extract.return._", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["_extract", "GDrivePathNotFound", "imports", "GDrivePathNotFound.__init__", "GDriveMissedCredentialKeyError.__init__", "GDriveAccessTokenRefreshError.__init__", "GDriveMissedCredentialKeyError", "GDriveAccessTokenRefreshError"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import defaultdict\nimport os\nimport posixpath\nimport logging\nimport re\nimport threading\nfrom urllib.parse import urlparse\n\nfrom funcy import retry, wrap_with, wrap_prop, cached_property\nfrom funcy.py3 import cat\n\nfrom dvc.progress import Tqdm\nfrom dvc.scheme import Schemes\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import tmp_fname, format_link\n\nlogger = logging.getLogger(__name__)\nFOLDER_MIME_TYPE = \"application/vnd.google-apps.folder\"\n\n\nclass GDrivePathNotFound(DvcException):\n def __init__(self, path_info):\n super().__init__(\"Google Drive path '{}' not found.\".format(path_info))\n\n\nclass GDriveAccessTokenRefreshError(DvcException):\n def __init__(self):\n super().__init__(\"Google Drive access token refreshment is failed.\")\n\n\nclass GDriveMissedCredentialKeyError(DvcException):\n def __init__(self, path):\n super().__init__(\n \"Google Drive user credentials file '{}' \"\n \"misses value for key.\".format(path)\n )\n\n\ndef _extract(exc, field):\n from pydrive2.files import ApiRequestError\n\n assert isinstance(exc, ApiRequestError)\n\n # https://cloud.google.com/storage/docs/json_api/v1/status-codes#errorformat\n return (\n exc.error[\"errors\"][0].get(field, \"\") if \"errors\" in exc.error else \"\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveURLInfo_GDriveURLInfo.__init__.self._spath.re_sub_2_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveURLInfo_GDriveURLInfo.__init__.self._spath.re_sub_2_self", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 94, "span_ids": ["GDriveURLInfo", "GDriveURLInfo.__init__"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GDriveURLInfo(CloudURLInfo):\n def __init__(self, url):\n super().__init__(url)\n\n # GDrive URL host part is case sensitive,\n # we are restoring it here.\n p = urlparse(url)\n self.host = p.netloc\n assert self.netloc == self.host\n\n # Normalize path. Important since we have a cache (path to ID)\n # and don't want to deal with different variations of path in it.\n self._spath = re.sub(\"/{2,}\", \"/\", self._spath.rstrip(\"/\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/__init__.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/params/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["Params.diff", "Params.__init__", "Params.show", "Params"], "tokens": 79}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Params(object):\n def __init__(self, repo):\n self.repo = repo\n\n def show(self, *args, **kwargs):\n from .show import show\n\n return show(self.repo, *args, **kwargs)\n\n def diff(self, *args, **kwargs):\n from .diff import diff\n\n return diff(self.repo, *args, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/show.py_show_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/show.py_show_", "embedding": null, "metadata": {"file_path": "dvc/repo/params/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 72, "span_ids": ["show"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@locked\ndef show(repo, revs=None):\n res = {}\n\n for branch in repo.brancher(revs=revs):\n configs = _collect_configs(repo)\n params = _read_params(repo, configs, branch)\n\n if params:\n res[branch] = params\n\n if not res:\n raise NoParamsError(\"no parameter configs files in this repository\")\n\n # Hide working tree params if they are the same as in the active branch\n try:\n active_branch = repo.scm.active_branch()\n except TypeError:\n pass # Detached head\n else:\n if res.get(\"working tree\") == res.get(active_branch):\n res.pop(\"working tree\", None)\n\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_no_params_test_diff.assert_dvc_params_diff_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_no_params_test_diff.assert_dvc_params_diff_a_", "embedding": null, "metadata": {"file_path": "tests/func/params/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["test_diff", "test_diff_no_changes", "test_diff_no_params"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_diff_no_params(tmp_dir, scm, dvc):\n assert dvc.params.diff() == {}\n\n\ndef test_diff_no_changes(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(params=[\"foo\"])\n scm.add([\"params.yaml\", \"Dvcfile\"])\n scm.commit(\"bar\")\n assert dvc.params.diff() == {}\n\n\ndef test_diff(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(params=[\"foo\"])\n scm.add([\"params.yaml\", \"Dvcfile\"])\n scm.commit(\"bar\")\n\n tmp_dir.scm_gen(\"params.yaml\", \"foo: baz\", commit=\"baz\")\n tmp_dir.scm_gen(\"params.yaml\", \"foo: qux\", commit=\"qux\")\n\n assert dvc.params.diff(a_rev=\"HEAD~2\") == {\n \"params.yaml\": {\"foo\": {\"old\": \"bar\", \"new\": \"qux\"}}\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_new_test_diff_deleted_config.assert_dvc_params_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_new_test_diff_deleted_config.assert_dvc_params_diff_", "embedding": null, "metadata": {"file_path": "tests/func/params/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 27, "end_line": 59, "span_ids": ["test_diff_new", "test_diff_deleted_config", "test_diff_deleted"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_diff_new(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(params=[\"foo\"])\n\n assert dvc.params.diff() == {\n \"params.yaml\": {\"foo\": {\"old\": None, \"new\": \"bar\"}}\n }\n\n\ndef test_diff_deleted(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(params=[\"foo\"])\n scm.add([\"params.yaml\", \"Dvcfile\"])\n scm.commit(\"bar\")\n\n (tmp_dir / \"params.yaml\").unlink()\n\n assert dvc.params.diff() == {\n \"params.yaml\": {\"foo\": {\"old\": \"bar\", \"new\": None}}\n }\n\n\ndef test_diff_deleted_config(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(params=[\"foo\"])\n scm.add([\"params.yaml\", \"Dvcfile\"])\n scm.commit(\"bar\")\n\n (tmp_dir / \"params.yaml\").unlink()\n\n assert dvc.params.diff() == {\n \"params.yaml\": {\"foo\": {\"old\": \"bar\", \"new\": None}}\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_list_test_diff_list.assert_dvc_params_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_list_test_diff_list.assert_dvc_params_diff_", "embedding": null, "metadata": {"file_path": "tests/func/params/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 62, "end_line": 74, "span_ids": ["test_diff_list"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_diff_list(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo:\\n- bar\\n- baz\")\n dvc.run(params=[\"foo\"])\n scm.add([\"params.yaml\", \"Dvcfile\"])\n scm.commit(\"foo\")\n\n tmp_dir.gen(\"params.yaml\", \"foo:\\n- bar\\n- baz\\n- qux\")\n\n assert dvc.params.diff() == {\n \"params.yaml\": {\n \"foo\": {\"old\": \"['bar', 'baz']\", \"new\": \"['bar', 'baz', 'qux']\"}\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_pytest_test_show_list.assert_dvc_params_show_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_pytest_test_show_list.assert_dvc_params_show_", "embedding": null, "metadata": {"file_path": "tests/func/params/test_show.py", "file_name": "test_show.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["test_show_empty", "imports", "test_show_list", "test_show", "test_show_multiple"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.repo.params.show import NoParamsError\n\n\ndef test_show_empty(dvc):\n with pytest.raises(NoParamsError):\n dvc.params.show()\n\n\ndef test_show(tmp_dir, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(params=[\"foo\"])\n assert dvc.params.show() == {\"\": {\"params.yaml\": {\"foo\": \"bar\"}}}\n\n\ndef test_show_multiple(tmp_dir, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\\nbaz: qux\\n\")\n dvc.run(fname=\"foo.dvc\", params=[\"foo\"])\n dvc.run(fname=\"baz.dvc\", params=[\"baz\"])\n assert dvc.params.show() == {\n \"\": {\"params.yaml\": {\"foo\": \"bar\", \"baz\": \"qux\"}}\n }\n\n\ndef test_show_list(tmp_dir, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo:\\n- bar\\n- baz\\n\")\n dvc.run(params=[\"foo\"])\n assert dvc.params.show() == {\"\": {\"params.yaml\": {\"foo\": [\"bar\", \"baz\"]}}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_test_show_branch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_test_show_branch_", "embedding": null, "metadata": {"file_path": "tests/func/params/test_show.py", "file_name": "test_show.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 45, "span_ids": ["test_show_branch"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_show_branch(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(params=[\"foo\"])\n scm.add([\"params.yaml\", \"Dvcfile\"])\n scm.commit(\"init\")\n\n with tmp_dir.branch(\"branch\", new=True):\n tmp_dir.scm_gen(\"params.yaml\", \"foo: baz\", commit=\"branch\")\n\n assert dvc.params.show(revs=[\"branch\"]) == {\n \"working tree\": {\"params.yaml\": {\"foo\": \"bar\"}},\n \"branch\": {\"params.yaml\": {\"foo\": \"baz\"}},\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_from_dvc_cli_import_parse_test_fetch.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_from_dvc_cli_import_parse_test_fetch.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_data_sync.py", "file_name": "test_data_sync.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["imports", "test_fetch"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.data_sync import CmdDataFetch, CmdDataPull, CmdDataPush\n\n\ndef test_fetch(mocker):\n cli_args = parse_args(\n [\n \"fetch\",\n \"target1\",\n \"target2\",\n \"--jobs\",\n \"2\",\n \"--remote\",\n \"remote\",\n \"--all-branches\",\n \"--all-tags\",\n \"--all-commits\",\n \"--with-deps\",\n \"--recursive\",\n ]\n )\n assert cli_args.func == CmdDataFetch\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"fetch\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n targets=[\"target1\", \"target2\"],\n jobs=2,\n remote=\"remote\",\n all_branches=True,\n all_tags=True,\n all_commits=True,\n with_deps=True,\n recursive=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_test_pull_test_pull.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_test_pull_test_pull.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_data_sync.py", "file_name": "test_data_sync.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 76, "span_ids": ["test_pull"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pull(mocker):\n cli_args = parse_args(\n [\n \"pull\",\n \"target1\",\n \"target2\",\n \"--jobs\",\n \"2\",\n \"--remote\",\n \"remote\",\n \"--all-branches\",\n \"--all-tags\",\n \"--all-commits\",\n \"--with-deps\",\n \"--force\",\n \"--recursive\",\n ]\n )\n assert cli_args.func == CmdDataPull\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"pull\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n targets=[\"target1\", \"target2\"],\n jobs=2,\n remote=\"remote\",\n all_branches=True,\n all_tags=True,\n all_commits=True,\n with_deps=True,\n force=True,\n recursive=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_test_push_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_data_sync.py_test_push_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_data_sync.py", "file_name": "test_data_sync.py", "file_type": "text/x-python", "category": "test", "start_line": 79, "end_line": 113, "span_ids": ["test_push"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_push(mocker):\n cli_args = parse_args(\n [\n \"push\",\n \"target1\",\n \"target2\",\n \"--jobs\",\n \"2\",\n \"--remote\",\n \"remote\",\n \"--all-branches\",\n \"--all-tags\",\n \"--all-commits\",\n \"--with-deps\",\n \"--recursive\",\n ]\n )\n assert cli_args.func == CmdDataPush\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"push\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n targets=[\"target1\", \"target2\"],\n jobs=2,\n remote=\"remote\",\n all_branches=True,\n all_tags=True,\n all_commits=True,\n with_deps=True,\n recursive=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_show_json_diff_test_metrics_diff_deleted_metric.assert__show_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_show_json_diff_test_metrics_diff_deleted_metric.assert__show_diff_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 85, "span_ids": ["test_metrics_diff_new_metric", "test_metrics_diff_no_changes", "test_metrics_show_raw_diff", "test_metrics_show_json_diff", "test_metrics_diff_no_diff", "test_metrics_diff_deleted_metric"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_show_json_diff():\n assert _show_diff(\n {\"metrics.json\": {\"a.b.c\": {\"old\": 1, \"new\": 2, \"diff\": 3}}}\n ) == (\n \" Path Metric Value Change\\n\"\n \"metrics.json a.b.c 2 3 \"\n )\n\n\ndef test_metrics_show_raw_diff():\n assert _show_diff({\"metrics\": {\"\": {\"old\": \"1\", \"new\": \"2\"}}}) == (\n \" Path Metric Value Change \\n\"\n \"metrics 2 diff not supported\"\n )\n\n\ndef test_metrics_diff_no_diff():\n assert _show_diff(\n {\"other.json\": {\"a.b.d\": {\"old\": \"old\", \"new\": \"new\"}}}\n ) == (\n \" Path Metric Value Change \\n\"\n \"other.json a.b.d new diff not supported\"\n )\n\n\ndef test_metrics_diff_no_changes():\n assert _show_diff({}) == \"\"\n\n\ndef test_metrics_diff_new_metric():\n assert _show_diff(\n {\"other.json\": {\"a.b.d\": {\"old\": None, \"new\": \"new\"}}}\n ) == (\n \" Path Metric Value Change \\n\"\n \"other.json a.b.d new diff not supported\"\n )\n\n\ndef test_metrics_diff_deleted_metric():\n assert _show_diff(\n {\"other.json\": {\"a.b.d\": {\"old\": \"old\", \"new\": None}}}\n ) == (\n \" Path Metric Value Change \\n\"\n \"other.json a.b.d None diff not supported\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_logging_test_params_diff.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_logging_test_params_diff.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_params.py", "file_name": "test_params.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 20, "span_ids": ["imports", "test_params_diff"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.cli import parse_args\nfrom dvc.command.params import CmdParamsDiff, _show_diff\n\n\ndef test_params_diff(dvc, mocker):\n cli_args = parse_args(\n [\"params\", \"diff\", \"HEAD~10\", \"HEAD~1\", \"--all\", \"--show-json\"]\n )\n assert cli_args.func == CmdParamsDiff\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.params.diff.diff\", return_value={})\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n cmd.repo, a_rev=\"HEAD~10\", b_rev=\"HEAD~1\", all=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_changed_test_params_diff_prec.assert__show_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_changed_test_params_diff_prec.assert__show_diff_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_params.py", "file_name": "test_params.py", "file_type": "text/x-python", "category": "test", "start_line": 23, "end_line": 72, "span_ids": ["test_params_diff_deleted", "test_params_diff_prec", "test_params_diff_no_changes", "test_params_diff_changed", "test_params_diff_unchanged", "test_params_diff_list", "test_params_diff_new"], "tokens": 434}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_params_diff_changed():\n assert _show_diff({\"params.yaml\": {\"a.b.c\": {\"old\": 1, \"new\": 2}}}) == (\n \" Path Param Old New\\n\" \"params.yaml a.b.c 1 2 \"\n )\n\n\ndef test_params_diff_list():\n assert _show_diff(\n {\"params.yaml\": {\"a.b.c\": {\"old\": 1, \"new\": [2, 3]}}}\n ) == (\n \" Path Param Old New \\n\"\n \"params.yaml a.b.c 1 [2, 3]\"\n )\n\n\ndef test_params_diff_unchanged():\n assert _show_diff(\n {\"params.yaml\": {\"a.b.d\": {\"old\": \"old\", \"new\": \"new\"}}}\n ) == (\n \" Path Param Old New\\n\" \"params.yaml a.b.d old new\"\n )\n\n\ndef test_params_diff_no_changes():\n assert _show_diff({}) == \"\"\n\n\ndef test_params_diff_new():\n assert _show_diff(\n {\"params.yaml\": {\"a.b.d\": {\"old\": None, \"new\": \"new\"}}}\n ) == (\n \" Path Param Old New\\n\" \"params.yaml a.b.d None new\"\n )\n\n\ndef test_params_diff_deleted():\n assert _show_diff(\n {\"params.yaml\": {\"a.b.d\": {\"old\": \"old\", \"new\": None}}}\n ) == (\n \" Path Param Old New \\n\" \"params.yaml a.b.d old None\"\n )\n\n\ndef test_params_diff_prec():\n assert _show_diff(\n {\"params.yaml\": {\"train.lr\": {\"old\": 0.0042, \"new\": 0.0043}}}\n ) == (\n \" Path Param Old New \\n\"\n \"params.yaml train.lr 0.0042 0.0043\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_show_json_test_params_diff_show_json.with_caplog_at_level_logg.assert_params_yaml_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_show_json_test_params_diff_show_json.with_caplog_at_level_logg.assert_params_yaml_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_params.py", "file_name": "test_params.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 85, "span_ids": ["test_params_diff_show_json"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_params_diff_show_json(dvc, mocker, caplog):\n cli_args = parse_args(\n [\"params\", \"diff\", \"HEAD~10\", \"HEAD~1\", \"--show-json\"]\n )\n cmd = cli_args.func(cli_args)\n mocker.patch(\n \"dvc.repo.params.diff.diff\", return_value={\"params.yaml\": {\"a\": \"b\"}}\n )\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n assert cmd.run() == 0\n assert '{\"params.yaml\": {\"a\": \"b\"}}\\n' in caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_sorted_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_sorted_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_params.py", "file_name": "test_params.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 103, "span_ids": ["test_params_diff_sorted"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_params_diff_sorted():\n assert _show_diff(\n {\n \"params.yaml\": {\n \"x.b\": {\"old\": 5, \"new\": 6},\n \"a.d.e\": {\"old\": 3, \"new\": 4},\n \"a.b.c\": {\"old\": 1, \"new\": 2},\n }\n }\n ) == (\n \" Path Param Old New\\n\"\n \"params.yaml a.b.c 1 2 \\n\"\n \"params.yaml a.d.e 3 4 \\n\"\n \"params.yaml x.b 5 6 \"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_status.py_from_dvc_cli_import_parse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_status.py_from_dvc_cli_import_parse_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_status.py", "file_name": "test_status.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 39, "span_ids": ["imports", "test_cloud_status"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.status import CmdDataStatus\n\n\ndef test_cloud_status(mocker):\n cli_args = parse_args(\n [\n \"status\",\n \"--cloud\",\n \"target1\",\n \"target2\",\n \"--jobs\",\n \"2\",\n \"--remote\",\n \"remote\",\n \"--all-branches\",\n \"--all-tags\",\n \"--all-commits\",\n \"--with-deps\",\n ]\n )\n assert cli_args.func == CmdDataStatus\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"status\", autospec=True, return_value={})\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n cloud=True,\n targets=[\"target1\", \"target2\"],\n jobs=2,\n remote=\"remote\",\n all_branches=True,\n all_tags=True,\n all_commits=True,\n with_deps=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_getpass_test_url.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_getpass_test_url.None_1", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "test_url"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import getpass\nimport os\nimport sys\n\nimport pytest\nfrom mock import mock_open\nfrom mock import patch\n\nfrom dvc.remote.ssh import RemoteSSH\nfrom dvc.system import System\nfrom tests.remotes import SSHMocked\n\n\ndef test_url(dvc):\n user = \"test\"\n host = \"123.45.67.89\"\n port = 1234\n path = \"/path/to/dir\"\n\n # URL ssh://[user@]host.xz[:port]/path\n url = \"ssh://{}@{}:{}{}\".format(user, host, port, path)\n config = {\"url\": url}\n\n remote = RemoteSSH(dvc, config)\n assert remote.path_info == url\n\n # SCP-like URL ssh://[user@]host.xz:/absolute/path\n url = \"ssh://{}@{}:{}\".format(user, host, path)\n config = {\"url\": url}\n\n remote = RemoteSSH(dvc, config)\n assert remote.path_info == url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_no_path_if_sys_version_info_major.else_.builtin_module_name.___builtin___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_no_path_if_sys_version_info_major.else_.builtin_module_name.___builtin___", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 52, "span_ids": ["test_no_path", "impl"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_no_path(dvc):\n config = {\"url\": \"ssh://127.0.0.1\"}\n remote = RemoteSSH(dvc, config)\n assert remote.path_info.path == \"\"\n\n\nmock_ssh_config = \"\"\"\nHost example.com\n User ubuntu\n HostName 1.2.3.4\n Port 1234\n IdentityFile ~/.ssh/not_default.key\n\"\"\"\n\nif sys.version_info.major == 3:\n builtin_module_name = \"builtins\"\nelse:\n builtin_module_name = \"__builtin__\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_host_override_from_config_test_ssh_host_override_from_config.assert_remote_path_info_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_host_override_from_config_test_ssh_host_override_from_config.assert_remote_path_info_h", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 75, "span_ids": ["test_ssh_host_override_from_config"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"config,expected_host\",\n [\n ({\"url\": \"ssh://example.com\"}, \"1.2.3.4\"),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, \"not_in_ssh_config.com\"),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_host_override_from_config(\n mock_file, mock_exists, dvc, config, expected_host\n):\n remote = RemoteSSH(dvc, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.path_info.host == expected_host", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_azure.py_from_dvc_remote_azure_imp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_azure.py_from_dvc_remote_azure_imp_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_azure.py", "file_name": "test_azure.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["test_init_compat", "imports", "test_init"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.remote.azure import RemoteAZURE\n\n\ncontainer_name = \"container-name\"\nconnection_string = (\n \"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;\"\n \"AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsu\"\n \"Fq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;\"\n \"BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;\"\n)\n\n\ndef test_init_compat(dvc):\n url = (\n \"azure://ContainerName={container_name};{connection_string}\"\n ).format(\n container_name=container_name, connection_string=connection_string,\n )\n config = {\"url\": url}\n remote = RemoteAZURE(dvc, config)\n assert remote.path_info == \"azure://\" + container_name\n assert remote.connection_string == connection_string\n\n\ndef test_init(dvc):\n prefix = \"some/prefix\"\n url = \"azure://{}/{}\".format(container_name, prefix)\n config = {\"url\": url, \"connection_string\": connection_string}\n remote = RemoteAZURE(dvc, config)\n assert remote.path_info == url\n assert remote.connection_string == connection_string", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_math_test_cmd_error.with_mock_patch_object_.with_pytest_raises_Remote.REMOTE_CLS_dvc_config_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_math_test_cmd_error.with_mock_patch_object_.with_pytest_raises_Remote.REMOTE_CLS_dvc_config_r", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_base.py", "file_name": "test_base.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["_CallableOrNone.__eq__", "_CallableOrNone", "test_cmd_error", "impl", "imports", "test_missing_deps"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import math\nimport mock\nimport pytest\n\nfrom dvc.path_info import PathInfo\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.remote.base import RemoteCmdError\nfrom dvc.remote.base import RemoteMissingDepsError\n\n\nclass _CallableOrNone(object):\n \"\"\"Helper for testing if object is callable() or None.\"\"\"\n\n def __eq__(self, other):\n return other is None or callable(other)\n\n\nCallableOrNone = _CallableOrNone()\nREMOTE_CLS = RemoteBASE\n\n\ndef test_missing_deps(dvc):\n requires = {\"missing\": \"missing\"}\n with mock.patch.object(REMOTE_CLS, \"REQUIRES\", requires):\n with pytest.raises(RemoteMissingDepsError):\n REMOTE_CLS(dvc, {})\n\n\ndef test_cmd_error(dvc):\n config = {}\n\n cmd = \"sed 'hello'\"\n ret = \"1\"\n err = \"sed: expression #1, char 2: extra characters after command\"\n\n with mock.patch.object(\n REMOTE_CLS,\n \"remove\",\n side_effect=RemoteCmdError(\"base\", cmd, ret, err),\n ):\n with pytest.raises(RemoteCmdError):\n REMOTE_CLS(dvc, config).remove(\"file\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gdrive.py_pytest_USER_CREDS_MISSED_KEY_ERROR._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gdrive.py_pytest_USER_CREDS_MISSED_KEY_ERROR._", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_gdrive.py", "file_name": "test_gdrive.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 12, "span_ids": ["imports"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport os\n\nfrom dvc.remote.gdrive import (\n RemoteGDrive,\n GDriveAccessTokenRefreshError,\n GDriveMissedCredentialKeyError,\n)\n\nUSER_CREDS_TOKEN_REFRESH_ERROR = '{\"access_token\": \"\", \"client_id\": \"\", \"client_secret\": \"\", \"refresh_token\": \"\", \"token_expiry\": \"\", \"token_uri\": \"https://oauth2.googleapis.com/token\", \"user_agent\": null, \"revoke_uri\": \"https://oauth2.googleapis.com/revoke\", \"id_token\": null, \"id_token_jwt\": null, \"token_response\": {\"access_token\": \"\", \"expires_in\": 3600, \"scope\": \"https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive\", \"token_type\": \"Bearer\"}, \"scopes\": [\"https://www.googleapis.com/auth/drive\", \"https://www.googleapis.com/auth/drive.appdata\"], \"token_info_uri\": \"https://oauth2.googleapis.com/tokeninfo\", \"invalid\": true, \"_class\": \"OAuth2Credentials\", \"_module\": \"oauth2client.client\"}' # noqa: E501\n\nUSER_CREDS_MISSED_KEY_ERROR = \"{}\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gs.py_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gs.py_mock_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_gs.py", "file_name": "test_gs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 57, "span_ids": ["test_gs_no_credspath", "test_dynamic_chunk_size", "test_init", "imports", "test_gs"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\nimport pytest\nimport requests\n\nfrom dvc.remote.gs import dynamic_chunk_size\nfrom dvc.remote.gs import RemoteGS\n\n\nBUCKET = \"bucket\"\nPREFIX = \"prefix\"\nURL = \"gs://{}/{}\".format(BUCKET, PREFIX)\nCREDENTIALPATH = \"/path/to/gcp_credentials.json\"\nPROJECT = \"PROJECT\"\nCONFIG = {\n \"projectname\": PROJECT,\n \"url\": URL,\n \"credentialpath\": CREDENTIALPATH,\n}\n\n\ndef test_init(dvc):\n remote = RemoteGS(dvc, CONFIG)\n assert remote.path_info == URL\n assert remote.projectname == PROJECT\n assert remote.credentialpath == CREDENTIALPATH\n\n\n@mock.patch(\"google.cloud.storage.Client.from_service_account_json\")\ndef test_gs(mock_client, dvc):\n remote = RemoteGS(dvc, CONFIG)\n assert remote.credentialpath\n remote.gs()\n mock_client.assert_called_once_with(CREDENTIALPATH)\n\n\n@mock.patch(\"google.cloud.storage.Client\")\ndef test_gs_no_credspath(mock_client, dvc):\n config = CONFIG.copy()\n del config[\"credentialpath\"]\n remote = RemoteGS(dvc, config)\n remote.gs()\n mock_client.assert_called_with(PROJECT)\n\n\ndef test_dynamic_chunk_size():\n chunk_sizes = []\n\n @dynamic_chunk_size\n def upload(chunk_size=None):\n chunk_sizes.append(chunk_size)\n raise requests.exceptions.ConnectionError()\n\n with pytest.raises(requests.exceptions.ConnectionError):\n upload()\n\n assert chunk_sizes == [10485760, 5242880, 2621440, 1310720, 524288, 262144]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_oss.py_from_dvc_remote_oss_impor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_oss.py_from_dvc_remote_oss_impor_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_oss.py", "file_name": "test_oss.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["test_init", "imports"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.remote.oss import RemoteOSS\n\n\nbucket_name = \"bucket-name\"\nendpoint = \"endpoint\"\nkey_id = \"Fq2UVErCz4I6tq\"\nkey_secret = \"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsu\"\n\n\ndef test_init(dvc):\n prefix = \"some/prefix\"\n url = \"oss://{}/{}\".format(bucket_name, prefix)\n config = {\n \"url\": url,\n \"oss_key_id\": key_id,\n \"oss_key_secret\": key_secret,\n \"oss_endpoint\": endpoint,\n }\n remote = RemoteOSS(dvc, config)\n assert remote.path_info == url\n assert remote.endpoint == endpoint\n assert remote.key_id == key_id\n assert remote.key_secret == key_secret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_NamedCacheItem_NamedCacheItem.update.for_checksum_child_item_.self_children_checksum_u": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_NamedCacheItem_NamedCacheItem.update.for_checksum_child_item_.self_children_checksum_u", "embedding": null, "metadata": {"file_path": "dvc/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 101, "span_ids": ["NamedCacheItem.child_keys", "NamedCacheItem", "NamedCacheItem.update", "NamedCacheItem.__eq__", "NamedCacheItem.__init__", "NamedCacheItem.child_names", "NamedCacheItem.add"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedCacheItem:\n def __init__(self):\n self.names = set()\n self.children = defaultdict(NamedCacheItem)\n\n def __eq__(self, other):\n return self.names == other.names and self.children == other.children\n\n def child_keys(self):\n for key, child in self.children.items():\n yield key\n yield from child.child_keys()\n\n def child_names(self):\n for key, child in self.children.items():\n yield key, child.names\n yield from child.child_names()\n\n def add(self, checksum, item):\n self.children[checksum].update(item)\n\n def update(self, item, suffix=\"\"):\n if suffix:\n self.names.update(n + suffix for n in item.names)\n else:\n self.names.update(item.names)\n for checksum, child_item in item.children.items():\n self.children[checksum].update(child_item)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser_add_parser.fetch_parser_add_argument": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser_add_parser.fetch_parser_add_argument", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 234, "span_ids": ["add_parser"], "tokens": 762}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, _parent_parser):\n from dvc.command.status import CmdDataStatus\n\n # Pull\n PULL_HELP = \"Download tracked files or directories from remote storage.\"\n\n pull_parser = subparsers.add_parser(\n \"pull\",\n parents=[shared_parent_parser()],\n description=append_doc_link(PULL_HELP, \"pull\"),\n help=PULL_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n pull_parser.add_argument(\n \"-r\", \"--remote\", help=\"Remote storage to pull from\", metavar=\"\",\n )\n pull_parser.add_argument(\n \"-a\",\n \"--all-branches\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all branches.\",\n )\n pull_parser.add_argument(\n \"-T\",\n \"--all-tags\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all tags.\",\n )\n pull_parser.add_argument(\n \"--all-commits\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all commits.\",\n )\n pull_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Do not prompt when removing working directory files.\",\n )\n pull_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all dependencies of the specified target.\",\n )\n pull_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Pull cache for subdirectories of the specified directory.\",\n )\n pull_parser.set_defaults(func=CmdDataPull)\n\n # Push\n PUSH_HELP = \"Upload tracked files or directories to remote storage.\"\n\n push_parser = subparsers.add_parser(\n \"push\",\n parents=[shared_parent_parser()],\n description=append_doc_link(PUSH_HELP, \"push\"),\n help=PUSH_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n push_parser.add_argument(\n \"-r\", \"--remote\", help=\"Remote storage to push to\", metavar=\"\",\n )\n push_parser.add_argument(\n \"-a\",\n \"--all-branches\",\n action=\"store_true\",\n default=False,\n help=\"Push cache for all branches.\",\n )\n push_parser.add_argument(\n \"-T\",\n \"--all-tags\",\n action=\"store_true\",\n default=False,\n help=\"Push cache for all tags.\",\n )\n push_parser.add_argument(\n \"--all-commits\",\n action=\"store_true\",\n default=False,\n help=\"Push cache for all commits.\",\n )\n push_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Push cache for all dependencies of the specified target.\",\n )\n push_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Push cache for subdirectories of specified directory.\",\n )\n push_parser.set_defaults(func=CmdDataPush)\n\n # Fetch\n FETCH_HELP = (\n \"Get tracked files or directories from remote storage\"\n \" into the cache.\"\n )\n\n fetch_parser = subparsers.add_parser(\n \"fetch\",\n parents=[shared_parent_parser()],\n description=append_doc_link(FETCH_HELP, \"fetch\"),\n help=FETCH_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n fetch_parser.add_argument(\n \"-r\",\n \"--remote\",\n help=\"Remote storage to fetch from\",\n metavar=\"\",\n )\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser.None_16_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser.None_16_", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 235, "end_line": 338, "span_ids": ["add_parser"], "tokens": 619}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, _parent_parser):\n # ... other code\n fetch_parser.add_argument(\n \"-a\",\n \"--all-branches\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all branches.\",\n )\n fetch_parser.add_argument(\n \"-T\",\n \"--all-tags\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all tags.\",\n )\n fetch_parser.add_argument(\n \"--all-commits\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all commits.\",\n )\n fetch_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all dependencies of the \" \"specified target.\",\n )\n fetch_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for subdirectories of specified directory.\",\n )\n fetch_parser.set_defaults(func=CmdDataFetch)\n\n # Status\n STATUS_HELP = (\n \"Show changed stages, compare local cache and a remote storage.\"\n )\n\n status_parser = subparsers.add_parser(\n \"status\",\n parents=[shared_parent_parser()],\n description=append_doc_link(STATUS_HELP, \"status\"),\n help=STATUS_HELP,\n conflict_handler=\"resolve\",\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n status_parser.add_argument(\n \"-q\",\n \"--quiet\",\n action=\"store_true\",\n default=False,\n help=(\n \"Suppresses all output.\"\n \" Exit with 0 if pipelines are up to date, otherwise 1.\"\n ),\n )\n status_parser.add_argument(\n \"-c\",\n \"--cloud\",\n action=\"store_true\",\n default=False,\n help=\"Show status of a local cache compared to a remote repository.\",\n )\n status_parser.add_argument(\n \"-r\",\n \"--remote\",\n help=\"Remote storage to compare local cache to\",\n metavar=\"\",\n )\n status_parser.add_argument(\n \"-a\",\n \"--all-branches\",\n action=\"store_true\",\n default=False,\n help=\"Show status of a local cache compared to a remote repository \"\n \"for all branches.\",\n )\n status_parser.add_argument(\n \"-T\",\n \"--all-tags\",\n action=\"store_true\",\n default=False,\n help=\"Show status of a local cache compared to a remote repository \"\n \"for all tags.\",\n )\n status_parser.add_argument(\n \"--all-commits\",\n action=\"store_true\",\n default=False,\n help=\"Show status of a local cache compared to a remote repository \"\n \"for all commits.\",\n )\n status_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Show status for all dependencies of the specified target.\",\n )\n status_parser.set_defaults(func=CmdDataStatus)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsAdd__show_diff.return.table_Path_Metric_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsAdd__show_diff.return.table_Path_Metric_", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 112, "span_ids": ["CmdMetricsRemove.run", "CmdMetricsAdd", "CmdMetricsAdd.run", "CmdMetricsRemove", "_show_diff"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdMetricsAdd(CmdBase):\n def run(self):\n try:\n self.repo.metrics.add(self.args.path)\n except DvcException:\n msg = \"failed to add metric file '{}'\".format(self.args.path)\n logger.exception(msg)\n return 1\n\n return 0\n\n\nclass CmdMetricsRemove(CmdBase):\n def run(self):\n try:\n self.repo.metrics.remove(self.args.path)\n except DvcException:\n msg = \"failed to remove metric file '{}'\".format(self.args.path)\n logger.exception(msg)\n return 1\n\n return 0\n\n\ndef _show_diff(diff):\n from collections import OrderedDict\n\n from dvc.utils.diff import table\n\n rows = []\n for fname, mdiff in diff.items():\n sorted_mdiff = OrderedDict(sorted(mdiff.items()))\n for metric, change in sorted_mdiff.items():\n rows.append(\n [\n fname,\n metric,\n change[\"new\"],\n change.get(\"diff\", \"diff not supported\"),\n ]\n )\n\n return table([\"Path\", \"Metric\", \"Value\", \"Change\"], rows)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_add_parser.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_add_parser.None_12", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 247, "span_ids": ["add_parser"], "tokens": 752}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n METRICS_HELP = \"Commands to add, manage, collect, and display metrics.\"\n\n metrics_parser = subparsers.add_parser(\n \"metrics\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_HELP, \"metrics\"),\n help=METRICS_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n\n metrics_subparsers = metrics_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use `dvc metrics CMD --help` to display command-specific help.\",\n )\n\n fix_subparsers(metrics_subparsers)\n\n METRICS_ADD_HELP = \"Mark a DVC-tracked file as a metric.\"\n metrics_add_parser = metrics_subparsers.add_parser(\n \"add\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_ADD_HELP, \"metrics/add\"),\n help=METRICS_ADD_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n metrics_add_parser.add_argument(\"path\", help=\"Path to a metric file.\")\n metrics_add_parser.set_defaults(func=CmdMetricsAdd)\n\n METRICS_SHOW_HELP = \"Print metrics, with optional formatting.\"\n metrics_show_parser = metrics_subparsers.add_parser(\n \"show\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_SHOW_HELP, \"metrics/show\"),\n help=METRICS_SHOW_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n metrics_show_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"Metric files or directories (see -R) to show\",\n )\n metrics_show_parser.add_argument(\n \"-a\",\n \"--all-branches\",\n action=\"store_true\",\n default=False,\n help=\"Show metrics for all branches.\",\n )\n metrics_show_parser.add_argument(\n \"-T\",\n \"--all-tags\",\n action=\"store_true\",\n default=False,\n help=\"Show metrics for all tags.\",\n )\n metrics_show_parser.add_argument(\n \"--all-commits\",\n action=\"store_true\",\n default=False,\n help=\"Show metrics for all commits.\",\n )\n metrics_show_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=(\n \"If any target is a directory, recursively search and process \"\n \"metric files.\"\n ),\n )\n metrics_show_parser.add_argument(\n \"--show-json\",\n action=\"store_true\",\n default=False,\n help=\"Show output in JSON format.\",\n )\n metrics_show_parser.set_defaults(func=CmdMetricsShow)\n\n METRICS_DIFF_HELP = \"Show changes in metrics between commits\"\n \" in the DVC repository, or between a commit and the workspace.\"\n metrics_diff_parser = metrics_subparsers.add_parser(\n \"diff\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_DIFF_HELP, \"metrics/diff\"),\n help=METRICS_DIFF_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n metrics_diff_parser.add_argument(\n \"a_rev\", nargs=\"?\", help=\"Old Git commit to compare (defaults to HEAD)\"\n )\n metrics_diff_parser.add_argument(\n \"b_rev\",\n nargs=\"?\",\n help=(\"New Git commit to compare (defaults to the current workspace)\"),\n )\n metrics_diff_parser.add_argument(\n \"--targets\",\n nargs=\"*\",\n help=(\n \"Metric files or directories (see -R) to show diff for. \"\n \"Shows diff for all metric files by default.\"\n ),\n metavar=\"\",\n )\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser.None_13_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser.None_13_", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 248, "end_line": 282, "span_ids": ["add_parser"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n # ... other code\n metrics_diff_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=(\n \"If any target is a directory, recursively search and process \"\n \"metric files.\"\n ),\n )\n metrics_diff_parser.add_argument(\n \"--all\",\n action=\"store_true\",\n default=False,\n help=\"Show unchanged metrics as well.\",\n )\n metrics_diff_parser.add_argument(\n \"--show-json\",\n action=\"store_true\",\n default=False,\n help=\"Show output in JSON format.\",\n )\n metrics_diff_parser.set_defaults(func=CmdMetricsDiff)\n\n METRICS_REMOVE_HELP = \"Remove metric mark on a DVC-tracked file.\"\n metrics_remove_parser = metrics_subparsers.add_parser(\n \"remove\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_REMOVE_HELP, \"metrics/remove\"),\n help=METRICS_REMOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n metrics_remove_parser.add_argument(\"path\", help=\"Path to a metric file.\")\n metrics_remove_parser.set_defaults(func=CmdMetricsRemove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_argparse_CmdPipelineShow._show.for_stage_in_stages_.if_commands_.else_.logger_info__stage_repr_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_argparse_CmdPipelineShow._show.for_stage_in_stages_.if_commands_.else_.logger_info__stage_repr_s", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 43, "span_ids": ["CmdPipelineShow", "imports", "_stage_repr", "CmdPipelineShow._show"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link, fix_subparsers\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _stage_repr(stage):\n from dvc.stage import PipelineStage\n\n return (\n \"{}:{}\".format(stage.relpath, stage.name)\n if isinstance(stage, PipelineStage)\n else stage.relpath\n )\n\n\nclass CmdPipelineShow(CmdBase):\n def _show(self, target, commands, outs, locked):\n import networkx\n from dvc import dvcfile\n from dvc.utils import parse_target\n\n path, name = parse_target(target)\n stage = dvcfile.Dvcfile(self.repo, path).stages[name]\n G = self.repo.pipeline_graph\n stages = networkx.dfs_postorder_nodes(G, stage)\n if locked:\n stages = [s for s in stages if s.locked]\n\n for stage in stages:\n if commands:\n if stage.cmd is None:\n continue\n logger.info(stage.cmd)\n elif outs:\n for out in stage.outs:\n logger.info(str(out))\n else:\n logger.info(_stage_repr(stage))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._save_paths_Config.validate.try_.except_Invalid_as_exc_.raise_ConfigError_str_exc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._save_paths_Config.validate.try_.except_Invalid_as_exc_.raise_ConfigError_str_exc", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 335, "end_line": 378, "span_ids": ["Config._save_paths", "Config.validate", "Config.edit", "Config._map_dirs", "Config._load_config_to_level"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Config(dict):\n\n @staticmethod\n def _save_paths(conf, filename):\n conf_dir = os.path.dirname(filename)\n rel = partial(Config._to_relpath, conf_dir)\n\n return Config._map_dirs(conf, rel)\n\n @staticmethod\n def _map_dirs(conf, func):\n dirs_schema = {\"cache\": {\"dir\": func}, \"remote\": {str: {\"url\": func}}}\n return Schema(dirs_schema, extra=ALLOW_EXTRA)(conf)\n\n def _load_config_to_level(self, level=None):\n merged_conf = {}\n for merge_level in self.LEVELS:\n if merge_level == level:\n break\n if merge_level in self.files:\n _merge(merged_conf, self.load_one(merge_level))\n return merged_conf\n\n @contextmanager\n def edit(self, level=\"repo\"):\n if level in {\"repo\", \"local\"} and self.dvc_dir is None:\n raise ConfigError(\"Not inside a DVC repo\")\n\n conf = self.load_one(level)\n yield conf\n\n conf = self._save_paths(conf, self.files[level])\n\n merged_conf = self._load_config_to_level(level)\n _merge(merged_conf, conf)\n self.validate(merged_conf)\n\n _save_config(self.files[level], conf)\n self.load()\n\n @staticmethod\n def validate(data):\n try:\n return COMPILED_SCHEMA(data)\n except Invalid as exc:\n raise ConfigError(str(exc)) from None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._save_pulled_checksums_DataCloud._save_pulled_checksums.for_checksum_in_cache_sch.if_self_repo_cache_local_.self_repo_state_save_cach": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._save_pulled_checksums_DataCloud._save_pulled_checksums.for_checksum_in_cache_sch.if_self_repo_cache_local_.self_repo_state_save_cach", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 98, "span_ids": ["DataCloud._save_pulled_checksums"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataCloud(object):\n\n def _save_pulled_checksums(self, cache):\n for checksum in cache.scheme_keys(\"local\"):\n cache_file = self.repo.cache.local.checksum_to_path_info(checksum)\n if self.repo.cache.local.exists(cache_file):\n # We can safely save here, as existing corrupted files will\n # be removed upon status, while files corrupted during\n # download will not be moved from tmp_file\n # (see `RemoteBASE.download()`)\n self.repo.state.save(cache_file, checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.status_", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 116, "span_ids": ["DataCloud.status"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataCloud(object):\n\n def status(self, cache, jobs=None, remote=None, show_checksums=False):\n \"\"\"Check status of data items in a cloud-agnostic way.\n\n Args:\n cache (NamedCache): named checksums to check status for.\n jobs (int): number of jobs that can be running simultaneously.\n remote (dvc.remote.base.RemoteBASE): optional remote to compare\n cache to. By default remote from core.remote config option\n is used.\n show_checksums (bool): show checksums instead of file names in\n information messages.\n \"\"\"\n remote = self.get_remote(remote, \"status\")\n return self.repo.cache.local.status(\n cache, jobs=jobs, remote=remote, show_checksums=show_checksums\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_os_MultiStageFileLoadError.__init__.super___init___Cannot_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_os_MultiStageFileLoadError.__init__.super___init___Cannot_", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["imports", "MultiStageFileLoadError.__init__", "MultiStageFileLoadError"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport re\nimport logging\n\nimport dvc.prompt as prompt\n\nfrom voluptuous import MultipleInvalid\nfrom dvc import serialize\nfrom dvc.exceptions import DvcException\nfrom dvc.loader import SingleStageLoader, StageLoader\nfrom dvc.schema import (\n COMPILED_SINGLE_STAGE_SCHEMA,\n COMPILED_MULTI_STAGE_SCHEMA,\n)\nfrom dvc.stage.exceptions import (\n StageFileBadNameError,\n StageFileDoesNotExistError,\n StageFileIsNotDvcFileError,\n StageFileFormatError,\n StageFileAlreadyExistsError,\n)\nfrom dvc.utils import relpath\nfrom dvc.utils.stage import (\n dump_stage_file,\n parse_stage,\n parse_stage_for_update,\n)\n\nlogger = logging.getLogger(__name__)\n\nDVC_FILE = \"Dvcfile\"\nDVC_FILE_SUFFIX = \".dvc\"\nTAG_REGEX = r\"^(?P.*)@(?P[^\\\\/@:]*)$\"\n\n\nclass MultiStageFileLoadError(DvcException):\n def __init__(self, file):\n super().__init__(\"Cannot load multi-stage file: '{}'\".format(file))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile_Dvcfile._get_path_tag.return.match_group_path_matc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile_Dvcfile._get_path_tag.return.match_group_path_matc", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 117, "span_ids": ["Dvcfile.__repr__", "Dvcfile.__str__", "Dvcfile.is_valid_filename", "Dvcfile.stage", "Dvcfile.check_isfile", "Dvcfile.__init__", "Dvcfile.lockfile", "Dvcfile.relpath", "Dvcfile.stages", "Dvcfile._get_path_tag", "Dvcfile.check_dvc_filename", "Dvcfile.check_file_exists", "Dvcfile.is_stage_file", "Dvcfile", "Dvcfile.exists"], "tokens": 525}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Dvcfile:\n def __init__(self, repo, path):\n self.repo = repo\n self.path, self.tag = self._get_path_tag(path)\n\n def __repr__(self):\n return \"{}: {}\".format(\n DVC_FILE, relpath(self.path, self.repo.root_dir)\n )\n\n def __str__(self):\n return \"{}: {}\".format(DVC_FILE, self.relpath)\n\n @property\n def relpath(self):\n return relpath(self.path)\n\n @property\n def stage(self):\n data, raw = self._load()\n if not self.is_multi_stage(data):\n return SingleStageLoader.load_stage(self, data, raw)\n raise MultiStageFileLoadError(self.path)\n\n @property\n def lockfile(self):\n return os.path.splitext(self.path)[0] + \".lock\"\n\n @property\n def stages(self):\n from . import lockfile\n\n data, raw = self._load()\n if self.is_multi_stage(data):\n lockfile_data = lockfile.load(self.repo, self.lockfile)\n return StageLoader(self, data.get(\"stages\", {}), lockfile_data)\n return SingleStageLoader(self, data, raw)\n\n @classmethod\n def is_valid_filename(cls, path):\n return (\n path.endswith(DVC_FILE_SUFFIX)\n or os.path.basename(path) == DVC_FILE\n )\n\n @classmethod\n def is_stage_file(cls, path):\n return os.path.isfile(path) and cls.is_valid_filename(path)\n\n @classmethod\n def check_dvc_filename(cls, path):\n if not cls.is_valid_filename(path):\n raise StageFileBadNameError(\n \"bad DVC-file name '{}'. DVC-files should be named \"\n \"'Dvcfile' or have a '.dvc' suffix (e.g. '{}.dvc').\".format(\n relpath(path), os.path.basename(path)\n )\n )\n\n def exists(self):\n return self.repo.tree.exists(self.path)\n\n def check_file_exists(self):\n if not self.exists():\n raise StageFileDoesNotExistError(self.path)\n\n def check_isfile(self):\n if not self.repo.tree.isfile(self.path):\n raise StageFileIsNotDvcFileError(self.path)\n\n @staticmethod\n def _get_path_tag(s):\n regex = re.compile(TAG_REGEX)\n match = regex.match(s)\n if not match:\n return s, None\n return match.group(\"path\"), match.group(\"tag\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_Dvcfile.dump.for_out_in_filter_lambda_.Dvcfile_s_repo_s_path_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_Dvcfile.dump.for_out_in_filter_lambda_.Dvcfile_s_repo_s_path_d", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 140, "span_ids": ["Dvcfile.dump"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Dvcfile:\n\n def dump(self, stage, update_dvcfile=False):\n \"\"\"Dumps given stage appropriately in the dvcfile.\"\"\"\n from dvc.stage import create_stage, PipelineStage, Stage\n\n if not isinstance(stage, PipelineStage):\n self.dump_single_stage(stage)\n return\n\n self.dump_lockfile(stage)\n if update_dvcfile and not stage.is_data_source:\n self.dump_multistage_dvcfile(stage)\n\n for out in filter(lambda o: o.use_cache, stage.outs):\n s = create_stage(\n Stage,\n stage.repo,\n os.path.join(stage.wdir, out.def_path + DVC_FILE_SUFFIX),\n wdir=stage.wdir,\n )\n s.outs = [out]\n s.md5 = s._compute_md5()\n Dvcfile(s.repo, s.path).dump_single_stage(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_lockfile_Dvcfile.dump_multistage_dvcfile.self_repo_scm_track_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_lockfile_Dvcfile.dump_multistage_dvcfile.self_repo_scm_track_file_", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 162, "span_ids": ["Dvcfile.dump_lockfile", "Dvcfile.dump_multistage_dvcfile"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Dvcfile:\n\n def dump_lockfile(self, stage):\n from . import lockfile\n\n lockfile.dump(self.repo, self.lockfile, serialize.to_lockfile(stage))\n self.repo.scm.track_file(relpath(self.lockfile))\n\n def dump_multistage_dvcfile(self, stage):\n data = {}\n if self.exists():\n with open(self.path, \"r\") as fd:\n data = parse_stage_for_update(fd.read(), self.path)\n if not self.is_multi_stage(data):\n raise MultiStageFileLoadError(self.path)\n else:\n open(self.path, \"w+\").close()\n\n data[\"stages\"] = data.get(\"stages\", {})\n data[\"stages\"].update(serialize.to_dvcfile(stage))\n\n dump_stage_file(self.path, COMPILED_MULTI_STAGE_SCHEMA(data))\n self.repo.scm.track_file(relpath(self.path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_single_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Dvcfile.dump_single_stage_", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 226, "span_ids": ["Dvcfile.validate_single_stage", "Dvcfile._load", "Dvcfile._validate", "Dvcfile.dump_single_stage", "Dvcfile.validate_multi_stage", "Dvcfile.is_multi_stage", "Dvcfile.remove_with_prompt"], "tokens": 434}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Dvcfile:\n\n def dump_single_stage(self, stage):\n self.check_dvc_filename(self.path)\n\n logger.debug(\n \"Saving information to '{file}'.\".format(file=relpath(self.path))\n )\n\n dump_stage_file(self.path, serialize.to_single_stage_file(stage))\n self.repo.scm.track_file(relpath(self.path))\n\n def _load(self):\n # it raises the proper exceptions by priority:\n # 1. when the file doesn't exists\n # 2. filename is not a DVC-file\n # 3. path doesn't represent a regular file\n self.check_file_exists()\n self.check_dvc_filename(self.path)\n self.check_isfile()\n\n with self.repo.tree.open(self.path) as fd:\n stage_text = fd.read()\n d = parse_stage(stage_text, self.path)\n return d, stage_text\n\n @staticmethod\n def validate_single_stage(d, fname=None):\n Dvcfile._validate(COMPILED_SINGLE_STAGE_SCHEMA, d, fname)\n\n @staticmethod\n def validate_multi_stage(d, fname=None):\n Dvcfile._validate(COMPILED_MULTI_STAGE_SCHEMA, d, fname)\n\n @staticmethod\n def _validate(schema, d, fname=None):\n try:\n schema(d)\n except MultipleInvalid as exc:\n raise StageFileFormatError(fname, exc)\n\n def is_multi_stage(self, d=None):\n if d is None:\n d = self._load()[0]\n check_multi_stage = d.get(\"stages\")\n if check_multi_stage:\n self.validate_multi_stage(d, self.path)\n return True\n\n self.validate_single_stage(d, self.path)\n return False\n\n def remove_with_prompt(self, force=False):\n if not self.exists():\n return\n\n msg = (\n \"'{}' already exists. Do you wish to run the command and \"\n \"overwrite it?\".format(relpath(self.path))\n )\n if not (force or prompt.confirm(msg)):\n raise StageFileAlreadyExistsError(self.path)\n\n os.unlink(self.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_collections_resolve_paths.return.path_wdir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_collections_resolve_paths.return.path_wdir", "embedding": null, "metadata": {"file_path": "dvc/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["imports", "StageNotFound.__init__", "resolve_paths", "StageNotFound"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import collections\nimport logging\nimport os\n\nfrom copy import deepcopy\nfrom itertools import chain\n\nfrom dvc import dependency, output\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\n\n\nclass StageNotFound(KeyError, DvcException):\n def __init__(self, file, name):\n super().__init__(\n \"Stage with '{}' name not found inside '{}' file\".format(\n name, relpath(file)\n )\n )\n\n\ndef resolve_paths(path, wdir=None):\n path = os.path.abspath(path)\n wdir = wdir or os.curdir\n wdir = os.path.abspath(os.path.join(os.path.dirname(path), wdir))\n return path, wdir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader_StageLoader._fill_lock_checksums.for_key_item_in_items_.item.checksum.lock_data_get_key_ge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader_StageLoader._fill_lock_checksums.for_key_item_in_items_.item.checksum.lock_data_get_key_ge", "embedding": null, "metadata": {"file_path": "dvc/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 31, "end_line": 47, "span_ids": ["StageLoader._fill_lock_checksums", "StageLoader", "StageLoader.__init__"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StageLoader(collections.abc.Mapping):\n def __init__(self, dvcfile, stages_data, lockfile_data=None):\n self.dvcfile = dvcfile\n self.stages_data = stages_data or {}\n self.lockfile_data = lockfile_data or {}\n\n @staticmethod\n def _fill_lock_checksums(stage, lock_data):\n from .stage import Stage\n\n outs = stage.outs if not stage.cmd_changed else []\n items = chain(\n ((Stage.PARAM_DEPS, dep) for dep in stage.deps),\n ((Stage.PARAM_OUTS, out) for out in outs),\n )\n for key, item in items:\n item.checksum = lock_data.get(key, {}).get(item.def_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader.load_stage_StageLoader.load_stage.return.stage": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader.load_stage_StageLoader.load_stage.return.stage", "embedding": null, "metadata": {"file_path": "dvc/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 66, "span_ids": ["StageLoader.load_stage"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StageLoader(collections.abc.Mapping):\n\n @classmethod\n def load_stage(cls, dvcfile, name, stage_data, lock_data):\n from .stage import PipelineStage, Stage, loads_from\n\n path, wdir = resolve_paths(\n dvcfile.path, stage_data.get(Stage.PARAM_WDIR)\n )\n stage = loads_from(PipelineStage, dvcfile.repo, path, wdir, stage_data)\n stage.name = name\n stage._fill_stage_dependencies(**stage_data)\n stage._fill_stage_outputs(**stage_data)\n if lock_data:\n stage.cmd_changed = lock_data.get(\n Stage.PARAM_CMD\n ) != stage_data.get(Stage.PARAM_CMD)\n cls._fill_lock_checksums(stage, lock_data)\n\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader.__getitem___StageLoader.__contains__.return.name_in_self_stages_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_StageLoader.__getitem___StageLoader.__contains__.return.name_in_self_stages_data", "embedding": null, "metadata": {"file_path": "dvc/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 90, "span_ids": ["StageLoader.__iter__", "StageLoader.__contains__", "StageLoader.__getitem__", "StageLoader.__len__"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StageLoader(collections.abc.Mapping):\n\n def __getitem__(self, name):\n if name not in self:\n raise StageNotFound(self.dvcfile.path, name)\n\n if not self.lockfile_data.get(name):\n logger.warning(\n \"No lock entry found for '%s:%s'\", self.dvcfile.relpath, name\n )\n return self.load_stage(\n self.dvcfile,\n name,\n self.stages_data[name],\n self.lockfile_data.get(name, {}),\n )\n\n def __iter__(self):\n return iter(self.stages_data)\n\n def __len__(self):\n return len(self.stages_data)\n\n def __contains__(self, name):\n return name in self.stages_data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_SingleStageLoader_SingleStageLoader.__getitem__.return.self_load_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_SingleStageLoader_SingleStageLoader.__getitem__.return.self_load_stage_", "embedding": null, "metadata": {"file_path": "dvc/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 110, "span_ids": ["SingleStageLoader.__getitem__", "SingleStageLoader", "SingleStageLoader.__init__"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SingleStageLoader(collections.abc.Mapping):\n def __init__(self, dvcfile, stage_data, stage_text=None):\n self.dvcfile = dvcfile\n self.stage_data = stage_data or {}\n self.stage_text = stage_text\n\n def __getitem__(self, item):\n if item:\n logger.warning(\n \"Ignoring name '%s' for single stage in '%s'.\",\n item,\n self.dvcfile,\n )\n # during `load`, we remove attributes from stage data, so as to\n # not duplicate, therefore, for MappingView, we need to deepcopy.\n return self.load_stage(\n self.dvcfile, deepcopy(self.stage_data), self.stage_text\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_SingleStageLoader.load_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/loader.py_SingleStageLoader.load_stage_", "embedding": null, "metadata": {"file_path": "dvc/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 133, "span_ids": ["SingleStageLoader.__len__", "SingleStageLoader.load_stage", "SingleStageLoader.__iter__", "SingleStageLoader.__contains__"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SingleStageLoader(collections.abc.Mapping):\n\n @classmethod\n def load_stage(cls, dvcfile, d, stage_text):\n from dvc.stage import Stage, loads_from\n\n path, wdir = resolve_paths(dvcfile.path, d.get(Stage.PARAM_WDIR))\n stage = loads_from(Stage, dvcfile.repo, path, wdir, d)\n stage._stage_text, stage.tag = stage_text, dvcfile.tag\n stage.deps = dependency.loadd_from(\n stage, d.get(Stage.PARAM_DEPS) or []\n )\n stage.outs = output.loadd_from(stage, d.get(Stage.PARAM_OUTS) or [])\n return stage\n\n def __iter__(self):\n return iter([None])\n\n def __contains__(self, item):\n return False\n\n def __len__(self):\n return 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lockfile.py_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lockfile.py_json_", "embedding": null, "metadata": {"file_path": "dvc/lockfile.py", "file_name": "lockfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 50, "span_ids": ["read", "exists", "imports", "load", "dump", "write", "LockfileCorruptedError.__init__", "LockfileCorruptedError"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import json\n\nfrom typing import TYPE_CHECKING\nfrom collections import OrderedDict\n\nfrom dvc.exceptions import DvcException\nfrom dvc.schema import COMPILED_LOCKFILE_SCHEMA\nfrom voluptuous import MultipleInvalid\n\nif TYPE_CHECKING:\n from dvc.repo import Repo\n\n\nclass LockfileCorruptedError(DvcException):\n def __init__(self, path):\n super().__init__(\"Lockfile '{}' is corrupted.\".format(path))\n\n\ndef exists(repo: \"Repo\", path: str) -> bool:\n return repo.tree.exists(path)\n\n\ndef read(repo: \"Repo\", path: str) -> dict:\n with repo.tree.open(path) as f:\n return json.load(f, object_pairs_hook=OrderedDict)\n\n\ndef write(repo: \"Repo\", path: str, data: dict) -> None:\n with repo.tree.open(path, \"w+\") as f:\n json.dump(data, f)\n\n\ndef load(repo: \"Repo\", path: str) -> dict:\n if not exists(repo, path):\n return {}\n try:\n return COMPILED_LOCKFILE_SCHEMA(read(repo, path))\n except MultipleInvalid:\n raise LockfileCorruptedError(path)\n\n\ndef dump(repo: \"Repo\", path: str, stage_data: dict):\n if not exists(repo, path):\n data = stage_data\n else:\n data = read(repo, path)\n data.update(stage_data)\n\n write(repo, path, COMPILED_LOCKFILE_SCHEMA(data))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_errno_index_locked.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_errno_index_locked.return.wrapper", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 82, "span_ids": ["RemoteMissingDepsError", "imports", "DirCacheError", "RemoteCmdError", "RemoteActionNotImplemented", "RemoteCmdError.__init__", "DirCacheError.__init__", "RemoteActionNotImplemented.__init__", "index_locked"], "tokens": 508}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import errno\nimport hashlib\nimport itertools\nimport json\nimport logging\nimport tempfile\nfrom urllib.parse import urlparse\nfrom concurrent.futures import ThreadPoolExecutor\nfrom copy import copy\nfrom functools import partial, wraps\nfrom multiprocessing import cpu_count\nfrom operator import itemgetter\n\nfrom shortuuid import uuid\n\nimport dvc.prompt as prompt\nfrom dvc.exceptions import (\n CheckoutError,\n DvcException,\n ConfirmRemoveError,\n DvcIgnoreInCollectedDirError,\n RemoteCacheRequiredError,\n)\nfrom dvc.ignore import DvcIgnore\nfrom dvc.path_info import PathInfo, URLInfo, WindowsPathInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.index import RemoteIndex, RemoteIndexNoop\nfrom dvc.remote.slow_link_detection import slow_link_guard\nfrom dvc.state import StateNoop\nfrom dvc.utils import tmp_fname\nfrom dvc.utils.fs import move, makedirs\nfrom dvc.utils.http import open_url\n\nlogger = logging.getLogger(__name__)\n\nSTATUS_OK = 1\nSTATUS_MISSING = 2\nSTATUS_NEW = 3\nSTATUS_DELETED = 4\n\nSTATUS_MAP = {\n # (local_exists, remote_exists)\n (True, True): STATUS_OK,\n (False, False): STATUS_MISSING,\n (True, False): STATUS_NEW,\n (False, True): STATUS_DELETED,\n}\n\n\nclass RemoteCmdError(DvcException):\n def __init__(self, remote, cmd, ret, err):\n super().__init__(\n \"{remote} command '{cmd}' finished with non-zero return code\"\n \" {ret}': {err}\".format(remote=remote, cmd=cmd, ret=ret, err=err)\n )\n\n\nclass RemoteActionNotImplemented(DvcException):\n def __init__(self, action, scheme):\n m = \"{} is not supported for {} remotes\".format(action, scheme)\n super().__init__(m)\n\n\nclass RemoteMissingDepsError(DvcException):\n pass\n\n\nclass DirCacheError(DvcException):\n def __init__(self, checksum):\n super().__init__(\n \"Failed to load dir cache for hash value: '{}'.\".format(checksum)\n )\n\n\ndef index_locked(f):\n @wraps(f)\n def wrapper(remote_obj, *args, **kwargs):\n remote = kwargs.get(\"remote\", remote_obj)\n with remote.index:\n return f(remote_obj, *args, **kwargs)\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.load_dir_cache_RemoteBASE.load_dir_cache.return.d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.load_dir_cache_RemoteBASE.load_dir_cache.return.d", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 294, "end_line": 318, "span_ids": ["RemoteBASE.load_dir_cache"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def load_dir_cache(self, checksum):\n path_info = self.checksum_to_path_info(checksum)\n\n try:\n with self.cache.open(path_info, \"r\") as fobj:\n d = json.load(fobj)\n except (ValueError, FileNotFoundError) as exc:\n raise DirCacheError(checksum) from exc\n\n if not isinstance(d, list):\n logger.error(\n \"dir cache file format error '%s' [skipping the file]\",\n path_info,\n )\n return []\n\n if self.path_cls == WindowsPathInfo:\n # only need to convert it for Windows\n for info in d:\n # NOTE: here is a BUG, see comment to .as_posix() below\n info[self.PARAM_RELPATH] = info[self.PARAM_RELPATH].replace(\n \"/\", self.path_cls.sep\n )\n\n return d", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_dir_checksum_RemoteBASE.save_info.return._self_PARAM_CHECKSUM_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_dir_checksum_RemoteBASE.save_info.return._self_PARAM_CHECKSUM_sel", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 320, "end_line": 356, "span_ids": ["RemoteBASE.is_dir_checksum", "RemoteBASE.get_checksum", "RemoteBASE.save_info"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n @classmethod\n def is_dir_checksum(cls, checksum):\n return checksum.endswith(cls.CHECKSUM_DIR_SUFFIX)\n\n def get_checksum(self, path_info):\n assert path_info.scheme == self.scheme\n\n if not self.exists(path_info):\n return None\n\n checksum = self.state.get(path_info)\n\n # If we have dir checksum in state db, but dir cache file is lost,\n # then we need to recollect the dir via .get_dir_checksum() call below,\n # see https://github.com/iterative/dvc/issues/2219 for context\n if (\n checksum\n and self.is_dir_checksum(checksum)\n and not self.exists(self.cache.checksum_to_path_info(checksum))\n ):\n checksum = None\n\n if checksum:\n return checksum\n\n if self.isdir(path_info):\n checksum = self.get_dir_checksum(path_info)\n else:\n checksum = self.get_file_checksum(path_info)\n\n if checksum:\n self.state.save(path_info, checksum)\n\n return checksum\n\n def save_info(self, path_info):\n return {self.PARAM_CHECKSUM: self.get_checksum(path_info)}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.cache_exists_RemoteBASE.cache_exists.return.list_indexed_checksums_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.cache_exists_RemoteBASE.cache_exists.return.list_indexed_checksums_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 863, "end_line": 952, "span_ids": ["RemoteBASE.cache_exists"], "tokens": 837}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def cache_exists(self, checksums, jobs=None, name=None):\n \"\"\"Check if the given checksums are stored in the remote.\n\n There are two ways of performing this check:\n\n - Traverse method: Get a list of all the files in the remote\n (traversing the cache directory) and compare it with\n the given checksums. Cache entries will be retrieved in parallel\n threads according to prefix (i.e. entries starting with, \"00...\",\n \"01...\", and so on) and a progress bar will be displayed.\n\n - Exists method: For each given checksum, run the `exists`\n method and filter the checksums that aren't on the remote.\n This is done in parallel threads.\n It also shows a progress bar when performing the check.\n\n The reason for such an odd logic is that most of the remotes\n take much shorter time to just retrieve everything they have under\n a certain prefix (e.g. s3, gs, ssh, hdfs). Other remotes that can\n check if particular file exists much quicker, use their own\n implementation of cache_exists (see ssh, local).\n\n Which method to use will be automatically determined after estimating\n the size of the remote cache, and comparing the estimated size with\n len(checksums). To estimate the size of the remote cache, we fetch\n a small subset of cache entries (i.e. entries starting with \"00...\").\n Based on the number of entries in that subset, the size of the full\n cache can be estimated, since the cache is evenly distributed according\n to checksum.\n\n Returns:\n A list with checksums that were found in the remote\n \"\"\"\n # Remotes which do not use traverse prefix should override\n # cache_exists() (see ssh, local)\n assert self.TRAVERSE_PREFIX_LEN >= 2\n\n checksums = set(checksums)\n indexed_checksums = set(self.index.intersection(checksums))\n checksums -= indexed_checksums\n logger.debug(\n \"Matched '{}' indexed checksums\".format(len(indexed_checksums))\n )\n if not checksums:\n return indexed_checksums\n\n if len(checksums) == 1 or not self.CAN_TRAVERSE:\n remote_checksums = self._cache_object_exists(checksums, jobs, name)\n return list(indexed_checksums) + remote_checksums\n\n # Max remote size allowed for us to use traverse method\n remote_size, remote_checksums = self._estimate_cache_size(\n checksums, name\n )\n\n traverse_pages = remote_size / self.LIST_OBJECT_PAGE_SIZE\n # For sufficiently large remotes, traverse must be weighted to account\n # for performance overhead from large lists/sets.\n # From testing with S3, for remotes with 1M+ files, object_exists is\n # faster until len(checksums) is at least 10k~100k\n if remote_size > self.TRAVERSE_THRESHOLD_SIZE:\n traverse_weight = traverse_pages * self.TRAVERSE_WEIGHT_MULTIPLIER\n else:\n traverse_weight = traverse_pages\n if len(checksums) < traverse_weight:\n logger.debug(\n \"Large remote ('{}' checksums < '{}' traverse weight), \"\n \"using object_exists for remaining checksums\".format(\n len(checksums), traverse_weight\n )\n )\n return (\n list(indexed_checksums)\n + list(checksums & remote_checksums)\n + self._cache_object_exists(\n checksums - remote_checksums, jobs, name\n )\n )\n\n logger.debug(\n \"Querying '{}' checksums via traverse\".format(len(checksums))\n )\n remote_checksums = set(\n self._cache_checksums_traverse(\n remote_size, remote_checksums, jobs, name\n )\n )\n return list(indexed_checksums) + list(\n checksums & set(remote_checksums)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_logging_RemoteIndexNoop.intersection.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_logging_RemoteIndexNoop.intersection.return._", "embedding": null, "metadata": {"file_path": "dvc/remote/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["RemoteIndexNoop.update", "RemoteIndexNoop", "RemoteIndexNoop.__init__", "imports", "RemoteIndexNoop.clear", "RemoteIndexNoop.dump", "RemoteIndexNoop.checksums", "RemoteIndexNoop.__iter__", "RemoteIndexNoop.load", "RemoteIndexNoop.intersection", "RemoteIndexNoop.__exit__", "RemoteIndexNoop.dir_checksums", "RemoteIndexNoop.__contains__", "RemoteIndexNoop.__enter__"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport os\nimport sqlite3\nimport threading\n\nfrom funcy import lchunks\n\nfrom dvc.state import _connect_sqlite\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteIndexNoop:\n \"\"\"No-op class for remotes which are not indexed (i.e. local).\"\"\"\n\n def __init__(self, *args, **kwargs):\n pass\n\n def __enter__(self):\n pass\n\n def __exit__(self, typ, value, tbck):\n pass\n\n def __iter__(self):\n return iter([])\n\n def __contains__(self, checksum):\n return False\n\n @staticmethod\n def checksums():\n return []\n\n @staticmethod\n def dir_checksums():\n return []\n\n def load(self):\n pass\n\n def dump(self):\n pass\n\n def clear(self):\n pass\n\n def update(self, *args):\n pass\n\n @staticmethod\n def intersection(*args):\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex_RemoteIndex._executemany.return.self_cursor_executemany_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex_RemoteIndex._executemany.return.self_cursor_executemany_c", "embedding": null, "metadata": {"file_path": "dvc/remote/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 119, "span_ids": ["RemoteIndex.is_dir_checksum", "RemoteIndex._executemany", "RemoteIndex.__exit__", "RemoteIndex.__init__", "RemoteIndex.__iter__", "RemoteIndex.__enter__", "RemoteIndex.checksums", "RemoteIndex.__contains__", "RemoteIndex.dir_checksums", "RemoteIndex._execute", "RemoteIndex"], "tokens": 459}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteIndex:\n \"\"\"Class for indexing remote checksums in a sqlite3 database.\n\n Args:\n repo: repo for this remote index.\n name: name for this index. Index db will be loaded from and saved to\n ``.dvc/tmp/index/{name}.idx``.\n dir_suffix: suffix used for naming directory checksums\n \"\"\"\n\n INDEX_SUFFIX = \".idx\"\n VERSION = 1\n INDEX_TABLE = \"remote_index\"\n INDEX_TABLE_LAYOUT = \"checksum TEXT PRIMARY KEY, \" \"dir INTEGER NOT NULL\"\n\n def __init__(self, repo, name, dir_suffix=\".dir\"):\n self.path = os.path.join(\n repo.index_dir, \"{}{}\".format(name, self.INDEX_SUFFIX)\n )\n\n self.dir_suffix = dir_suffix\n self.database = None\n self.cursor = None\n self.modified = False\n self.lock = threading.Lock()\n\n def __iter__(self):\n cmd = \"SELECT checksum FROM {}\".format(self.INDEX_TABLE)\n for (checksum,) in self._execute(cmd):\n yield checksum\n\n def __enter__(self):\n self.lock.acquire()\n self.load()\n\n def __exit__(self, typ, value, tbck):\n self.dump()\n self.lock.release()\n\n def __contains__(self, checksum):\n cmd = \"SELECT checksum FROM {} WHERE checksum = (?)\".format(\n self.INDEX_TABLE\n )\n self._execute(cmd, (checksum,))\n return self.cursor.fetchone() is not None\n\n def checksums(self):\n \"\"\"Iterate over checksums stored in the index.\"\"\"\n return iter(self)\n\n def dir_checksums(self):\n \"\"\"Iterate over .dir checksums stored in the index.\"\"\"\n cmd = \"SELECT checksum FROM {} WHERE dir = 1\".format(self.INDEX_TABLE)\n for (checksum,) in self._execute(cmd):\n yield checksum\n\n def is_dir_checksum(self, checksum):\n return checksum.endswith(self.dir_suffix)\n\n def _execute(self, cmd, parameters=()):\n return self.cursor.execute(cmd, parameters)\n\n def _executemany(self, cmd, seq_of_parameters):\n return self.cursor.executemany(cmd, seq_of_parameters)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex._prepare_db_RemoteIndex._prepare_db.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex._prepare_db_RemoteIndex._prepare_db.None_1", "embedding": null, "metadata": {"file_path": "dvc/remote/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 145, "span_ids": ["RemoteIndex._prepare_db"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteIndex:\n\n def _prepare_db(self, empty=False):\n if not empty:\n cmd = \"PRAGMA user_version;\"\n self._execute(cmd)\n ret = self.cursor.fetchall()\n assert len(ret) == 1\n assert len(ret[0]) == 1\n assert isinstance(ret[0][0], int)\n version = ret[0][0]\n\n if version != self.VERSION:\n logger.error(\n \"Index file version '{}' will be reformatted \"\n \"to the current version '{}'.\".format(\n version, self.VERSION,\n )\n )\n cmd = \"DROP TABLE IF EXISTS {};\"\n self._execute(cmd.format(self.INDEX_TABLE))\n\n cmd = \"CREATE TABLE IF NOT EXISTS {} ({})\"\n self._execute(cmd.format(self.INDEX_TABLE, self.INDEX_TABLE_LAYOUT))\n\n cmd = \"PRAGMA user_version = {};\"\n self._execute(cmd.format(self.VERSION))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.load_RemoteIndex.load.while_True_.try_.except_sqlite3_DatabaseEr.if_retries_0_.else_.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.load_RemoteIndex.load.while_True_.try_.except_sqlite3_DatabaseEr.if_retries_0_.else_.raise", "embedding": null, "metadata": {"file_path": "dvc/remote/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 147, "end_line": 170, "span_ids": ["RemoteIndex.load"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteIndex:\n\n def load(self):\n \"\"\"(Re)load this index database.\"\"\"\n retries = 1\n while True:\n assert self.database is None\n assert self.cursor is None\n\n empty = not os.path.isfile(self.path)\n self.database = _connect_sqlite(self.path, {\"nolock\": 1})\n self.cursor = self.database.cursor()\n\n try:\n self._prepare_db(empty=empty)\n return\n except sqlite3.DatabaseError:\n self.cursor.close()\n self.database.close()\n self.database = None\n self.cursor = None\n if retries > 0:\n os.unlink(self.path)\n retries -= 1\n else:\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.dump_RemoteIndex.update.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.dump_RemoteIndex.update.None_1", "embedding": null, "metadata": {"file_path": "dvc/remote/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 203, "span_ids": ["RemoteIndex.update", "RemoteIndex.clear", "RemoteIndex.dump"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteIndex:\n\n def dump(self):\n \"\"\"Save this index database.\"\"\"\n assert self.database is not None\n\n self.database.commit()\n self.cursor.close()\n self.database.close()\n self.database = None\n self.cursor = None\n\n def clear(self):\n \"\"\"Clear this index (to force re-indexing later).\n\n Changes to the index will not committed until dump() is called.\n \"\"\"\n cmd = \"DELETE FROM {}\".format(self.INDEX_TABLE)\n self._execute(cmd)\n\n def update(self, dir_checksums, file_checksums):\n \"\"\"Update this index, adding the specified checksums.\n\n Changes to the index will not committed until dump() is called.\n \"\"\"\n cmd = \"INSERT OR IGNORE INTO {} (checksum, dir) VALUES (?, ?)\".format(\n self.INDEX_TABLE\n )\n self._executemany(\n cmd, ((checksum, True) for checksum in dir_checksums)\n )\n self._executemany(\n cmd, ((checksum, False) for checksum in file_checksums)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.intersection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.intersection_", "embedding": null, "metadata": {"file_path": "dvc/remote/index.py", "file_name": "index.py", "file_type": "text/x-python", "category": "implementation", "start_line": 205, "end_line": 215, "span_ids": ["RemoteIndex.intersection"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteIndex:\n\n def intersection(self, checksums):\n \"\"\"Iterate over values from `checksums` which exist in the index.\"\"\"\n # sqlite has a compile time limit of 999, see:\n # https://www.sqlite.org/c3ref/c_limit_attached.html#sqlitelimitvariablenumber\n for chunk in lchunks(999, checksums):\n cmd = \"SELECT checksum FROM {} WHERE checksum IN ({})\".format(\n self.INDEX_TABLE, \",\".join(\"?\" for checksum in chunk)\n )\n for (checksum,) in self._execute(cmd, chunk):\n yield checksum", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.is_hardlink_RemoteLOCAL.status.return.dict_dir_status_file_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.is_hardlink_RemoteLOCAL.status.return.dict_dir_status_file_s", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 215, "end_line": 278, "span_ids": ["RemoteLOCAL._upload", "RemoteLOCAL.cache_exists", "RemoteLOCAL._download", "RemoteLOCAL.open", "RemoteLOCAL.status", "RemoteLOCAL.is_hardlink", "RemoteLOCAL.reflink"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n @staticmethod\n def is_hardlink(path_info):\n return System.is_hardlink(path_info)\n\n def reflink(self, from_info, to_info):\n tmp_info = to_info.parent / tmp_fname(to_info.name)\n System.reflink(from_info, tmp_info)\n # NOTE: reflink has its own separate inode, so you can set permissions\n # that are different from the source.\n os.chmod(fspath_py35(tmp_info), self._file_mode)\n os.rename(fspath_py35(tmp_info), fspath_py35(to_info))\n\n def cache_exists(self, checksums, jobs=None, name=None):\n return [\n checksum\n for checksum in Tqdm(\n checksums,\n unit=\"file\",\n desc=\"Querying \"\n + (\"cache in \" + name if name else \"local cache\"),\n )\n if not self.changed_cache_file(checksum)\n ]\n\n def _upload(\n self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs\n ):\n makedirs(to_info.parent, exist_ok=True)\n\n tmp_file = tmp_fname(to_info)\n copyfile(\n from_file, tmp_file, name=name, no_progress_bar=no_progress_bar\n )\n os.rename(tmp_file, fspath_py35(to_info))\n\n def _download(\n self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs\n ):\n copyfile(\n from_info, to_file, no_progress_bar=no_progress_bar, name=name\n )\n\n @staticmethod\n def open(path_info, mode=\"r\", encoding=None):\n return open(fspath_py35(path_info), mode=mode, encoding=encoding)\n\n @index_locked\n def status(\n self,\n named_cache,\n remote,\n jobs=None,\n show_checksums=False,\n download=False,\n ):\n # Return flattened dict containing all status info\n dir_status, file_status, _ = self._status(\n named_cache,\n remote,\n jobs=jobs,\n show_checksums=show_checksums,\n download=download,\n )\n return dict(dir_status, **file_status)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._status_RemoteLOCAL._status.return.self__make_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._status_RemoteLOCAL._status.return.self__make_status_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 328, "span_ids": ["RemoteLOCAL._status"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _status(\n self,\n named_cache,\n remote,\n jobs=None,\n show_checksums=False,\n download=False,\n ):\n \"\"\"Return a tuple of (dir_status_info, file_status_info, dir_mapping).\n\n dir_status_info contains status for .dir files, file_status_info\n contains status for all other files, and dir_mapping is a dict of\n {dir_path_info: set(file_path_info...)} which can be used to map\n a .dir file to its file contents.\n \"\"\"\n logger.debug(\n \"Preparing to collect status from {}\".format(remote.path_info)\n )\n md5s = set(named_cache.scheme_keys(self.scheme))\n\n logger.debug(\"Collecting information from local cache...\")\n local_exists = frozenset(\n self.cache_exists(md5s, jobs=jobs, name=self.cache_dir)\n )\n\n # This is a performance optimization. We can safely assume that,\n # if the resources that we want to fetch are already cached,\n # there's no need to check the remote storage for the existence of\n # those files.\n if download and local_exists == md5s:\n remote_exists = local_exists\n else:\n logger.debug(\"Collecting information from remote cache...\")\n remote_exists = set()\n dir_md5s = set(named_cache.dir_keys(self.scheme))\n if dir_md5s:\n remote_exists.update(\n self._indexed_dir_checksums(named_cache, remote, dir_md5s)\n )\n md5s.difference_update(remote_exists)\n if md5s:\n remote_exists.update(\n remote.cache_exists(\n md5s, jobs=jobs, name=str(remote.path_info)\n )\n )\n return self._make_status(\n named_cache, remote, show_checksums, local_exists, remote_exists\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._make_status_RemoteLOCAL._make_status.return.dir_status_file_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._make_status_RemoteLOCAL._make_status.return.dir_status_file_status_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 330, "end_line": 359, "span_ids": ["RemoteLOCAL._make_status"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _make_status(\n self, named_cache, remote, show_checksums, local_exists, remote_exists\n ):\n def make_names(checksum, names):\n return {\"name\": checksum if show_checksums else \" \".join(names)}\n\n dir_status = {}\n file_status = {}\n dir_paths = {}\n for checksum, item in named_cache[self.scheme].items():\n if item.children:\n dir_status[checksum] = make_names(checksum, item.names)\n file_status.update(\n {\n child_checksum: make_names(child_checksum, child.names)\n for child_checksum, child in item.children.items()\n }\n )\n dir_paths[remote.checksum_to_path_info(checksum)] = frozenset(\n map(remote.checksum_to_path_info, item.child_keys())\n )\n else:\n file_status[checksum] = make_names(checksum, item.names)\n\n self._fill_statuses(dir_status, local_exists, remote_exists)\n self._fill_statuses(file_status, local_exists, remote_exists)\n\n self._log_missing_caches(dict(dir_status, **file_status))\n\n return dir_status, file_status, dir_paths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._indexed_dir_checksums_RemoteLOCAL._indexed_dir_checksums.for_dir_checksum_in_dir_e.yield_from_file_checksums": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._indexed_dir_checksums_RemoteLOCAL._indexed_dir_checksums.for_dir_checksum_in_dir_e.yield_from_file_checksums", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 396, "span_ids": ["RemoteLOCAL._indexed_dir_checksums"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _indexed_dir_checksums(self, named_cache, remote, dir_md5s):\n # Validate our index by verifying all indexed .dir checksums\n # still exist on the remote\n indexed_dirs = set(remote.index.dir_checksums())\n indexed_dir_exists = set()\n if indexed_dirs:\n indexed_dir_exists.update(\n remote._cache_object_exists(indexed_dirs)\n )\n missing_dirs = indexed_dirs.difference(indexed_dir_exists)\n if missing_dirs:\n logger.debug(\n \"Remote cache missing indexed .dir checksums '{}', \"\n \"clearing remote index\".format(\", \".join(missing_dirs))\n )\n remote.index.clear()\n\n # Check if non-indexed (new) dir checksums exist on remote\n dir_exists = dir_md5s.intersection(indexed_dir_exists)\n dir_exists.update(remote._cache_object_exists(dir_md5s - dir_exists))\n\n # If .dir checksum exists on the remote, assume directory contents\n # still exists on the remote\n for dir_checksum in dir_exists:\n file_checksums = list(\n named_cache.child_keys(self.scheme, dir_checksum)\n )\n if dir_checksum not in remote.index:\n logger.debug(\n \"Indexing new .dir '{}' with '{}' nested files\".format(\n dir_checksum, len(file_checksums)\n )\n )\n remote.index.update([dir_checksum], file_checksums)\n yield dir_checksum\n yield from file_checksums", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_dir_plans_0_len_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_dir_plans_0_len_f", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 429, "end_line": 528, "span_ids": ["RemoteLOCAL._process"], "tokens": 635}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def _process(\n self,\n named_cache,\n remote,\n jobs=None,\n show_checksums=False,\n download=False,\n ):\n logger.debug(\n \"Preparing to {} '{}'\".format(\n \"download data from\" if download else \"upload data to\",\n remote.path_info,\n )\n )\n\n if download:\n func = partial(\n remote.download,\n dir_mode=self._dir_mode,\n file_mode=self._file_mode,\n )\n status = STATUS_DELETED\n else:\n func = remote.upload\n status = STATUS_NEW\n\n if jobs is None:\n jobs = remote.JOBS\n\n dir_status, file_status, dir_paths = self._status(\n named_cache,\n remote,\n jobs=jobs,\n show_checksums=show_checksums,\n download=download,\n )\n\n dir_plans = self._get_plans(download, remote, dir_status, status)\n file_plans = self._get_plans(download, remote, file_status, status)\n\n if len(dir_plans[0]) + len(file_plans[0]) == 0:\n return 0\n\n with ThreadPoolExecutor(max_workers=jobs) as executor:\n if download:\n fails = sum(executor.map(func, *dir_plans))\n fails += sum(executor.map(func, *file_plans))\n else:\n # for uploads, push files first, and any .dir files last\n\n file_futures = {}\n for from_info, to_info, name in zip(*file_plans):\n file_futures[to_info] = executor.submit(\n func, from_info, to_info, name\n )\n dir_futures = {}\n for from_info, to_info, name in zip(*dir_plans):\n wait_futures = {\n future\n for file_path, future in file_futures.items()\n if file_path in dir_paths[to_info]\n }\n dir_futures[to_info] = executor.submit(\n self._dir_upload,\n func,\n wait_futures,\n from_info,\n to_info,\n name,\n )\n fails = sum(\n future.result()\n for future in concat(\n file_futures.values(), dir_futures.values()\n )\n )\n\n if fails:\n if download:\n remote.index.clear()\n raise DownloadError(fails)\n raise UploadError(fails)\n\n if not download:\n # index successfully pushed dirs\n for to_info, future in dir_futures.items():\n if future.result() == 0:\n dir_checksum = remote.path_to_checksum(str(to_info))\n file_checksums = list(\n named_cache.child_keys(self.scheme, dir_checksum)\n )\n logger.debug(\n \"Indexing pushed dir '{}' with \"\n \"'{}' nested files\".format(\n dir_checksum, len(file_checksums)\n )\n )\n remote.index.update([dir_checksum], file_checksums)\n\n return len(dir_plans[0]) + len(file_plans[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._dir_upload_RemoteLOCAL._dir_upload.return.func_from_info_to_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._dir_upload_RemoteLOCAL._dir_upload.return.func_from_info_to_info_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 530, "end_line": 544, "span_ids": ["RemoteLOCAL._dir_upload"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n @staticmethod\n def _dir_upload(func, futures, from_info, to_info, name):\n for future in as_completed(futures):\n if future.result():\n # do not upload this .dir file if any file in this\n # directory failed to upload\n logger.debug(\n \"failed to upload full contents of '{}', \"\n \"aborting .dir file upload\".format(name)\n )\n logger.error(\n \"failed to upload '{}' to '{}'\".format(from_info, to_info)\n )\n return 1\n return func(from_info, to_info, name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.push_RemoteLOCAL.pull.return.self__process_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.push_RemoteLOCAL.pull.return.self__process_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 546, "end_line": 564, "span_ids": ["RemoteLOCAL.push", "RemoteLOCAL.pull"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n @index_locked\n def push(self, named_cache, remote, jobs=None, show_checksums=False):\n return self._process(\n named_cache,\n remote,\n jobs=jobs,\n show_checksums=show_checksums,\n download=False,\n )\n\n @index_locked\n def pull(self, named_cache, remote, jobs=None, show_checksums=False):\n return self._process(\n named_cache,\n remote,\n jobs=jobs,\n show_checksums=show_checksums,\n download=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._log_missing_caches_RemoteLOCAL._log_missing_caches.if_missing_caches_.logger_warning_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._log_missing_caches_RemoteLOCAL._log_missing_caches.if_missing_caches_.logger_warning_msg_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 566, "end_line": 582, "span_ids": ["RemoteLOCAL._log_missing_caches"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n @staticmethod\n def _log_missing_caches(checksum_info_dict):\n missing_caches = [\n (md5, info)\n for md5, info in checksum_info_dict.items()\n if info[\"status\"] == STATUS_MISSING\n ]\n if missing_caches:\n missing_desc = \"\".join(\n \"\\nname: {}, md5: {}\".format(info[\"name\"], md5)\n for md5, info in missing_caches\n )\n msg = (\n \"Some of the cache files do not exist neither locally \"\n \"nor on remote. Missing cache files: {}\".format(missing_desc)\n )\n logger.warning(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.check_modified_graph_Repo.check_modified_graph.if_not_getattr_self__sk.self__collect_graph_old_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.check_modified_graph_Repo.check_modified_graph.if_not_getattr_self__sk.self__collect_graph_old_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 193, "span_ids": ["Repo.check_modified_graph"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def check_modified_graph(self, new_stages, old_stages=None):\n \"\"\"Generate graph including the new stage to check for errors\"\"\"\n # Building graph might be costly for the ones with many DVC-files,\n # so we provide this undocumented hack to skip it. See [1] for\n # more details. The hack can be used as:\n #\n # repo = Repo(...)\n # repo._skip_graph_checks = True\n # repo.add(...)\n #\n # A user should care about not duplicating outs and not adding cycles,\n # otherwise DVC might have an undefined behaviour.\n #\n # [1] https://github.com/iterative/dvc/issues/2671\n if not getattr(self, \"_skip_graph_checks\", False):\n self._collect_graph((old_stages or self.stages) + new_stages)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_inside_Repo.collect_for_pipelines.return._dvcfile_stages_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_inside_Repo.collect_for_pipelines.return._dvcfile_stages_name_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 215, "span_ids": ["Repo._collect_inside", "Repo.collect_for_pipelines"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def _collect_inside(self, path, graph):\n import networkx as nx\n\n stages = nx.dfs_postorder_nodes(graph or self.pipeline_graph)\n return [stage for stage in stages if path_isin(stage.path, path)]\n\n def collect_for_pipelines(\n self, path=None, name=None, recursive=False, graph=None\n ):\n from ..dvcfile import Dvcfile\n\n if not path:\n return list(graph) if graph else self.pipeline_stages\n\n path = os.path.abspath(path)\n if recursive and os.path.isdir(path):\n return self._collect_inside(path, graph or self.pipeline_graph)\n\n dvcfile = Dvcfile(self, path)\n dvcfile.check_file_exists()\n return [dvcfile.stages[name]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.graph_Repo.pipeline_graph.return.self__collect_graph_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.graph_Repo.pipeline_graph.return.self__collect_graph_self_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 416, "end_line": 443, "span_ids": ["Repo.pipeline_graph", "Repo.graph", "Repo.pipelines", "Repo.pipeline_stages", "Repo.stages"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n @cached_property\n def graph(self):\n return self._collect_graph(self.stages)\n\n @cached_property\n def pipelines(self):\n return get_pipelines(self.pipeline_graph)\n\n @cached_property\n def stages(self):\n \"\"\"\n Walks down the root directory looking for Dvcfiles,\n skipping the directories that are related with\n any SCM (e.g. `.git`), DVC itself (`.dvc`), or directories\n tracked by DVC (e.g. `dvc add data` would skip `data/`)\n\n NOTE: For large repos, this could be an expensive\n operation. Consider using some memoization.\n \"\"\"\n return self._collect_stages()[0]\n\n @cached_property\n def pipeline_stages(self):\n return self._collect_stages()[1]\n\n @cached_property\n def pipeline_graph(self):\n return self._collect_graph(self.pipeline_stages)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_stages_Repo._collect_stages.return.output_stages_pipeline_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_stages_Repo._collect_stages.return.output_stages_pipeline_s", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 445, "end_line": 488, "span_ids": ["Repo._collect_stages"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def _collect_stages(self):\n from dvc.dvcfile import Dvcfile\n from dvc.stage import PipelineStage\n\n pipeline_stages = []\n output_stages = []\n ignored_outs = set()\n outs = set()\n\n for root, dirs, files in self.tree.walk(self.root_dir):\n for fname in files:\n path = os.path.join(root, fname)\n if not Dvcfile.is_valid_filename(path):\n continue\n dvcfile = Dvcfile(self, path)\n for stage in dvcfile.stages.values():\n if isinstance(stage, PipelineStage):\n ignored_outs.update(\n out.path_info for out in stage.outs\n )\n pipeline_stages.append(stage)\n else:\n # Old single-stages are used for both\n # outputs and pipelines.\n output_stages.append(stage)\n\n outs.update(\n out.fspath\n for out in stage.outs\n if out.scheme == \"local\"\n )\n\n dirs[:] = [d for d in dirs if os.path.join(root, d) not in outs]\n\n # DVC files are generated by multi-stage for data management.\n # We need to ignore those stages for pipelines_stages, but still\n # should be collected for output stages.\n pipeline_stages.extend(\n stage\n for stage in output_stages\n if not stage.outs\n or all(out.path_info not in ignored_outs for out in stage.outs)\n )\n return output_stages, pipeline_stages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp_url.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp_url.py_os_", "embedding": null, "metadata": {"file_path": "dvc/repo/imp_url.py", "file_name": "imp_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 47, "span_ids": ["imports", "imp_url"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom . import locked as locked_repo\nfrom dvc.repo.scm_context import scm_context\nfrom dvc.utils import resolve_output, resolve_paths, relpath\nfrom dvc.utils.fs import path_isin\n\n\n@locked_repo\n@scm_context\ndef imp_url(self, url, out=None, fname=None, erepo=None, locked=True):\n from dvc.dvcfile import Dvcfile\n from dvc.stage import Stage, create_stage\n\n out = resolve_output(url, out)\n path, wdir, out = resolve_paths(self, out)\n\n # NOTE: when user is importing something from within his own repository\n if os.path.exists(url) and path_isin(os.path.abspath(url), self.root_dir):\n url = relpath(url, wdir)\n\n stage = create_stage(\n Stage,\n self,\n fname or path,\n wdir=wdir,\n deps=[url],\n outs=[out],\n erepo=erepo,\n )\n\n if stage is None:\n return None\n\n dvcfile = Dvcfile(self, stage.path)\n dvcfile.remove_with_prompt(force=True)\n\n self.check_modified_graph([stage])\n\n stage.run()\n\n stage.locked = locked\n\n dvcfile.dump(stage)\n\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/ls.py_from_dvc_path_info_import_ls.with_external_repo_url_r.return.ret_list": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/ls.py_from_dvc_path_info_import_ls.with_external_repo_url_r.return.ret_list", "embedding": null, "metadata": {"file_path": "dvc/repo/ls.py", "file_name": "ls.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 56, "span_ids": ["imports", "ls"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.path_info import PathInfo\nfrom dvc.exceptions import PathMissingError\n\n\n@staticmethod\ndef ls(\n url, path=None, rev=None, recursive=None, outs_only=False,\n):\n \"\"\"Methods for getting files and outputs for the repo.\n\n Args:\n url (str): the repo url\n path (str, optional): relative path into the repo\n rev (str, optional): SHA commit, branch or tag name\n recursive (bool, optional): recursively walk the repo\n outs_only (bool, optional): show only DVC-artifacts\n\n Returns:\n list of `entry`\n\n Notes:\n `entry` is a dictionary with structure\n {\n \"path\": str,\n \"isout\": bool,\n \"isdir\": bool,\n \"isexec\": bool,\n }\n \"\"\"\n from dvc.external_repo import external_repo\n from dvc.repo import Repo\n\n with external_repo(url, rev) as repo:\n path_info = PathInfo(repo.root_dir)\n if path:\n path_info /= path\n\n ret = {}\n if isinstance(repo, Repo):\n ret = _ls(repo, path_info, recursive, True)\n\n nondvc = {}\n if not outs_only:\n nondvc = _ls(repo, path_info, recursive, False)\n\n ret.update(nondvc)\n\n if path and not ret:\n raise PathMissingError(path, repo, output_only=outs_only)\n\n ret_list = []\n for path, info in ret.items():\n info[\"path\"] = path\n ret_list.append(info)\n ret_list.sort(key=lambda f: f[\"path\"])\n return ret_list", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/ls.py__ls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/ls.py__ls_", "embedding": null, "metadata": {"file_path": "dvc/repo/ls.py", "file_name": "ls.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 103, "span_ids": ["_ls"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _ls(repo, path_info, recursive=None, dvc=False):\n from dvc.ignore import CleanTree\n from dvc.repo.tree import DvcTree\n from dvc.scm.tree import WorkingTree\n\n if dvc:\n tree = DvcTree(repo)\n else:\n tree = CleanTree(WorkingTree(repo.root_dir))\n\n ret = {}\n try:\n for root, dirs, files in tree.walk(path_info.fspath):\n for fname in files:\n info = PathInfo(root) / fname\n path = str(info.relative_to(path_info))\n ret[path] = {\n \"isout\": dvc,\n \"isdir\": False,\n \"isexec\": False if dvc else tree.isexec(info.fspath),\n }\n\n if not recursive:\n for dname in dirs:\n info = PathInfo(root) / dname\n path = str(info.relative_to(path_info))\n ret[path] = {\n \"isout\": tree.isdvc(info.fspath) if dvc else False,\n \"isdir\": True,\n \"isexec\": False if dvc else tree.isexec(info.fspath),\n }\n break\n except NotADirectoryError:\n return {\n path_info.name: {\n \"isout\": dvc,\n \"isdir\": False,\n \"isexec\": False if dvc else tree.isexec(path_info.fspath),\n }\n }\n except FileNotFoundError:\n return {}\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/diff.py_from_dvc_utils_diff_impor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/diff.py_from_dvc_utils_diff_impor_", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["imports", "_get_metrics", "diff"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.utils.diff import format_dict, diff as _diff\nfrom dvc.exceptions import NoMetricsError\n\n\ndef _get_metrics(repo, *args, rev=None, **kwargs):\n try:\n metrics = repo.metrics.show(\n *args, **kwargs, revs=[rev] if rev else None\n )\n return metrics.get(rev or \"\", {})\n except NoMetricsError:\n return {}\n\n\ndef diff(repo, *args, a_rev=None, b_rev=None, **kwargs):\n with_unchanged = kwargs.pop(\"all\", False)\n\n old = _get_metrics(repo, *args, **kwargs, rev=(a_rev or \"HEAD\"))\n new = _get_metrics(repo, *args, **kwargs, rev=b_rev)\n\n return _diff(\n format_dict(old), format_dict(new), with_unchanged=with_unchanged\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/modify.py_from_dvc_dvcfile_import_D_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/modify.py_from_dvc_dvcfile_import_D_", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/modify.py", "file_name": "modify.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["imports", "modify"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dvcfile import Dvcfile\nfrom dvc.exceptions import DvcException\nfrom dvc.repo import locked\n\n\n@locked\ndef modify(repo, path, delete=False):\n outs = repo.find_outs_by_path(path)\n assert len(outs) == 1\n out = outs[0]\n\n if out.scheme != \"local\":\n msg = \"output '{}' scheme '{}' is not supported for metrics\"\n raise DvcException(msg.format(out.path, out.path_info.scheme))\n\n if delete:\n out.metric = None\n\n out.verify_metric()\n\n dvcfile = Dvcfile(repo, out.stage.path)\n dvcfile.dump(out.stage)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_yaml__collect_metrics.return.list_filter__filter_metr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_yaml__collect_metrics.return.list_filter__filter_metr", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 37, "span_ids": ["imports", "_collect_metrics"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import yaml\nimport logging\nimport os\n\nfrom dvc.path_info import PathInfo\nfrom dvc.compat import fspath_py35\nfrom dvc.exceptions import NoMetricsError\nfrom dvc.repo import locked\nfrom dvc.repo.tree import RepoTree\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _collect_metrics(repo, targets, recursive):\n metrics = set()\n\n for stage in repo.stages:\n for out in stage.outs:\n if not out.metric:\n continue\n\n metrics.add(out.path_info)\n\n if not targets:\n return list(metrics)\n\n target_infos = [PathInfo(os.path.abspath(target)) for target in targets]\n\n def _filter(path_info):\n for info in target_infos:\n func = path_info.isin_or_eq if recursive else path_info.__eq__\n if func(info):\n return True\n return False\n\n return list(filter(_filter, metrics))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__extract_metrics__read_metrics.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__extract_metrics__read_metrics.return.res", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 78, "span_ids": ["_read_metrics", "_extract_metrics"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _extract_metrics(metrics):\n if isinstance(metrics, (int, float)):\n return metrics\n\n if not isinstance(metrics, dict):\n return None\n\n ret = {}\n for key, val in metrics.items():\n m = _extract_metrics(val)\n if m:\n ret[key] = m\n\n return ret\n\n\ndef _read_metrics(repo, metrics, rev):\n tree = RepoTree(repo)\n\n res = {}\n for metric in metrics:\n if not tree.exists(fspath_py35(metric)):\n continue\n\n with tree.open(fspath_py35(metric), \"r\") as fobj:\n try:\n # NOTE this also supports JSON\n val = yaml.safe_load(fobj)\n except yaml.YAMLError:\n logger.debug(\n \"failed to read '%s' on '%s'\", metric, rev, exc_info=True\n )\n continue\n\n val = _extract_metrics(val)\n if val:\n res[str(metric)] = val\n\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/diff.py_from_dvc_utils_diff_impor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/diff.py_from_dvc_utils_diff_impor_", "embedding": null, "metadata": {"file_path": "dvc/repo/params/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["_get_params", "imports", "diff"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.utils.diff import format_dict, diff as _diff\nfrom .show import NoParamsError\n\n\ndef _get_params(repo, *args, rev=None, **kwargs):\n try:\n params = repo.params.show(*args, **kwargs, revs=[rev] if rev else None)\n return params.get(rev or \"\", {})\n except NoParamsError:\n return {}\n\n\ndef diff(repo, *args, a_rev=None, b_rev=None, **kwargs):\n with_unchanged = kwargs.pop(\"all\", False)\n\n old = _get_params(repo, *args, **kwargs, rev=(a_rev or \"HEAD\"))\n new = _get_params(repo, *args, **kwargs, rev=b_rev)\n\n return _diff(\n format_dict(old), format_dict(new), with_unchanged=with_unchanged\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/show.py_yaml__read_params.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/show.py_yaml__read_params.return.res", "embedding": null, "metadata": {"file_path": "dvc/repo/params/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["NoParamsError", "imports", "_collect_configs", "_read_params"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import yaml\nimport logging\n\nfrom dvc.repo import locked\nfrom dvc.path_info import PathInfo\nfrom dvc.compat import fspath_py35\nfrom dvc.exceptions import DvcException\nfrom dvc.dependency.param import DependencyPARAMS\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass NoParamsError(DvcException):\n pass\n\n\ndef _collect_configs(repo):\n configs = set()\n configs.add(PathInfo(repo.root_dir) / DependencyPARAMS.DEFAULT_PARAMS_FILE)\n for stage in repo.stages:\n for dep in stage.deps:\n if not isinstance(dep, DependencyPARAMS):\n continue\n\n configs.add(dep.path_info)\n return list(configs)\n\n\ndef _read_params(repo, configs, rev):\n res = {}\n for config in configs:\n if not repo.tree.exists(fspath_py35(config)):\n continue\n\n with repo.tree.open(fspath_py35(config), \"r\") as fobj:\n try:\n res[str(config)] = yaml.safe_load(fobj)\n except yaml.YAMLError:\n logger.debug(\n \"failed to read '%s' on '%s'\", config, rev, exc_info=True\n )\n continue\n\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_reproduce_reproduce.return._reproduce_stages_active_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_reproduce_reproduce.return._reproduce_stages_active_", "embedding": null, "metadata": {"file_path": "dvc/repo/reproduce.py", "file_name": "reproduce.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 98, "span_ids": ["reproduce"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@locked\n@scm_context\ndef reproduce(\n self,\n target=None,\n recursive=False,\n pipeline=False,\n all_pipelines=False,\n **kwargs\n):\n from ..dvcfile import Dvcfile\n from dvc.utils import parse_target\n\n if not target and not all_pipelines:\n raise InvalidArgumentError(\n \"Neither `target` nor `--all-pipelines` are specified.\"\n )\n\n interactive = kwargs.get(\"interactive\", False)\n if not interactive:\n kwargs[\"interactive\"] = self.config[\"core\"].get(\"interactive\", False)\n\n active_graph = _get_active_graph(self.pipeline_graph)\n active_pipelines = get_pipelines(active_graph)\n\n path, name = parse_target(target)\n if pipeline or all_pipelines:\n if all_pipelines:\n pipelines = active_pipelines\n else:\n dvcfile = Dvcfile(self, path)\n stage = dvcfile.stages[name]\n pipelines = [get_pipeline(active_pipelines, stage)]\n\n targets = []\n for pipeline in pipelines:\n for stage in pipeline:\n if pipeline.in_degree(stage) == 0:\n targets.append(stage)\n else:\n targets = self.collect_for_pipelines(\n path, name=name, recursive=recursive, graph=active_graph\n )\n\n return _reproduce_stages(active_graph, targets, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_os__get_file_path.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_os__get_file_path.return._", "embedding": null, "metadata": {"file_path": "dvc/repo/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["imports", "_get_file_path"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom . import locked\nfrom .scm_context import scm_context\nfrom ..exceptions import DvcException\nfrom ..utils import relpath\n\nfrom funcy import first, concat\n\n\ndef _get_file_path(**kwargs):\n from dvc.dvcfile import DVC_FILE_SUFFIX, DVC_FILE\n\n out = first(\n concat(\n kwargs.get(\"outs\", []),\n kwargs.get(\"outs_no_cache\", []),\n kwargs.get(\"metrics\", []),\n kwargs.get(\"metrics_no_cache\", []),\n kwargs.get(\"outs_persist\", []),\n kwargs.get(\"outs_persist_no_cache\", []),\n )\n )\n\n return (\n os.path.basename(os.path.normpath(out)) + DVC_FILE_SUFFIX\n if out\n else DVC_FILE\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_run_", "embedding": null, "metadata": {"file_path": "dvc/repo/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 63, "span_ids": ["run"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@locked\n@scm_context\ndef run(self, fname=None, no_exec=False, **kwargs):\n from dvc.stage import PipelineStage, Stage, create_stage\n from dvc.dvcfile import DVC_FILE, Dvcfile\n\n stage_cls, path = PipelineStage, fname or DVC_FILE\n if not kwargs.get(\"name\"):\n kwargs.pop(\"name\", None)\n stage_cls, path = Stage, fname or _get_file_path(**kwargs)\n\n stage = create_stage(stage_cls, repo=self, path=path, **kwargs)\n if stage is None:\n return None\n\n dvcfile = Dvcfile(self, path)\n if dvcfile.exists() and not dvcfile.is_multi_stage():\n if stage_cls == PipelineStage:\n raise DvcException(\n \"'{}' is a single-stage dvcfile. Please use \"\n \"`-f ` and try again.`.\".format(\n relpath(dvcfile.path)\n )\n )\n dvcfile.remove_with_prompt(force=kwargs.get(\"overwrite\", True))\n\n self.check_modified_graph([stage], self.pipeline_stages)\n if not no_exec:\n stage.run(no_commit=kwargs.get(\"no_commit\", False))\n dvcfile.dump(stage, update_dvcfile=True)\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_os_DvcTree.open.return.open_out_cache_path_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_os_DvcTree.open.return.open_out_cache_path_mode", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["DvcTree.__init__", "DvcTree.open", "imports", "DvcTree._find_outs", "DvcTree"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport errno\n\nfrom dvc.scm.tree import BaseTree, WorkingTree\nfrom dvc.path_info import PathInfo\nfrom dvc.exceptions import OutputNotFoundError\n\n\nclass DvcTree(BaseTree):\n def __init__(self, repo):\n self.repo = repo\n\n def _find_outs(self, path, *args, **kwargs):\n outs = self.repo.find_outs_by_path(path, *args, **kwargs)\n\n def _is_cached(out):\n return out.use_cache\n\n outs = list(filter(_is_cached, outs))\n if not outs:\n raise OutputNotFoundError(path, self.repo)\n\n return outs\n\n def open(self, path, mode=\"r\", encoding=\"utf-8\"):\n try:\n outs = self._find_outs(path, strict=False)\n except OutputNotFoundError as exc:\n raise FileNotFoundError from exc\n\n if len(outs) != 1 or outs[0].is_dir_checksum:\n raise IOError(errno.EISDIR)\n\n out = outs[0]\n # temporary hack to make cache use WorkingTree and not GitTree, because\n # cache dir doesn't exist in the latter.\n saved_tree = self.repo.tree\n self.repo.tree = WorkingTree(self.repo.root_dir)\n try:\n if out.changed_cache():\n raise FileNotFoundError\n finally:\n self.repo.tree = saved_tree\n\n return open(out.cache_path, mode=mode, encoding=encoding)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.exists_DvcTree.isfile.return.not_self_isdir_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.exists_DvcTree.isfile.return.not_self_isdir_path_", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 69, "span_ids": ["DvcTree.exists", "DvcTree.isdir", "DvcTree.isfile"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DvcTree(BaseTree):\n\n def exists(self, path):\n try:\n self._find_outs(path, strict=False, recursive=True)\n return True\n except OutputNotFoundError:\n return False\n\n def isdir(self, path):\n if not self.exists(path):\n return False\n\n path_info = PathInfo(os.path.abspath(path))\n outs = self._find_outs(path, strict=False, recursive=True)\n if len(outs) != 1 or outs[0].path_info != path_info:\n return True\n\n return outs[0].is_dir_checksum\n\n def isfile(self, path):\n if not self.exists(path):\n return False\n\n return not self.isdir(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree._walk_DvcTree._walk.if_topdown_.else_.assert_False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree._walk_DvcTree._walk.if_topdown_.else_.assert_False", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 93, "span_ids": ["DvcTree._walk"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DvcTree(BaseTree):\n\n def _walk(self, root, trie, topdown=True):\n dirs = set()\n files = []\n\n root_len = len(root.parts)\n for key, out in trie.iteritems(prefix=root.parts):\n if key == root.parts:\n continue\n\n name = key[root_len]\n if len(key) > root_len + 1 or out.is_dir_checksum:\n dirs.add(name)\n continue\n\n files.append(name)\n\n if topdown:\n yield root.fspath, list(dirs), files\n\n for dname in dirs:\n yield from self._walk(root / dname, trie)\n else:\n assert False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.walk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.walk_", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 142, "span_ids": ["DvcTree.walk", "RepoTree.open", "RepoTree.exists", "RepoTree", "DvcTree.isdvc", "DvcTree.isexec", "RepoTree.__init__"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DvcTree(BaseTree):\n\n def walk(self, top, topdown=True):\n from pygtrie import Trie\n\n assert topdown\n\n if not self.exists(top):\n raise FileNotFoundError\n\n if not self.isdir(top):\n raise NotADirectoryError\n\n root = PathInfo(os.path.abspath(top))\n outs = self._find_outs(top, recursive=True, strict=False)\n\n trie = Trie()\n\n for out in outs:\n trie[out.path_info.parts] = out\n\n yield from self._walk(root, trie, topdown=topdown)\n\n def isdvc(self, path):\n try:\n return len(self._find_outs(path)) == 1\n except OutputNotFoundError:\n pass\n return False\n\n def isexec(self, path):\n return False\n\n\nclass RepoTree(BaseTree):\n def __init__(self, repo):\n self.repo = repo\n self.dvctree = DvcTree(repo)\n\n def open(self, *args, **kwargs):\n try:\n return self.dvctree.open(*args, **kwargs)\n except FileNotFoundError:\n pass\n\n return self.repo.tree.open(*args, **kwargs)\n\n def exists(self, path):\n return self.repo.tree.exists(path) or self.dvctree.exists(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/schema.py_from_dvc_stage_params_imp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/schema.py_from_dvc_stage_params_imp_", "embedding": null, "metadata": {"file_path": "dvc/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["imports"], "tokens": 350}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.stage.params import StageParams, OutputParams\nfrom dvc import dependency, output\n\nfrom voluptuous import Any, Schema, Optional, Required\n\n\nSTAGES = \"stages\"\nSINGLE_STAGE_SCHEMA = {\n StageParams.PARAM_MD5: output.CHECKSUM_SCHEMA,\n StageParams.PARAM_CMD: Any(str, None),\n StageParams.PARAM_WDIR: Any(str, None),\n StageParams.PARAM_DEPS: Any([dependency.SCHEMA], None),\n StageParams.PARAM_OUTS: Any([output.SCHEMA], None),\n StageParams.PARAM_LOCKED: bool,\n StageParams.PARAM_META: object,\n StageParams.PARAM_ALWAYS_CHANGED: bool,\n}\n\nLOCK_FILE_STAGE_SCHEMA = {\n Required(StageParams.PARAM_CMD): str,\n Required(StageParams.PARAM_DEPS): {str: output.CHECKSUM_SCHEMA},\n Required(StageParams.PARAM_OUTS): {str: output.CHECKSUM_SCHEMA},\n}\nLOCKFILE_SCHEMA = {str: LOCK_FILE_STAGE_SCHEMA}\n\nSINGLE_PIPELINE_STAGE_SCHEMA = {\n str: {\n StageParams.PARAM_CMD: str,\n Optional(StageParams.PARAM_WDIR): str,\n Optional(StageParams.PARAM_DEPS): [str],\n Optional(StageParams.PARAM_LOCKED): bool,\n Optional(StageParams.PARAM_META): object,\n Optional(StageParams.PARAM_ALWAYS_CHANGED): bool,\n **{Optional(p.value): [str] for p in OutputParams},\n }\n}\nMULTI_STAGE_SCHEMA = {STAGES: SINGLE_PIPELINE_STAGE_SCHEMA}\n\nCOMPILED_SINGLE_STAGE_SCHEMA = Schema(SINGLE_STAGE_SCHEMA)\nCOMPILED_MULTI_STAGE_SCHEMA = Schema(MULTI_STAGE_SCHEMA)\nCOMPILED_LOCKFILE_SCHEMA = Schema(LOCKFILE_SCHEMA)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py__Manages_source_control_NoSCMError.__init__.super___init___msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py__Manages_source_control_NoSCMError.__init__.super___init___msg_", "embedding": null, "metadata": {"file_path": "dvc/scm/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["NoSCMError", "RevError", "CloneError.__init__", "NoSCMError.__init__", "FileNotInRepoError", "docstring", "CloneError", "SCMError"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages source control systems (e.g. Git) in DVC.\"\"\"\n\nimport os\n\nfrom dvc.exceptions import DvcException\n\n\nclass SCMError(DvcException):\n \"\"\"Base class for source control management errors.\"\"\"\n\n\nclass FileNotInRepoError(SCMError):\n \"\"\"Thrown when trying to find .gitignore for a file that is not in a scm\n repository.\n \"\"\"\n\n\nclass CloneError(SCMError):\n def __init__(self, url, path):\n super().__init__(\"Failed to clone repo '{}' to '{}'\".format(url, path))\n\n\nclass RevError(SCMError):\n pass\n\n\nclass NoSCMError(SCMError):\n def __init__(self):\n msg = (\n \"Only supported for Git repositories. If you're \"\n \"seeing this error in a Git repo, try updating the DVC \"\n \"configuration with `dvc config core.no_scm false`.\"\n )\n super().__init__(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_TqdmGit_TqdmGit.code2desc.return.ops_get_op_code_OP_OP_M": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_TqdmGit_TqdmGit.code2desc.return.ops_get_op_code_OP_OP_M", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 53, "span_ids": ["TqdmGit", "TqdmGit.code2desc", "TqdmGit.update_git"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TqdmGit(Tqdm):\n def update_git(self, op_code, cur_count, max_count=None, message=\"\"):\n op_code = self.code2desc(op_code)\n if op_code:\n self.set_description_str(op_code, refresh=False)\n if message:\n self.set_postfix_str(message, refresh=False)\n self.update_to(cur_count, max_count)\n\n @staticmethod\n def code2desc(op_code):\n from git import RootUpdateProgress as OP\n\n ops = dict(\n (\n (OP.COUNTING, \"Counting\"),\n (OP.COMPRESSING, \"Compressing\"),\n (OP.WRITING, \"Writing\"),\n (OP.RECEIVING, \"Receiving\"),\n (OP.RESOLVING, \"Resolving\"),\n (OP.FINDING_SOURCES, \"Finding sources\"),\n (OP.CHECKING_OUT, \"Checking out\"),\n (OP.CLONE, \"Cloning\"),\n (OP.FETCH, \"Fetching\"),\n (OP.UPDWKTREE, \"Updating working tree\"),\n (OP.REMOVE, \"Removing\"),\n (OP.PATHCHANGE, \"Changing path\"),\n (OP.URLCHANGE, \"Changing URL\"),\n (OP.BRANCHCHANGE, \"Changing branch\"),\n )\n )\n return ops.get(op_code & OP.OP_MASK, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_from_collections_import_O__get_outs.return.outs_bucket": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_from_collections_import_O__get_outs.return.outs_bucket", "embedding": null, "metadata": {"file_path": "dvc/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["_get_outs", "imports"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import OrderedDict\nfrom typing import TYPE_CHECKING\n\nfrom dvc.utils.collections import apply_diff\nfrom dvc.utils.stage import parse_stage_for_update\n\nif TYPE_CHECKING:\n from dvc.stage import PipelineStage, Stage\n\n\ndef _get_outs(stage: \"PipelineStage\"):\n outs_bucket = {}\n for o in stage.outs:\n bucket_key = [\"metrics\"] if o.metric else [\"outs\"]\n\n if not o.metric and o.persist:\n bucket_key += [\"persist\"]\n if not o.use_cache:\n bucket_key += [\"no_cache\"]\n key = \"_\".join(bucket_key)\n outs_bucket[key] = outs_bucket.get(key, []) + [o.def_path]\n return outs_bucket", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_dvcfile_to_dvcfile.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_dvcfile_to_dvcfile.return._", "embedding": null, "metadata": {"file_path": "dvc/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 39, "span_ids": ["to_dvcfile"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def to_dvcfile(stage: \"PipelineStage\"):\n return {\n stage.name: {\n key: value\n for key, value in {\n stage.PARAM_CMD: stage.cmd,\n stage.PARAM_WDIR: stage.resolve_wdir(),\n stage.PARAM_DEPS: [d.def_path for d in stage.deps],\n **_get_outs(stage),\n stage.PARAM_LOCKED: stage.locked,\n stage.PARAM_ALWAYS_CHANGED: stage.always_changed,\n }.items()\n if value\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_lockfile_to_lockfile.return.OrderedDict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_lockfile_to_lockfile.return.OrderedDict_", "embedding": null, "metadata": {"file_path": "dvc/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 69, "span_ids": ["to_lockfile"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def to_lockfile(stage: \"PipelineStage\") -> OrderedDict:\n assert stage.cmd\n assert stage.name\n\n deps = OrderedDict(\n [\n (dep.def_path, dep.remote.get_checksum(dep.path_info),)\n for dep in stage.deps\n if dep.remote.get_checksum(dep.path_info)\n ]\n )\n outs = OrderedDict(\n [\n (out.def_path, out.remote.get_checksum(out.path_info),)\n for out in stage.outs\n if out.remote.get_checksum(out.path_info)\n ]\n )\n return OrderedDict(\n [\n (\n stage.name,\n OrderedDict(\n [(\"cmd\", stage.cmd), (\"deps\", deps,), (\"outs\", outs)]\n ),\n )\n ]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_single_stage_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/serialize.py_to_single_stage_file_", "embedding": null, "metadata": {"file_path": "dvc/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 90, "span_ids": ["to_single_stage_file"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def to_single_stage_file(stage: \"Stage\"):\n state = stage.dumpd()\n\n # When we load a stage we parse yaml with a fast parser, which strips\n # off all the comments and formatting. To retain those on update we do\n # a trick here:\n # - reparse the same yaml text with a slow but smart ruamel yaml parser\n # - apply changes to a returned structure\n # - serialize it\n if stage._stage_text is not None:\n saved_state = parse_stage_for_update(stage._stage_text, stage.path)\n # Stage doesn't work with meta in any way, so .dumpd() doesn't\n # have it. We simply copy it over.\n if \"meta\" in saved_state:\n state[\"meta\"] = saved_state[\"meta\"]\n apply_diff(state, saved_state)\n state = saved_state\n return state", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_pathlib_loads_from.return.cls_kw_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_pathlib_loads_from.return.cls_kw_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["imports", "loads_from"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pathlib\nimport logging\nimport os\nimport signal\nimport subprocess\nimport threading\n\nfrom itertools import chain\n\nfrom funcy import project\n\nimport dvc.dependency as dependency\nimport dvc.output as output\nimport dvc.prompt as prompt\nfrom dvc.exceptions import CheckoutError, DvcException\nfrom .decorators import rwlocked, unlocked_repo\nfrom .exceptions import (\n StageCmdFailedError,\n StagePathOutsideError,\n StagePathNotFoundError,\n StagePathNotDirectoryError,\n StageCommitError,\n StageUpdateError,\n MissingDep,\n MissingDataSource,\n)\nfrom . import params\nfrom dvc.utils import dict_md5\nfrom dvc.utils import fix_env\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import path_isin\nfrom .params import OutputParams\n\nlogger = logging.getLogger(__name__)\n\n\ndef loads_from(cls, repo, path, wdir, data):\n kw = {\n \"repo\": repo,\n \"path\": path,\n \"wdir\": wdir,\n **project(\n data,\n [\n Stage.PARAM_CMD,\n Stage.PARAM_LOCKED,\n Stage.PARAM_ALWAYS_CHANGED,\n Stage.PARAM_MD5,\n \"name\",\n ],\n ),\n }\n return cls(**kw)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_create_stage_create_stage.return.stage": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_create_stage_create_stage.return.stage", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 83, "span_ids": ["create_stage"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_stage(cls, repo, path, **kwargs):\n from dvc.dvcfile import Dvcfile\n\n wdir = os.path.abspath(kwargs.get(\"wdir\", None) or os.curdir)\n path = os.path.abspath(path)\n Dvcfile.check_dvc_filename(path)\n cls._check_stage_path(repo, wdir, is_wdir=kwargs.get(\"wdir\"))\n cls._check_stage_path(repo, os.path.dirname(path))\n\n stage = loads_from(cls, repo, path, wdir, kwargs)\n stage._fill_stage_outputs(**kwargs)\n stage._fill_stage_dependencies(**kwargs)\n stage._check_circular_dependency()\n stage._check_duplicated_arguments()\n\n if stage and stage.dvcfile.exists():\n has_persist_outs = any(out.persist for out in stage.outs)\n ignore_build_cache = (\n kwargs.get(\"ignore_build_cache\", False) or has_persist_outs\n )\n if has_persist_outs:\n logger.warning(\"Build cache is ignored when persisting outputs.\")\n\n if not ignore_build_cache and stage.can_be_skipped:\n logger.info(\"Stage is cached, skipping.\")\n return None\n\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage_Stage.is_repo_import.return.isinstance_self_deps_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage_Stage.is_repo_import.return.isinstance_self_deps_0_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 197, "span_ids": ["Stage.__repr__", "Stage.__init__", "Stage.changed_md5", "Stage.__hash__", "Stage.is_callback", "Stage.is_data_source", "Stage.path", "Stage.dvcfile_3", "Stage", "Stage.relpath", "Stage.path_1", "Stage.is_repo_import", "Stage.path_in_repo", "Stage.__eq__", "Stage.dvcfile", "Stage.is_import"], "tokens": 686}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n def __init__(\n self,\n repo,\n path=None,\n cmd=None,\n wdir=os.curdir,\n deps=None,\n outs=None,\n md5=None,\n locked=False,\n tag=None,\n always_changed=False,\n stage_text=None,\n dvcfile=None,\n ):\n if deps is None:\n deps = []\n if outs is None:\n outs = []\n\n self.repo = repo\n self._path = path\n self.cmd = cmd\n self.wdir = wdir\n self.outs = outs\n self.deps = deps\n self.md5 = md5\n self.locked = locked\n self.tag = tag\n self.always_changed = always_changed\n self._stage_text = stage_text\n self._dvcfile = dvcfile\n\n @property\n def path(self):\n return self._path\n\n @path.setter\n def path(self, path):\n self._path = path\n\n @property\n def dvcfile(self):\n if self.path and self._dvcfile and self.path == self._dvcfile.path:\n return self._dvcfile\n\n if not self.path:\n raise DvcException(\n \"Stage does not have any path set \"\n \"and is detached from dvcfile.\"\n )\n\n from dvc.dvcfile import Dvcfile\n\n self._dvcfile = Dvcfile(self.repo, self.path)\n return self._dvcfile\n\n @dvcfile.setter\n def dvcfile(self, dvcfile):\n self._dvcfile = dvcfile\n\n def __repr__(self):\n return \"Stage: '{path}'\".format(\n path=self.relpath if self.path else \"No path\"\n )\n\n def __hash__(self):\n return hash(self.path_in_repo)\n\n def __eq__(self, other):\n return (\n self.__class__ == other.__class__\n and self.repo is other.repo\n and self.path_in_repo == other.path_in_repo\n )\n\n @property\n def path_in_repo(self):\n return relpath(self.path, self.repo.root_dir)\n\n @property\n def relpath(self):\n return relpath(self.path)\n\n @property\n def is_data_source(self):\n \"\"\"Whether the DVC-file was created with `dvc add` or `dvc import`\"\"\"\n return self.cmd is None\n\n def changed_md5(self):\n return self.md5 != self._compute_md5()\n\n @property\n def is_callback(self):\n \"\"\"\n A callback stage is always considered as changed,\n so it runs on every `dvc repro` call.\n \"\"\"\n return not self.is_data_source and len(self.deps) == 0\n\n @property\n def is_import(self):\n \"\"\"Whether the DVC-file was created with `dvc import`.\"\"\"\n return not self.cmd and len(self.deps) == 1 and len(self.outs) == 1\n\n @property\n def is_repo_import(self):\n if not self.is_import:\n return False\n\n return isinstance(self.deps[0], dependency.DependencyREPO)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._changed_deps_Stage._changed_deps.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._changed_deps_Stage._changed_deps.return.False", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 199, "end_line": 225, "span_ids": ["Stage._changed_deps"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def _changed_deps(self):\n if self.locked:\n return False\n\n if self.is_callback:\n logger.warning(\n \"DVC-file '{fname}' is a \\\"callback\\\" stage \"\n \"(has a command and no dependencies) and thus always \"\n \"considered as changed.\".format(fname=self.relpath)\n )\n return True\n\n if self.always_changed:\n return True\n\n for dep in self.deps:\n status = dep.status()\n if status:\n logger.debug(\n \"Dependency '{dep}' of '{stage}' changed because it is \"\n \"'{status}'.\".format(\n dep=dep, stage=self.relpath, status=status[str(dep)]\n )\n )\n return True\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._changed_outs_Stage.remove.os_unlink_self_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._changed_outs_Stage.remove.os_unlink_self_path_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 227, "end_line": 286, "span_ids": ["Stage.remove_outs", "Stage._changed_md5", "Stage.unprotect_outs", "Stage.remove", "Stage.changed", "Stage._changed_outs", "Stage._changed"], "tokens": 407}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def _changed_outs(self):\n for out in self.outs:\n status = out.status()\n if status:\n logger.debug(\n \"Output '{out}' of '{stage}' changed because it is \"\n \"'{status}'\".format(\n out=out, stage=self.relpath, status=status[str(out)]\n )\n )\n return True\n\n return False\n\n def _changed_md5(self):\n if self.changed_md5():\n logger.warning(\"DVC-file '{}' changed.\".format(self.relpath))\n return True\n return False\n\n @rwlocked(read=[\"deps\", \"outs\"])\n def changed(self):\n if self._changed():\n logger.warning(\"{} changed.\".format(self))\n return True\n\n logger.debug(\"{} didn't change.\".format(self))\n return False\n\n def _changed(self):\n # Short-circuit order: stage md5 is fast, deps are expected to change\n return (\n self._changed_md5() or self._changed_deps() or self._changed_outs()\n )\n\n @rwlocked(write=[\"outs\"])\n def remove_outs(self, ignore_remove=False, force=False):\n \"\"\"Used mainly for `dvc remove --outs` and :func:`Stage.reproduce`.\"\"\"\n for out in self.outs:\n if out.persist and not force:\n out.unprotect()\n else:\n logger.debug(\n \"Removing output '{out}' of '{stage}'.\".format(\n out=out, stage=self.relpath\n )\n )\n out.remove(ignore_remove=ignore_remove)\n\n def unprotect_outs(self):\n for out in self.outs:\n out.unprotect()\n\n @rwlocked(write=[\"outs\"])\n def remove(self, force=False, remove_outs=True):\n if remove_outs:\n self.remove_outs(ignore_remove=True, force=force)\n else:\n self.unprotect_outs()\n os.unlink(self.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.reproduce_Stage.update.try_.finally_.self.locked.locked": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.reproduce_Stage.update.try_.finally_.self.locked.locked", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 318, "span_ids": ["Stage.reproduce", "Stage.update"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n @rwlocked(read=[\"deps\"], write=[\"outs\"])\n def reproduce(self, interactive=False, **kwargs):\n\n if not kwargs.get(\"force\", False) and not self.changed():\n return None\n\n msg = (\n \"Going to reproduce '{stage}'. \"\n \"Are you sure you want to continue?\".format(stage=self.relpath)\n )\n\n if interactive and not prompt.confirm(msg):\n raise DvcException(\"reproduction aborted by the user\")\n\n self.run(**kwargs)\n\n logger.debug(\"'{stage}' was reproduced\".format(stage=self.relpath))\n\n return self\n\n def update(self, rev=None):\n if not self.is_repo_import and not self.is_import:\n raise StageUpdateError(self.relpath)\n\n self.deps[0].update(rev=rev)\n locked = self.locked\n self.locked = False\n try:\n self.reproduce()\n finally:\n self.locked = locked", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._check_stage_path_Stage.reload.return.self_dvcfile_stage": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._check_stage_path_Stage.reload.return.self_dvcfile_stage", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 320, "end_line": 351, "span_ids": ["Stage.can_be_skipped", "Stage.reload", "Stage._check_stage_path"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n @staticmethod\n def _check_stage_path(repo, path, is_wdir=False):\n assert repo is not None\n\n error_msg = \"{wdir_or_path} '{path}' {{}}\".format(\n wdir_or_path=\"stage working dir\" if is_wdir else \"file path\",\n path=path,\n )\n\n real_path = os.path.realpath(path)\n if not os.path.exists(real_path):\n raise StagePathNotFoundError(error_msg.format(\"does not exist\"))\n\n if not os.path.isdir(real_path):\n raise StagePathNotDirectoryError(\n error_msg.format(\"is not directory\")\n )\n\n proj_dir = os.path.realpath(repo.root_dir)\n if real_path != proj_dir and not path_isin(real_path, proj_dir):\n raise StagePathOutsideError(\n error_msg.format(\"is outside of DVC repo\")\n )\n\n @property\n def can_be_skipped(self):\n return (\n self.is_cached and not self.is_callback and not self.always_changed\n )\n\n def reload(self):\n return self.dvcfile.stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.is_cached_Stage.is_cached.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.is_cached_Stage.is_cached.return.True", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 353, "end_line": 396, "span_ids": ["Stage.is_cached"], "tokens": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n @property\n def is_cached(self):\n \"\"\"\n Checks if this stage has been already ran and stored\n \"\"\"\n from dvc.remote.local import RemoteLOCAL\n from dvc.remote.s3 import RemoteS3\n\n old = self.reload()\n if old._changed_outs():\n return False\n\n # NOTE: need to save checksums for deps in order to compare them\n # with what is written in the old stage.\n for dep in self.deps:\n dep.save()\n\n old_d = old.dumpd()\n new_d = self.dumpd()\n\n # NOTE: need to remove checksums from old dict in order to compare\n # it to the new one, since the new one doesn't have checksums yet.\n old_d.pop(self.PARAM_MD5, None)\n new_d.pop(self.PARAM_MD5, None)\n outs = old_d.get(self.PARAM_OUTS, [])\n for out in outs:\n out.pop(RemoteLOCAL.PARAM_CHECKSUM, None)\n out.pop(RemoteS3.PARAM_CHECKSUM, None)\n\n if old_d != new_d:\n return False\n\n # NOTE: committing to prevent potential data duplication. For example\n #\n # $ dvc config cache.type hardlink\n # $ echo foo > foo\n # $ dvc add foo\n # $ rm -f foo\n # $ echo foo > foo\n # $ dvc add foo # should replace foo with a link to cache\n #\n old.commit()\n\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._fill_stage_outputs_Stage.resolve_wdir.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._fill_stage_outputs_Stage.resolve_wdir.return._", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 398, "end_line": 428, "span_ids": ["Stage._fill_stage_dependencies", "Stage._fill_stage_outputs", "Stage.resolve_wdir", "Stage._fix_outs_deps_path"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def _fill_stage_outputs(self, **kwargs):\n assert not self.outs\n\n self.outs = []\n for key in (p.value for p in OutputParams):\n self.outs += output.loads_from(\n self,\n kwargs.get(key, []),\n use_cache=\"no_cache\" not in key,\n persist=\"persist\" in key,\n metric=\"metrics\" in key,\n )\n\n def _fill_stage_dependencies(self, **kwargs):\n assert not self.deps\n self.deps = []\n self.deps += dependency.loads_from(\n self, kwargs.get(\"deps\", []), erepo=kwargs.get(\"erepo\", None)\n )\n self.deps += dependency.loads_params(self, kwargs.get(\"params\", []))\n\n def _fix_outs_deps_path(self, wdir):\n for out in chain(self.outs, self.deps):\n if out.is_in_repo:\n out.def_path = relpath(out.path_info, wdir)\n\n def resolve_wdir(self):\n rel_wdir = relpath(self.wdir, os.path.dirname(self.path))\n return (\n pathlib.PurePath(rel_wdir).as_posix() if rel_wdir != \".\" else None\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.dumpd_Stage.dumpd.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.dumpd_Stage.dumpd.return._", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 430, "end_line": 443, "span_ids": ["Stage.dumpd"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def dumpd(self):\n return {\n key: value\n for key, value in {\n Stage.PARAM_MD5: self.md5,\n Stage.PARAM_CMD: self.cmd,\n Stage.PARAM_WDIR: self.resolve_wdir(),\n Stage.PARAM_LOCKED: self.locked,\n Stage.PARAM_DEPS: [d.dumpd() for d in self.deps],\n Stage.PARAM_OUTS: [o.dumpd() for o in self.outs],\n Stage.PARAM_ALWAYS_CHANGED: self.always_changed,\n }.items()\n if value\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._compute_md5_Stage._compute_md5.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._compute_md5_Stage._compute_md5.return.m", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 445, "end_line": 474, "span_ids": ["Stage._compute_md5"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def _compute_md5(self):\n from dvc.output.base import OutputBase\n\n d = self.dumpd()\n\n # Remove md5 and meta, these should not affect stage md5\n d.pop(self.PARAM_MD5, None)\n d.pop(self.PARAM_META, None)\n\n # Ignore the wdir default value. In this case DVC-file w/o\n # wdir has the same md5 as a file with the default value specified.\n # It's important for backward compatibility with pipelines that\n # didn't have WDIR in their DVC-files.\n if d.get(self.PARAM_WDIR) == \".\":\n del d[self.PARAM_WDIR]\n\n # NOTE: excluding parameters that don't affect the state of the\n # pipeline. Not excluding `OutputLOCAL.PARAM_CACHE`, because if\n # it has changed, we might not have that output in our cache.\n m = dict_md5(\n d,\n exclude=[\n self.PARAM_LOCKED,\n OutputBase.PARAM_METRIC,\n OutputBase.PARAM_TAGS,\n OutputBase.PARAM_PERSIST,\n ],\n )\n logger.debug(\"Computed stage '{}' md5: '{}'\".format(self.relpath, m))\n return m", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.save_Stage.check_can_commit.if_changed_deps_or_change.self_save_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.save_Stage.check_can_commit.if_changed_deps_or_change.self_save_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 476, "end_line": 511, "span_ids": ["Stage.save", "Stage.check_can_commit", "Stage._changed_entries"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def save(self):\n for dep in self.deps:\n dep.save()\n\n for out in self.outs:\n out.save()\n\n self.md5 = self._compute_md5()\n\n @staticmethod\n def _changed_entries(entries):\n return [\n str(entry)\n for entry in entries\n if entry.checksum and entry.changed_checksum()\n ]\n\n def check_can_commit(self, force):\n changed_deps = self._changed_entries(self.deps)\n changed_outs = self._changed_entries(self.outs)\n\n if changed_deps or changed_outs or self.changed_md5():\n msg = (\n \"dependencies {}\".format(changed_deps) if changed_deps else \"\"\n )\n msg += \" and \" if (changed_deps and changed_outs) else \"\"\n msg += \"outputs {}\".format(changed_outs) if changed_outs else \"\"\n msg += \"md5\" if not (changed_deps or changed_outs) else \"\"\n msg += \" of '{}' changed. \".format(self.relpath)\n msg += \"Are you sure you want to commit it?\"\n if not force and not prompt.confirm(msg):\n raise StageCommitError(\n \"unable to commit changed '{}'. Use `-f|--force` to \"\n \"force.\".format(self.relpath)\n )\n self.save()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.commit_Stage._warn_if_fish.logger_warning_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.commit_Stage._warn_if_fish.logger_warning_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 513, "end_line": 538, "span_ids": ["Stage._warn_if_fish", "Stage.commit", "Stage._check_missing_deps"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n @rwlocked(write=[\"outs\"])\n def commit(self):\n for out in self.outs:\n out.commit()\n\n def _check_missing_deps(self):\n missing = [dep for dep in self.deps if not dep.exists]\n\n if any(missing):\n raise MissingDep(missing)\n\n @staticmethod\n def _warn_if_fish(executable): # pragma: no cover\n if (\n executable is None\n or os.path.basename(os.path.realpath(executable)) != \"fish\"\n ):\n return\n\n logger.warning(\n \"DVC detected that you are using fish as your default \"\n \"shell. Be aware that it might cause problems by overwriting \"\n \"your current environment variables with values defined \"\n \"in '.fishrc', which might affect your command. See \"\n \"https://github.com/iterative/dvc/issues/1307. \"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._check_circular_dependency_Stage._check_duplicated_arguments.for_path_occurrence_in_p.if_occurrence_1_.raise_ArgumentDuplication": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._check_circular_dependency_Stage._check_duplicated_arguments.for_path_occurrence_in_p.if_occurrence_1_.raise_ArgumentDuplication", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 540, "end_line": 558, "span_ids": ["Stage._check_circular_dependency", "Stage._check_duplicated_arguments"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def _check_circular_dependency(self):\n from dvc.exceptions import CircularDependencyError\n\n circular_dependencies = set(d.path_info for d in self.deps) & set(\n o.path_info for o in self.outs\n )\n\n if circular_dependencies:\n raise CircularDependencyError(str(circular_dependencies.pop()))\n\n def _check_duplicated_arguments(self):\n from dvc.exceptions import ArgumentDuplicationError\n from collections import Counter\n\n path_counts = Counter(edge.path_info for edge in self.deps + self.outs)\n\n for path, occurrence in path_counts.items():\n if occurrence > 1:\n raise ArgumentDuplicationError(str(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._run_Stage._run.if_p_is_None_or_p_retu.raise_StageCmdFailedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._run_Stage._run.if_p_is_None_or_p_retu.raise_StageCmdFailedError", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 560, "end_line": 608, "span_ids": ["Stage._run"], "tokens": 476}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n @unlocked_repo\n def _run(self):\n self._check_missing_deps()\n\n kwargs = {\"cwd\": self.wdir, \"env\": fix_env(None), \"close_fds\": True}\n\n if os.name == \"nt\":\n kwargs[\"shell\"] = True\n cmd = self.cmd\n else:\n # NOTE: when you specify `shell=True`, `Popen` [1] will default to\n # `/bin/sh` on *nix and will add [\"/bin/sh\", \"-c\"] to your command.\n # But we actually want to run the same shell that we are running\n # from right now, which is usually determined by the `SHELL` env\n # var. So instead, we compose our command on our own, making sure\n # to include special flags to prevent shell from reading any\n # configs and modifying env, which may change the behavior or the\n # command we are running. See [2] for more info.\n #\n # [1] https://github.com/python/cpython/blob/3.7/Lib/subprocess.py\n # #L1426\n # [2] https://github.com/iterative/dvc/issues/2506\n # #issuecomment-535396799\n kwargs[\"shell\"] = False\n executable = os.getenv(\"SHELL\") or \"/bin/sh\"\n\n self._warn_if_fish(executable)\n\n opts = {\"zsh\": [\"--no-rcs\"], \"bash\": [\"--noprofile\", \"--norc\"]}\n name = os.path.basename(executable).lower()\n cmd = [executable] + opts.get(name, []) + [\"-c\", self.cmd]\n\n main_thread = isinstance(\n threading.current_thread(), threading._MainThread\n )\n old_handler = None\n p = None\n\n try:\n p = subprocess.Popen(cmd, **kwargs)\n if main_thread:\n old_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)\n p.communicate()\n finally:\n if old_handler:\n signal.signal(signal.SIGINT, old_handler)\n\n if (p is None) or (p.returncode != 0):\n raise StageCmdFailedError(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.run_Stage.run.if_not_dry_.if_not_no_commit_.self_commit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.run_Stage.run.if_not_dry_.if_not_no_commit_.self_commit_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 610, "end_line": 661, "span_ids": ["Stage.run"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n @rwlocked(read=[\"deps\"], write=[\"outs\"])\n def run(self, dry=False, no_commit=False, force=False):\n if (self.cmd or self.is_import) and not self.locked and not dry:\n self.remove_outs(ignore_remove=False, force=False)\n\n if self.locked:\n logger.info(\n \"Verifying outputs in locked stage '{stage}'\".format(\n stage=self.relpath\n )\n )\n if not dry:\n self.check_missing_outputs()\n\n elif self.is_import:\n logger.info(\n \"Importing '{dep}' -> '{out}'\".format(\n dep=self.deps[0], out=self.outs[0]\n )\n )\n if not dry:\n if (\n not force\n and not self._changed_md5()\n and self._already_cached()\n ):\n self.outs[0].checkout()\n else:\n self.deps[0].download(self.outs[0])\n elif self.is_data_source:\n msg = \"Verifying data sources in '{}'\".format(self.relpath)\n logger.info(msg)\n if not dry:\n self.check_missing_outputs()\n\n else:\n logger.info(\"Running command:\\n\\t{}\".format(self.cmd))\n if not dry:\n if (\n not force\n and not self.is_callback\n and not self.always_changed\n and self._already_cached()\n ):\n self.checkout()\n else:\n self._run()\n\n if not dry:\n self.save()\n if not no_commit:\n self.commit()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.check_missing_outputs_Stage.checkout.return.checkouts": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.check_missing_outputs_Stage.checkout.return.checkouts", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 663, "end_line": 700, "span_ids": ["Stage.check_missing_outputs", "Stage.checkout", "Stage._filter_outs"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def check_missing_outputs(self):\n paths = [str(out) for out in self.outs if not out.exists]\n if paths:\n raise MissingDataSource(paths)\n\n def _filter_outs(self, path_info):\n def _func(o):\n return path_info.isin_or_eq(o.path_info)\n\n return filter(_func, self.outs) if path_info else self.outs\n\n @rwlocked(write=[\"outs\"])\n def checkout(\n self,\n force=False,\n progress_callback=None,\n relink=False,\n filter_info=None,\n ):\n checkouts = {\"failed\": [], \"added\": [], \"modified\": []}\n for out in self._filter_outs(filter_info):\n try:\n result = out.checkout(\n force=force,\n tag=self.tag,\n progress_callback=progress_callback,\n relink=relink,\n filter_info=filter_info,\n )\n added, modified = result or (None, None)\n if modified:\n checkouts[\"modified\"].append(out.path_info)\n elif added:\n checkouts[\"added\"].append(out.path_info)\n except CheckoutError as exc:\n checkouts[\"failed\"].extend(exc.target_infos)\n\n return checkouts", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._status_Stage.status.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._status_Stage.status.return._", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 702, "end_line": 735, "span_ids": ["Stage.status", "Stage._status"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n @staticmethod\n def _status(entries):\n ret = {}\n\n for entry in entries:\n ret.update(entry.status())\n\n return ret\n\n @rwlocked(read=[\"deps\", \"outs\"])\n def status(self, check_updates=False):\n ret = []\n\n show_import = self.is_repo_import and check_updates\n\n if not self.locked or show_import:\n deps_status = self._status(self.deps)\n if deps_status:\n ret.append({\"changed deps\": deps_status})\n\n outs_status = self._status(self.outs)\n if outs_status:\n ret.append({\"changed outs\": outs_status})\n\n if self.changed_md5():\n ret.append(\"changed checksum\")\n\n if self.is_callback or self.always_changed:\n ret.append(\"always changed\")\n\n if ret:\n return {self.relpath: ret}\n\n return {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._already_cached_Stage.get_used_cache.return.cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._already_cached_Stage.get_used_cache.return.cache", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 737, "end_line": 756, "span_ids": ["Stage.get_all_files_number", "Stage.get_used_cache", "Stage._already_cached"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(params.StageParams):\n\n def _already_cached(self):\n return all(not dep.changed() for dep in self.deps) and all(\n not out.changed_cache() if out.use_cache else not out.changed()\n for out in self.outs\n )\n\n def get_all_files_number(self, filter_info=None):\n return sum(\n out.get_files_number(filter_info)\n for out in self._filter_outs(filter_info)\n )\n\n def get_used_cache(self, *args, **kwargs):\n from dvc.cache import NamedCache\n\n cache = NamedCache()\n for out in self._filter_outs(kwargs.get(\"filter_info\")):\n cache.update(out.get_used_cache(*args, **kwargs))\n\n return cache", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_PipelineStage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_PipelineStage_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 759, "end_line": 787, "span_ids": ["PipelineStage.__repr__", "PipelineStage.__eq__", "PipelineStage.is_cached", "PipelineStage.__init__", "PipelineStage", "PipelineStage.__hash__", "PipelineStage._changed", "PipelineStage.reload"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PipelineStage(Stage):\n def __init__(self, name=None, **kwargs):\n super().__init__(**kwargs)\n self.name = name\n self.cmd_changed = False\n\n def __eq__(self, other):\n return super().__eq__(other) and self.name == other.name\n\n def __hash__(self):\n return hash((self.path_in_repo, self.name))\n\n def __repr__(self):\n return \"Stage: '{path}:{name}'\".format(\n path=self.relpath if self.path else \"No path\", name=self.name\n )\n\n def _changed(self):\n if self.cmd_changed:\n logger.warning(\"'cmd' of {} has changed.\".format(self))\n return self.cmd_changed or self._changed_deps() or self._changed_outs()\n\n def reload(self):\n return self.dvcfile.stages[self.name]\n\n @property\n def is_cached(self):\n return self.name in self.dvcfile.stages and super().is_cached", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/decorators.py_from_funcy_import_decorat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/decorators.py_from_funcy_import_decorat_", "embedding": null, "metadata": {"file_path": "dvc/stage/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 51, "span_ids": ["imports", "rwlocked", "unlocked_repo"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from funcy import decorator\nfrom functools import wraps\n\n\n@decorator\ndef rwlocked(call, read=None, write=None):\n import sys\n from dvc.rwlock import rwlock\n from dvc.dependency.repo import DependencyREPO\n\n if read is None:\n read = []\n\n if write is None:\n write = []\n\n stage = call._args[0]\n\n assert stage.repo.lock.is_locked\n\n def _chain(names):\n return [\n item.path_info\n for attr in names\n for item in getattr(stage, attr)\n # There is no need to lock DependencyREPO deps, as there is no\n # corresponding OutputREPO, so we can't even write it.\n if not isinstance(item, DependencyREPO)\n ]\n\n cmd = \" \".join(sys.argv)\n\n with rwlock(stage.repo.tmp_dir, cmd, _chain(read), _chain(write)):\n return call()\n\n\ndef unlocked_repo(f):\n @wraps(f)\n def wrapper(stage, *args, **kwargs):\n stage.repo.state.dump()\n stage.repo.lock.unlock()\n stage.repo._reset()\n try:\n ret = f(stage, *args, **kwargs)\n finally:\n stage.repo.lock.lock()\n stage.repo.state.load()\n return ret\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/exceptions.py_from_dvc_exceptions_impor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/exceptions.py_from_dvc_exceptions_impor_", "embedding": null, "metadata": {"file_path": "dvc/stage/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 95, "span_ids": ["StagePathOutsideError", "StagePathNotFoundError", "MissingDataSource.__init__", "StageFileDoesNotExistError.__init__", "MissingDep.__init__", "StageFileAlreadyExistsError", "StagePathNotDirectoryError", "StageFileIsNotDvcFileError", "imports", "StageFileFormatError.__init__", "StageFileDoesNotExistError", "MissingDataSource", "StageCommitError", "StageFileBadNameError", "StageFileFormatError", "StageCmdFailedError", "StageFileAlreadyExistsError.__init__", "StageUpdateError.__init__", "StageCmdFailedError.__init__", "StageFileIsNotDvcFileError.__init__", "StageUpdateError", "MissingDep"], "tokens": 578}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.exceptions import DvcException\n\n\nclass StageCmdFailedError(DvcException):\n def __init__(self, stage):\n msg = \"stage '{}' cmd '{}' failed\".format(stage.relpath, stage.cmd)\n super().__init__(msg)\n\n\nclass StageFileFormatError(DvcException):\n def __init__(self, fname, e):\n msg = \"DVC-file '{}' format error: {}\".format(fname, str(e))\n super().__init__(msg)\n\n\nclass StageFileDoesNotExistError(DvcException):\n def __init__(self, fname):\n from dvc.dvcfile import DVC_FILE_SUFFIX, Dvcfile\n\n msg = \"'{}' does not exist.\".format(fname)\n\n sname = fname + DVC_FILE_SUFFIX\n if Dvcfile.is_stage_file(sname):\n msg += \" Do you mean '{}'?\".format(sname)\n\n super().__init__(msg)\n\n\nclass StageFileAlreadyExistsError(DvcException):\n def __init__(self, relpath):\n msg = \"not overwriting '{}'\".format(relpath)\n super().__init__(msg)\n\n\nclass StageFileIsNotDvcFileError(DvcException):\n def __init__(self, fname):\n from dvc.dvcfile import Dvcfile, DVC_FILE_SUFFIX\n\n msg = \"'{}' is not a DVC-file\".format(fname)\n\n sname = fname + DVC_FILE_SUFFIX\n if Dvcfile.is_stage_file(sname):\n msg += \" Do you mean '{}'?\".format(sname)\n\n super().__init__(msg)\n\n\nclass StageFileBadNameError(DvcException):\n pass\n\n\nclass StagePathOutsideError(DvcException):\n pass\n\n\nclass StagePathNotFoundError(DvcException):\n pass\n\n\nclass StagePathNotDirectoryError(DvcException):\n pass\n\n\nclass StageCommitError(DvcException):\n pass\n\n\nclass StageUpdateError(DvcException):\n def __init__(self, path):\n super().__init__(\n \"update is not supported for '{}' that is not an \"\n \"import.\".format(path)\n )\n\n\nclass MissingDep(DvcException):\n def __init__(self, deps):\n assert len(deps) > 0\n\n dep = \"dependencies\" if len(deps) > 1 else \"dependency\"\n msg = \"missing '{}': {}\".format(dep, \", \".join(map(str, deps)))\n super().__init__(msg)\n\n\nclass MissingDataSource(DvcException):\n def __init__(self, missing_files):\n assert len(missing_files) > 0\n\n source = \"source\"\n if len(missing_files) > 1:\n source += \"s\"\n\n msg = \"missing data '{}': {}\".format(source, \", \".join(missing_files))\n super().__init__(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/params.py_from_enum_import_Enum_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/params.py_from_enum_import_Enum_", "embedding": null, "metadata": {"file_path": "dvc/stage/params.py", "file_name": "params.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports", "StageParams", "OutputParams"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from enum import Enum\n\n\nclass StageParams:\n PARAM_MD5 = \"md5\"\n PARAM_CMD = \"cmd\"\n PARAM_WDIR = \"wdir\"\n PARAM_DEPS = \"deps\"\n PARAM_OUTS = \"outs\"\n PARAM_LOCKED = \"locked\"\n PARAM_META = \"meta\"\n PARAM_ALWAYS_CHANGED = \"always_changed\"\n\n\nclass OutputParams(Enum):\n PERSIST = \"outs_persist\"\n PERSIST_NO_CACHE = \"outs_persist_no_cache\"\n METRICS_NO_CACHE = \"metrics_no_cache\"\n METRICS = \"metrics\"\n NO_CACHE = \"outs_no_cache\"\n OUTS = \"outs\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__visual_width_resolve_output.return.out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__visual_width_resolve_output.return.out", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 345, "span_ids": ["_visual_width", "resolve_output", "env2bool", "relpath", "_visual_center"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _visual_width(line):\n \"\"\"Get the the number of columns required to display a string\"\"\"\n\n return len(re.sub(colorama.ansitowin32.AnsiToWin32.ANSI_CSI_RE, \"\", line))\n\n\ndef _visual_center(line, width):\n \"\"\"Center align string according to it's visual width\"\"\"\n\n spaces = max(width - _visual_width(line), 0)\n left_padding = int(spaces / 2)\n right_padding = spaces - left_padding\n\n return (left_padding * \" \") + line + (right_padding * \" \")\n\n\ndef relpath(path, start=os.curdir):\n path = fspath(path)\n start = os.path.abspath(fspath(start))\n\n # Windows path on different drive than curdir doesn't have relpath\n if os.name == \"nt\" and not os.path.commonprefix(\n [start, os.path.abspath(path)]\n ):\n return path\n return os.path.relpath(path, start)\n\n\ndef env2bool(var, undefined=False):\n \"\"\"\n undefined: return value if env var is unset\n \"\"\"\n var = os.getenv(var, None)\n if var is None:\n return undefined\n return bool(re.search(\"1|y|yes|true\", var, flags=re.I))\n\n\ndef resolve_output(inp, out):\n from urllib.parse import urlparse\n\n name = os.path.basename(os.path.normpath(urlparse(inp).path))\n if not out:\n return name\n if os.path.isdir(out):\n return os.path.join(out, name)\n return out", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_resolve_paths_resolve_paths.return._path_wdir_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_resolve_paths_resolve_paths.return._path_wdir_out_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 348, "end_line": 371, "span_ids": ["resolve_paths"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def resolve_paths(repo, out):\n from ..dvcfile import DVC_FILE_SUFFIX\n from ..path_info import PathInfo\n from .fs import contains_symlink_up_to\n\n abspath = os.path.abspath(out)\n dirname = os.path.dirname(abspath)\n base = os.path.basename(os.path.normpath(out))\n\n # NOTE: `out` might not exist yet, so using `dirname`(aka `wdir`) to check\n # if it is a local path.\n if (\n os.path.exists(dirname) # out might not exist yet, so\n and PathInfo(abspath).isin_or_eq(repo.root_dir)\n and not contains_symlink_up_to(abspath, repo.root_dir)\n ):\n wdir = dirname\n out = base\n else:\n wdir = os.getcwd()\n\n path = os.path.join(wdir, base + DVC_FILE_SUFFIX)\n\n return (path, wdir, out)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_format_link_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_format_link_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 374, "end_line": 391, "span_ids": ["format_link", "parse_target"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_link(link):\n return \"<{blue}{link}{nc}>\".format(\n blue=colorama.Fore.CYAN, link=link, nc=colorama.Fore.RESET\n )\n\n\ndef parse_target(target, default=\"Dvcfile\"):\n if not target:\n return None, None\n\n match = TARGET_REGEX.match(target)\n if not match:\n return target, None\n path, name = match.group(\"path\"), match.group(\"name\")\n if not path:\n logger.warning(\"Assuming file to be '%s'\", default)\n return path or default, name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/diff.py_json__diff_vals.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/diff.py_json__diff_vals.return.res", "embedding": null, "metadata": {"file_path": "dvc/utils/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["imports", "_diff_vals", "_parse"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import json\nfrom collections import defaultdict\n\n\ndef _parse(raw):\n if raw is None or isinstance(raw, (dict, list, int, float)):\n return raw\n\n assert isinstance(raw, str)\n try:\n return json.loads(raw)\n except json.JSONDecodeError:\n return raw\n\n\ndef _diff_vals(old, new, with_unchanged):\n if (\n isinstance(new, list)\n and isinstance(old, list)\n and len(old) == len(new) == 1\n ):\n return _diff_vals(old[0], new[0], with_unchanged)\n\n if not with_unchanged and old == new:\n return {}\n\n res = {\"old\": old, \"new\": new}\n if isinstance(new, (int, float)) and isinstance(old, (int, float)):\n res[\"diff\"] = new - old\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/diff.py__flatten_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/diff.py__flatten_", "embedding": null, "metadata": {"file_path": "dvc/utils/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 119, "span_ids": ["_flatten", "format_dict", "diff", "_diff", "table", "_diff_dicts"], "tokens": 493}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _flatten(d):\n if not d:\n return defaultdict(lambda: None)\n\n if isinstance(d, dict):\n from flatten_json import flatten as fltn\n\n return defaultdict(lambda: None, fltn(d, \".\"))\n\n return defaultdict(lambda: \"unable to parse\")\n\n\ndef _diff_dicts(old_dict, new_dict, with_unchanged):\n new = _flatten(new_dict)\n old = _flatten(old_dict)\n\n res = defaultdict(dict)\n\n xpaths = set(old.keys())\n xpaths.update(set(new.keys()))\n for xpath in xpaths:\n old_val = old[xpath]\n new_val = new[xpath]\n val_diff = _diff_vals(old_val, new_val, with_unchanged)\n if val_diff:\n res[xpath] = val_diff\n return dict(res)\n\n\ndef _diff(old_raw, new_raw, with_unchanged):\n old = _parse(old_raw)\n new = _parse(new_raw)\n\n if isinstance(new, dict) or isinstance(old, dict):\n return _diff_dicts(old, new, with_unchanged)\n\n val_diff = _diff_vals(old, new, with_unchanged)\n if val_diff:\n return {\"\": val_diff}\n\n return {}\n\n\ndef diff(old, new, with_unchanged=False):\n paths = set(old.keys())\n paths.update(set(new.keys()))\n\n res = defaultdict(dict)\n for path in paths:\n path_diff = _diff(old.get(path), new.get(path), with_unchanged)\n if path_diff:\n res[path] = path_diff\n return dict(res)\n\n\ndef table(header, rows):\n from texttable import Texttable\n\n if not rows:\n return \"\"\n\n t = Texttable()\n\n # disable automatic formatting\n t.set_cols_dtype([\"t\"] * len(header))\n\n # remove borders to make it easier for users to copy stuff\n t.set_chars([\"\"] * len(header))\n t.set_deco(0)\n\n t.add_rows([header] + rows)\n\n return t.draw()\n\n\ndef format_dict(d):\n ret = {}\n for key, val in d.items():\n if isinstance(val, dict):\n new_val = format_dict(val)\n elif isinstance(val, list):\n new_val = str(val)\n else:\n new_val = val\n ret[key] = new_val\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_sys_get_inode.return.inode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_sys_get_inode.return.inode", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["imports", "get_inode", "fs_copy"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nimport errno\nimport logging\nimport os\nimport shutil\nimport stat\n\nimport nanotime\nfrom shortuuid import uuid\n\nfrom dvc.exceptions import DvcException\nfrom dvc.scm.tree import is_working_tree\nfrom dvc.system import System\nfrom dvc.utils import dict_md5\nfrom dvc.utils import fspath\nfrom dvc.utils import fspath_py35\n\n\nlogger = logging.getLogger(__name__)\n\nLOCAL_CHUNK_SIZE = 2 ** 20 # 1 MB\n\n\ndef fs_copy(src, dst):\n if os.path.isdir(src):\n shutil.copytree(src, dst)\n else:\n shutil.copy2(src, dst)\n\n\ndef get_inode(path):\n inode = System.inode(path)\n logger.debug(\"Path '%s' inode '%d'\", path, inode)\n return inode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_json_test_metrics_diff_simple.assert_dvc_metrics_diff_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_json_test_metrics_diff_simple.assert_dvc_metrics_diff_a", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 18, "span_ids": ["imports", "test_metrics_diff_simple"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import json\nimport yaml\n\n\ndef test_metrics_diff_simple(tmp_dir, scm, dvc):\n def _gen(val):\n tmp_dir.gen({\"m.yaml\": str(val)})\n dvc.run(cmd=\"\", metrics=[\"m.yaml\"])\n dvc.scm.add([\"m.yaml.dvc\"])\n dvc.scm.commit(str(val))\n\n _gen(1)\n _gen(2)\n _gen(3)\n\n expected = {\"m.yaml\": {\"\": {\"old\": 1, \"new\": 3, \"diff\": 2}}}\n\n assert dvc.metrics.diff(a_rev=\"HEAD~2\") == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_yaml_test_metrics_diff_yaml.assert_dvc_metrics_diff_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_yaml_test_metrics_diff_yaml.assert_dvc_metrics_diff_a", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 21, "end_line": 35, "span_ids": ["test_metrics_diff_yaml"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_diff_yaml(tmp_dir, scm, dvc):\n def _gen(val):\n metrics = {\"a\": {\"b\": {\"c\": val, \"d\": 1, \"e\": str(val)}}}\n tmp_dir.gen({\"m.yaml\": yaml.dump(metrics)})\n dvc.run(cmd=\"\", metrics=[\"m.yaml\"])\n dvc.scm.add([\"m.yaml.dvc\"])\n dvc.scm.commit(str(val))\n\n _gen(1)\n _gen(2)\n _gen(3)\n\n expected = {\"m.yaml\": {\"a.b.c\": {\"old\": 1, \"new\": 3, \"diff\": 2}}}\n\n assert dvc.metrics.diff(a_rev=\"HEAD~2\") == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_json_test_metrics_diff_json.assert_dvc_metrics_diff_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_json_test_metrics_diff_json.assert_dvc_metrics_diff_a", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 51, "span_ids": ["test_metrics_diff_json"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_diff_json(tmp_dir, scm, dvc):\n def _gen(val):\n metrics = {\"a\": {\"b\": {\"c\": val, \"d\": 1, \"e\": str(val)}}}\n tmp_dir.gen({\"m.json\": json.dumps(metrics)})\n dvc.run(cmd=\"\", metrics=[\"m.json\"])\n dvc.scm.add([\"m.json.dvc\"])\n dvc.scm.commit(str(val))\n\n _gen(1)\n _gen(2)\n _gen(3)\n\n expected = {\"m.json\": {\"a.b.c\": {\"old\": 1, \"new\": 3, \"diff\": 2}}}\n assert dvc.metrics.diff(a_rev=\"HEAD~2\") == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_json_unchanged_test_metrics_diff_json_unchanged.assert_dvc_metrics_diff_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_json_unchanged_test_metrics_diff_json_unchanged.assert_dvc_metrics_diff_a", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 54, "end_line": 66, "span_ids": ["test_metrics_diff_json_unchanged"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_diff_json_unchanged(tmp_dir, scm, dvc):\n def _gen(val):\n metrics = {\"a\": {\"b\": {\"c\": val, \"d\": 1, \"e\": str(val)}}}\n tmp_dir.gen({\"m.json\": json.dumps(metrics)})\n dvc.run(cmd=\"\", metrics=[\"m.json\"])\n dvc.scm.add([\"m.json.dvc\"])\n dvc.scm.commit(str(val))\n\n _gen(1)\n _gen(2)\n _gen(1)\n\n assert dvc.metrics.diff(a_rev=\"HEAD~2\") == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_broken_json_test_metrics_diff_broken_json.assert_dvc_metrics_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_broken_json_test_metrics_diff_broken_json.assert_dvc_metrics_diff_", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 83, "span_ids": ["test_metrics_diff_broken_json"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_diff_broken_json(tmp_dir, scm, dvc):\n metrics = {\"a\": {\"b\": {\"c\": 1, \"d\": 1, \"e\": \"3\"}}}\n tmp_dir.gen({\"m.json\": json.dumps(metrics)})\n dvc.run(cmd=\"\", metrics_no_cache=[\"m.json\"])\n dvc.scm.add([\"m.json.dvc\", \"m.json\"])\n dvc.scm.commit(\"add metrics\")\n\n (tmp_dir / \"m.json\").write_text(json.dumps(metrics) + \"ma\\nlformed\\n\")\n\n assert dvc.metrics.diff() == {\n \"m.json\": {\n \"a.b.c\": {\"old\": 1, \"new\": None},\n \"a.b.d\": {\"old\": 1, \"new\": None},\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_no_metrics_test_metrics_diff_new_metric.assert_dvc_metrics_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_no_metrics_test_metrics_diff_new_metric.assert_dvc_metrics_diff_", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 86, "end_line": 101, "span_ids": ["test_metrics_diff_no_metrics", "test_metrics_diff_new_metric"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_diff_no_metrics(tmp_dir, scm, dvc):\n tmp_dir.scm_gen({\"foo\": \"foo\"}, commit=\"add foo\")\n assert dvc.metrics.diff(a_rev=\"HEAD~1\") == {}\n\n\ndef test_metrics_diff_new_metric(tmp_dir, scm, dvc):\n metrics = {\"a\": {\"b\": {\"c\": 1, \"d\": 1, \"e\": \"3\"}}}\n tmp_dir.gen({\"m.json\": json.dumps(metrics)})\n dvc.run(cmd=\"\", metrics_no_cache=[\"m.json\"])\n\n assert dvc.metrics.diff() == {\n \"m.json\": {\n \"a.b.c\": {\"old\": None, \"new\": 1},\n \"a.b.d\": {\"old\": None, \"new\": 1},\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_deleted_metric_test_metrics_diff_deleted_metric.assert_dvc_metrics_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_deleted_metric_test_metrics_diff_deleted_metric.assert_dvc_metrics_diff_", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 104, "end_line": 118, "span_ids": ["test_metrics_diff_deleted_metric"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_diff_deleted_metric(tmp_dir, scm, dvc):\n metrics = {\"a\": {\"b\": {\"c\": 1, \"d\": 1, \"e\": \"3\"}}}\n tmp_dir.gen({\"m.json\": json.dumps(metrics)})\n dvc.run(cmd=\"\", metrics_no_cache=[\"m.json\"])\n dvc.scm.add([\"m.json.dvc\", \"m.json\"])\n dvc.scm.commit(\"add metrics\")\n\n (tmp_dir / \"m.json\").unlink()\n\n assert dvc.metrics.diff() == {\n \"m.json\": {\n \"a.b.c\": {\"old\": 1, \"new\": None},\n \"a.b.d\": {\"old\": 1, \"new\": None},\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_with_unchanged_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_with_unchanged_", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 136, "span_ids": ["test_metrics_diff_with_unchanged"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_diff_with_unchanged(tmp_dir, scm, dvc):\n tmp_dir.gen(\"metrics.yaml\", \"foo: 1\\nxyz: 10\")\n dvc.run(metrics_no_cache=[\"metrics.yaml\"])\n scm.add([\"metrics.yaml\", \"metrics.yaml.dvc\"])\n scm.commit(\"1\")\n\n tmp_dir.scm_gen(\"metrics.yaml\", \"foo: 2\\nxyz: 10\", commit=\"2\")\n tmp_dir.scm_gen(\"metrics.yaml\", \"foo: 3\\nxyz: 10\", commit=\"3\")\n\n assert dvc.metrics.diff(a_rev=\"HEAD~2\", all=True) == {\n \"metrics.yaml\": {\n \"foo\": {\"old\": 1, \"new\": 3, \"diff\": 2},\n \"xyz\": {\"old\": 10, \"new\": 10, \"diff\": 0},\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_pytest_test_show_invalid_metric.with_pytest_raises_NoMetr.dvc_metrics_show_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_pytest_test_show_invalid_metric.with_pytest_raises_NoMetr.dvc_metrics_show_", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_show.py", "file_name": "test_show.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 35, "span_ids": ["test_show_empty", "test_show_invalid_metric", "imports", "test_show", "test_show_simple", "test_show_multiple"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.repo.metrics.show import NoMetricsError\n\n\ndef test_show_empty(dvc):\n with pytest.raises(NoMetricsError):\n dvc.metrics.show()\n\n\ndef test_show_simple(tmp_dir, dvc):\n tmp_dir.gen(\"metrics.yaml\", \"1.1\")\n dvc.run(metrics=[\"metrics.yaml\"])\n assert dvc.metrics.show() == {\"\": {\"metrics.yaml\": 1.1}}\n\n\ndef test_show(tmp_dir, dvc):\n tmp_dir.gen(\"metrics.yaml\", \"foo: 1.1\")\n dvc.run(metrics=[\"metrics.yaml\"])\n assert dvc.metrics.show() == {\"\": {\"metrics.yaml\": {\"foo\": 1.1}}}\n\n\ndef test_show_multiple(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo: 1\\n\")\n tmp_dir.gen(\"baz\", \"baz: 2\\n\")\n dvc.run(fname=\"foo.dvc\", metrics=[\"foo\"])\n dvc.run(fname=\"baz.dvc\", metrics=[\"baz\"])\n assert dvc.metrics.show() == {\"\": {\"foo\": {\"foo\": 1}, \"baz\": {\"baz\": 2}}}\n\n\ndef test_show_invalid_metric(tmp_dir, dvc):\n tmp_dir.gen(\"metrics.yaml\", \"foo:\\n- bar\\n- baz\\nxyz: string\")\n dvc.run(metrics=[\"metrics.yaml\"])\n with pytest.raises(NoMetricsError):\n dvc.metrics.show()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_test_show_branch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_test_show_branch_", "embedding": null, "metadata": {"file_path": "tests/func/metrics/test_show.py", "file_name": "test_show.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 51, "span_ids": ["test_show_branch"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_show_branch(tmp_dir, scm, dvc):\n tmp_dir.gen(\"metrics.yaml\", \"foo: 1\")\n dvc.run(metrics_no_cache=[\"metrics.yaml\"])\n scm.add([\"metrics.yaml\", \"metrics.yaml.dvc\"])\n scm.commit(\"init\")\n\n with tmp_dir.branch(\"branch\", new=True):\n tmp_dir.scm_gen(\"metrics.yaml\", \"foo: 2\", commit=\"branch\")\n\n assert dvc.metrics.show(revs=[\"branch\"]) == {\n \"working tree\": {\"metrics.yaml\": {\"foo\": 1}},\n \"branch\": {\"metrics.yaml\": {\"foo\": 2}},\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_dict_test_diff_dict.assert_dvc_params_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_dict_test_diff_dict.assert_dvc_params_diff_", "embedding": null, "metadata": {"file_path": "tests/func/params/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 87, "span_ids": ["test_diff_dict"], "tokens": 106}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_diff_dict(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo:\\n bar: baz\")\n dvc.run(params=[\"foo\"])\n scm.add([\"params.yaml\", \"Dvcfile\"])\n scm.commit(\"foo\")\n\n tmp_dir.gen(\"params.yaml\", \"foo:\\n bar: qux\")\n\n assert dvc.params.diff() == {\n \"params.yaml\": {\"foo.bar\": {\"old\": \"baz\", \"new\": \"qux\"}}\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_with_unchanged_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_with_unchanged_", "embedding": null, "metadata": {"file_path": "tests/func/params/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 105, "span_ids": ["test_diff_with_unchanged"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_diff_with_unchanged(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\\nxyz: val\")\n dvc.run(params=[\"foo,xyz\"])\n scm.add([\"params.yaml\", \"Dvcfile\"])\n scm.commit(\"bar\")\n\n tmp_dir.scm_gen(\"params.yaml\", \"foo: baz\\nxyz: val\", commit=\"baz\")\n tmp_dir.scm_gen(\"params.yaml\", \"foo: qux\\nxyz: val\", commit=\"qux\")\n\n assert dvc.params.diff(a_rev=\"HEAD~2\", all=True) == {\n \"params.yaml\": {\n \"foo\": {\"old\": \"bar\", \"new\": \"qux\"},\n \"xyz\": {\"old\": \"val\", \"new\": \"val\"},\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_pytest_remote.return.dvc_cloud_get_remote_ups": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_pytest_remote.return.dvc_cloud_get_remote_ups", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_index.py", "file_name": "test_index.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 27, "span_ids": ["imports", "remote"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.compat import fspath\nfrom dvc.exceptions import DownloadError, UploadError\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.remote.index import RemoteIndex\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.utils.fs import remove\n\n\n@pytest.fixture(scope=\"function\")\ndef remote(tmp_dir, dvc, tmp_path_factory, mocker):\n url = fspath(tmp_path_factory.mktemp(\"upstream\"))\n dvc.config[\"remote\"][\"upstream\"] = {\"url\": url}\n dvc.config[\"core\"][\"remote\"] = \"upstream\"\n\n # patch cache_exists since the RemoteLOCAL normally overrides\n # RemoteBASE.cache_exists.\n def cache_exists(self, *args, **kwargs):\n return RemoteBASE.cache_exists(self, *args, **kwargs)\n\n mocker.patch.object(RemoteLOCAL, \"cache_exists\", cache_exists)\n\n # patch index class since RemoteLOCAL normally overrides index class\n mocker.patch.object(RemoteLOCAL, \"INDEX_CLS\", RemoteIndex)\n\n return dvc.cloud.get_remote(\"upstream\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_on_status_test_indexed_on_status.None_1.assert_foo_checksum_not_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_on_status_test_indexed_on_status.None_1.assert_foo_checksum_not_i", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_index.py", "file_name": "test_index.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 42, "span_ids": ["test_indexed_on_status"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_indexed_on_status(tmp_dir, dvc, tmp_path_factory, remote):\n foo = tmp_dir.dvc_gen({\"foo\": \"foo content\"})[0].outs[0]\n bar = tmp_dir.dvc_gen({\"bar\": {\"baz\": \"baz content\"}})[0].outs[0]\n baz = bar.dir_cache[0]\n dvc.push()\n with remote.index:\n remote.index.clear()\n\n dvc.status(cloud=True)\n with remote.index:\n assert {bar.checksum, baz[\"md5\"]} == set(remote.index.checksums())\n assert [bar.checksum] == list(remote.index.dir_checksums())\n assert foo.checksum not in remote.index.checksums()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_on_push_test_indexed_on_push.with_remote_index_.assert_foo_checksum_not_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_on_push_test_indexed_on_push.with_remote_index_.assert_foo_checksum_not_i", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_index.py", "file_name": "test_index.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 54, "span_ids": ["test_indexed_on_push"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_indexed_on_push(tmp_dir, dvc, tmp_path_factory, remote):\n foo = tmp_dir.dvc_gen({\"foo\": \"foo content\"})[0].outs[0]\n bar = tmp_dir.dvc_gen({\"bar\": {\"baz\": \"baz content\"}})[0].outs[0]\n baz = bar.dir_cache[0]\n\n dvc.push()\n with remote.index:\n assert {bar.checksum, baz[\"md5\"]} == set(remote.index.checksums())\n assert [bar.checksum] == list(remote.index.dir_checksums())\n assert foo.checksum not in remote.index.checksums()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_dir_missing_test_clear_on_download_err.mocked_clear_assert_calle": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_indexed_dir_missing_test_clear_on_download_err.mocked_clear_assert_calle", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_index.py", "file_name": "test_index.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 85, "span_ids": ["test_indexed_dir_missing", "test_clear_on_gc", "test_clear_on_download_err"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_indexed_dir_missing(tmp_dir, dvc, tmp_path_factory, remote):\n bar = tmp_dir.dvc_gen({\"bar\": {\"baz\": \"baz content\"}})[0].outs[0]\n with remote.index:\n remote.index.update([bar.checksum], [])\n dvc.status(cloud=True)\n with remote.index:\n assert not list(remote.index.checksums())\n\n\ndef test_clear_on_gc(tmp_dir, dvc, tmp_path_factory, remote, mocker):\n (foo,) = tmp_dir.dvc_gen({\"foo\": \"foo content\"})\n dvc.push()\n dvc.remove(foo.relpath)\n\n mocked_clear = mocker.patch.object(remote.INDEX_CLS, \"clear\")\n dvc.gc(workspace=True, cloud=True)\n mocked_clear.assert_called_with()\n\n\ndef test_clear_on_download_err(tmp_dir, dvc, tmp_path_factory, remote, mocker):\n tmp_dir.dvc_gen({\"foo\": \"foo content\"})\n dvc.push()\n remove(dvc.cache.local.cache_dir)\n\n mocked_clear = mocker.patch.object(remote.INDEX_CLS, \"clear\")\n mocker.patch.object(RemoteLOCAL, \"_download\", side_effect=Exception)\n with pytest.raises(DownloadError):\n dvc.pull()\n mocked_clear.assert_called_once_with()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_partial_upload_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_test_partial_upload_", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_index.py", "file_name": "test_index.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 104, "span_ids": ["test_partial_upload"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_partial_upload(tmp_dir, dvc, tmp_path_factory, remote, mocker):\n tmp_dir.dvc_gen({\"foo\": \"foo content\"})\n tmp_dir.dvc_gen({\"bar\": {\"baz\": \"baz content\"}})\n\n original = RemoteLOCAL._upload\n\n def unreliable_upload(self, from_file, to_info, name=None, **kwargs):\n if \"baz\" in name:\n raise Exception(\"stop baz\")\n return original(self, from_file, to_info, name, **kwargs)\n\n mocker.patch.object(RemoteLOCAL, \"_upload\", unreliable_upload)\n with pytest.raises(UploadError):\n dvc.push()\n with remote.index:\n assert not list(remote.index.checksums())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI.test_test_set_invalid_key.with_pytest_raises_Config.with_dvc_config_edit_as.conf_core_invalid_key": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI.test_test_set_invalid_key.with_pytest_raises_Config.with_dvc_config_edit_as.conf_core_invalid_key", "embedding": null, "metadata": {"file_path": "tests/func/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 90, "span_ids": ["test_set_invalid_key", "TestConfigCLI.test_non_existing", "TestConfigCLI.test", "TestConfigCLI.test_local"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestConfigCLI(TestDvc):\n\n def test(self):\n self._do_test(False)\n\n def test_local(self):\n self._do_test(True)\n\n def test_non_existing(self):\n ret = main([\"config\", \"non_existing_section.field\"])\n self.assertEqual(ret, 251)\n\n ret = main([\"config\", \"global.non_existing_field\"])\n self.assertEqual(ret, 251)\n\n ret = main([\"config\", \"non_existing_section.field\", \"-u\"])\n self.assertEqual(ret, 251)\n\n ret = main([\"config\", \"global.non_existing_field\", \"-u\"])\n self.assertEqual(ret, 251)\n\n ret = main([\"config\", \"core.remote\", \"myremote\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"config\", \"core.non_existing_field\", \"-u\"])\n self.assertEqual(ret, 251)\n\n\ndef test_set_invalid_key(dvc):\n with pytest.raises(ConfigError, match=r\"extra keys not allowed\"):\n with dvc.config.edit() as conf:\n conf[\"core\"][\"invalid_key\"] = \"value\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_test_merging_two_levels_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_test_merging_two_levels_", "embedding": null, "metadata": {"file_path": "tests/func/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 115, "span_ids": ["test_merging_two_levels", "test_config_loads_without_error_for_non_dvc_repo"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_merging_two_levels(dvc):\n with dvc.config.edit() as conf:\n conf[\"remote\"][\"test\"] = {\"url\": \"ssh://example.com\"}\n\n with pytest.raises(\n ConfigError, match=r\"expected 'url' for dictionary value\"\n ):\n with dvc.config.edit(\"global\") as conf:\n conf[\"remote\"][\"test\"] = {\"password\": \"1\"}\n\n with dvc.config.edit(\"local\") as conf:\n conf[\"remote\"][\"test\"] = {\"password\": \"1\"}\n\n assert dvc.config[\"remote\"][\"test\"] == {\n \"url\": \"ssh://example.com\",\n \"password\": \"1\",\n }\n\n\ndef test_config_loads_without_error_for_non_dvc_repo(tmp_dir):\n # regression testing for https://github.com/iterative/dvc/issues/3328\n Config(validate=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_pytest_test_run_load_one_for_multistage.assert_dvc_reproduce_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_pytest_test_run_load_one_for_multistage.assert_dvc_reproduce_co", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 27, "span_ids": ["imports", "test_run_load_one_for_multistage"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.dvcfile import Dvcfile\nfrom dvc.stage import Stage\nfrom dvc.loader import StageNotFound\nfrom dvc.stage.exceptions import StageFileDoesNotExistError\n\n\ndef test_run_load_one_for_multistage(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n stage1 = dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n name=\"copy-foo-foo2\",\n outs_persist_no_cache=[\"foo2\"],\n always_changed=True,\n )\n stage2 = Dvcfile(dvc, \"Dvcfile\").stages[\"copy-foo-foo2\"]\n assert stage1 == stage2\n foo_out = stage2.outs[0]\n assert stage2.cmd == \"cp foo foo2\"\n assert stage2.name == \"copy-foo-foo2\"\n assert foo_out.def_path == \"foo2\"\n assert foo_out.persist\n assert not foo_out.use_cache\n assert stage2.deps[0].def_path == \"foo\"\n assert dvc.reproduce(\":copy-foo-foo2\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_run_load_one_for_multistage_non_existing_test_run_load_one_on_single_stage.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_run_load_one_for_multistage_non_existing_test_run_load_one_on_single_stage.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 54, "span_ids": ["test_run_load_one_on_single_stage", "test_run_load_one_for_multistage_non_existing", "test_run_load_one_for_multistage_non_existing_stage_name"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_run_load_one_for_multistage_non_existing(tmp_dir, dvc):\n with pytest.raises(StageFileDoesNotExistError):\n assert Dvcfile(dvc, \"Dvcfile\").stages.get(\"copy-foo-foo2\")\n\n\ndef test_run_load_one_for_multistage_non_existing_stage_name(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n name=\"copy-foo-foo2\",\n metrics=[\"foo2\"],\n always_changed=True,\n )\n with pytest.raises(StageNotFound):\n assert Dvcfile(dvc, stage.path).stages[\"random-name\"]\n\n\ndef test_run_load_one_on_single_stage(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = dvc.run(\n cmd=\"cp foo foo2\", deps=[\"foo\"], metrics=[\"foo2\"], always_changed=True,\n )\n assert Dvcfile(dvc, stage.path).stages.get(\"random-name\")\n assert Dvcfile(dvc, stage.path).stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_has_stage_with_name_test_has_stage_with_name.assert_copy_not_in_dvcf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_has_stage_with_name_test_has_stage_with_name.assert_copy_not_in_dvcf", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 68, "span_ids": ["test_has_stage_with_name"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_has_stage_with_name(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n name=\"copy-foo-foo2\",\n metrics=[\"foo2\"],\n always_changed=True,\n )\n dvcfile = Dvcfile(dvc, \"Dvcfile\")\n assert \"copy-foo-foo2\" in dvcfile.stages\n assert \"copy\" not in dvcfile.stages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_load_all_multistage_test_load_all_multistage.assert_set_Dvcfile_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_load_all_multistage_test_load_all_multistage.assert_set_Dvcfile_dvc_", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 92, "span_ids": ["test_load_all_multistage"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_load_all_multistage(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n stage1 = dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n name=\"copy-foo-foo2\",\n metrics=[\"foo2\"],\n always_changed=True,\n )\n stages = Dvcfile(dvc, \"Dvcfile\").stages.values()\n assert len(stages) == 1\n assert list(stages) == [stage1]\n\n tmp_dir.gen(\"bar\", \"bar\")\n stage2 = dvc.run(\n cmd=\"cp bar bar2\",\n deps=[\"bar\"],\n name=\"copy-bar-bar2\",\n metrics=[\"bar2\"],\n always_changed=True,\n )\n assert set(Dvcfile(dvc, \"Dvcfile\").stages.values()) == {stage2, stage1}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_load_all_singlestage_test_load_multistage.with_pytest_raises_MultiS.Dvcfile_dvc_Dvcfile_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_load_all_singlestage_test_load_multistage.with_pytest_raises_MultiS.Dvcfile_dvc_Dvcfile_s", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 95, "end_line": 125, "span_ids": ["test_load_all_singlestage", "test_load_multistage", "test_load_singlestage"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_load_all_singlestage(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n stage1 = dvc.run(\n cmd=\"cp foo foo2\", deps=[\"foo\"], metrics=[\"foo2\"], always_changed=True,\n )\n stages = Dvcfile(dvc, \"foo2.dvc\").stages.values()\n assert len(stages) == 1\n assert list(stages) == [stage1]\n\n\ndef test_load_singlestage(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n stage1 = dvc.run(\n cmd=\"cp foo foo2\", deps=[\"foo\"], metrics=[\"foo2\"], always_changed=True,\n )\n assert Dvcfile(dvc, \"foo2.dvc\").stage == stage1\n\n\ndef test_load_multistage(tmp_dir, dvc):\n from dvc.dvcfile import MultiStageFileLoadError\n\n tmp_dir.gen(\"foo\", \"foo\")\n dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n name=\"copy-foo-foo2\",\n metrics=[\"foo2\"],\n always_changed=True,\n )\n with pytest.raises(MultiStageFileLoadError):\n Dvcfile(dvc, \"Dvcfile\").stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_is_multistage_test_is_multistage.assert_not_Dvcfile_dvc_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_is_multistage_test_is_multistage.assert_not_Dvcfile_dvc_s", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 128, "end_line": 141, "span_ids": ["test_is_multistage"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_is_multistage(tmp_dir, dvc):\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n stage1 = dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n name=\"copy-foo-foo2\",\n metrics=[\"foo2\"],\n always_changed=True,\n )\n assert Dvcfile(dvc, stage1.path).is_multi_stage()\n stage2 = dvc.run(\n cmd=\"cp bar bar2\", deps=[\"bar\"], metrics=[\"bar2\"], always_changed=True,\n )\n assert not Dvcfile(dvc, stage2.path).is_multi_stage()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_stage_collection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_stage_collection_", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 165, "span_ids": ["test_stage_collection"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stage_collection(tmp_dir, dvc):\n tmp_dir.gen(\n {\n \"dir\": {\"file1\": \"file1\", \"file2\": \"file2\"},\n \"foo\": \"foo\",\n \"bar\": \"bar\",\n }\n )\n (stage1,) = dvc.add(\"dir\")\n stage2 = dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n name=\"copy-foo-foo2\",\n metrics=[\"foo2\"],\n always_changed=True,\n )\n stage3 = dvc.run(\n cmd=\"cp bar bar2\", deps=[\"bar\"], metrics=[\"bar2\"], always_changed=True,\n )\n assert {s for s in dvc.pipeline_stages} == {stage3, stage2, stage1}\n assert {s for s in dvc.stages} == {Stage(dvc, \"foo2.dvc\"), stage1, stage3}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_positive_test_gc_cloud_positive.for_flag_in_cw_ca_.assert_main_gc_vf_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_positive_test_gc_cloud_positive.for_flag_in_cw_ca_.assert_main_gc_vf_", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 297, "end_line": 306, "span_ids": ["test_gc_cloud_positive"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_gc_cloud_positive(tmp_dir, dvc, tmp_path_factory):\n with dvc.config.edit() as conf:\n storage = fspath(tmp_path_factory.mktemp(\"test_remote_base\"))\n conf[\"remote\"][\"local_remote\"] = {\"url\": storage}\n conf[\"core\"][\"remote\"] = \"local_remote\"\n\n dvc.push()\n\n for flag in [\"-cw\", \"-ca\", \"-cT\", \"-caT\", \"-cwT\"]:\n assert main([\"gc\", \"-vf\", flag]) == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_remove_order_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_cloud_remove_order_", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 309, "end_line": 335, "span_ids": ["test_gc_cloud_remove_order"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_gc_cloud_remove_order(tmp_dir, scm, dvc, tmp_path_factory, mocker):\n storage = fspath(tmp_path_factory.mktemp(\"test_remote_base\"))\n dvc.config[\"remote\"][\"local_remote\"] = {\"url\": storage}\n dvc.config[\"core\"][\"remote\"] = \"local_remote\"\n\n (standalone, dir1, dir2) = tmp_dir.dvc_gen(\n {\n \"file1\": \"standalone\",\n \"dir1\": {\"file2\": \"file2\"},\n \"dir2\": {\"file3\": \"file3\", \"file4\": \"file4\"},\n }\n )\n dvc.push()\n dvc.remove(standalone.relpath)\n dvc.remove(dir1.relpath)\n dvc.remove(dir2.relpath)\n dvc.gc(workspace=True)\n\n mocked_remove = mocker.patch.object(RemoteLOCAL, \"remove\", autospec=True)\n dvc.gc(workspace=True, cloud=True)\n assert len(mocked_remove.mock_calls) == 8\n # dir (and unpacked dir) should be first 4 checksums removed from\n # the remote\n for args in mocked_remove.call_args_list[:4]:\n checksum = str(args[0][1])\n assert checksum.endswith(\".dir\") or checksum.endswith(\".dir.unpacked\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_split_pipeline_test_split_pipeline.assert_set_edges_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_split_pipeline_test_split_pipeline.assert_set_edges_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 242, "end_line": 268, "span_ids": ["test_split_pipeline"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_split_pipeline(tmp_dir, scm, dvc):\n tmp_dir.scm_gen(\"git_dep1\", \"git_dep1\")\n tmp_dir.scm_gen(\"git_dep2\", \"git_dep2\")\n\n tmp_dir.dvc_gen(\"data\", \"source file content\")\n dvc.run(\n deps=[\"git_dep1\", \"data\"],\n outs=[\"data_train\", \"data_valid\"],\n cmd=\"echo train >> data_train && echo valid >> data_valid\",\n )\n stage = dvc.run(\n deps=[\"git_dep2\", \"data_train\", \"data_valid\"],\n outs=[\"result\"],\n cmd=\"echo result >> result\",\n )\n\n command = CmdPipelineShow([])\n nodes, edges, is_tree = command._build_graph(\n stage.path, commands=False, outs=True\n )\n assert set(nodes) == {\"data\", \"data_train\", \"data_valid\", \"result\"}\n assert set(edges) == {\n (\"result\", \"data_train\"),\n (\"result\", \"data_valid\"),\n (\"data_train\", \"data\"),\n (\"data_valid\", \"data\"),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_pipeline_list_show_multistage_test_pipeline_list_show_multistage.None_2.assert_1_pipelines_in_to": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_pipeline_list_show_multistage_test_pipeline_list_show_multistage.None_2.assert_1_pipelines_in_to", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 271, "end_line": 296, "span_ids": ["test_pipeline_list_show_multistage"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pipeline_list_show_multistage(tmp_dir, dvc, run_copy, caplog):\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n run_copy(\"bar\", \"foobar\")\n command = CmdPipelineShow([])\n\n caplog.clear()\n with caplog.at_level(logging.INFO, \"dvc\"):\n command._show(\"foobar.dvc\", False, False, False)\n output = caplog.text.splitlines()\n assert \"Dvcfile:copy-foo-bar\" in output[0]\n assert \"foobar.dvc\" in output[1]\n\n caplog.clear()\n with caplog.at_level(logging.INFO, \"dvc\"):\n command._show(\"Dvcfile:copy-foo-bar\", False, False, False)\n assert \"Dvcfile:copy-foo-bar\" in caplog.text\n assert \"foobar.dvc\" not in caplog.text\n\n command = CmdPipelineList([])\n caplog.clear()\n with caplog.at_level(logging.INFO, \"dvc\"):\n command.run()\n assert \"Dvcfile:copy-foo-bar\" in caplog.text\n assert \"foobar.dvc\" in caplog.text\n assert \"1 pipelines in total\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_pipeline_ascii_multistage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_pipeline_ascii_multistage_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 299, "end_line": 312, "span_ids": ["test_pipeline_ascii_multistage"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pipeline_ascii_multistage(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n run_copy(\"bar\", \"foobar\")\n command = CmdPipelineShow([])\n nodes, edges, is_tree = command._build_graph(\"foobar.dvc\")\n assert set(nodes) == {\"Dvcfile:copy-foo-bar\", \"foobar.dvc\"}\n assert set(edges) == {\n (\"foobar.dvc\", \"Dvcfile:copy-foo-bar\"),\n }\n\n nodes, edges, is_tree = command._build_graph(\"Dvcfile:copy-foo-bar\")\n assert set(nodes) == {\"Dvcfile:copy-foo-bar\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_modify_missing_remote_test_external_dir_resource_on_no_cache.with_pytest_raises_Remote.dvc_run_deps_fspath_exte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_modify_missing_remote_test_external_dir_resource_on_no_cache.with_pytest_raises_Remote.dvc_run_deps_fspath_exte", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 242, "span_ids": ["test_modify_missing_remote", "test_external_dir_resource_on_no_cache"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_modify_missing_remote(tmp_dir, dvc):\n assert main([\"remote\", \"modify\", \"myremote\", \"user\", \"xxx\"]) == 251\n\n\ndef test_external_dir_resource_on_no_cache(tmp_dir, dvc, tmp_path_factory):\n # https://github.com/iterative/dvc/issues/2647, is some situations\n # (external dir dependency) cache is required to calculate dir md5\n external_dir = tmp_path_factory.mktemp(\"external_dir\")\n (external_dir / \"file\").write_text(\"content\")\n\n dvc.cache.local = None\n with pytest.raises(RemoteCacheRequiredError):\n dvc.run(deps=[fspath(external_dir)])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_push_order_test_push_order.assert_mocked_upload_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_push_order_test_push_order.assert_mocked_upload_call", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 245, "end_line": 256, "span_ids": ["test_push_order"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_push_order(tmp_dir, dvc, tmp_path_factory, mocker):\n url = fspath(tmp_path_factory.mktemp(\"upstream\"))\n dvc.config[\"remote\"][\"upstream\"] = {\"url\": url}\n dvc.config[\"core\"][\"remote\"] = \"upstream\"\n\n tmp_dir.dvc_gen({\"foo\": {\"bar\": \"bar content\"}})\n tmp_dir.dvc_gen({\"baz\": \"baz content\"})\n\n mocked_upload = mocker.patch.object(RemoteLOCAL, \"_upload\", return_value=0)\n dvc.push()\n # last uploaded file should be dir checksum\n assert mocked_upload.call_args[0][0].endswith(\".dir\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_modify_validation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_modify_validation_", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 259, "end_line": 273, "span_ids": ["test_remote_modify_validation"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_remote_modify_validation(dvc):\n remote_name = \"drive\"\n unsupported_config = \"unsupported_config\"\n assert (\n main([\"remote\", \"add\", \"-d\", remote_name, \"gdrive://test/test\"]) == 0\n )\n assert (\n main(\n [\"remote\", \"modify\", remote_name, unsupported_config, \"something\"]\n )\n == 251\n )\n config = configobj.ConfigObj(dvc.config.files[\"repo\"])\n assert unsupported_config not in config['remote \"{}\"'.format(remote_name)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_filecmp_SingleStageRun._get_stage_target.return.stage_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_filecmp_SingleStageRun._get_stage_target.return.stage_path", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 60, "span_ids": ["imports", "SingleStageRun._run", "SingleStageRun", "SingleStageRun._get_stage_target"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import filecmp\nimport getpass\nimport os\nimport posixpath\nimport re\nimport shutil\nimport uuid\nfrom pathlib import Path\nfrom subprocess import PIPE\nfrom subprocess import Popen\nfrom urllib.parse import urljoin\nfrom unittest import SkipTest\n\nimport boto3\nimport paramiko\nimport pytest\nfrom flaky.flaky_decorator import flaky\nfrom google.cloud import storage as gc\nfrom mock import patch\n\nfrom dvc.compat import fspath\nfrom dvc.exceptions import CyclicGraphError\nfrom dvc.exceptions import ReproductionError\nfrom dvc.exceptions import StagePathAsOutputError\nfrom dvc.main import main\nfrom dvc.output.base import OutputBase\nfrom dvc.path_info import URLInfo\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.stage import Stage\nfrom dvc.dvcfile import Dvcfile\nfrom dvc.stage.exceptions import StageFileDoesNotExistError\nfrom dvc.system import System\nfrom dvc.utils import file_md5\nfrom dvc.utils import relpath\nfrom dvc.utils.stage import dump_stage_file\nfrom dvc.utils.stage import load_stage_file\nfrom dvc.utils.fs import remove\nfrom tests.basic_env import TestDvc\nfrom tests.remotes import (\n GCP,\n HDFS,\n Local,\n S3,\n SSH,\n SSHMocked,\n TEST_AWS_REPO_BUCKET,\n TEST_GCP_REPO_BUCKET,\n)\nfrom tests.utils.httpd import StaticFileServer, ContentMD5Handler\n\n\nclass SingleStageRun:\n def _run(self, **kwargs):\n kwargs.pop(\"name\", None)\n return self.dvc.run(**kwargs)\n\n @staticmethod\n def _get_stage_target(stage):\n return stage.path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__TODO_Test_for_multis_TestReproDepUnderDir.test.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__TODO_Test_for_multis_TestReproDepUnderDir.test.None_6", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 228, "end_line": 254, "span_ids": ["TestReproDepUnderDir.test", "TestReproDepUnderDir", "TestReproWorkingDirectoryAsOutput.test_similar_paths"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# TODO: Test ^ for multistage\n\n\nclass TestReproDepUnderDir(SingleStageRun, TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.dir_stage = stages[0]\n self.assertTrue(self.dir_stage is not None)\n\n self.file1 = \"file1\"\n stage = self._run(\n fname=self.file1 + \".dvc\",\n outs=[self.file1],\n deps=[self.DATA, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.DATA, self.file1),\n name=\"copy-data-file1\",\n )\n\n self.assertTrue(filecmp.cmp(self.file1, self.DATA, shallow=False))\n\n os.unlink(self.DATA)\n shutil.copyfile(self.FOO, self.DATA)\n\n stages = self.dvc.reproduce(self._get_stage_target(stage))\n self.assertEqual(len(stages), 2)\n self.assertTrue(filecmp.cmp(self.file1, self.FOO, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPipeline_TestReproPipelines.test_cli.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPipeline_TestReproPipelines.test_cli.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 480, "end_line": 533, "span_ids": ["TestReproPipelines", "TestReproPipelines.setUp", "TestReproPipelines.test", "TestReproPipeline", "TestReproPipelines.test_cli", "TestReproPipeline.test_cli", "TestReproPipeline.test"], "tokens": 421}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproPipeline(TestReproChangedDeepData):\n def test(self):\n stages = self.dvc.reproduce(\n self._get_stage_target(self.stage), force=True, pipeline=True\n )\n self.assertEqual(len(stages), 3)\n\n def test_cli(self):\n ret = main(\n [\"repro\", \"--pipeline\", \"-f\", self._get_stage_target(self.stage)]\n )\n self.assertEqual(ret, 0)\n\n\nclass TestReproPipelines(SingleStageRun, TestDvc):\n def setUp(self):\n super().setUp()\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n self.foo_stage = stages[0]\n self.assertTrue(self.foo_stage is not None)\n\n stages = self.dvc.add(self.BAR)\n self.assertEqual(len(stages), 1)\n self.bar_stage = stages[0]\n self.assertTrue(self.bar_stage is not None)\n\n self.file1 = \"file1\"\n self.file1_stage = self.dvc.run(\n fname=self.file1 + \".dvc\",\n outs=[self.file1],\n deps=[self.FOO, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, self.file1),\n )\n\n self.file2 = \"file2\"\n self.file2_stage = self._run(\n fname=self.file2 + \".dvc\",\n outs=[self.file2],\n deps=[self.BAR, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.BAR, self.file2),\n name=\"copy-BAR-file2\",\n )\n\n def test(self):\n stages = self.dvc.reproduce(all_pipelines=True, force=True)\n self.assertEqual(len(stages), 4)\n self.assertTrue(self.file1_stage in stages)\n self.assertTrue(self.file2_stage in stages)\n\n def test_cli(self):\n ret = main([\"repro\", \"-f\", \"-P\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDir_TestReproChangedDir.test.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDir_TestReproChangedDir.test.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 671, "end_line": 701, "span_ids": ["TestReproChangedDir", "TestReproChangedDir.test"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproChangedDir(SingleStageRun, TestDvc):\n def test(self):\n file_name = \"file\"\n shutil.copyfile(self.FOO, file_name)\n\n dir_name = \"dir\"\n dir_code = \"dir.py\"\n code = (\n 'import os; import shutil; os.mkdir(\"{}\"); '\n 'shutil.copyfile(\"{}\", os.path.join(\"{}\", \"{}\"))'\n )\n\n with open(dir_code, \"w+\") as fd:\n fd.write(code.format(dir_name, file_name, dir_name, file_name))\n\n stage = self._run(\n outs=[dir_name],\n deps=[file_name, dir_code],\n cmd=\"python {}\".format(dir_code),\n name=\"copy-in-dir\",\n )\n target = self._get_stage_target(stage)\n\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 0)\n\n os.unlink(file_name)\n shutil.copyfile(self.BAR, file_name)\n\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAllPipelines_TestReproAllPipelines.test.with_patch_object_.self_assertEqual_mock_rep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAllPipelines_TestReproAllPipelines.test.with_patch_object_.self_assertEqual_mock_rep", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1243, "end_line": 1283, "span_ids": ["TestReproAllPipelines", "TestReproAllPipelines.test"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproAllPipelines(SingleStageRun, TestDvc):\n def test(self):\n stages = [\n self._run(\n fname=\"start.dvc\",\n outs=[\"start.txt\"],\n cmd=\"echo start > start.txt\",\n name=\"start\",\n ),\n self._run(\n fname=\"middle.dvc\",\n deps=[\"start.txt\"],\n outs=[\"middle.txt\"],\n cmd=\"echo middle > middle.txt\",\n name=\"middle\",\n ),\n self._run(\n fname=\"final.dvc\",\n deps=[\"middle.txt\"],\n outs=[\"final.txt\"],\n cmd=\"echo final > final.txt\",\n name=\"final\",\n ),\n self._run(\n fname=\"disconnected.dvc\",\n outs=[\"disconnected.txt\"],\n cmd=\"echo other > disconnected.txt\",\n name=\"disconnected\",\n ),\n ]\n\n from dvc.state import StateNoop\n\n self.dvc.state = StateNoop()\n\n with patch.object(\n Stage, \"reproduce\", side_effect=stages\n ) as mock_reproduce:\n ret = main([\"repro\", \"--all-pipelines\"])\n self.assertEqual(ret, 0)\n self.assertEqual(mock_reproduce.call_count, 4)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproNoCommit_TestReproAlreadyCached.test.self_assertNotEqual_run_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproNoCommit_TestReproAlreadyCached.test.self_assertNotEqual_run_o", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1286, "end_line": 1310, "span_ids": ["TestReproAlreadyCached", "TestReproAlreadyCached.test", "TestReproNoCommit.test", "TestReproNoCommit"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproNoCommit(TestRepro):\n def test(self):\n remove(self.dvc.cache.local.cache_dir)\n ret = main(\n [\"repro\", self._get_stage_target(self.stage), \"--no-commit\"]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.path.exists(self.dvc.cache.local.cache_dir))\n\n\nclass TestReproAlreadyCached(TestRepro):\n def test(self):\n stage = self._run(\n fname=\"datetime.dvc\",\n deps=[],\n outs=[\"datetime.txt\"],\n cmd='python -c \"import time; print(time.time())\" > datetime.txt',\n name=\"datetime\",\n )\n run_out = stage.outs[0]\n repro_out = self.dvc.reproduce(self._get_stage_target(stage))[0].outs[\n 0\n ]\n\n self.assertNotEqual(run_out.checksum, repro_out.checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached.test_force_with_dependencies_TestReproAlreadyCached.test_force_with_dependencies.self_assertNotEqual_run_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached.test_force_with_dependencies_TestReproAlreadyCached.test_force_with_dependencies.self_assertNotEqual_run_o", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1312, "end_line": 1325, "span_ids": ["TestReproAlreadyCached.test_force_with_dependencies"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproAlreadyCached(TestRepro):\n\n def test_force_with_dependencies(self):\n run_out = self.dvc.run(\n fname=\"datetime.dvc\",\n deps=[self.FOO],\n outs=[\"datetime.txt\"],\n cmd='python -c \"import time; print(time.time())\" > datetime.txt',\n ).outs[0]\n\n ret = main([\"repro\", \"--force\", \"datetime.dvc\"])\n self.assertEqual(ret, 0)\n\n repro_out = Dvcfile(self.dvc, \"datetime.dvc\").stage.outs[0]\n\n self.assertNotEqual(run_out.checksum, repro_out.checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_os_TestReproChangedDirDataMultiStage.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_os_TestReproChangedDirDataMultiStage.pass", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 157, "span_ids": ["TestReproChangedDirMultiStage", "TestReproCyclicGraphMultiStage", "TestReproFailMultiStage", "TestReproChangedDirDataMultiStage", "MultiStageRun", "MultiStageRun._get_stage_target", "TestReproLockedCallbackMultiStage", "MultiStageRun._run", "TestReproUnderDirMultiStage", "TestReproPipelineMultiStage", "TestReproAllPipelinesMultiStage", "TestReproPipelinesMultiStage", "TestNonExistingOutputMultiStage", "TestReproLockedMultiStage", "TestReproNoDepsMultiStage", "TestReproDry", "TestReproLockedUnchangedMultiStage", "TestReproForceMultiStage", "TestReproChangedDeepDataMultiStage", "imports", "TestReproChangedCodeMultiStage", "TestReproPhonyMultiStage", "TestReproChangedDataMultiStage", "TestCmdReproMultiStage", "TestReproAlreadyCachedMultiStage", "TestReproUpToDateMultiStage", "TestReproNoCommit", "TestReproDepDirWithOutputsUnderItMultiStage"], "tokens": 799}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom textwrap import dedent\n\nimport pytest\n\nfrom dvc.exceptions import CyclicGraphError\nfrom dvc.stage import PipelineStage\nfrom dvc.utils.stage import dump_stage_file\nfrom tests.func import test_repro\n\nfrom dvc.main import main\n\n\nCOPY_SCRIPT_FORMAT = dedent(\n \"\"\"\\\n import sys\n import shutil\n shutil.copyfile({}, {})\n\"\"\"\n)\nCOPY_SCRIPT = COPY_SCRIPT_FORMAT.format(\"sys.argv[1]\", \"sys.argv[2]\")\n\n\nclass MultiStageRun:\n def _run(self, **kwargs):\n assert kwargs.get(\"name\")\n kwargs.pop(\"fname\", None)\n # ignore fname for now\n return self.dvc.run(**kwargs)\n\n @staticmethod\n def _get_stage_target(stage):\n return stage.path + \":\" + stage.name\n\n\nclass TestReproFailMultiStage(MultiStageRun, test_repro.TestReproFail):\n pass\n\n\nclass TestReproCyclicGraphMultiStage(\n MultiStageRun, test_repro.TestReproCyclicGraph\n):\n pass\n\n\nclass TestReproUnderDirMultiStage(\n MultiStageRun, test_repro.TestReproDepUnderDir\n):\n pass\n\n\nclass TestReproDepDirWithOutputsUnderItMultiStage(\n MultiStageRun, test_repro.TestReproDepDirWithOutputsUnderIt\n):\n pass\n\n\nclass TestReproNoDepsMultiStage(MultiStageRun, test_repro.TestReproNoDeps):\n pass\n\n\nclass TestReproForceMultiStage(MultiStageRun, test_repro.TestReproForce):\n pass\n\n\nclass TestReproChangedCodeMultiStage(\n MultiStageRun, test_repro.TestReproChangedCode\n):\n pass\n\n\nclass TestReproChangedDataMultiStage(\n MultiStageRun, test_repro.TestReproChangedData\n):\n pass\n\n\nclass TestReproDry(MultiStageRun, test_repro.TestReproDry):\n pass\n\n\nclass TestReproUpToDateMultiStage(MultiStageRun, test_repro.TestReproUpToDate):\n pass\n\n\nclass TestReproChangedDeepDataMultiStage(\n MultiStageRun, test_repro.TestReproChangedDeepData\n):\n pass\n\n\nclass TestReproPipelineMultiStage(MultiStageRun, test_repro.TestReproPipeline):\n pass\n\n\nclass TestReproPipelinesMultiStage(\n MultiStageRun, test_repro.TestReproPipelines\n):\n pass\n\n\nclass TestReproLockedMultiStage(MultiStageRun, test_repro.TestReproLocked):\n pass\n\n\nclass TestReproLockedCallbackMultiStage(\n MultiStageRun, test_repro.TestReproLockedCallback\n):\n pass\n\n\nclass TestReproLockedUnchangedMultiStage(\n MultiStageRun, test_repro.TestReproLockedUnchanged\n):\n pass\n\n\nclass TestReproPhonyMultiStage(MultiStageRun, test_repro.TestReproPhony):\n pass\n\n\nclass TestCmdReproMultiStage(MultiStageRun, test_repro.TestCmdRepro):\n pass\n\n\nclass TestReproAllPipelinesMultiStage(\n MultiStageRun, test_repro.TestReproAllPipelines\n):\n pass\n\n\nclass TestReproNoCommit(MultiStageRun, test_repro.TestReproNoCommit):\n pass\n\n\nclass TestNonExistingOutputMultiStage(\n MultiStageRun, test_repro.TestNonExistingOutput\n):\n pass\n\n\nclass TestReproAlreadyCachedMultiStage(\n MultiStageRun, test_repro.TestReproAlreadyCached\n):\n pass\n\n\nclass TestReproChangedDirMultiStage(\n MultiStageRun, test_repro.TestReproChangedDir\n):\n pass\n\n\nclass TestReproChangedDirDataMultiStage(\n MultiStageRun, test_repro.TestReproChangedDirData\n):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_non_existing_stage_name_test_downstream.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_non_existing_stage_name_test_downstream.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 160, "end_line": 223, "span_ids": ["test_non_existing_stage_name", "test_downstream"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_non_existing_stage_name(tmp_dir, dvc, run_copy):\n from dvc.exceptions import DvcException\n\n tmp_dir.gen(\"file1\", \"file1\")\n run_copy(\"file1\", \"file2\", name=\"copy-file1-file2\")\n\n with pytest.raises(DvcException):\n dvc.lock_stage(\":copy-file1-file3\")\n\n assert main([\"lock\", \":copy-file1-file3\"]) != 0\n\n\n# TODO: TestReproWorkingDirectoryAsOutput\n\n\ndef test_downstream(tmp_dir, dvc):\n # The dependency graph should look like this:\n #\n # E\n # / \\\n # D F\n # / \\ \\\n # B C G\n # \\ /\n # A\n #\n assert main([\"run\", \"-n\", \"A-gen\", \"-o\", \"A\", \"echo A>A\"]) == 0\n assert main([\"run\", \"-n\", \"B-gen\", \"-d\", \"A\", \"-o\", \"B\", \"echo B>B\"]) == 0\n assert main([\"run\", \"-d\", \"A\", \"-o\", \"C\", \"echo C>C\"]) == 0\n assert (\n main(\n [\"run\", \"-n\", \"D-gen\", \"-d\", \"B\", \"-d\", \"C\", \"-o\", \"D\", \"echo D>D\"]\n )\n == 0\n )\n assert main([\"run\", \"-o\", \"G\", \"echo G>G\"]) == 0\n assert main([\"run\", \"-n\", \"F-gen\", \"-d\", \"G\", \"-o\", \"F\", \"echo F>F\"]) == 0\n assert main([\"run\", \"-d\", \"D\", \"-d\", \"F\", \"-o\", \"E\", \"echo E>E\"]) == 0\n\n # We want the evaluation to move from B to E\n #\n # E\n # /\n # D\n # /\n # B\n #\n evaluation = dvc.reproduce(\"Dvcfile:B-gen\", downstream=True, force=True)\n\n assert len(evaluation) == 3\n assert (\n isinstance(evaluation[0], PipelineStage)\n and evaluation[0].relpath == \"Dvcfile\"\n and evaluation[0].name == \"B-gen\"\n )\n assert (\n isinstance(evaluation[1], PipelineStage)\n and evaluation[1].relpath == \"Dvcfile\"\n and evaluation[1].name == \"D-gen\"\n )\n assert (\n not isinstance(evaluation[2], PipelineStage)\n and evaluation[2].relpath == \"E.dvc\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_cmd_changes_test_repro_when_cmd_changes.assert_dvc_reproduce_targ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_cmd_changes_test_repro_when_cmd_changes.assert_dvc_reproduce_targ", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 237, "span_ids": ["test_repro_when_cmd_changes"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repro_when_cmd_changes(tmp_dir, dvc, run_copy):\n from dvc.dvcfile import Dvcfile\n\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", fname=\"copy-process.dvc\", name=\"copy-file\")\n target = \"copy-process.dvc:copy-file\"\n assert not dvc.reproduce(target)\n\n stage.cmd = \" \".join(stage.cmd.split()) # change cmd spacing by two\n Dvcfile(dvc, \"copy-process.dvc\").dump_multistage_dvcfile(stage)\n\n assert dvc.reproduce(target)[0] == stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_is_added_in_dvcfile_test_repro_when_new_deps_is_added_in_dvcfile.assert_dvc_reproduce_targ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_is_added_in_dvcfile_test_repro_when_new_deps_is_added_in_dvcfile.assert_dvc_reproduce_targ", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 240, "end_line": 260, "span_ids": ["test_repro_when_new_deps_is_added_in_dvcfile"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repro_when_new_deps_is_added_in_dvcfile(tmp_dir, dvc, run_copy):\n from dvc.dvcfile import Dvcfile\n\n tmp_dir.gen(\"copy.py\", COPY_SCRIPT)\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n stage = dvc.run(\n cmd=\"python copy.py {} {}\".format(\"foo\", \"foobar\"),\n outs=[\"foobar\"],\n deps=[\"foo\"],\n fname=\"copy-process.dvc\",\n name=\"copy-file\",\n )\n target = \"copy-process.dvc:copy-file\"\n assert not dvc.reproduce(target)\n\n dvcfile = Dvcfile(dvc, stage.path)\n data, _ = dvcfile._load()\n data[\"stages\"][\"copy-file\"][\"deps\"] += [\"copy.py\"]\n dump_stage_file(stage.path, data)\n\n assert dvc.reproduce(target)[0] == stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_outs_is_added_in_dvcfile_test_repro_when_new_outs_is_added_in_dvcfile.assert_dvc_reproduce_targ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_outs_is_added_in_dvcfile_test_repro_when_new_outs_is_added_in_dvcfile.assert_dvc_reproduce_targ", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 263, "end_line": 283, "span_ids": ["test_repro_when_new_outs_is_added_in_dvcfile"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repro_when_new_outs_is_added_in_dvcfile(tmp_dir, dvc):\n from dvc.dvcfile import Dvcfile\n\n tmp_dir.gen(\"copy.py\", COPY_SCRIPT)\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n stage = dvc.run(\n cmd=\"python copy.py {} {}\".format(\"foo\", \"foobar\"),\n outs=[], # scenario where user forgot to add\n deps=[\"foo\"],\n fname=\"copy-process.dvc\",\n name=\"copy-file\",\n )\n target = \"copy-process.dvc:copy-file\"\n assert not dvc.reproduce(target)\n\n dvcfile = Dvcfile(dvc, stage.path)\n data, _ = dvcfile._load()\n data[\"stages\"][\"copy-file\"][\"outs\"] = [\"foobar\"]\n dump_stage_file(stage.path, data)\n\n assert dvc.reproduce(target)[0] == stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_is_moved_test_repro_when_new_deps_is_moved.assert_dvc_reproduce_targ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_is_moved_test_repro_when_new_deps_is_moved.assert_dvc_reproduce_targ", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 286, "end_line": 311, "span_ids": ["test_repro_when_new_deps_is_moved"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repro_when_new_deps_is_moved(tmp_dir, dvc):\n from dvc.dvcfile import Dvcfile\n\n tmp_dir.gen(\"copy.py\", COPY_SCRIPT)\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"foo\"})\n stage = dvc.run(\n cmd=\"python copy.py {} {}\".format(\"foo\", \"foobar\"),\n outs=[\"foobar\"],\n deps=[\"foo\"],\n fname=\"copy-process.dvc\",\n name=\"copy-file\",\n )\n target = \"copy-process.dvc:copy-file\"\n assert not dvc.reproduce(target)\n\n tmp_dir.gen(\"copy.py\", COPY_SCRIPT_FORMAT.format(\"'bar'\", \"'foobar'\"))\n from shutil import move\n\n move(\"foo\", \"bar\")\n\n dvcfile = Dvcfile(dvc, stage.path)\n data, _ = dvcfile._load()\n data[\"stages\"][\"copy-file\"][\"deps\"] = [\"bar\"]\n dump_stage_file(stage.path, data)\n\n assert dvc.reproduce(target)[0] == stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_out_overlaps_others_stage_outs_test_repro_when_new_out_overlaps_others_stage_outs.with_pytest_raises_Overla.dvc_reproduce_run_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_out_overlaps_others_stage_outs_test_repro_when_new_out_overlaps_others_stage_outs.with_pytest_raises_Overla.dvc_reproduce_run_copy_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 314, "end_line": 332, "span_ids": ["test_repro_when_new_out_overlaps_others_stage_outs"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repro_when_new_out_overlaps_others_stage_outs(tmp_dir, dvc):\n from dvc.exceptions import OverlappingOutputPathsError\n\n tmp_dir.gen({\"dir\": {\"file1\": \"file1\"}, \"foo\": \"foo\"})\n dvc.add(\"dir\")\n dump_stage_file(\n \"Dvcfile\",\n {\n \"stages\": {\n \"run-copy\": {\n \"cmd\": \"python copy {} {}\".format(\"foo\", \"dir/foo\"),\n \"deps\": [\"foo\"],\n \"outs\": [\"dir/foo\"],\n }\n }\n },\n )\n with pytest.raises(OverlappingOutputPathsError):\n dvc.reproduce(\":run-copy\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_added_does_not_exist_test_repro_when_new_deps_added_does_not_exist.with_pytest_raises_Reprod.dvc_reproduce_run_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_deps_added_does_not_exist_test_repro_when_new_deps_added_does_not_exist.with_pytest_raises_Reprod.dvc_reproduce_run_copy_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 335, "end_line": 353, "span_ids": ["test_repro_when_new_deps_added_does_not_exist"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repro_when_new_deps_added_does_not_exist(tmp_dir, dvc):\n from dvc.exceptions import ReproductionError\n\n tmp_dir.gen(\"copy.py\", COPY_SCRIPT)\n tmp_dir.gen(\"foo\", \"foo\")\n dump_stage_file(\n \"Dvcfile\",\n {\n \"stages\": {\n \"run-copy\": {\n \"cmd\": \"python copy.py {} {}\".format(\"foo\", \"foobar\"),\n \"deps\": [\"foo\", \"bar\"],\n \"outs\": [\"foobar\"],\n }\n }\n },\n )\n with pytest.raises(ReproductionError):\n dvc.reproduce(\":run-copy\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_outs_added_does_not_exist_test_repro_when_new_outs_added_does_not_exist.with_pytest_raises_Reprod.dvc_reproduce_run_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_new_outs_added_does_not_exist_test_repro_when_new_outs_added_does_not_exist.with_pytest_raises_Reprod.dvc_reproduce_run_copy_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 356, "end_line": 374, "span_ids": ["test_repro_when_new_outs_added_does_not_exist"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repro_when_new_outs_added_does_not_exist(tmp_dir, dvc):\n from dvc.exceptions import ReproductionError\n\n tmp_dir.gen(\"copy.py\", COPY_SCRIPT)\n tmp_dir.gen(\"foo\", \"foo\")\n dump_stage_file(\n \"Dvcfile\",\n {\n \"stages\": {\n \"run-copy\": {\n \"cmd\": \"python copy {} {}\".format(\"foo\", \"foobar\"),\n \"deps\": [\"foo\"],\n \"outs\": [\"foobar\", \"bar\"],\n }\n }\n },\n )\n with pytest.raises(ReproductionError):\n dvc.reproduce(\":run-copy\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_lockfile_gets_deleted_test_repro_when_lockfile_gets_deleted.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_when_lockfile_gets_deleted_test_repro_when_lockfile_gets_deleted.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 377, "end_line": 405, "span_ids": ["test_repro_when_lockfile_gets_deleted"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repro_when_lockfile_gets_deleted(tmp_dir, dvc):\n tmp_dir.gen(\"copy.py\", COPY_SCRIPT)\n tmp_dir.gen(\"foo\", \"foo\")\n dump_stage_file(\n \"Dvcfile\",\n {\n \"stages\": {\n \"run-copy\": {\n \"cmd\": \"python copy.py {} {}\".format(\"foo\", \"foobar\"),\n \"deps\": [\"foo\"],\n \"outs\": [\"foobar\"],\n }\n }\n },\n )\n assert dvc.reproduce(\":run-copy\")\n assert os.path.exists(\"Dvcfile.lock\")\n assert os.path.exists(\"foobar.dvc\")\n\n assert not dvc.reproduce(\":run-copy\")\n os.unlink(\"Dvcfile.lock\")\n stages = dvc.reproduce(\":run-copy\")\n assert (\n stages\n and stages[0].relpath == \"Dvcfile\"\n and stages[0].name == \"run-copy\"\n )\n\n assert os.path.exists(\"foobar.dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_cyclic_graph_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_cyclic_graph_error_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro_multistage.py", "file_name": "test_repro_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 408, "end_line": 427, "span_ids": ["test_cyclic_graph_error"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_cyclic_graph_error(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n run_copy(\"bar\", \"baz\", name=\"copy-bar-baz\")\n run_copy(\"baz\", \"foobar\", name=\"copy-baz-foobar\")\n\n stage_dump = {\n \"stages\": {\n \"copy-baz-foo\": {\n \"cmd\": \"echo baz > foo\",\n \"deps\": [\"baz\"],\n \"outs\": [\"foo\"],\n }\n }\n }\n dump_stage_file(\"cycle.dvc\", stage_dump)\n\n with pytest.raises(CyclicGraphError):\n dvc.reproduce(\"cycle.dvc:copy-baz-foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_pytest_test_run_with_name.assert_os_path_exists_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_pytest_test_run_with_name.assert_os_path_exists_fo", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["test_run_with_name", "imports"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport os\n\n\ndef test_run_with_name(tmp_dir, dvc, run_copy):\n from dvc.stage import PipelineStage\n from dvc.dvcfile import DVC_FILE, DVC_FILE_SUFFIX\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n assert not os.path.exists(DVC_FILE)\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-to-bar\")\n assert isinstance(stage, PipelineStage)\n assert stage.name == \"copy-foo-to-bar\"\n assert os.path.exists(DVC_FILE)\n assert os.path.exists(DVC_FILE + \".lock\")\n assert os.path.exists(\"foo\" + DVC_FILE_SUFFIX)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_with_multistage_and_single_stage_test_run_with_multistage_and_single_stage.assert_stage2_name_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_with_multistage_and_single_stage_test_run_with_multistage_and_single_stage.assert_stage2_name_co", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 19, "end_line": 30, "span_ids": ["test_run_with_multistage_and_single_stage"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_run_with_multistage_and_single_stage(tmp_dir, dvc, run_copy):\n from dvc.stage import PipelineStage, Stage\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n stage1 = run_copy(\"foo\", \"foo1\")\n stage2 = run_copy(\"foo1\", \"foo2\", name=\"copy-foo1-foo2\")\n stage3 = run_copy(\"foo2\", \"foo3\")\n\n assert isinstance(stage2, PipelineStage)\n assert isinstance(stage1, Stage)\n assert isinstance(stage3, Stage)\n assert stage2.name == \"copy-foo1-foo2\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_multi_stage_repeat_test_run_multi_stage_repeat.assert_all_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_multi_stage_repeat_test_run_multi_stage_repeat.assert_all_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 52, "span_ids": ["test_run_multi_stage_repeat"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_run_multi_stage_repeat(tmp_dir, dvc, run_copy):\n from dvc.stage import PipelineStage\n from dvc.dvcfile import Dvcfile, DVC_FILE, DVC_FILE_SUFFIX\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"foo1\", name=\"copy-foo-foo1\")\n run_copy(\"foo1\", \"foo2\", name=\"copy-foo1-foo2\")\n run_copy(\"foo2\", \"foo3\")\n\n stages = list(Dvcfile(dvc, DVC_FILE).stages.values())\n assert len(stages) == 2\n assert all(isinstance(stage, PipelineStage) for stage in stages)\n assert set(stage.name for stage in stages) == {\n \"copy-foo-foo1\",\n \"copy-foo1-foo2\",\n }\n assert all(\n os.path.exists(file + DVC_FILE_SUFFIX)\n for file in [\"foo1\", \"foo2\", \"foo3\"]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multi_stage_try_writing_on_single_stage_file_test_multi_stage_try_writing_on_single_stage_file.with_pytest_raises_MultiS.run_copy_foo2_foo3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multi_stage_try_writing_on_single_stage_file_test_multi_stage_try_writing_on_single_stage_file.with_pytest_raises_MultiS.run_copy_foo2_foo3_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 68, "span_ids": ["test_multi_stage_try_writing_on_single_stage_file"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_multi_stage_try_writing_on_single_stage_file(tmp_dir, dvc, run_copy):\n from dvc.exceptions import DvcException\n from dvc.dvcfile import MultiStageFileLoadError\n\n tmp_dir.dvc_gen(\"foo\")\n dvc.run(cmd=\"echo foo\", deps=[\"foo\"])\n\n with pytest.raises(DvcException):\n run_copy(\"foo\", \"foo2\", name=\"copy-foo1-foo2\")\n\n run_copy(\"foo\", \"foo2\", name=\"copy-foo1-foo2\", fname=\"DIFFERENT-FILE.dvc\")\n\n with pytest.raises(MultiStageFileLoadError):\n run_copy(\"foo2\", \"foo3\", fname=\"DIFFERENT-FILE.dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multi_stage_run_cached_test_multistage_dump_on_non_cached_outputs.assert_not_os_path_exists": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multi_stage_run_cached_test_multistage_dump_on_non_cached_outputs.assert_not_os_path_exists", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 90, "span_ids": ["test_multistage_dump_on_non_cached_outputs", "test_multi_stage_run_cached"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_multi_stage_run_cached(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n\n run_copy(\"foo\", \"foo2\", name=\"copy-foo1-foo2\")\n stage2 = run_copy(\"foo\", \"foo2\", name=\"copy-foo1-foo2\")\n\n assert stage2 is None\n\n\ndef test_multistage_dump_on_non_cached_outputs(tmp_dir, dvc):\n from dvc.dvcfile import DVC_FILE_SUFFIX\n\n tmp_dir.dvc_gen(\"foo\")\n dvc.run(\n cmd=\"cp foo foo1\",\n deps=[\"foo\"],\n name=\"copy-foo1-foo2\",\n outs_no_cache=[\"foo1\"],\n )\n assert not os.path.exists(\"foo1\" + DVC_FILE_SUFFIX)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multistage_with_wdir_test_multistage_with_wdir.assert_dir_data_sta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multistage_with_wdir_test_multistage_with_wdir.assert_dir_data_sta", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 106, "span_ids": ["test_multistage_with_wdir"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_multistage_with_wdir(tmp_dir, dvc):\n from dvc.dvcfile import Dvcfile\n\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n stage = dvc.run(\n cmd=\"cp foo foo1\",\n deps=[\"foo\"],\n name=\"copy-foo1-foo2\",\n outs=[\"foo1\"],\n wdir=\"dir\",\n )\n\n data, _ = Dvcfile(dvc, stage.path)._load()\n assert \"dir\" == data[\"stages\"][\"copy-foo1-foo2\"][\"wdir\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multistage_always_changed_test_multistage_always_changed.assert_data_stages_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_multistage_always_changed_test_multistage_always_changed.assert_data_stages_co", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 109, "end_line": 122, "span_ids": ["test_multistage_always_changed"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_multistage_always_changed(tmp_dir, dvc):\n from dvc.dvcfile import Dvcfile\n\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n stage = dvc.run(\n cmd=\"cp foo foo1\",\n deps=[\"foo\"],\n name=\"copy-foo1-foo2\",\n outs=[\"foo1\"],\n always_changed=True,\n )\n\n data, _ = Dvcfile(dvc, stage.path)._load()\n assert data[\"stages\"][\"copy-foo1-foo2\"][\"always_changed\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_graph_test_graph.with_pytest_raises_Cyclic.dvc_run_deps_baz_out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_graph_test_graph.with_pytest_raises_Cyclic.dvc_run_deps_baz_out", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 135, "span_ids": ["test_graph"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_graph(tmp_dir, dvc):\n from dvc.exceptions import CyclicGraphError\n\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"echo foo > bar\", name=\"1\")\n\n dvc.run(deps=[\"bar\"], outs=[\"baz\"], cmd=\"echo bar > baz\", name=\"2\")\n\n with pytest.raises(CyclicGraphError):\n dvc.run(deps=[\"baz\"], outs=[\"foo\"], cmd=\"echo baz > foo\", name=\"3\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_dump_on_multistage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_dump_on_multistage_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_multistage.py", "file_name": "test_run_multistage.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 181, "span_ids": ["test_run_dump_on_multistage"], "tokens": 307}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_run_dump_on_multistage(tmp_dir, dvc):\n from dvc.dvcfile import Dvcfile\n\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n dvc.run(\n cmd=\"cp foo foo1\",\n deps=[\"foo\"],\n name=\"copy-foo-foo1\",\n outs=[\"foo1\"],\n wdir=\"dir\",\n )\n data, _ = Dvcfile(dvc, \"Dvcfile\")._load()\n assert data == {\n \"stages\": {\n \"copy-foo-foo1\": {\n \"cmd\": \"cp foo foo1\",\n \"wdir\": \"dir\",\n \"deps\": [\"foo\"],\n \"outs\": [\"foo1\"],\n }\n }\n }\n\n dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n name=\"copy-foo-foo2\",\n wdir=\"dir\",\n outs_persist=[\"foo2\"],\n always_changed=True,\n )\n assert Dvcfile(dvc, \"Dvcfile\")._load()[0] == {\n \"stages\": {\n \"copy-foo-foo2\": {\n \"cmd\": \"cp foo foo2\",\n \"deps\": [\"foo\"],\n \"outs_persist\": [\"foo2\"],\n \"always_changed\": True,\n \"wdir\": \"dir\",\n },\n **data[\"stages\"],\n }\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_filecmp_from_tests_basic_env_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_filecmp_from_tests_basic_env_impo", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["imports"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import filecmp\nimport logging\nimport os\nimport uuid\nfrom pathlib import Path\n\nimport mock\nimport pytest\n\nfrom dvc.dependency.base import DependencyIsStageFileError\nfrom dvc.exceptions import ArgumentDuplicationError\nfrom dvc.exceptions import CircularDependencyError\nfrom dvc.exceptions import CyclicGraphError\nfrom dvc.exceptions import OutputDuplicationError\nfrom dvc.exceptions import OverlappingOutputPathsError\nfrom dvc.exceptions import StagePathAsOutputError\nfrom dvc.dvcfile import DVC_FILE_SUFFIX\nfrom dvc.main import main\nfrom dvc.output import OutputBase\nfrom dvc.output.base import OutputIsStageFileError\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.stage import Stage\nfrom dvc.stage.exceptions import (\n StageFileAlreadyExistsError,\n StageFileBadNameError,\n StagePathOutsideError,\n StagePathNotFoundError,\n StagePathNotDirectoryError,\n MissingDep,\n)\nfrom dvc.system import System\nfrom dvc.utils import file_md5\nfrom dvc.utils.stage import load_stage_file\nfrom tests.basic_env import TestDvc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRun_TestRun.test.with_self_assertRaises_Ou.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRun_TestRun.test.with_self_assertRaises_Ou.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 70, "span_ids": ["TestRun.test", "TestRun"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRun(TestDvc):\n def test(self):\n cmd = \"python {} {} {}\".format(self.CODE, self.FOO, \"out\")\n deps = [self.FOO, self.CODE]\n outs = [os.path.join(self.dvc.root_dir, \"out\")]\n outs_no_cache = []\n fname = \"out.dvc\"\n\n self.dvc.add(self.FOO)\n stage = self.dvc.run(\n cmd=cmd,\n deps=deps,\n outs=outs,\n outs_no_cache=outs_no_cache,\n fname=fname,\n )\n\n self.assertTrue(filecmp.cmp(self.FOO, \"out\", shallow=False))\n self.assertTrue(os.path.isfile(stage.path))\n self.assertEqual(stage.cmd, cmd)\n self.assertEqual(len(stage.deps), len(deps))\n self.assertEqual(len(stage.outs), len(outs + outs_no_cache))\n self.assertEqual(stage.outs[0].fspath, outs[0])\n self.assertEqual(stage.outs[0].checksum, file_md5(self.FOO)[0])\n self.assertTrue(stage.path, fname)\n\n with self.assertRaises(OutputDuplicationError):\n self.dvc.run(\n cmd=cmd,\n deps=deps,\n outs=outs,\n outs_no_cache=outs_no_cache,\n fname=\"duplicate\" + fname,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunEmpty_TestRunNoExec.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunEmpty_TestRunNoExec.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 98, "span_ids": ["TestRunNoExec.test", "TestRunMissingDep", "TestRunEmpty", "TestRunNoExec", "TestRunEmpty.test", "TestRunMissingDep.test"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunEmpty(TestDvc):\n def test(self):\n self.dvc.run(\n cmd=\"\", deps=[], outs=[], outs_no_cache=[], fname=\"empty.dvc\",\n )\n\n\nclass TestRunMissingDep(TestDvc):\n def test(self):\n with self.assertRaises(MissingDep):\n self.dvc.run(\n cmd=\"\",\n deps=[\"non-existing-dep\"],\n outs=[],\n outs_no_cache=[],\n fname=\"empty.dvc\",\n )\n\n\nclass TestRunNoExec(TestDvc):\n def test(self):\n self.dvc.run(\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, \"out\"),\n no_exec=True,\n )\n self.assertFalse(os.path.exists(\"out\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunCircularDependency_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunCircularDependency_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 101, "end_line": 141, "span_ids": ["TestRunCircularDependency.test", "TestRunCircularDependency.test_non_normalized_paths", "TestRunCircularDependency.test_graph", "TestRunCircularDependency.test_outs_no_cache", "TestRunCircularDependency"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunCircularDependency(TestDvc):\n def test(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[self.FOO],\n outs=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_outs_no_cache(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[self.FOO],\n outs_no_cache=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_non_normalized_paths(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[\"./foo\"],\n outs=[\"foo\"],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_graph(self):\n self.dvc.run(\n deps=[self.FOO], outs=[\"bar.txt\"], cmd=\"echo bar > bar.txt\"\n )\n\n self.dvc.run(\n deps=[\"bar.txt\"], outs=[\"baz.txt\"], cmd=\"echo baz > baz.txt\"\n )\n\n with self.assertRaises(CyclicGraphError):\n self.dvc.run(\n deps=[\"baz.txt\"], outs=[self.FOO], cmd=\"echo baz > foo\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunDuplicatedArguments_TestRunDuplicatedArguments.test_non_normalized_paths.with_self_assertRaises_Ar.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunDuplicatedArguments_TestRunDuplicatedArguments.test_non_normalized_paths.with_self_assertRaises_Ar.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 170, "span_ids": ["TestRunDuplicatedArguments.test", "TestRunDuplicatedArguments.test_non_normalized_paths", "TestRunDuplicatedArguments", "TestRunDuplicatedArguments.test_outs_no_cache"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunDuplicatedArguments(TestDvc):\n def test(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[self.FOO, self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_outs_no_cache(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n outs=[self.FOO],\n outs_no_cache=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_non_normalized_paths(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[\"foo\", \"./foo\"],\n fname=\"circular-dependency.dvc\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunStageInsideOutput_TestRunBadCwd.test_same_prefix.with_self_assertRaises_St.self_dvc_run_cmd_wdir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunStageInsideOutput_TestRunBadCwd.test_same_prefix.with_self_assertRaises_St.self_dvc_run_cmd_wdir", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 202, "span_ids": ["TestRunStageInsideOutput.test_cwd", "TestRunBadCwd.test", "TestRunStageInsideOutput", "TestRunStageInsideOutput.test_file_name", "TestRunBadCwd", "TestRunBadCwd.test_same_prefix"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunStageInsideOutput(TestDvc):\n def test_cwd(self):\n self.dvc.run(cmd=\"\", deps=[], outs=[self.DATA_DIR])\n\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.run(\n cmd=\"\", fname=os.path.join(self.DATA_DIR, \"inside-cwd.dvc\")\n )\n\n def test_file_name(self):\n self.dvc.run(cmd=\"\", deps=[], outs=[self.DATA_DIR])\n\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.run(\n cmd=\"\",\n outs=[self.FOO],\n fname=os.path.join(self.DATA_DIR, \"inside-cwd.dvc\"),\n )\n\n\nclass TestRunBadCwd(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(cmd=\"\", wdir=self.mkdtemp())\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = \"{}-{}\".format(self._root_dir, uuid.uuid4())\n os.mkdir(path)\n self.dvc.run(cmd=\"\", wdir=path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.with_self_assertRaises_St.self_dvc_run_cmd_wdir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.with_self_assertRaises_St.self_dvc_run_cmd_wdir", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 205, "end_line": 227, "span_ids": ["TestRunBadWdir.test_same_prefix", "TestRunBadWdir.test", "TestRunBadWdir", "TestRunBadWdir.test_not_found", "TestRunBadWdir.test_not_dir"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunBadWdir(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(cmd=\"\", wdir=self.mkdtemp())\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = \"{}-{}\".format(self._root_dir, uuid.uuid4())\n os.mkdir(path)\n self.dvc.run(cmd=\"\", wdir=path)\n\n def test_not_found(self):\n with self.assertRaises(StagePathNotFoundError):\n path = os.path.join(self._root_dir, str(uuid.uuid4()))\n self.dvc.run(cmd=\"\", wdir=path)\n\n def test_not_dir(self):\n with self.assertRaises(StagePathNotDirectoryError):\n path = os.path.join(self._root_dir, str(uuid.uuid4()))\n os.mkdir(path)\n path = os.path.join(path, str(uuid.uuid4()))\n open(path, \"a\").close()\n self.dvc.run(cmd=\"\", wdir=path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunBadName_TestRunBadName.test_not_found.with_self_assertRaises_St.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunBadName_TestRunBadName.test_not_found.with_self_assertRaises_St.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 251, "span_ids": ["TestRunBadName.test", "TestRunBadName", "TestRunBadName.test_not_found", "TestRunBadName.test_same_prefix"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunBadName(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(\n cmd=\"\",\n fname=os.path.join(self.mkdtemp(), self.FOO + DVC_FILE_SUFFIX),\n )\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = \"{}-{}\".format(self._root_dir, uuid.uuid4())\n os.mkdir(path)\n self.dvc.run(\n cmd=\"\", fname=os.path.join(path, self.FOO + DVC_FILE_SUFFIX),\n )\n\n def test_not_found(self):\n with self.assertRaises(StagePathNotFoundError):\n path = os.path.join(self._root_dir, str(uuid.uuid4()))\n self.dvc.run(\n cmd=\"\", fname=os.path.join(path, self.FOO + DVC_FILE_SUFFIX),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunRemoveOuts_TestRunRemoveOuts.test.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunRemoveOuts_TestRunRemoveOuts.test.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 254, "end_line": 267, "span_ids": ["TestRunRemoveOuts", "TestRunRemoveOuts.test"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunRemoveOuts(TestDvc):\n def test(self):\n with open(self.CODE, \"w+\") as fobj:\n fobj.write(\"import sys\\n\")\n fobj.write(\"import os\\n\")\n fobj.write(\"if os.path.exists(sys.argv[1]):\\n\")\n fobj.write(\" sys.exit(1)\\n\")\n fobj.write(\"open(sys.argv[1], 'w+').close()\\n\")\n\n self.dvc.run(\n deps=[self.CODE],\n outs=[self.FOO],\n cmd=\"python {} {}\".format(self.CODE, self.FOO),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_2.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_2.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 270, "end_line": 314, "span_ids": ["TestRunUnprotectOutsCopy.test", "TestRunUnprotectOutsCopy"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunUnprotectOutsCopy(TestDvc):\n def test(self):\n with open(self.CODE, \"w+\") as fobj:\n fobj.write(\"import sys\\n\")\n fobj.write(\"with open(sys.argv[1], 'a+') as fobj:\\n\")\n fobj.write(\" fobj.write('foo')\\n\")\n\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.access(self.FOO, os.W_OK))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.access(self.FOO, os.W_OK))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_4.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_4.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 317, "end_line": 377, "span_ids": ["TestRunUnprotectOutsSymlink", "TestRunUnprotectOutsSymlink.test"], "tokens": 403}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunUnprotectOutsSymlink(TestDvc):\n def test(self):\n with open(self.CODE, \"w+\") as fobj:\n fobj.write(\"import sys\\n\")\n fobj.write(\"import os\\n\")\n fobj.write(\"with open(sys.argv[1], 'a+') as fobj:\\n\")\n fobj.write(\" fobj.write('foo')\\n\")\n\n ret = main([\"config\", \"cache.type\", \"symlink\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(ret, 0)\n ret = main(\n [\n \"run\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n\n if os.name == \"nt\":\n # NOTE: Windows symlink perms don't propagate to the target\n self.assertTrue(os.access(self.FOO, os.W_OK))\n else:\n self.assertFalse(os.access(self.FOO, os.W_OK))\n\n self.assertTrue(System.is_symlink(self.FOO))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n\n if os.name == \"nt\":\n # NOTE: Windows symlink perms don't propagate to the target\n self.assertTrue(os.access(self.FOO, os.W_OK))\n else:\n self.assertFalse(os.access(self.FOO, os.W_OK))\n\n self.assertTrue(System.is_symlink(self.FOO))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_2.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_2.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 380, "end_line": 428, "span_ids": ["TestRunUnprotectOutsHardlink", "TestRunUnprotectOutsHardlink.test"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunUnprotectOutsHardlink(TestDvc):\n def test(self):\n with open(self.CODE, \"w+\") as fobj:\n fobj.write(\"import sys\\n\")\n fobj.write(\"import os\\n\")\n fobj.write(\"with open(sys.argv[1], 'a+') as fobj:\\n\")\n fobj.write(\" fobj.write('foo')\\n\")\n\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(ret, 0)\n ret = main(\n [\n \"run\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_hardlink(self.FOO))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_hardlink(self.FOO))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunOverwrite_TestCmdRunOverwrite.test.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunOverwrite_TestCmdRunOverwrite.test.None_9", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 431, "end_line": 521, "span_ids": ["TestCmdRunOverwrite.test", "TestCmdRunOverwrite"], "tokens": 507}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdRunOverwrite(TestDvc):\n def test(self):\n # NOTE: using sleep() is a workaround for filesystems\n # with low mtime resolution. We have to use mtime since\n # comparing mtime's is the only way to check that the stage\n # file didn't change(size and inode in the first test down\n # below don't change).\n import time\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was NOT overwritten\n self.assertEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was overwritten\n self.assertNotEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\"run\", \"--overwrite-dvcfile\", \"-f\", \"out.dvc\", \"-d\", self.BAR]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was overwritten\n self.assertNotEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.with_open_metrics_txt_.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.with_open_metrics_txt_.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 524, "end_line": 535, "span_ids": ["TestCmdRunCliMetrics", "TestCmdRunCliMetrics.test_cached", "TestCmdRunCliMetrics.test_not_cached"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdRunCliMetrics(TestDvc):\n def test_cached(self):\n ret = main([\"run\", \"-m\", \"metrics.txt\", \"echo test > metrics.txt\"])\n self.assertEqual(ret, 0)\n with open(\"metrics.txt\", \"r\") as fd:\n self.assertEqual(fd.read().rstrip(), \"test\")\n\n def test_not_cached(self):\n ret = main([\"run\", \"-M\", \"metrics.txt\", \"echo test > metrics.txt\"])\n self.assertEqual(ret, 0)\n with open(\"metrics.txt\", \"r\") as fd:\n self.assertEqual(fd.read().rstrip(), \"test\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunWorkingDirectory_TestCmdRunWorkingDirectory.test_default_wdir_is_not_written.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunWorkingDirectory_TestCmdRunWorkingDirectory.test_default_wdir_is_not_written.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 538, "end_line": 550, "span_ids": ["TestCmdRunWorkingDirectory.test_default_wdir_is_not_written", "TestCmdRunWorkingDirectory"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdRunWorkingDirectory(TestDvc):\n def test_default_wdir_is_not_written(self):\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(self.FOO), outs=[self.FOO], wdir=\".\"\n )\n d = load_stage_file(stage.relpath)\n self.assertNotIn(Stage.PARAM_WDIR, d.keys())\n\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(self.BAR), outs=[self.BAR]\n )\n d = load_stage_file(stage.relpath)\n self.assertNotIn(Stage.PARAM_WDIR, d.keys())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir.self_assertEqual_d_Stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir.self_assertEqual_d_Stage_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 552, "end_line": 567, "span_ids": ["TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdRunWorkingDirectory(TestDvc):\n\n def test_fname_changes_path_and_wdir(self):\n dname = \"dir\"\n os.mkdir(os.path.join(self._root_dir, dname))\n foo = os.path.join(dname, self.FOO)\n fname = os.path.join(dname, \"stage\" + DVC_FILE_SUFFIX)\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(foo), outs=[foo], fname=fname\n )\n self.assertEqual(stage.wdir, os.path.realpath(self._root_dir))\n self.assertEqual(\n stage.path, os.path.join(os.path.realpath(self._root_dir), fname)\n )\n\n # Check that it is dumped properly (relative to fname)\n d = load_stage_file(stage.relpath)\n self.assertEqual(d[Stage.PARAM_WDIR], \"..\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_test_rerun_deterministic_test_rerun_changed_out.with_pytest_raises_StageF.run_copy_foo_out_ov": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_test_rerun_deterministic_test_rerun_changed_out.with_pytest_raises_StageF.run_copy_foo_out_ov", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 570, "end_line": 620, "span_ids": ["test_rerun_callback", "test_rerun_deterministic_ignore_cache", "test_rerun_changed_out", "test_rerun_changed_dep", "test_rerun_changed_stage", "test_rerun_deterministic"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_rerun_deterministic(tmp_dir, run_copy):\n tmp_dir.gen(\"foo\", \"foo content\")\n\n assert run_copy(\"foo\", \"out\") is not None\n assert run_copy(\"foo\", \"out\") is None\n\n\ndef test_rerun_deterministic_ignore_cache(tmp_dir, run_copy):\n tmp_dir.gen(\"foo\", \"foo content\")\n\n assert run_copy(\"foo\", \"out\") is not None\n assert run_copy(\"foo\", \"out\", ignore_build_cache=True) is not None\n\n\ndef test_rerun_callback(dvc):\n def run_callback():\n return dvc.run(\n cmd=(\"echo content > out\"), outs=[\"out\"], deps=[], overwrite=False\n )\n\n assert run_callback() is not None\n\n with mock.patch(\"dvc.prompt.confirm\", return_value=True):\n assert run_callback() is not None\n\n\ndef test_rerun_changed_dep(tmp_dir, run_copy):\n tmp_dir.gen(\"foo\", \"foo content\")\n assert run_copy(\"foo\", \"out\") is not None\n\n tmp_dir.gen(\"foo\", \"changed content\")\n with pytest.raises(StageFileAlreadyExistsError):\n run_copy(\"foo\", \"out\", overwrite=False)\n\n\ndef test_rerun_changed_stage(tmp_dir, run_copy):\n tmp_dir.gen(\"foo\", \"foo content\")\n assert run_copy(\"foo\", \"out\") is not None\n\n tmp_dir.gen(\"bar\", \"bar content\")\n with pytest.raises(StageFileAlreadyExistsError):\n run_copy(\"bar\", \"out\", overwrite=False)\n\n\ndef test_rerun_changed_out(tmp_dir, run_copy):\n tmp_dir.gen(\"foo\", \"foo content\")\n assert run_copy(\"foo\", \"out\") is not None\n\n Path(\"out\").write_text(\"modification\")\n with pytest.raises(StageFileAlreadyExistsError):\n run_copy(\"foo\", \"out\", overwrite=False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunCommit_TestRunCommit.test.self_assertEqual_len_os_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunCommit_TestRunCommit.test.self_assertEqual_len_os_l", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 623, "end_line": 636, "span_ids": ["TestRunCommit", "TestRunCommit.test"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunCommit(TestDvc):\n def test(self):\n fname = \"test\"\n ret = main(\n [\"run\", \"-o\", fname, \"--no-commit\", \"echo\", \"test\", \">\", fname]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(fname))\n self.assertFalse(os.path.exists(self.dvc.cache.local.cache_dir))\n\n ret = main([\"commit\", fname + \".dvc\"])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(fname))\n self.assertEqual(len(os.listdir(self.dvc.cache.local.cache_dir)), 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunPersist_TestRunPersist.should_remove_persistent_outs.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunPersist_TestRunPersist.should_remove_persistent_outs.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 639, "end_line": 685, "span_ids": ["TestRunPersist.should_append_upon_repro", "TestRunPersist.should_remove_persistent_outs", "TestRunPersist.run_command", "TestRunPersist.outs_command", "TestRunPersist", "TestRunPersist._test", "TestRunPersist.stage_should_contain_persist_flag"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunPersist(TestDvc):\n @property\n def outs_command(self):\n raise NotImplementedError\n\n def _test(self):\n file = \"file.txt\"\n file_content = \"content\"\n stage_file = file + DVC_FILE_SUFFIX\n\n self.run_command(file, file_content)\n self.stage_should_contain_persist_flag(stage_file)\n\n self.should_append_upon_repro(file, stage_file)\n\n self.should_remove_persistent_outs(file, stage_file)\n\n def run_command(self, file, file_content):\n ret = main(\n [\n \"run\",\n self.outs_command,\n file,\n \"echo {} >> {}\".format(file_content, file),\n ]\n )\n self.assertEqual(0, ret)\n\n def stage_should_contain_persist_flag(self, stage_file):\n stage_file_content = load_stage_file(stage_file)\n self.assertEqual(\n True, stage_file_content[\"outs\"][0][OutputBase.PARAM_PERSIST]\n )\n\n def should_append_upon_repro(self, file, stage_file):\n ret = main([\"repro\", stage_file])\n self.assertEqual(0, ret)\n\n with open(file, \"r\") as fobj:\n lines = fobj.readlines()\n self.assertEqual(2, len(lines))\n\n def should_remove_persistent_outs(self, file, stage_file):\n ret = main([\"remove\", stage_file])\n self.assertEqual(0, ret)\n\n self.assertFalse(os.path.exists(file))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunPersistOuts_TestShouldRaiseOnOverlappingOutputPaths.test.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunPersistOuts_TestShouldRaiseOnOverlappingOutputPaths.test.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 688, "end_line": 732, "span_ids": ["TestRunPersistOutsNoCache.test", "TestRunPersistOuts.outs_command", "TestShouldRaiseOnOverlappingOutputPaths", "TestShouldRaiseOnOverlappingOutputPaths.test", "TestRunPersistOuts.test", "TestRunPersistOuts", "TestRunPersistOutsNoCache", "TestRunPersistOutsNoCache.outs_command"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunPersistOuts(TestRunPersist):\n @property\n def outs_command(self):\n return \"--outs-persist\"\n\n def test(self):\n self._test()\n\n\nclass TestRunPersistOutsNoCache(TestRunPersist):\n @property\n def outs_command(self):\n return \"--outs-persist-no-cache\"\n\n def test(self):\n self._test()\n\n\nclass TestShouldRaiseOnOverlappingOutputPaths(TestDvc):\n def test(self):\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(0, ret)\n\n with self.assertRaises(OverlappingOutputPathsError) as err:\n self.dvc.run(\n outs=[self.DATA], cmd=\"echo data >> {}\".format(self.DATA)\n )\n error_output = str(err.exception)\n\n data_dir_stage = self.DATA_DIR + DVC_FILE_SUFFIX\n data_stage = os.path.basename(self.DATA) + DVC_FILE_SUFFIX\n\n self.assertIn(\"Paths for outs:\\n\", error_output)\n self.assertIn(\n \"\\n'{}'('{}')\\n\".format(self.DATA_DIR, data_dir_stage),\n error_output,\n )\n self.assertIn(\n \"\\n'{}'('{}')\\n\".format(self.DATA, data_stage), error_output\n )\n self.assertIn(\n \"\\noverlap. To avoid unpredictable behaviour, rerun \"\n \"command with non overlapping outs paths.\",\n error_output,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRerunWithSameOutputs_TestRerunWithSameOutputs._run_twice_with_same_outputs.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRerunWithSameOutputs_TestRerunWithSameOutputs._run_twice_with_same_outputs.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 735, "end_line": 767, "span_ids": ["TestRerunWithSameOutputs", "TestRerunWithSameOutputs._read_content_only", "TestRerunWithSameOutputs._outs_command", "TestRerunWithSameOutputs._run_twice_with_same_outputs"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRerunWithSameOutputs(TestDvc):\n def _read_content_only(self, path):\n with open(path, \"r\") as fobj:\n return [line.rstrip() for line in fobj]\n\n @property\n def _outs_command(self):\n raise NotImplementedError\n\n def _run_twice_with_same_outputs(self):\n ret = main(\n [\n \"run\",\n \"--outs\",\n self.FOO,\n \"echo {} > {}\".format(self.FOO_CONTENTS, self.FOO),\n ]\n )\n self.assertEqual(0, ret)\n\n output_file_content = self._read_content_only(self.FOO)\n self.assertEqual([self.FOO_CONTENTS], output_file_content)\n\n ret = main(\n [\n \"run\",\n self._outs_command,\n self.FOO,\n \"--overwrite-dvcfile\",\n \"echo {} >> {}\".format(self.BAR_CONTENTS, self.FOO),\n ]\n )\n self.assertEqual(0, ret)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestNewRunShouldRemoveOutsOnNoPersist_TestNewRunShouldNotRemoveOutsOnPersist._outs_command.return._outs_persist_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestNewRunShouldRemoveOutsOnNoPersist_TestNewRunShouldNotRemoveOutsOnPersist._outs_command.return._outs_persist_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 770, "end_line": 793, "span_ids": ["TestNewRunShouldNotRemoveOutsOnPersist._outs_command", "TestNewRunShouldRemoveOutsOnNoPersist", "TestNewRunShouldNotRemoveOutsOnPersist.test", "TestNewRunShouldRemoveOutsOnNoPersist._outs_command", "TestNewRunShouldNotRemoveOutsOnPersist", "TestNewRunShouldRemoveOutsOnNoPersist.test"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestNewRunShouldRemoveOutsOnNoPersist(TestRerunWithSameOutputs):\n def test(self):\n self._run_twice_with_same_outputs()\n\n output_file_content = self._read_content_only(self.FOO)\n self.assertEqual([self.BAR_CONTENTS], output_file_content)\n\n @property\n def _outs_command(self):\n return \"--outs\"\n\n\nclass TestNewRunShouldNotRemoveOutsOnPersist(TestRerunWithSameOutputs):\n def test(self):\n self._run_twice_with_same_outputs()\n\n output_file_content = self._read_content_only(self.FOO)\n self.assertEqual(\n [self.FOO_CONTENTS, self.BAR_CONTENTS], output_file_content\n )\n\n @property\n def _outs_command(self):\n return \"--outs-persist\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.test.with_self_dvc_lock_self_.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_not_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.test.with_self_dvc_lock_self_.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_not_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 796, "end_line": 822, "span_ids": ["TestShouldNotCheckoutUponCorruptedLocalHardlinkCache", "TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.setUp", "TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.test"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldNotCheckoutUponCorruptedLocalHardlinkCache(TestDvc):\n def setUp(self):\n super().setUp()\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n self.dvc = DvcRepo(\".\")\n\n def test(self):\n cmd = \"python {} {} {}\".format(self.CODE, self.FOO, self.BAR)\n stage = self.dvc.run(deps=[self.FOO], outs=[self.BAR], cmd=cmd)\n\n os.chmod(self.BAR, 0o644)\n with open(self.BAR, \"w\") as fd:\n fd.write(\"corrupting the output cache\")\n\n patch_checkout = mock.patch.object(\n stage.outs[0], \"checkout\", wraps=stage.outs[0].checkout\n )\n patch_run = mock.patch.object(stage, \"_run\", wraps=stage._run)\n\n with self.dvc.lock, self.dvc.state:\n with patch_checkout as mock_checkout:\n with patch_run as mock_run:\n stage.run()\n\n mock_run.assert_called_once()\n mock_checkout.assert_not_called()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestPersistentOutput_TestPersistentOutput.test_ignore_build_cache.with_open_greetings_r.assert_hello_nhello_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestPersistentOutput_TestPersistentOutput.test_ignore_build_cache.with_open_greetings_r.assert_hello_nhello_n_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 825, "end_line": 852, "span_ids": ["TestPersistentOutput", "TestPersistentOutput.test_ignore_build_cache"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPersistentOutput(TestDvc):\n def test_ignore_build_cache(self):\n warning = \"Build cache is ignored when persisting outputs.\"\n\n with open(\"immutable\", \"w\") as fobj:\n fobj.write(\"1\")\n\n cmd = [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--deps\",\n \"immutable\",\n \"--outs-persist\",\n \"greetings\",\n \"echo hello>>greetings\",\n ]\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n assert main(cmd) == 0\n assert warning not in self._caplog.text\n\n assert main(cmd) == 0\n assert warning in self._caplog.text\n\n # Even if the \"immutable\" dependency didn't change\n # it should run the command again, as it is \"ignoring build cache\"\n with open(\"greetings\", \"r\") as fobj:\n assert \"hello\\nhello\\n\" == fobj.read()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_test_bad_stage_fname_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_test_bad_stage_fname_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_single_stage.py", "file_name": "test_run_single_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 855, "end_line": 876, "span_ids": ["test_should_raise_on_stage_output", "test_bad_stage_fname", "test_should_raise_on_stage_dependency"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_bad_stage_fname(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo content\")\n\n with pytest.raises(StageFileBadNameError):\n # fname should end with .dvc\n run_copy(\"foo\", \"foo_copy\", fname=\"out_stage\")\n\n # Check that command hasn't been run\n assert not (tmp_dir / \"foo_copy\").exists()\n\n\ndef test_should_raise_on_stage_dependency(run_copy):\n with pytest.raises(DependencyIsStageFileError):\n run_copy(\"name.dvc\", \"stage_copy\")\n\n\ndef test_should_raise_on_stage_output(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo content\")\n\n with pytest.raises(OutputIsStageFileError):\n run_copy(\"foo\", \"name.dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_os_test_empty_list.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_os_test_empty_list.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 52, "span_ids": ["test_none", "imports", "test_cmd_none", "test_no_cmd", "test_empty_list", "test_cmd_str", "test_object", "test_cmd_obj"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport tempfile\nimport pytest\n\nfrom dvc.main import main\nfrom dvc.output.local import OutputLOCAL\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.repo import Repo\nfrom dvc.stage import Stage\nfrom dvc.dvcfile import Dvcfile\nfrom dvc.stage.exceptions import StageFileFormatError\nfrom dvc.utils.stage import dump_stage_file\nfrom dvc.utils.stage import load_stage_file\nfrom tests.basic_env import TestDvc\n\n\ndef test_cmd_obj():\n with pytest.raises(StageFileFormatError):\n Dvcfile.validate_single_stage({Stage.PARAM_CMD: {}})\n\n\ndef test_cmd_none():\n Dvcfile.validate_single_stage({Stage.PARAM_CMD: None})\n\n\ndef test_no_cmd():\n Dvcfile.validate_single_stage({})\n\n\ndef test_cmd_str():\n Dvcfile.validate_single_stage({Stage.PARAM_CMD: \"cmd\"})\n\n\ndef test_object():\n with pytest.raises(StageFileFormatError):\n Dvcfile.validate_single_stage({Stage.PARAM_DEPS: {}})\n\n with pytest.raises(StageFileFormatError):\n Dvcfile.validate_single_stage({Stage.PARAM_OUTS: {}})\n\n\ndef test_none():\n Dvcfile.validate_single_stage({Stage.PARAM_DEPS: None})\n Dvcfile.validate_single_stage({Stage.PARAM_OUTS: None})\n\n\ndef test_empty_list():\n d = {Stage.PARAM_DEPS: []}\n Dvcfile.validate_single_stage(d)\n\n d = {Stage.PARAM_OUTS: []}\n Dvcfile.validate_single_stage(d)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_list_test_list.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_list_test_list.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 67, "span_ids": ["test_list"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_list():\n lst = [\n {OutputLOCAL.PARAM_PATH: \"foo\", RemoteLOCAL.PARAM_CHECKSUM: \"123\"},\n {OutputLOCAL.PARAM_PATH: \"bar\", RemoteLOCAL.PARAM_CHECKSUM: None},\n {OutputLOCAL.PARAM_PATH: \"baz\"},\n ]\n d = {Stage.PARAM_DEPS: lst}\n Dvcfile.validate_single_stage(d)\n\n lst[0][OutputLOCAL.PARAM_CACHE] = True\n lst[1][OutputLOCAL.PARAM_CACHE] = False\n d = {Stage.PARAM_OUTS: lst}\n Dvcfile.validate_single_stage(d)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_show_test_metrics_diff_prec.assert__show_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_show_test_metrics_diff_prec.assert__show_diff_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 84, "end_line": 120, "span_ids": ["test_metrics_show", "test_metrics_diff_prec"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_show(dvc, mocker):\n cli_args = parse_args(\n [\n \"metrics\",\n \"show\",\n \"-R\",\n \"--all-tags\",\n \"--all-branches\",\n \"--all-commits\",\n \"target1\",\n \"target2\",\n ]\n )\n assert cli_args.func == CmdMetricsShow\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.metrics.show.show\", return_value={})\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n cmd.repo,\n [\"target1\", \"target2\"],\n recursive=True,\n all_tags=True,\n all_branches=True,\n all_commits=True,\n )\n\n\ndef test_metrics_diff_prec():\n assert _show_diff(\n {\"other.json\": {\"a.b\": {\"old\": 0.0042, \"new\": 0.0043, \"diff\": 0.0001}}}\n ) == (\n \" Path Metric Value Change\\n\"\n \"other.json a.b 0.0043 0.0001\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_diff_sorted_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_diff_sorted_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 123, "end_line": 138, "span_ids": ["test_metrics_diff_sorted"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_metrics_diff_sorted():\n assert _show_diff(\n {\n \"metrics.yaml\": {\n \"x.b\": {\"old\": 5, \"new\": 6, \"diff\": 1},\n \"a.d.e\": {\"old\": 3, \"new\": 4, \"diff\": 1},\n \"a.b.c\": {\"old\": 1, \"new\": 2, \"diff\": 1},\n }\n }\n ) == (\n \" Path Metric Value Change\\n\"\n \"metrics.yaml a.b.c 2 1 \\n\"\n \"metrics.yaml a.d.e 4 1 \\n\"\n \"metrics.yaml x.b 6 1 \"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_index.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_index.py_os_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_index.py", "file_name": "test_index.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 58, "span_ids": ["test_init", "imports", "test_is_dir_checksum", "test_roundtrip", "test_intersection", "test_update", "test_clear", "index"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport pytest\nfrom funcy import first\n\nfrom dvc.remote.index import RemoteIndex\n\n\n@pytest.fixture(scope=\"function\")\ndef index(dvc):\n index = RemoteIndex(dvc, \"foo\")\n index.load()\n yield index\n index.dump()\n os.unlink(index.path)\n\n\ndef test_init(dvc, index):\n assert str(index.path) == os.path.join(dvc.index_dir, \"foo.idx\")\n\n\ndef test_is_dir_checksum(dvc, index):\n assert index.is_dir_checksum(\"foo.dir\")\n assert not index.is_dir_checksum(\"foo\")\n\n\ndef test_roundtrip(dvc, index):\n expected_dir = {\"1234.dir\"}\n expected_file = {\"5678\"}\n index.update(expected_dir, expected_file)\n index.dump()\n index.load()\n assert set(index.dir_checksums()) == expected_dir\n assert set(index.checksums()) == expected_dir | expected_file\n\n\ndef test_clear(dvc, index):\n index.update(\n [\"1234.dir\"], [\"5678\"],\n )\n index.clear()\n assert first(index.checksums()) is None\n\n\ndef test_update(dvc, index):\n expected_dir = {\"1234.dir\"}\n expected_file = {\"5678\"}\n index.update(expected_dir, expected_file)\n assert set(index.dir_checksums()) == expected_dir\n assert set(index.checksums()) == expected_dir | expected_file\n\n\ndef test_intersection(dvc, index):\n checksums = (str(i) for i in range(2000))\n expected = {str(i) for i in range(1000)}\n index.update([], checksums)\n assert set(index.intersection(expected)) == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_test_is_protected_test_is_protected.if_os_name_nt_and_li.else_.assert_remote_is_protecte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_test_is_protected_test_is_protected.if_os_name_nt_and_li.else_.assert_remote_is_protecte", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 34, "end_line": 62, "span_ids": ["test_is_protected"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"link_name\", [\"hardlink\", \"symlink\"])\ndef test_is_protected(tmp_dir, dvc, link_name):\n remote = RemoteLOCAL(dvc, {})\n link_method = getattr(remote, link_name)\n\n (tmp_dir / \"foo\").write_text(\"foo\")\n\n foo = PathInfo(tmp_dir / \"foo\")\n link = PathInfo(tmp_dir / \"link\")\n\n link_method(foo, link)\n\n assert not remote.is_protected(foo)\n assert not remote.is_protected(link)\n\n remote.protect(foo)\n\n assert remote.is_protected(foo)\n assert remote.is_protected(link)\n\n remote.unprotect(link)\n\n assert not remote.is_protected(link)\n if os.name == \"nt\" and link_name == \"hardlink\":\n # NOTE: NTFS doesn't allow deleting read-only files, which forces us to\n # set write perms on the link, which propagates to the source.\n assert not remote.is_protected(foo)\n else:\n assert remote.is_protected(foo)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_reproduce.py_mock_test_get_active_graph.assert_not_active_graph_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_reproduce.py_mock_test_get_active_graph.assert_not_active_graph_e", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_reproduce.py", "file_name": "test_reproduce.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 27, "span_ids": ["imports", "test_get_active_graph"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\n\nfrom dvc.repo.reproduce import _get_active_graph\n\n\ndef test_get_active_graph(tmp_dir, dvc):\n (pre_foo_stage,) = tmp_dir.dvc_gen({\"pre-foo\": \"pre-foo\"})\n foo_stage = dvc.run(deps=[\"pre-foo\"], outs=[\"foo\"], cmd=\"echo foo > foo\")\n bar_stage = dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"echo bar > bar\")\n baz_stage = dvc.run(deps=[\"foo\"], outs=[\"baz\"], cmd=\"echo baz > baz\")\n\n dvc.lock_stage(\"bar.dvc\")\n\n graph = dvc.graph\n active_graph = _get_active_graph(graph)\n assert active_graph.nodes == graph.nodes\n assert set(active_graph.edges) == {\n (foo_stage, pre_foo_stage),\n (baz_stage, foo_stage),\n }\n\n dvc.lock_stage(\"baz.dvc\")\n\n graph = dvc.graph\n active_graph = _get_active_graph(graph)\n assert set(active_graph.nodes) == {bar_stage, baz_stage}\n assert not active_graph.edges", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_reproduce.py_test_number_reproduces_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_reproduce.py_test_number_reproduces_", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_reproduce.py", "file_name": "test_reproduce.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 44, "span_ids": ["test_number_reproduces"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mock.patch(\"dvc.repo.reproduce._reproduce_stage\", returns=[])\ndef test_number_reproduces(reproduce_stage_mock, tmp_dir, dvc):\n tmp_dir.dvc_gen({\"pre-foo\": \"pre-foo\"})\n\n dvc.run(deps=[\"pre-foo\"], outs=[\"foo\"], cmd=\"echo foo > foo\")\n dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"echo bar > bar\")\n dvc.run(deps=[\"foo\"], outs=[\"baz\"], cmd=\"echo baz > baz\")\n dvc.run(deps=[\"bar\"], outs=[\"boop\"], cmd=\"echo boop > boop\")\n\n reproduce_stage_mock.reset_mock()\n\n dvc.reproduce(all_pipelines=True)\n\n assert reproduce_stage_mock.call_count == 5", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_os_test_open.with_tree_open_foo_r_.assert_fobj_read_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_os_test_open.with_tree_open_foo_r_.assert_fobj_read_fo", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["imports", "test_exists", "test_open"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport shutil\n\nfrom dvc.repo.tree import DvcTree\nfrom dvc.compat import fspath_py35\n\n\ndef test_exists(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n dvc.add(\"foo\")\n (tmp_dir / \"foo\").unlink()\n\n tree = DvcTree(dvc)\n assert tree.exists(\"foo\")\n\n\ndef test_open(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n dvc.add(\"foo\")\n (tmp_dir / \"foo\").unlink()\n\n tree = DvcTree(dvc)\n with tree.open(\"foo\", \"r\") as fobj:\n assert fobj.read() == \"foo\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_open_in_history_test_open_in_history.for_rev_in_dvc_brancher_r.with_tree_open_foo_r_.assert_fobj_read_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_open_in_history_test_open_in_history.for_rev_in_dvc_brancher_r.with_tree_open_foo_r_.assert_fobj_read_fo", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 27, "end_line": 44, "span_ids": ["test_open_in_history"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_open_in_history(tmp_dir, scm, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n dvc.add(\"foo\")\n dvc.scm.add([\"foo.dvc\", \".gitignore\"])\n dvc.scm.commit(\"foo\")\n\n tmp_dir.gen(\"foo\", \"foofoo\")\n dvc.add(\"foo\")\n dvc.scm.add([\"foo.dvc\", \".gitignore\"])\n dvc.scm.commit(\"foofoo\")\n\n for rev in dvc.brancher(revs=[\"HEAD~1\"]):\n if rev == \"working tree\":\n continue\n\n tree = DvcTree(dvc)\n with tree.open(\"foo\", \"r\") as fobj:\n assert fobj.read() == \"foo\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_isdir_isfile_test_isdir_mixed.assert_not_tree_isfile_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_isdir_isfile_test_isdir_mixed.assert_not_tree_isfile_d", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 73, "span_ids": ["test_isdir_isfile", "test_isdir_mixed"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_isdir_isfile(tmp_dir, dvc):\n tmp_dir.gen({\"datafile\": \"data\", \"datadir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n\n tree = DvcTree(dvc)\n assert not tree.isdir(\"datadir\")\n assert not tree.isfile(\"datadir\")\n assert not tree.isdir(\"datafile\")\n assert not tree.isfile(\"datafile\")\n\n dvc.add([\"datadir\", \"datafile\"])\n shutil.rmtree(fspath_py35(tmp_dir / \"datadir\"))\n (tmp_dir / \"datafile\").unlink()\n\n assert tree.isdir(\"datadir\")\n assert not tree.isfile(\"datadir\")\n assert not tree.isdir(\"datafile\")\n assert tree.isfile(\"datafile\")\n\n\ndef test_isdir_mixed(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n\n dvc.add(str(tmp_dir / \"dir\" / \"foo\"))\n\n tree = DvcTree(dvc)\n assert tree.isdir(\"dir\")\n assert not tree.isfile(\"dir\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_walk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_walk_", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 116, "span_ids": ["test_walk", "test_isdvc"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_walk(tmp_dir, dvc):\n tmp_dir.gen(\n {\n \"dir\": {\n \"subdir1\": {\"foo1\": \"foo1\", \"bar1\": \"bar1\"},\n \"subdir2\": {\"foo2\": \"foo2\"},\n \"foo\": \"foo\",\n \"bar\": \"bar\",\n }\n }\n )\n\n dvc.add(\"dir\", recursive=True)\n tree = DvcTree(dvc)\n\n expected = [\n str(tmp_dir / \"dir\" / \"subdir1\"),\n str(tmp_dir / \"dir\" / \"subdir2\"),\n str(tmp_dir / \"dir\" / \"subdir1\" / \"foo1\"),\n str(tmp_dir / \"dir\" / \"subdir1\" / \"bar1\"),\n str(tmp_dir / \"dir\" / \"subdir2\" / \"foo2\"),\n str(tmp_dir / \"dir\" / \"foo\"),\n str(tmp_dir / \"dir\" / \"bar\"),\n ]\n\n actual = []\n for root, dirs, files in tree.walk(\"dir\"):\n for entry in dirs + files:\n actual.append(os.path.join(root, entry))\n\n assert set(actual) == set(expected)\n assert len(actual) == len(expected)\n\n\ndef test_isdvc(tmp_dir, dvc):\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n dvc.add(\"foo\")\n tree = DvcTree(dvc)\n assert tree.isdvc(\"foo\")\n assert not tree.isdvc(\"bar\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_from_dvc_stage_import_Pip_test_stage_dump_no_outs_deps.assert_lockfile_load_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_from_dvc_stage_import_Pip_test_stage_dump_no_outs_deps.assert_lockfile_load_dvc_", "embedding": null, "metadata": {"file_path": "tests/unit/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 12, "span_ids": ["imports", "test_stage_dump_no_outs_deps"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.stage import PipelineStage\nfrom dvc import lockfile, serialize\nimport json\nimport pytest\n\n\ndef test_stage_dump_no_outs_deps(tmp_dir, dvc):\n stage = PipelineStage(name=\"s1\", repo=dvc, path=\"path\", cmd=\"command\")\n lockfile.dump(dvc, \"path.lock\", serialize.to_lockfile(stage))\n assert lockfile.load(dvc, \"path.lock\") == {\n \"s1\": {\"cmd\": \"command\", \"deps\": {}, \"outs\": {}}\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_dump_when_already_exists_test_stage_dump_when_already_exists.assert_lockfile_load_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_dump_when_already_exists_test_stage_dump_when_already_exists.assert_lockfile_load_dvc_", "embedding": null, "metadata": {"file_path": "tests/unit/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 15, "end_line": 25, "span_ids": ["test_stage_dump_when_already_exists"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stage_dump_when_already_exists(tmp_dir, dvc):\n data = {\"s1\": {\"cmd\": \"command\", \"deps\": {}, \"outs\": {}}}\n with open(\"path.lock\", \"w+\") as f:\n json.dump(data, f)\n stage = PipelineStage(name=\"s2\", repo=dvc, path=\"path\", cmd=\"command2\")\n\n lockfile.dump(dvc, \"path.lock\", serialize.to_lockfile(stage))\n assert lockfile.load(dvc, \"path.lock\") == {\n **data,\n \"s2\": {\"cmd\": \"command2\", \"deps\": {}, \"outs\": {}},\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_dump_with_deps_and_outs_test_stage_dump_with_deps_and_outs.assert_lockfile_load_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_dump_with_deps_and_outs_test_stage_dump_with_deps_and_outs.assert_lockfile_load_dvc_", "embedding": null, "metadata": {"file_path": "tests/unit/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 28, "end_line": 44, "span_ids": ["test_stage_dump_with_deps_and_outs"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stage_dump_with_deps_and_outs(tmp_dir, dvc):\n data = {\n \"s1\": {\n \"cmd\": \"command\",\n \"deps\": {\"1.txt\": \"checksum\"},\n \"outs\": {\"2.txt\": \"checksum\"},\n }\n }\n with open(\"path.lock\", \"w+\") as f:\n json.dump(data, f)\n\n stage = PipelineStage(name=\"s2\", repo=dvc, path=\"path\", cmd=\"command2\")\n lockfile.dump(dvc, \"path.lock\", serialize.to_lockfile(stage))\n assert lockfile.load(dvc, \"path.lock\") == {\n **data,\n \"s2\": {\"cmd\": \"command2\", \"deps\": {}, \"outs\": {}},\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_overwrites_if_already_exists_test_load_when_lockfile_does_not_exist.assert_lockfile_loa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_stage_overwrites_if_already_exists_test_load_when_lockfile_does_not_exist.assert_lockfile_loa", "embedding": null, "metadata": {"file_path": "tests/unit/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 58, "span_ids": ["test_load_when_lockfile_does_not_exist", "test_stage_overwrites_if_already_exists"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stage_overwrites_if_already_exists(tmp_dir, dvc):\n stage = PipelineStage(name=\"s2\", repo=dvc, path=\"path\", cmd=\"command2\")\n lockfile.dump(dvc, \"path.lock\", serialize.to_lockfile(stage))\n stage = PipelineStage(name=\"s2\", repo=dvc, path=\"path\", cmd=\"command3\")\n lockfile.dump(dvc, \"path.lock\", serialize.to_lockfile(stage))\n assert lockfile.load(dvc, \"path.lock\") == {\n \"s2\": {\"cmd\": \"command3\", \"deps\": {}, \"outs\": {}},\n }\n\n\ndef test_load_when_lockfile_does_not_exist(tmp_dir, dvc):\n assert {} == lockfile.load(dvc, \"dvcfile.lock\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_load_when_lockfile_is_corrupted_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_test_load_when_lockfile_is_corrupted_", "embedding": null, "metadata": {"file_path": "tests/unit/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 78, "span_ids": ["test_load_when_lockfile_is_corrupted"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"corrupt_data\",\n [\n {\"s1\": {\"cmd\": \"command\", \"outs\": {}}},\n {\"s1\": {\"outs\": {}}},\n {\"s1\": {\"cmd\": \"command\", \"deps\": {}}},\n {\"s1\": {}},\n {\"s1\": {\"cmd\": \"command\", \"outs\": {\"file\": \"checksum\"}}},\n {\"s1\": {\"cmd\": \"command\", \"deps\": {\"file\": \"checksum\"}}},\n ],\n)\ndef test_load_when_lockfile_is_corrupted(tmp_dir, dvc, corrupt_data):\n with open(\"Dvcfile.lock\", \"w+\") as f:\n json.dump(corrupt_data, f)\n with pytest.raises(lockfile.LockfileCorruptedError) as exc_info:\n lockfile.load(dvc, \"Dvcfile.lock\")\n assert \"Dvcfile.lock\" in str(exc_info.value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_signal_TestPathConversion.test.self_assertEqual_stage_du": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_signal_TestPathConversion.test.self_assertEqual_stage_du", "embedding": null, "metadata": {"file_path": "tests/unit/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 59, "span_ids": ["TestPathConversion.test", "imports", "test_wdir_default_ignored", "test_meta_ignored", "test_wdir_non_default_is_not_ignored", "TestPathConversion", "test_stage_checksum"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import signal\nimport subprocess\nimport threading\nfrom unittest import TestCase\n\nimport mock\nimport pytest\n\nfrom dvc.dependency.repo import DependencyREPO\nfrom dvc.stage import Stage\nfrom dvc.stage.exceptions import StageUpdateError\n\nTEST_STAGE_DICT = {\n \"md5\": \"123456\",\n \"cmd\": \"mycmd\",\n \"outs\": [{\"path\": \"a\", \"md5\": \"123456789\"}],\n \"deps\": [{\"path\": \"b\", \"md5\": \"987654321\"}],\n}\n\n\ndef test_stage_checksum():\n stage = Stage(None, \"path\")\n\n with mock.patch.object(stage, \"dumpd\", return_value=TEST_STAGE_DICT):\n assert stage._compute_md5() == \"e9521a22111493406ea64a88cda63e0b\"\n\n\ndef test_wdir_default_ignored():\n stage = Stage(None, \"path\")\n d = dict(TEST_STAGE_DICT, wdir=\".\")\n\n with mock.patch.object(stage, \"dumpd\", return_value=d):\n assert stage._compute_md5() == \"e9521a22111493406ea64a88cda63e0b\"\n\n\ndef test_wdir_non_default_is_not_ignored():\n stage = Stage(None, \"path\")\n d = dict(TEST_STAGE_DICT, wdir=\"..\")\n\n with mock.patch.object(stage, \"dumpd\", return_value=d):\n assert stage._compute_md5() == \"2ceba15e87f6848aa756502c1e6d24e9\"\n\n\ndef test_meta_ignored():\n stage = Stage(None, \"path\")\n d = dict(TEST_STAGE_DICT, meta={\"author\": \"Suor\"})\n\n with mock.patch.object(stage, \"dumpd\", return_value=d):\n assert stage._compute_md5() == \"e9521a22111493406ea64a88cda63e0b\"\n\n\nclass TestPathConversion(TestCase):\n def test(self):\n import os\n\n stage = Stage(None, \"path\")\n\n stage.wdir = os.path.join(\"..\", \"..\")\n self.assertEqual(stage.dumpd()[\"wdir\"], \"../..\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config._to_relpath.return.PathInfo_path_as_posix_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config._to_relpath.return.PathInfo_path_as_posix_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 333, "span_ids": ["Config.load", "Config.load_one", "Config", "Config.init", "Config.__init__", "Config._load_paths", "Config._to_relpath", "Config.get_dir", "Config.files"], "tokens": 828}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Config(dict):\n \"\"\"Class that manages configuration files for a DVC repo.\n\n Args:\n dvc_dir (str): optional path to `.dvc` directory, that is used to\n access repo-specific configs like .dvc/config and\n .dvc/config.local.\n validate (bool): optional flag to tell dvc if it should validate the\n config or just load it as is. 'True' by default.\n\n Raises:\n ConfigError: thrown if config has an invalid format.\n \"\"\"\n\n APPNAME = \"dvc\"\n APPAUTHOR = \"iterative\"\n\n # In the order they shadow each other\n LEVELS = (\"system\", \"global\", \"repo\", \"local\")\n\n CONFIG = \"config\"\n CONFIG_LOCAL = \"config.local\"\n\n def __init__(self, dvc_dir=None, validate=True):\n self.dvc_dir = dvc_dir\n\n if not dvc_dir:\n try:\n from dvc.repo import Repo\n\n self.dvc_dir = os.path.join(Repo.find_dvc_dir())\n except NotDvcRepoError:\n self.dvc_dir = None\n else:\n self.dvc_dir = os.path.abspath(os.path.realpath(dvc_dir))\n\n self.load(validate=validate)\n\n @classmethod\n def get_dir(cls, level):\n from appdirs import user_config_dir, site_config_dir\n\n assert level in (\"global\", \"system\")\n\n if level == \"global\":\n return user_config_dir(cls.APPNAME, cls.APPAUTHOR)\n if level == \"system\":\n return site_config_dir(cls.APPNAME, cls.APPAUTHOR)\n\n @cached_property\n def files(self):\n files = {\n level: os.path.join(self.get_dir(level), self.CONFIG)\n for level in (\"system\", \"global\")\n }\n\n if self.dvc_dir is not None:\n files[\"repo\"] = os.path.join(self.dvc_dir, self.CONFIG)\n files[\"local\"] = os.path.join(self.dvc_dir, self.CONFIG_LOCAL)\n\n return files\n\n @staticmethod\n def init(dvc_dir):\n \"\"\"Initializes dvc config.\n\n Args:\n dvc_dir (str): path to .dvc directory.\n\n Returns:\n dvc.config.Config: config object.\n \"\"\"\n config_file = os.path.join(dvc_dir, Config.CONFIG)\n open(config_file, \"w+\").close()\n return Config(dvc_dir)\n\n def load(self, validate=True):\n \"\"\"Loads config from all the config files.\n\n Raises:\n ConfigError: thrown if config has an invalid format.\n \"\"\"\n conf = self._load_config_to_level()\n\n if validate:\n conf = self.validate(conf)\n\n self.clear()\n self.update(conf)\n\n # Add resolved default cache.dir\n if not self[\"cache\"].get(\"dir\") and self.dvc_dir:\n self[\"cache\"][\"dir\"] = os.path.join(self.dvc_dir, \"cache\")\n\n def load_one(self, level):\n conf = _load_config(self.files[level])\n conf = self._load_paths(conf, self.files[level])\n\n # Autovivify sections\n for key in COMPILED_SCHEMA.schema:\n conf.setdefault(key, {})\n\n return conf\n\n @staticmethod\n def _load_paths(conf, filename):\n abs_conf_dir = os.path.abspath(os.path.dirname(filename))\n\n def resolve(path):\n if os.path.isabs(path) or re.match(r\"\\w+://\", path):\n return path\n return RelPath(os.path.join(abs_conf_dir, path))\n\n return Config._map_dirs(conf, resolve)\n\n @staticmethod\n def _to_relpath(conf_dir, path):\n if re.match(r\"\\w+://\", path):\n return path\n\n if isinstance(path, RelPath) or not os.path.isabs(path):\n path = relpath(path, conf_dir)\n\n return PathInfo(path).as_posix()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_relative_path_TestRemote.test_relative_path.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_relative_path_TestRemote.test_relative_path.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 52, "span_ids": ["TestRemote.test_relative_path"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemote(TestDvc):\n\n def test_relative_path(self):\n dname = os.path.join(\"..\", \"path\", \"to\", \"dir\")\n ret = main([\"remote\", \"add\", \"mylocal\", dname])\n self.assertEqual(ret, 0)\n\n # NOTE: we are in the repo's root and config is in .dvc/, so\n # dir path written to config should be just one level above.\n rel = os.path.join(\"..\", dname)\n config = configobj.ConfigObj(self.dvc.config.files[\"repo\"])\n self.assertEqual(\n config['remote \"mylocal\"'][\"url\"], rel.replace(\"\\\\\", \"/\")\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_config.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_config.py__", "embedding": null, "metadata": {"file_path": "tests/unit/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 18, "span_ids": ["imports", "test_to_relpath"], "tokens": 101}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport pytest\n\nfrom dvc.config import Config\n\n\n@pytest.mark.parametrize(\n \"path, expected\",\n [\n (\"cache\", \"../cache\"),\n (os.path.join(\"..\", \"cache\"), \"../../cache\"),\n (os.getcwd(), os.getcwd().replace(\"\\\\\", \"/\")),\n (\"ssh://some/path\", \"ssh://some/path\"),\n ],\n)\ndef test_to_relpath(path, expected):\n assert Config._to_relpath(os.path.join(\".\", \"config\"), path) == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}}} \ No newline at end of file